summaryrefslogtreecommitdiffstats
path: root/src/sql
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-01-169-0/+48
|\ | | | | | | | | | | | | Conflicts: src/widgets/styles/qstyleanimation.cpp Change-Id: Iae570895be6544de80f9c1ec309d1a08c59daff8
| * Remove the QtSql driver headers from the APIThiago Macieira2013-01-149-0/+48
| | | | | | | | | | | | | | | | | | These headers are technically private API, since they include private headers. They should be _p.h actually, but that change I'll leave for 5.1. Change-Id: I2dec222854e147da0fc166de311012472954012e Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | Bump Qt version to 5.1.0Frederik Gladhorn2013-01-151-5/+5
|/ | | | | | Change-Id: I6d372c933e48eeda921fe781b073bf4e05b31585 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: David Faure (KDE) <faure@kde.org>
* Fix warnings in the SQL drivers found by GCC 4.7Thiago Macieira2012-12-284-13/+17
| | | | | | | | | | | qsql_psql.cpp:774:12: error: enumeration value 'CancelQuery' not handled in switch [-Werror=switch] qsql_mysql.cpp:1163:12: error: enumeration value 'CancelQuery' not handled in switch [-Werror=switch] qsql_sqlite.cpp:527:12: error: enumeration value 'CancelQuery' not handled in switch [-Werror=switch] qsql_odbc.cpp:88:97: error: format '%d' expects argument of type 'int', but argument 3 has type 'long unsigned int' [-Werror=format] qsql_odbc.cpp:706:76: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] Change-Id: I79965283057e92a44a0c8375530cfb30107c891c Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Bump Qt version to 5.0.1Sergio Ahumada2012-12-211-5/+5
| | | | | Change-Id: Ie8f437b8dfe8a67c7b34321439dd988a02612437 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use PG_VERSION if PG_MAJORVERSION is not definedAndy Shaw2012-12-201-16/+21
| | | | | | | | | | | When only PG_VERSION was available for getting the client driver version for PostgreSQL it meant that it would not detect the client version and subsequently would not set the connection up correctly as a result. This fixes the blob test already in tst_qsqlquery. Change-Id: Ie2176a43b6be9c0e835498fca5aea129f0cc8fc6 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Doc: Correcting qhp link to Qt SQL's C++ Classes.Jerome Pasion2012-12-171-1/+1
| | | | | | Task-number: QTBUG-28579 Change-Id: I0faae04ab125236554cb39659169780e2ab64629 Reviewed-by: Geir Vattekar <geir.vattekar@digia.com>
* Workaround with hardcoded url QT-BUG 28500Nico Vertriest2012-12-111-1/+1
| | | | | Change-Id: I385c14401ced85b12ce65446b224de6910bf3b37 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* SQL: Change in QSqlResultPrivate::positionalToNamedBinding()Caroline Chao2012-12-101-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | With the change cff46983a, prepared queries can now store a named paramater to be used more than once. When using ?, thus positional binding, there is no named parameter, thus there is no need to store it. When prepare is called from a query with ?, it currently causes an error when the feature QSqlDriver::NamedPlaceholders is true. Because holders values are called while holders is actually empty. QSqlDriver::NamedPlaceholders is true for QOCI plugin only but the problem is independant of the plugin used. Adding a test case with a test driver to make the test runnable without Oracle installed. Change-Id: I6d7491f7e09a7b62d2d4d216b40fedd67e927e27 Reviewed-by: Matt Newell <newellm@blur.com> Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Doc: removed control code+minor rephrasingNico Vertriest2012-12-071-3/+3
| | | | | | | | | QTBUG-28382 Change-Id: Ic166fcb283d3339853c68a71be9aebd6cfed0523 Reviewed-by: Martin Smith <martin.smith@digia.com> Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Docs: Fix some warningsChristian Stenger2012-12-063-5/+3
| | | | | Change-Id: I3898c89e54aa671ff8cb1b25c49cfe3835ab9384 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Doc: Remove obsolete statementChristian Stenger2012-12-061-3/+0
| | | | | Change-Id: Ic7f14dae391684a4870e030ab4549b3a59f1ea5f Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Always use QAIM to get the default flags.Stephen Kelly2012-11-281-2/+2
| | | | | Change-Id: I801f5c8023e3e3672fde28139a7f34f640e650f5 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* tr()-Fix: Do not add up translateable strings.Friedemann Kleint2012-11-261-2/+1
| | | | | | | | | Placeholders might go to a different position in translated strings. Change-Id: Id6a84ea931dc0487bd72eb8d01669369a3dce9c6 Reviewed-by: Caroline Chao <caroline.chao@digia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Fix example paths in example manifests that are used by Qt Creator.Eike Ziller2012-11-261-0/+2
| | | | | | Task-number: QTBUG-27801 Change-Id: I345c009fc0e4e1c1eabb43ad142e3b474e7a6fee Reviewed-by: hjk <qthjk@ovi.com>
* create interface QSqlDriver::cancelQuery()Sune Vuorela2012-11-202-1/+27
| | | | | | | | | This is useful for canceling a long running sql query. Note that it needs support from the individual drivers. Change-Id: Ia170a70487ff4ee13c85f12bc13e62fb198617fe Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Merge branch 'newdocs'Eskil Abrahamsen Blomfeldt2012-11-206-37/+30
|\ | | | | | | | | | | | | | | | | | | | | Added prepare_docs to qt_build_config.prf (it was added directly in configure in the source branch) Conflicts: configure tools/configure/configureapp.cpp Change-Id: I1337c69fc62b1c934e3e39b4409e4857440c9db8
| * Doc: Cleaning up QHP information in module configuration files.Jerome Pasion2012-11-071-13/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a common standard among all Qt modules. These changes affect the final .qch file for each module. Changes: 1)URL in qt-project.org is confirmed by DevNet maintainer url = http://qt-project.org/doc/<module> 2)Landing page title mapping indexTitle = landing page 3)"C++ Classes" as a child node. The list of C++ classes and the titles are specified in the wiki. 4)Removed extra subprojects. They are not needed for now. Each module may need additional nodes. Change-Id: I1825476c21fe9aaddc9d6b512ff74229f17271a0 Reviewed-by: Martin Smith <martin.smith@digia.com>
| * Merge branch 'master' of ssh://codereview.qt-project.org/qt/qtbase into newdocsJerome Pasion2012-11-022-12/+0
| |\ | | | | | | | | | Change-Id: I7e6cee190a341901dfbf8effb54ebccb91bf7a17
| * | Doc: Removed the HTML template from the .qdocconf filesJerome Pasion2012-10-261-1/+0
| | | | | | | | | | | | | | | | | | | | | -qt-module-defaults.qdocconf already contains the HTML template. Change-Id: I5757741166f0f688ce0e8a4e77ed45fd4d72f1c7 Reviewed-by: Martin Smith <martin.smith@digia.com>
| * | Merge remote-tracking branch 'gerrit/master' into newdocsTor Arne Vestbø2012-10-262-3/+1
| |\ \ | | | | | | | | | | | | Change-Id: I10cf9f915c602c8e5a0e7d7c9e17b7bc5ca00640
| * \ \ Merge remote-tracking branch 'gerrit/master' into newdocsTor Arne Vestbø2012-10-162-11/+7
| |\ \ \ | | | | | | | | | | | | | | | Change-Id: If2168c519daf45390af04af9ef9722770453a493
| * | | | doc: Add a bunch of missing dependsTor Arne Vestbø2012-10-161-1/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: I32c3730f8181d73a7c8e36ef382c74b8da754269
| * | | | doc: Fix a few doc errors for QtSQLTor Arne Vestbø2012-10-126-23/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The examples include path already contains 'sql', so we can't prefix the includes with 'sql' as well. Changing the include path to also include the parent examples directory is not an option, as qdoc will then try to generate output for example single example. Change-Id: Ifae07af86e60e6105a0625f29fbd6bc8f73b2550 Reviewed-by: Martin Smith <martin.smith@digia.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* | | | | SQL: Fix OCI driver's compile errors.Caroline Chao2012-11-202-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-27979 Change-Id: I4ae4cdba855c05bc6fab0f845ff16a96c8119fdb Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | | | | Fix error reporting in TDS SQL driver.Aaron McCarthy2012-11-181-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The error and message handlers used by the freetds library were getting reset to back to the default every time a database was opened. The Qt TDS SQL driver was calling dbinit() from QTDSDriver::open(). This had two problems: 1. dbinit() would reset the error handler previously set by a call to dberrhandle(). A db error would then cause the application to abort. 2. freetds expects dbinit() and dbexit() to be called symmetrically. Opening multiple database connections would result in freetds not cleaning up on application close. Solved by moving the dbinit() call into the QTDSDriver constructor. Change-Id: I59018d83238672c903b96a4d7f3f21b664c3ff4c Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | | | | Fix msvc2010 compiler warnings of switch with default but no case labelsThiago A. Correa2012-11-188-32/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I5de4d7405131314c4e2bdb1222d2bb1a2d34a993 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | | | | fix binding of bool type in mysql driverMark Brand2012-11-091-1/+6
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MYSQL_TYPE_TINY should be used for binding bool input value. MYSQL_TYPE_LONG might be too big for bool, resulting in bools being saved in the database as int 127. The problem was not specific to the vendor's BOOL column type. http://dev.mysql.com/doc/refman/5.0/en/numeric-type-overview.html http://dev.mysql.com/doc/refman/5.0/en/c-api-prepared-statement-type-codes.html Added generic autotest to make sure that binding bool works. All drivers should pass this test. Task-number: QTBUG-27763 Change-Id: I4e69f8e3b32fffb702ec9fa8a80ff5c50dea954b Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | | | Enable the "#include <QSql>" camel-case header, for the QSql namespaceSze Howe Koh2012-10-271-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The sync.profile Perl script will now generate the "QSql" header file during compilation. By removing the \inheaderfile command, the documentation will now display the namespace's own name as the header (i.e. "QSql" in this case). Previously, the only documented way to include the namespace was to include the whole module, which is expensive. This change also makes QSql consistent with other namespaces, such as QSsl and QAudio, which have their own dedicated camel-case headers. Part of the Header Consistency Project (http://lists.qt-project.org/pipermail/development/2012-October/007421.html) Change-Id: Ibb82d442956e767c13b82f1e552aabdf2e8ff110 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | | | QSqlRelationalDelegate: remove setEditorData reimplementationMark Brand2012-10-261-11/+0
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | Since commit 84787d82ee9369b2a83c5b0568ee62ab602a5528 QItemDelegate::setEditorData() works out of the box on QComboBox. Change-Id: Ic9839f7eccccbdb787ce204fe98311335ee16b92 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* | | Doc: Fix small capitalization error for the Qt SQL module header.Sze Howe Koh2012-10-221-1/+1
| | | | | | | | | | | | | | | | | | | | | The header file is named QtSql, not QtSQL. Change-Id: Ia3634c80d73f04fd27256f392cfed2068eeb9bc5 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | | remove explicit load(qt_build_config)s from the librariesOswald Buddenhagen2012-10-191-2/+0
| |/ |/| | | | | | | | | | | .qmake.conf (and previously .qmake.cache) already does that for us. Change-Id: I06cc01fa45921d7bd66dda7a0f88729faeff37bd Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* | QtSql: Correct documented default precision policy.Mark Brand2012-10-151-8/+4
| | | | | | | | | | | | | | | | Follow-up to commit c9f77564df14f91276e9ca693a9b3f339dab9334 Task-number: QTBUG-27482 Change-Id: I17c12ee14d4609bccbe67bba2581f13d72c069ae Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | correct spelling in QtSql documentationMark Brand2012-10-151-1/+1
| | | | | | | | | | | | Change-Id: I69e4178bbe967a70b1141122639883b5cbacd924 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Bill King <bill.king@nokia.com>
* | QSqlTableModel: let select() and selectRow() be slotsMark Brand2012-10-141-3/+3
|/ | | | | | | | | It's convenient to be able to connect a button to select() and signals that provide a row to selectRow(). Change-Id: I520d5564943f679ec9e68331878a211dd52b4a06 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: David Faure <david.faure@kdab.com>
* Modularize documenation buildTor Arne Vestbø2012-10-102-6/+4
| | | | | | | | | | qdocconf files can now reference $QT_INSTALL_DOCS to pick up e.g. global includes, instead of using relative paths. Qt modules will automatically get a doc target that builds and installs into the right place (including supporting shadow-builds) if they set QMAKE_DOCS before loading(qt_module). Change-Id: Ia408385199e56e3ead0afa45645a059d1a8b0d48 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* QSqlQuery::value string overloadThiago A. Correa2012-10-082-0/+19
| | | | | | | | | | Introduce value overload to take field name as a parameter. This allows for terser application code that avoids explicit calls to QSqlRecord::value(). Change-Id: I02b6712cd5ec41633b902714315b5716c17d1a9b Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Fix QSqlQuery::value to use proper index checkThiago A. Correa2012-10-051-1/+1
| | | | | | | | Change the validation of index parameter to use -1 constant instead of QSql::BeforeFirstRow which is unrelated to field index Change-Id: I43b42bc7ce717bcd9ddc987d2e716f1672c00775 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Qt SQL: Cleaned up documentation group membership and brief desc.Jerome Pasion2012-10-051-5/+6
| | | | | | Task-number: QTBUG-27449 Change-Id: I052c7c9beab344e6c0902f9440c1d6b74e15b0b6 Reviewed-by: Geir Vattekar <geir.vattekar@digia.com>
* QSqlTableModel::selectRow(): don't expand cache if there is no changeMark Brand2012-10-051-4/+26
| | | | | | | | Test added. Change-Id: Ibd72ef2aeee482abbd22991573460e55dc577457 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: David Faure (fixes for KDE) <faure@kde.org>
* QSqlTableModel: record(row) must use virtual data()Mark Brand2012-10-051-3/+11
| | | | | | | | | | | | | | Commit fbf010a26617b3986e9a76bd9c004403aebfcdc2 introduced a version of record(row) that includes the generated flags, but it neglected to populate the values using virtual data() as QSqlQueryModel correctly does. Test included lest we forget again. Change-Id: I49d0f8f87cd0c5078aa6a0e8373b2cffc01f2387 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QSqlTableModel: restore use of virtual setData() in setRecord()Mark Brand2012-10-051-5/+7
| | | | | | | | | | | | | | | | setRecord() should use setData() as intended so that reimplementations of setData() in subclasses will be respected. Commit 11bd543d901f67f79db3f5b5dfaa626c6e8faa45 failed to consider this. Test added which should prevent this mistake being repeated. Change-Id: Ia2d930cd42b5a27521bb389edb1b07fb1bf0fa36 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* QSqlTableModel: don't cache unchanged value in setData()Mark Brand2012-10-051-0/+6
| | | | | | | | | | | | | | | | | | | | | | This is good for performance in terms of avoiding unnecessary database activity and keeping the cache smaller. Detail: This change was not included in the big refactoring of QSqlTM. The idea was that the model shouldn't second guess the intention of the application and maybe the application wants to cause a submit. It was a marginal consideration. Now I think it's clear that our interest in not unnecessarily expanding the cache outweighs that. In addition, applications can now call selectRow() if they worry that the database values for the row have changed and want to set a value back again. Test added. Change-Id: I63814dcb63a96c6ba1c8cc227807725a954a0b68 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: David Faure <david.faure@kdab.com>
* QSqlTableModel: fix segfault when overriding selectRow()Mark Brand2012-10-051-9/+14
| | | | | | | | | | | | | | | | | The STL-style iteration over the cache in submitAll() assumed the iterator would remain valid until reaching cache.end(). This failed to consider that virtual selectRow() might be overridden so that it removes rows from the cache. For example, it might call select() which would empty the cache. The new approach checks at each iteration whether the row is still in the cache. Using foreach here is justified by its fitness for purpose and readability. New test included. Change-Id: Idee8807ede239c3ba56ff1604574c49f47385ad2 Reviewed-by: David Faure (fixes for KDE) <faure@kde.org>
* fix #includesMark Brand2012-10-021-1/+2
| | | | | | Change-Id: Ia33d7ef08e43bad95d57823e37757a09e53493b9 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* fix indentationMark Brand2012-09-281-3/+3
| | | | | Change-Id: Iebec20c1be5a0610007a8e7ffd2646bda7f2785d Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Remove duplicate words and punctuation from documentation.Mitch Curtis2012-09-261-1/+1
| | | | | Change-Id: I5550c62d412510bc2c5acceb2cae7d2f2ef6a8d3 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* fix incorrect uses of qmake in documentationJoerg Bornemann2012-09-252-6/+6
| | | | | | | | | Assigning backslashes to qmake variables yields a warning these days. Use forward slashes as they get automatically converted. Task-number: QTBUG-27325 Change-Id: I804fa641064ce183e9794026ad1dbc91725d334d Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* QSqlTableMode::selectRow(): lack of WHERE clause is an errorMark Brand2012-09-241-1/+9
| | | | | | | | | Since we only want one row, never ever run a SELECT without a WHERE clause. Change-Id: I40a78935f5573111faa3922eae97e6d5961be5f2 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* QSqlTableModel::selectRow(): reduce scope of QSqlQueryMark Brand2012-09-241-6/+8
| | | | | | | | | | It's good to clean up the query before emitting signals about the updated row. It's possible that connected slots will call selectRow() again for other rows. Change-Id: I482fe2dd58218f53567ce8725ee591ce2eeda348 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>