Details
-
Bug
-
Resolution: Out of scope
-
P2: Important
-
None
-
4.8.0, 5.2.1, 5.9.6
-
None
-
MacOS 10.6.8, 10.9.2
Description
ODBC is not working correctly in MacOS.
QSqlDatabase db = QSqlDatabase::addDatabase("QODBC"); QString dsn = QString("DRIVER={FileMaker ODBC};SERVER=%1;DATABASE=%2;UID=%3;PWD=%4;").arg(serverName).arg(dbName).arg(user).arg(pass); db.setDatabaseName(dsn); if(!db.open()) { cout << qPrintable(db.lastError().text()) << endl; return -1; } QSqlQuery q(db); if(!q.exec("SELECT * FROM test")) { cout << qPrintable(q.lastError().text()) << endl; return -1; } while(q.next()) { qDebug() << q.value(0).toString(); }
Connecting to db and the query don't report any errors, but there are no values printed.
I have found that, the problem is in qsql_odbc.cpp - QODBCResult::fetchNext() function, line 1043:
if (d->hasSQLFetchScroll) r = SQLFetchScroll(d->hStmt, SQL_FETCH_NEXT, 0); else r = SQLFetch(d->hStmt);
d->hasSQLFetchScroll returns true, but SQLFetchScroll returns -1.
Temporary walkaround for me is using SQLFetch(d->hStmt) instead of SQLFetchScroll.
Attachments
Issue Links
- is duplicated by
-
QTBUG-89612 CLONE - MacOS ODBC issue
- Closed
For Gerrit Dashboard: QTBUG-25260 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
47537,1 | ODBC fixes for compatibility with ODBC MacOs implementation | stable | qt/qtbase | Status: ABANDONED | -2 | 0 |