diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-11-20 07:58:51 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-11-20 07:58:51 (GMT) |
commit | 1b6bccf66f493844d940a9ea3353aa3ee308fc3d (patch) | |
tree | 48d3c1049c6e29fb66d94eb3b0ba931bcf6ea981 /src/declarative | |
parent | fa4d5b7f1a94460e33862084eda5dacc99204a14 (diff) | |
download | Qt-1b6bccf66f493844d940a9ea3353aa3ee308fc3d.zip Qt-1b6bccf66f493844d940a9ea3353aa3ee308fc3d.tar.gz Qt-1b6bccf66f493844d940a9ea3353aa3ee308fc3d.tar.bz2 |
Check version for cached DB too.
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/qml/qmlsqldatabase.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/declarative/qml/qmlsqldatabase.cpp b/src/declarative/qml/qmlsqldatabase.cpp index 933eb92..d11e3cb 100644 --- a/src/declarative/qml/qmlsqldatabase.cpp +++ b/src/declarative/qml/qmlsqldatabase.cpp @@ -350,6 +350,8 @@ static QScriptValue qmlsqldatabase_open_sync(QScriptContext *context, QScriptEng if (QSqlDatabase::connectionNames().contains(dbid)) { database = QSqlDatabase::database(dbid); version = ini.value(QLatin1String("Version")).toString(); + if (version != dbversion && !dbversion.isEmpty() && !version.isEmpty()) + THROW_SQL(VERSION_ERR,QmlEngine::tr("SQL: database version mismatch")); } else { created = !QFile::exists(basename+QLatin1String(".sqlite")); database = QSqlDatabase::addDatabase(QLatin1String("QSQLITE"), dbid); |