-
Bug
-
Resolution: Incomplete
-
P2: Important
-
None
-
4.3.0, 4.3.1, 4.3.2, 4.3.3, 4.3.4, 4.3.5, 4.4.0, 4.4.1, 4.4.2, 4.4.3, 4.5.0, 4.5.1, 4.5.2, 4.5.3, 4.6.0, 4.6.1, 4.6.2, 4.6.3, 4.7.0, 4.7.1, 4.7.2, 4.7.3, 4.7.4
-
Tested on Fedora 16, Ubuntu 10.10, 11.04, 11.10 afflicts both versions 32bit 64bit ones.
Since many Linux distributions rose iODBC to unixODBC (starting from QT Approximately 4.3.0), the QODBC plugin has stopped working properly with some drivers like to access databases on IBM iSeries.
The problem is the reading of the fields that contain text strings.
The error returned is:
gfat-bin: gconv.c: 75: __ gconv: Assertion "outbuf! = ((void *) 0) && * outbuf! = ((void *) 0) 'failed.
I have already reported the bug, but I did not know what component concern.
Not getting answers, I began to search for the BUG analyzing the sources of QT 4.7.4.
Finally I discovered that an error is generated at line 374 of file qsql_odbc.cpp.
The following method call:
r = SQLGetData(hStmt,
column+1,
SQL_C_TCHAR,
NULL,
0,
&lengthIndicator);
generates the BUG.
Will not accept a NULL pointer.
In attacched file i found a more elegant solution.
I added a static function to control max lenght of UTF-8 and UTF-16 chars, so buffer can be preallocated correctly.