diff --git a/src/interfaces/odbc/statement.c b/src/interfaces/odbc/statement.c index 185c78bf63..06d97f7457 100644 --- a/src/interfaces/odbc/statement.c +++ b/src/interfaces/odbc/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;