From 6f4aff23365a4c664a4c98de17eb28457d2ec12d Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 10 Feb 2001 03:12:16 +0000 Subject: [PATCH] Ignore leading whitespace when trying to determine statement type, so that ODBC driver doesn't go belly up by failing to recognize a SELECT as such. --- statement.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/statement.c b/statement.c index 185c78b..06d97f7 100644 --- a/statement.c +++ b/statement.c @@ -22,8 +22,10 @@ #include "qresult.h" #include "convert.h" #include "environ.h" + #include #include +#include #ifndef WIN32 #include "iodbc.h" @@ -353,6 +355,10 @@ statement_type(char *statement) { int i; + /* ignore leading whitespace in query string */ + while (*statement && isspace((unsigned char) *statement)) + statement++; + for (i = 0; Statement_Type[i].s; i++) if ( ! strnicmp(statement, Statement_Type[i].s, strlen(Statement_Type[i].s))) return Statement_Type[i].type; -- 2.39.5