summaryrefslogtreecommitdiffstats
path: root/src/plugins/sqldrivers/sqlite
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-02-261-17/+8
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/network/bearermonitor/CMakeLists.txt examples/network/CMakeLists.txt src/corelib/tools/qlinkedlist.h src/sql/kernel/qsqldriver_p.h src/sql/kernel/qsqlresult_p.h src/widgets/kernel/qwidget.cpp src/widgets/kernel/qwidget_p.h tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp tests/auto/tools/moc/allmocs_baseline_in.json Change-Id: I21a3c34570ae79ea9d30107fae71759d7eac17d9
| * QtSql: cleanup QSqlDriverPrivate and QSqlResultPrivateChristian Ehrlicher2020-02-191-17/+8
| | | | | | | | | | | | | | | | Cleanup QSqlDriverPrivate/QSqlResultPrivate and their derived classes in ODBC, MySql, PostgreSQL and SQLite. Change-Id: I52e69c00cf981b81dde7c3a0370f86f06ef756bb Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Regenerate projects to correctly handle private dependenciesAlexandru Croitor2020-02-052-8/+5
| | | | | | | | | | | | | | Change-Id: I7d84bc9962bff5c89a90367ae704974c6ce2ec89 Reviewed-by: Qt CMake Build Bot Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2020-01-291-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/Qt5CoreConfigExtras.cmake.in src/corelib/Qt5CoreMacros.cmake src/dbus/Qt5DBusConfigExtras.cmake.in src/widgets/Qt5WidgetsConfigExtras.cmake.in Change-Id: Ib782f3b177c38b2cce83beebe15be9c0baa578f7
| * | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-01-281-1/+1
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qsettings.cpp src/corelib/kernel/qvariant.cpp src/corelib/serialization/qjsoncbor.cpp src/corelib/serialization/qjsonvalue.cpp src/corelib/tools/tools.pri src/gui/image/qimage.cpp src/gui/kernel/qguivariant.cpp src/widgets/kernel/qshortcut.cpp tests/auto/tools/moc/allmocs_baseline_in.json tests/auto/tools/moc/tst_moc.cpp src/opengl/qglframebufferobject.cpp Done-With: Edward Welbourne <edward.welbourne@qt.io> Done-With: Leander Beernaert <leander.beernaert@qt.io> Change-Id: Ie7f5fa646c607fe70c314bf7195f7578ded1d271
| | * Replace most use of QVariant::type and occurrences of QVariant::TypeOlivier Goffart2020-01-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I made a clazy automated check that replaced the use of QVariant::Type by the equivalent in QMetaType. This has been deprecated since Qt 5.0, but many uses were not yet removed. In addition, there was some manual changes to fix the compilation errors. Adapted the Private API of QDateTimeParser and QMimeDataPrivate and adjust QDateTimeEdit and QSpinBox. QVariant(QVariant::Invalid) in qstylesheet made no sense. But note that in QVariant::save, we actually wanted to use the non-user type. In the SQL module, many changes were actually reverted because the API still expects QVarient::Type. Change-Id: I98c368490e4ee465ed3a3b63bda8b8eaa50ea67e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Regenerate plugin projects to get new target namesAlexandru Croitor2020-01-272-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | And also to get the original output names (qmake's "TARGET"), so that the plugin file names are as they were in Qt 5. Change-Id: I96a060d1a81693652847857372bec334728cb549 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Merge remote-tracking branch 'origin/dev' into merge-devLeander Beernaert2020-01-241-8/+1
|\| | | | | | | | | | | Change-Id: I31b761cfd5ea01373c60d02a5da8c33398d34739
| * | SQL: cleanup private classesChristian Ehrlicher2020-01-071-8/+1
| |/ | | | | | | | | | | | | | | | | | | | | Cleanup private SQL classes: - use nullptr - use member initialization - adjust style - remove deprecated functions Change-Id: I845f5b1081649fdd40f4f80e1052331806230cf7 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Regenerate src/*Alexandru Croitor2019-11-142-13/+13
| | | | | | | | | | | | Change-Id: I0314b4faa1e4860e86198eea4189987e527dfec2 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2019-10-141-0/+5
|\| | | | | | | Change-Id: I4a78428a8ea273b6960792e3b8043f816fa37fcf
| * QSqlDriver: deprecate one-arg notification() signalChristian Ehrlicher2019-09-211-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | QSqlDriver::notifcation() signal is available in two versions since Qt4 times. They are both emitted in the corresponding places which is useless. Therefore deprecate the one-arg version. [ChangeLog][QtSql][QSqlDriver] The one-arg version of QSqlDriver::notifcation() is now deprecated. Change-Id: Ie09aa0cc952f4d854c6fb617b37b9047a3194ee3 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Regenerate qtbase after wip/qt6 -> wip/cmake mergeAlexandru Croitor2019-10-141-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note that android builds will be broken after this merge and regeneration, because we don't currently handle the minimum required changes that were brought in with the Android multi ABI support that comes from 5.14. This will have to be addressed in a separate change. For now the build on Android will fail while compiling due to incorrect generation of LIB_SUFFIX with QT_ARCH. Change-Id: Ia4a871f4b7ddd0da11caf5f34e10a599a97bb55d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* | Regenerate sqldrivers pluginsAlexandru Croitor2019-10-082-8/+100
| | | | | | | | | | | | Change-Id: I583b5936205495813cdb0f04fcdd2da3c7e2a3f4 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* | Merge branch 'wip/qt6' into wip/cmakeAlexandru Croitor2019-08-151-1/+1
|\| | | | | | | Change-Id: I50ac36b8803c296998149e98cc61e38687cdd14b
| * Port from QStringViewLiteral to u""Marc Mutz2019-07-291-1/+1
| | | | | | | | | | | | | | | | | | Now that all our supported compilers know char16_t, we no longer need QStringViewLiteral, whose only purpose in life was to turn u"" into L"" for MSVC < 2015. Change-Id: I25a094fe7992d9d5dbeb4a524d9e99e043dcb8ce Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | Add some missing CLASS_NAME values to pluginsAlexandru Croitor2019-07-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | This substantially decreases the number of warnings when doing a Qt static build with examples. This is a quickfix modifying the relevant files directly. A proper fix will follow that regenerates the whole files. Change-Id: I2a3cc2c4ea02b3412beb96f7b4be9d43365a460d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* | Merge commit 'dev' into 'wip/cmake-merge'Tobias Hunger2019-04-161-2/+2
|\| | | | | | | Change-Id: I176c40d031be26a1dd1cf08843e448a660598783
| * More nullptr usage in headersKevin Funk2019-03-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | Diff generated by running clang-tidy's modernize-use-nullptr checker on the CMake-based Qt version. Skipping src/3rdparty, examples/, tests/ Change-Id: Ib182074e2e2fd52f63093f73b3e2e4c0cb7af188 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | CMake: Re-generate plugins/sqldrivers/sqliteTobias Hunger2019-04-031-6/+13
| | | | | | | | | | | | Change-Id: I795c9d6045eb34e9d517cf25337b4e31d3ad0284 Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | cmake: Search and enable the sqlite[3] pluginAlbert Astals Cid2019-02-121-0/+25
|/ | | | | | | | Added to QtFeature.cmake a way to be able to run feature_module begin and end without having an actual module by passing NO_MODULE Change-Id: Ib708bd3878e2591da193d18563c8932cc4b75e7f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.11' into 5.12Qt Forward Merge Bot2018-09-141-7/+12
|\ | | | | | | Change-Id: Ic4c1a8041dcfd143861c39e0014fbdaaa3fb25c6
| * sqlite: Fix QSqlError handling when opening/closing databaseFlorian Bruhin2018-09-131-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both sqlite3_open_v2 and sqlite3_close are documented to return an error code: https://www.sqlite.org/c3ref/open.html https://sqlite.org/c3ref/close.html However, those were ignored (other than checking whether the operation succeeded), causing QSqlError::nativeErrorCode() to always be "-1" when there was an error while opening/closing the database. Additionally, the error string needs to be read (via sqlite3_errmsg16) in qMakeError *before* d->access is set to 0, or the databaseText() will always be "out of memory" no matter what error actually happened. Task-number: QTBUG-70506 Change-Id: I75cbf178c9711442e640afd26c4502214d20c598 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | SQL PostgreSQL/SQlite: Properly decode default varchar parameterChristian Ehrlicher2018-09-121-1/+8
| | | | | | | | | | | | | | | | | | The default values for varchar columns were not decoded properly. Task-number: QTBUG-46968 Change-Id: Ie13d48c316cd694240f7e287010b97afc8c6c341 Reviewed-by: Robert Szefner <robertsz27@interia.pl> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Remove a deprecation warning coming from QRegularExpressionGiuseppe D'Angelo2018-07-211-1/+1
| | | | | | | | | | | | | | The flag is deprecated. Change-Id: Ice6ffafac6a5fa79675fc7cd84a9fb746f17dfb5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-05-241-2/+2
|\| | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/features/qt_common.prf src/corelib/tools/qstring.cpp src/plugins/platforms/windows/qwindowsmousehandler.cpp src/widgets/widgets/qmainwindowlayout_p.h Change-Id: I5df613008f6336f69b257d08e49a133d033a9d65
| * sqlite: Allow for duplicated placeholders with just one placeholderAndy Shaw2018-05-161-2/+2
| | | | | | | | | | | | | | | | | | | | This accounts for a case of a placeholder being duplicated in the prepare query, but where only one placeholder was used. This amends e4e87a2ece1e0c9901514fea094f31863b64b570 Task-number: QTBUG-68299 Change-Id: Ia92ee912facd51a13e7222886debb219b24442b0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-05-081-1/+0
|\| | | | | | | | | | | | | | | Conflicts: src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp tests/auto/corelib/io/qresourceengine/qresourceengine_test.pro Change-Id: I3169f709cc2a1b75007cb23c02c4c79b74feeb04
| * Fix build without features.timezoneTasuku Suzuki2018-05-081-0/+4
| | | | | | | | | | Change-Id: I3f8421103afa61baf415636b4dc8cf93fb477bcc Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Use QDateTime::toString(Qt::ISODateWithMS) instead of reinventing itEdward Welbourne2018-05-031-27/+1
|/ | | | | | | | | Following up on a review comment on commit 0a5f71c6062d575602ff041fb1b88ec2d8ad92bc. Change-Id: I46924f5ad1b291039d22a3d6015d80306679ad26 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* sqlite: Support using execBatch() with duplicated named placeholdersAndy Shaw2018-03-271-0/+25
| | | | | | | | | | | | | | | Also expands the tst_qsqlquery::batchExec() test to account for this case and generally test the functionality. In addition it is made to be more robust to avoid any discrepencies with the testing data. The test in general is also cleaned up to enable more of it being tested with the different database drivers where possible. An expected fail is added for MySQL due to the fact that it has a bug where null timestamp entries are being converted to the current datetime when adding it as a bind value. Change-Id: I0061bd1c69ae35b4858afc49420f13ce59cf48ae Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QSqlResult: use QVector<int> instead QList<int> for indexes valueChristian Ehrlicher2018-03-231-4/+5
| | | | | | | | Minor tweak: QList<int> is taking 64bit per entry, QVector<int> only 32bit - this should reduce memory usage a little bit. Change-Id: I3e17269feb4840343f5cecfc71f8fccd70edc80f Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Modernize the "regularexpression" featureUlf Hermann2018-03-201-5/+5
| | | | | | | | | | | | | Use QT_CONFIG(regularexpression), disentangle it from QT_BOOTSTRAPPED, switch it off in the bootstrap build, remove the #ifdefs from qregularexpression.{h|cpp}, and add QT_REQUIRE_CONFIG(regularexpression) to the header. qregularexpression.{h|cpp} are already correctly excluded in tools.pri if !qtConfig(regularexpression). Change-Id: I21de154a6a118b76f99003d3acb72ac1e220d302 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* sqlite: Prevent a crash when sqlite does not detect any parametersAndy Shaw2018-03-171-1/+4
| | | | | | | | | | | | When using a virtual table inside a SQLite database it is possible that it does not report the right number of parameters. Therefore we need to account for this case to prevent it from crashing when trying to bind parameters it thinks does not exist. Task-number: QTBUG-66816 Change-Id: I3ff70bb1fe73091f43c3df53616f75858e451cfd Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Merge remote-tracking branch 'origin/5.10' into devLiang Qi2018-01-111-1/+15
|\ | | | | | | | | | | | | | | | | Conflicts: src/3rdparty/harfbuzz-ng/src/hb-private.hh src/sql/doc/snippets/code/doc_src_sql-driver.cpp src/sql/doc/src/sql-driver.qdoc Change-Id: I38f0e82fcd37926cbf3c1915e009a731040d4598
| * sqlite: Bind duplicated named placeholders correctlyAndy Shaw2018-01-081-1/+15
| | | | | | | | | | | | | | | | | | | | | | sqlite will reuse the index for bound parameters when the named placeholder is duplicated so we only need to call bind one time for each placeholder. Therefore we need to have just one instance of each value when doing the bind. Task-number: QTBUG-65150 Change-Id: I75c4bcc4563e43c180a59a7a4cbb770dbe994642 Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
* | Merge remote-tracking branch 'origin/5.10' into devLars Knoll2018-01-021-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf sc/corelib/io/qfsfileengine_p.h src/corelib/io/qstorageinfo_unix.cpp src/platformsupport/eglconvenience/qeglpbuffer_p.h src/platformsupport/input/libinput/qlibinputkeyboard.cpp src/platformsupport/input/libinput/qlibinputpointer.cpp src/plugins/platforms/cocoa/qcocoamenu.mm src/plugins/platforms/ios/qiosscreen.h src/plugins/platforms/ios/qioswindow.h src/plugins/platforms/ios/quiview.mm src/printsupport/dialogs/qpagesetupdialog_unix_p.h src/printsupport/dialogs/qprintpreviewdialog.cpp src/printsupport/widgets/qcupsjobwidget_p.h src/widgets/widgets/qmenu.cpp tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp Change-Id: Iecb4883122efe97ef0ed850271e6c51bab568e9c
| * sqlite: Check that there are values to be set when bindingAndy Shaw2018-01-021-1/+1
| | | | | | | | | | | | | | | | | | | | If the values vector is empty then we know already that the paramCount will still be invalid, so we should just accept that and not check the reused named placeholders. Task-number: QTBUG-64923 Change-Id: Ifaa755540c4574f1f76d3f9f129bf0f66b837b70 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Replace Q_DECL_OVERRIDE with override where possibleKevin Funk2017-09-193-27/+27
|/ | | | | | | | | | | | | | | | Remaining uses of Q_DECL_OVERRIDE are in: src/corelib/global/qcompilerdetection.h src/corelib/global/qglobal.cpp doc/global/qt-cpp-defines.qdocconf (definition and documentation of Q_DECL_OVERRIDE) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: Ib9b05d829add69e98a86238274b6a1fcb19b49ba Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Merge remote-tracking branch 'origin/5.9' into devOswald Buddenhagen2017-08-021-1/+28
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/xcb/qxcbconnection.h src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp src/plugins/styles/mac/qmacstyle_mac.mm src/widgets/widgets/qdockarealayout.cpp src/widgets/widgets/qmainwindow.cpp src/widgets/widgets/qmainwindowlayout.cpp src/widgets/widgets/qmainwindowlayout_p.h tests/auto/corelib/tools/qlocale/tst_qlocale.cpp tests/auto/other/macnativeevents/BLACKLIST tests/auto/widgets/widgets/qmenu/BLACKLIST Change-Id: Ic8e724b80a65e7b1af25511b0e674d209265e567
| * Fix storing of QDateTime timespec for SqliteJoni Poikelin2017-07-311-1/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 9e64fc9e1cebf1e11694c4f536881128f5aee288 caused a regression which stored all QDateTime entries as if they were in localtime, which causes them to be offset by the amount of local timezone offset. This is fixed by adding "Z" if the time should be in UTC or using "+/-hh:mm" if it should use fixed UTC offset or specific timezone. Task-number: QTBUG-57138 Change-Id: Ie60905dfb3a517db442b636ca41daf8348753d84 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | QSqlField: Add a means to see what the tablename is for a given fieldAndy Shaw2017-07-121-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | When you are using a query that pulls from a number of different tables then it can be ambiguous as to which table a particular field belongs to. So this will make it possible to determine the table that a given field belongs to if it is set. Task-number: QTBUG-7170 Change-Id: I49b7890c0523d81272a153df3860df800ff853d5 Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-06-191-2/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qprocess_unix.cpp src/corelib/io/qprocess_win.cpp src/plugins/platforms/android/qandroidplatformintegration.h src/plugins/platforms/windows/qwindowscontext.cpp src/plugins/platforms/windows/windows.pri src/tools/uic/cpp/cppwriteinitialization.cpp src/widgets/doc/src/widgets-and-layouts/gallery.qdoc Change-Id: I8d0834c77f350ea7540140c2c7f372814afc2d0f
| * make sql drivers independently configurableOswald Buddenhagen2017-06-171-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | our binary packages come without many sql drivers, because they have proprietary dependencies we cannot ship. not every user wants to build all of qt from scratch, so it makes sense to make it possible to "enrich" the existing installation by compiling just the drivers. to enable this, the drivers' configuration must be independent. but note that it's still not possible to configure a single driver - the entire sqldrivers directory is configured at once. a side effect of this is that the availability of the sql plugins cannot be made known with publicFeatures any more, because there is no associated module pri file to put that information into. that should be made inconsequential by making qtHaveModule() work for plugins. Task-number: QTBUG-58372 Change-Id: Ibdebe3199688a57f93cea82dc15623081d1280f5 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | QDate/Time: add toString(QStringView) overloadsMarc Mutz2017-04-121-2/+2
| | | | | | | | | | | | | | | | [ChangeLog][QtCore][QDate/QTime/QDateTime] Added toString() overloads taking the format as a QStringView. Change-Id: I322fa22e6b13fe8ba4badf0a3133425bd067ef32 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | SQLite: enable support for named placeholdersSamuel Gaist2017-04-041-2/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SQLite has been supporting named placeholders for some time now and the code of the module is also written in that sense. The only thing that currently fails is the parameter count check. If the named placeholder is used several times then the parameter count will not match the value count. This patch adds a second check in that case. This use case is already tested by tst_qsqlquery. [ChangeLog][QtSql][SQLite] Named placeholder can now be used. If compiling Qt by hand and using system libraries, this feature requires at least SQLite 3.3.11. Change-Id: I1f6fa93f72bd809136894eafce0a2ae5cf6a62db Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | SQLite: Disable mutex on connectionsEric Lemanissier2017-03-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | By default SQLite opens DB in Serialized mode, allowing connections to be used from several threads simultaneously: https://www.sqlite.org/threadsafe.html According to Qt documentation, database can only be used from one thread. This change opens sqlite dabases in "Multi-thread" mode, so that one does not pay for useless mutex locking for each DB access Change-Id: Ife61f1a648d74c91d3b27a2ce0059d052ccc62b2 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Stop using sqlite3_enable_shared_cache: deprecated on macOSThiago Macieira2017-03-161-2/+1
| | | | | | | | | | | | | | | | | | | | | | qsql_sqlite.cpp:643:5: warning: 'sqlite3_enable_shared_cache' is deprecated: first deprecated in macOS 10.7 [-Wdeprecated-declarations] https://www.sqlite.org/c3ref/enable_shared_cache.html says to use the flag to sqlite3_open_v2() Change-Id: Ib499cebaa4c4489b90b9fffd149d3d5bf9434ae5 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | Fix possible use after free error in SQLite REGEXPLorenz Haas2017-03-021-6/+9
| | | | | | | | | | | | | | | | | | If the cache insertion fails, regexp is deleted and "subject.contains(*regexp);" is UB. Coverity-Id: 176868 Change-Id: Ibf9340e019f09fdb8b2a82de8877cdfb2ffe1372 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* | REGEXP for SQLiteLorenz Haas2017-02-221-0/+63
|/ | | | | | | | | | | | | | | | | | | | | | Since SQLite does not define a regexp function by default, provide a Qt based implementation which can be enabled using QSQLITE_ENABLE_REGEXP as an connect option. This way statements like SELECT * FROM table WHERE col REGEXP '^[a-d]'; work out of the box. [ChangeLog][QtSql] Add QSQLITE_ENABLE_REGEXP connect option for QSQLiteDriver. If set a Qt based regexp() implementation is provided allowing to use REGEXP in SQL statements. Task-number: QTBUG-18084 Change-Id: I7f0e926fe4c5d6baea509f75497f46a61ca86679 Reviewed-by: Milian Wolff <milian.wolff@kdab.com> Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io> Reviewed-by: Sebastian Sauer <sebastian.sauer@kdab.com> Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>