Hello Andrew,
GLPK 4.28 does not correctly report SQL errors when failing to select
data via a table IN statement.
Example:
Wrong error reporting:
db_iodbc_open: Query "SELECT job, operation, machine, duration FROM dsp
WHERE problem = FT10" failed.
The driver reported the following diagnostics whilst running
SQLDriverConnect
Corrected reporting:
db_iodbc_open: Query "SELECT job, operation, machine, duration FROM dsp
WHERE problem = FT10" failed.
The driver reported the following diagnostics whilst running SQLExecDirect
42S21:1:1054:[MySQL][ODBC 3.51
Driver][mysqld-5.0.45-Debian_1ubuntu3.3-log]Unknown column 'FT10' in
'where clause'
Here the information returned from function SQLGetDiagRec() is added,
the colons separate the following fields:
SQLState - five-character SQLSTATE code pertaining to the diagnostic
record RecNumber. The first two characters indicate the class; the next
three indicate the subclass. In the example 42S21 signifies 'Column
already exists'.
RecNumber - Indicates the status record from which the application seeks
information. Status records are numbered from 1.
NativeError - Native error code, specific to the data source. In the
example MySQL error 1054 signifies 'Unknown column'.
MessageText - Error message text.
Please, patch the file glpsql.c as follows:
--- glpk/glpk/branches/glpk-4.28-bugfix_iodbc_open/src/glpsql.c 2008/06/11
17:49:26 239
+++ glpk/glpk/branches/glpk-4.28-bugfix_iodbc_open/src/glpsql.c 2008/06/11
17:50:25 240
@@ -663,7 +663,7 @@
SQL_SUCCESS)
{
xprintf("db_iodbc_open: Query\n\"%s\"\nfailed.\n", sql->query);
- extract_error("SQLDriverConnect", sql->hdbc, SQL_HANDLE_STMT);
+ extract_error("SQLExecDirect", sql->hstmt, SQL_HANDLE_STMT);
dl_SQLFreeHandle(SQL_HANDLE_STMT, sql->hstmt);
dl_SQLDisconnect(sql->hdbc);
dl_SQLFreeHandle(SQL_HANDLE_DBC, sql->hdbc);
The complete code is available at
http://glpk.dyndns.org/viewvc/svn/glpk/glpk/branches/glpk-4.28-bugfix_iodbc_open/src/glpsql.c
Revision 240 is the corrected code.
Revision 239 is the old code.
Best regards
Xypron
_______________________________________________
Bug-glpk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-glpk