diff options
author | Bill King <bill.king@nokia.com> | 2009-11-23 22:53:31 (GMT) |
---|---|---|
committer | Bill King <bill.king@nokia.com> | 2009-11-23 22:53:31 (GMT) |
commit | 6c7398254f47a70935607297dee53daa5139608a (patch) | |
tree | 725ed03f4df3603f70fd536c6d2cb6ef77ee25b2 | |
parent | 42469fcf03b0b7e30a6d7251f9a08a7d0d51c819 (diff) | |
parent | 1ce247ec7c2b4bda79cedf5dda2e6b1f636903b1 (diff) | |
download | Qt-6c7398254f47a70935607297dee53daa5139608a.zip Qt-6c7398254f47a70935607297dee53daa5139608a.tar.gz Qt-6c7398254f47a70935607297dee53daa5139608a.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-sql-team into 4.6
-rw-r--r-- | src/sql/drivers/mysql/qsql_mysql.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/sql/drivers/mysql/qsql_mysql.cpp b/src/sql/drivers/mysql/qsql_mysql.cpp index f368d1d..b74babc 100644 --- a/src/sql/drivers/mysql/qsql_mysql.cpp +++ b/src/sql/drivers/mysql/qsql_mysql.cpp @@ -509,15 +509,24 @@ bool QMYSQLResult::fetchNext() return false; if (d->preparedQuery) { #if MYSQL_VERSION_ID >= 40108 - if (mysql_stmt_fetch(d->stmt)) + int nRC = mysql_stmt_fetch(d->stmt); + if (nRC) { +#ifdef MYSQL_DATA_TRUNCATED + if (nRC == 1 || nRC == MYSQL_DATA_TRUNCATED) +#else + if (nRC == 1) +#endif // MYSQL_DATA_TRUNCATED + setLastError(qMakeStmtError(QCoreApplication::translate("QMYSQLResult", + "Unable to fetch data"), QSqlError::StatementError, d->stmt)); return false; + } #else return false; #endif } else { - d->row = mysql_fetch_row(d->result); - if (!d->row) - return false; + d->row = mysql_fetch_row(d->result); + if (!d->row) + return false; } setAt(at() + 1); return true; @@ -1365,7 +1374,6 @@ QStringList QMYSQLDriver::tables(QSql::TableType type) const QSqlIndex QMYSQLDriver::primaryIndex(const QString& tablename) const { QSqlIndex idx; - bool prepQ; if (!isOpen()) return idx; |