summaryrefslogtreecommitdiffstats
path: root/src/sql/kernel/qsqlquery.cpp
diff options
context:
space:
mode:
authorHonglei Zhang <honglei.zhang@nokia.com>2011-11-30 11:26:22 (GMT)
committerHonglei Zhang <honglei.zhang@nokia.com>2011-11-30 11:26:22 (GMT)
commit1ba0ce0cc1ab94f1397114ac8024a60dc7dfbdd8 (patch)
tree2fe5fe727fe3811a1b4cb83b053780a5c166f714 /src/sql/kernel/qsqlquery.cpp
parent20a154ffc3afacdbc22d00a3c4dd0a2916a14e33 (diff)
downloadQt-1ba0ce0cc1ab94f1397114ac8024a60dc7dfbdd8.zip
Qt-1ba0ce0cc1ab94f1397114ac8024a60dc7dfbdd8.tar.gz
Qt-1ba0ce0cc1ab94f1397114ac8024a60dc7dfbdd8.tar.bz2
QSQLITE support only one statement at a time
SQLite driver support only one statement at a time. This fix makes the exec and prepare call failed if more than one statements are given. This is bug fix for QTBUG-21884. Also the behaviour is documented in the API specification. Task-number: QTBUG-21884 Reviewed-by: Charles Yin
Diffstat (limited to 'src/sql/kernel/qsqlquery.cpp')
-rw-r--r--src/sql/kernel/qsqlquery.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/sql/kernel/qsqlquery.cpp b/src/sql/kernel/qsqlquery.cpp
index 361730a..753e4f8 100644
--- a/src/sql/kernel/qsqlquery.cpp
+++ b/src/sql/kernel/qsqlquery.cpp
@@ -338,6 +338,9 @@ bool QSqlQuery::isNull(int field) const
Note that the last error for this query is reset when exec() is
called.
+ For SQLite, the query string can contain only one statement at a time.
+ If more than one statements is give, the function returns false.
+
Example:
\snippet doc/src/snippets/sqldatabase/sqldatabase.cpp 34
@@ -887,6 +890,9 @@ void QSqlQuery::clear()
syntactically wrong query succeeds, but every consecutive exec()
will fail.
+ For SQLite, the query string can contain only one statement at a time.
+ If more than one statements are give, the function returns false.
+
Example:
\snippet doc/src/snippets/sqldatabase/sqldatabase.cpp 9