summaryrefslogtreecommitdiffstats
path: root/src/sql/drivers/sqlite/qsql_sqlite.cpp
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-11-30 11:32:16 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-11-30 11:32:16 (GMT)
commit572208788f98162af81254977135fe13abae5bf6 (patch)
tree2fe5fe727fe3811a1b4cb83b053780a5c166f714 /src/sql/drivers/sqlite/qsql_sqlite.cpp
parent1794dcc6a6353e4c3c5e0ecfee6ea646a401bd1e (diff)
parent1ba0ce0cc1ab94f1397114ac8024a60dc7dfbdd8 (diff)
downloadQt-572208788f98162af81254977135fe13abae5bf6.zip
Qt-572208788f98162af81254977135fe13abae5bf6.tar.gz
Qt-572208788f98162af81254977135fe13abae5bf6.tar.bz2
Merge branch 'master' of git://scm.dev.nokia.troll.no/qt/qt-symbian-team
* 'master' of git://scm.dev.nokia.troll.no/qt/qt-symbian-team: QSQLITE support only one statement at a time
Diffstat (limited to 'src/sql/drivers/sqlite/qsql_sqlite.cpp')
-rw-r--r--src/sql/drivers/sqlite/qsql_sqlite.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/sql/drivers/sqlite/qsql_sqlite.cpp b/src/sql/drivers/sqlite/qsql_sqlite.cpp
index 9fba6d6..8294a55 100644
--- a/src/sql/drivers/sqlite/qsql_sqlite.cpp
+++ b/src/sql/drivers/sqlite/qsql_sqlite.cpp
@@ -322,12 +322,14 @@ bool QSQLiteResult::prepare(const QString &query)
setSelect(false);
+ const void *pzTail = NULL;
+
#if (SQLITE_VERSION_NUMBER >= 3003011)
int res = sqlite3_prepare16_v2(d->access, query.constData(), (query.size() + 1) * sizeof(QChar),
- &d->stmt, 0);
+ &d->stmt, &pzTail);
#else
int res = sqlite3_prepare16(d->access, query.constData(), (query.size() + 1) * sizeof(QChar),
- &d->stmt, 0);
+ &d->stmt, &pzTail);
#endif
if (res != SQLITE_OK) {
@@ -335,6 +337,11 @@ bool QSQLiteResult::prepare(const QString &query)
"Unable to execute statement"), QSqlError::StatementError, res));
d->finalize();
return false;
+ } else if (pzTail && !QString(reinterpret_cast<const QChar *>(pzTail)).trimmed().isEmpty()) {
+ setLastError(qMakeError(d->access, QCoreApplication::translate("QSQLiteResult",
+ "Unable to execute multiple statements at a time"), QSqlError::StatementError, SQLITE_MISUSE));
+ d->finalize();
+ return false;
}
return true;
}