[Bug 665188] Re: QVariant and ODBC for iSeries segmentation fault in text field.
Mondin Marco
665188 at bugs.launchpad.net
Fri Feb 3 18:20:06 UTC 2012
I found the source of the problem and a solution.
In qsql_odbc.cpp file (at line 373 of QT4 version 4.7.4) is the following:
if(unicode) {
r = SQLGetData(hStmt,
column+1,
SQL_C_TCHAR,
NULL,
0,
&lengthIndicator);
The problem is in the NULL pointer.
If the lines are corrected as follows, the problem is resolved:
if(unicode) {
QVarLengthArray<SQLTCHAR> buftmp(colSize);
memset(buftmp.data(), 0, 65536*sizeof(SQLTCHAR));
r = SQLGetData(hStmt,
column+1,
SQL_C_TCHAR,
(SQLPOINTER)buftmp.data(),
0,
&lengthIndicator);
Probably not a very clean solution as I have not had time to analyze in
detail the sources, but at least it solves the problem.
Now all QT4 applications that need access to the database on the iSeries
with the IBM ODBC driver work properly.
--
You received this bug notification because you are a member of Kubuntu
Bugs, which is subscribed to qt4-x11 in Ubuntu.
https://bugs.launchpad.net/bugs/665188
Title:
QVariant and ODBC for iSeries segmentation fault in text field.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/qt4-x11/+bug/665188/+subscriptions
More information about the kubuntu-bugs
mailing list