Fixed odbc.c compiler warnings

Return SQL_ERROR when wanted column is lost
This commit is contained in:
Jean-Michel Vourgère 2012-07-02 23:02:35 +02:00
parent 212337cfaa
commit 5e092ba331

View File

@ -870,6 +870,9 @@ SQLRETURN SQL_API SQLColAttributes(
break;
}
}
if (i==table->num_cols) {
return SQL_ERROR;
}
// fprintf(stderr,"fDescType = %d\n", fDescType);
switch(fDescType) {
@ -1483,6 +1486,8 @@ SQLRETURN SQL_API SQLGetData(
break;
}
}
if (i==table->num_cols)
return SQL_ERROR;
if (icol!=stmt->icol) {
stmt->icol=icol;