summaryrefslogtreecommitdiffstats
path: root/src/sql
Commit message (Collapse)AuthorAgeFilesLines
* rename qt_module_config.prf => qt_module.prfOswald Buddenhagen2012-08-081-1/+1
| | | | | | | this is more logical, following the qt_plugin and qt_tool scheme. Change-Id: Ib3b2abec6728cdab260e15128b1cd78e8e6f5d6a Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Add possibility to add OpenSSL, DBUS, MySQL path under WindowsAndreas Holzammer2012-08-071-0/+5
| | | | | | | | | | | Under Windows it's quite possible that OpenSSL, DBUS or MySQL is not installed into a central place. If -I and -L is passed at configure time, it is added to all targets, and if that path contained a conflicting header things would go wrong. Change-Id: Ic3338c49aa6eaa91b3abf5341e709ef604bf7aab Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Doc: Adding a landing page for Qt SQL.Jerome Pasion2012-08-063-3/+37
| | | | | | | | -Simple landing page which contains a link to the SQL guide and API. -Gave a new title to C++ API page. Change-Id: I54eca4f6933bafa0affd5825e7fe2e1a2522dad0 Reviewed-by: Geir Vattekar <geir.vattekar@nokia.com>
* Fix some typos.Frederik Schwarzer2012-07-262-2/+2
| | | | | | | Change-Id: I3c3c96fbbc19e2a69ac2f22618f15f5262718e50 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* QSqlTM: add reimplemented record() methodMark Brand2012-07-172-3/+34
| | | | | | | | | | | QSqlQueryModel::record(row) populates the record it returns with values from virtual data(), so the values themselves can be supplied by QSqlTableModel. However, it is also desirable to be able to interrogate QSqlTableModel for the actual current record in its cache, including properties such as the generated flag. Change-Id: I733901913b7d237d5762448e953a99b5bd83fc7f Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
* QSqlTM: use generated flag more correctly in setRecord()/insertRecord()Mark Brand2012-07-171-11/+19
| | | | | | | | | | | | The generated flag should affect the generation of SQL commands rather than how the fields of the source record are applied to the model before submitting. This correction allows setRecord() to be used to change TRUE generated flags to FALSE. Clarified documentation on this point and updated change log. Change-Id: I7ee124930822561ed8beee6c6259970b3e929c9b Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
* Fix error when inserting to tables with datetime fields with QODBCThiago A. Correa2012-07-161-4/+42
| | | | | | | | | | | | | SQL Server 10 introduced stricter rules for TIMESTAMP validation, making it necessary to specify the decimal digits. Other databases might do the same as well, so this patch introduces a check for the TIMESTAMP column size and adjusts the decimal digits parameter as needed. Task-number: QTBUG-2192 Change-Id: If6d798c6c928ebda75bc474e49a07fbbfbe5816c Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Doc: Fix typo foreigh -> foreignSergio Ahumada2012-07-161-1/+1
| | | | | | Task-number: QTBUG-23260 Change-Id: I922a8b5cba5d8784305fb1779ccd352ab2ece365 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Add support for SQLSTATE error codesAndras Mantia2012-07-031-12/+18
| | | | | | | | | | | | | Postgres can report detailed information about an error using error codes. See http://www.postgresql.org/docs/8.1/static/errcodes-appendix.html . The current driver doesn't report the error, nor is it supported by the QSqlError object. The patch appends the error to the error message, helping applications to: - handle different errors in a specific way - show correct, translated error messages, independently on the language of the postgres installation Change-Id: Ica3530ac33d3aaa9985e06f6c1f302ece9891033 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Clean up the EXPORT macros in qglobal.h.Thiago Macieira2012-06-295-0/+13
| | | | | | | | | | | | | | | | | | | | QtPlatformSupport is a static library. It should never export anything, so Q_PLATFORMSUPPORT_EXPORT is unnecessary. QtSql, QtXml, QtDBus, QtOpenGL and QtPrintSupport now have the macros on their own source trees. It's possible these modules might be separated out from qtbase in the future. For QtDBus, the macros are moving back to where they used to be. This also leaves qglobal.h only creating the macros for QtCore, QtGui, QtWidgets and QtNetwork, the core libraries. Q_CANVAS_EXPORT, Q_OPENVG_EXPORT and Q_COMPAT_EXPORT aren't used anywhere in the Qt sources, so simply delete them. And the Q_QUICK1_EXPORT macro in the static section was wrong, so remove it too. Change-Id: I50bdf86e783338f814903b25979721f788a7becf Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Fix docs mentioning Q_EXPORT_PLUGIN2Lars Knoll2012-06-252-2/+2
| | | | | | | | Fix all remaining places where Q_EXPORT_PLUGIN2 was being used in the documentation. Change-Id: I7be67b83c18545d0e74f250b4b26583444b01909 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* fix misnomer: qt_module.prf => qt_build_config.prfOswald Buddenhagen2012-06-191-1/+1
| | | | | | qt_module suggests to be congruent to qt_plugin. Change-Id: I629530bcbe2ba6c0adbdc11a275119c8aff0c953
* automatically add QT_BUILD_FOO_LIB to DEFINESOswald Buddenhagen2012-06-191-1/+0
| | | | | Change-Id: I35d9861e48469eb5cc8824e361450684047e6559 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* clean up projects from QPRO_PWD nonsense, etc.Oswald Buddenhagen2012-06-191-1/+0
| | | | | Change-Id: I4c41aedf5bfb37e31ad202cacd2312b0bdb168e2 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* auto-generate QMAKE_PKGCONFIG_REQUIRES and QMAKE_PKGCONFIG_DESCRIPTIONOswald Buddenhagen2012-06-191-2/+0
| | | | | | | less boilerplate, more accuracy Change-Id: I6cc2abd50eafb4901d987c122f10a62ec9ea9da3 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* auto-generate module prisOswald Buddenhagen2012-06-191-2/+0
| | | | | Change-Id: I654428771034221ccf424be34d5d9c7764daf3b4 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* automatically add the version header to HEADERSOswald Buddenhagen2012-06-191-2/+0
| | | | | Change-Id: I7c2e1d852ebdbc5cca7a3a31ab2b4c9ab9faffd9 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* make qt_module_config.prf install the module pri fileOswald Buddenhagen2012-06-191-1/+0
| | | | | | | | | absorb module.prf into qt_installs.prf, as that's where it belongs. add qt_install_module option and automatically set it in qt_module_config. make qt_installs use that option. Change-Id: I860616f3a29a456f7b88ddaffa09375400c8911e Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Remove QFactoryInterface from sql driversLars Knoll2012-06-073-22/+10
| | | | | | | Change-Id: Ib31e6c4ce5264fc1e4281c8846df5630a6479a7c Reviewed-by: Mark Brand <mabrand@mabrand.nl> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Use the correct ifdef (QT_WIDGETS_LIB) in qsqlrelationaldelegate.hKent Hansen2012-06-061-2/+2
| | | | | Change-Id: I4cdb1eef7dab55c7d295463fe8ad29b5480b0788 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* QSqlResult: replace virtual hooks with virtual functionsMark Brand2012-06-0615-63/+63
| | | | | | | | | | | | | | | | | | Instead of virtual functions which would have broken binary compatibility, virtual_hook() was used to implement the virtual functionality. Now, since the step to Qt 5.0 allows breaking binary compatibility, we take the opporunity to simplify the code using real virtual functions. SetNumericalPrecision --> setNumericalPrecisionPolicy() NextResult --> nextResult() DetachFromResultSet --> detachFromResultSet() BatchOperation --> execBatch() Task-number: QTBUG-25252 Change-Id: Idd3a870f876d8b8a7457559d5f31ec2073786a75 Reviewed-by: Bill King <bill.king@nokia.com> Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
* Replace QVariant::typeToName usage by QMetaType::typeName call.Jędrzej Nowacki2012-05-281-1/+1
| | | | | | | | | Type information is kept in QMetaType class. QVariant is delegating operations, so it is better to use QMetaType directly. Change-Id: I91209fa1c9dc4303d6bd47c96824d3cd64ce5291 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Itemviews: compile with QT_STRICT_ITERATORSThiago Macieira2012-05-261-1/+1
| | | | | | | Just a few mixed up iterators. Change-Id: I19f62457ee24bc844fadd182ba61866e259e9636 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Doc: Add a default license footer.Casper van Donderen2012-05-111-0/+1
| | | | | | | | The CSS for the footer is not completely correct, but at this time it is better to have something than nothing. Change-Id: I7371e1e458a2abafcdb0fca5564ad73e209d64c3 Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
* QtSql: remove \link usagesGiuseppe D'Angelo2012-05-112-10/+10
| | | | | | Change-Id: I9723c34184b298e8b0a2be7185416b9e911f948e Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com> Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Doc: Fix \sa usageMarius Storm-Olsen2012-05-112-5/+5
| | | | | | | | | Ensure comma between elements (757 missing), single space and curly- braces around title elements, etc. Change-Id: Id16c3fda7fc47a12a0682f8720214f4990609a97 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Merge branch 'docs-refactoring' into masterMarius Storm-Olsen2012-05-102-4/+3
|\ | | | | | | Change-Id: Iebd1966abace3cdf7f9428dcfc1ded5b124ab113
| * Properly implement a 'make docs' target for subdirs and apps/libsMarius Storm-Olsen2012-05-092-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Only call qdoc for projects which sets the QMAKE_DOCS variable to point to a qdocconf file. Exclude examples/ and tests/ from the qdoc run, by adding no_docs_target to CONFIG for those projects. Change-Id: Ic856c8f19db59309302d0602b3e99735609e525a Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* | No longer use deprecated methods for plugin loading.Friedemann Kleint2012-05-091-9/+10
|/ | | | | Change-Id: I19c66b1c41ea4dd236726c86d7d071b210ec9244 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Change remaining uses of {to,from}Ascii to {to,from}Latin1 [QtSql]Thiago Macieira2012-05-055-23/+23
| | | | | | | | | | This operation should be a no-op anyway, since at this point in time, the fromAscii and toAscii functions simply call their fromLatin1 and toLatin1 counterparts. Task-number: QTBUG-21872 Change-Id: Icb3ab0e1f4f3173563f3de36115b5457cf1ba856 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Change QtSql documentation to recommend QString::toUtf8Thiago Macieira2012-05-031-3/+3
| | | | | Change-Id: I604166677ea182553adffc4835050f2964f2aef9 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Add "make docs" target for QtNetwork and sanitize other qdocconfs.Casper van Donderen2012-05-021-20/+20
| | | | | Change-Id: Ic9d6384b20162debeb69cb067c96c330c0fd999a Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
* Don't use obsolete qVariantValue, qVariantCanConvert, etc.Debao Zhang2012-05-021-1/+1
| | | | | | | | | | qVariantValue and qVariantCanConvert are Compatibility members, while in Qt4.8 they are marked as Qt 3 Support Members. qVariantFromValue and qVariantSetValue are Obsolete members. Change-Id: Ie8505cad1e0950e40c6f6710fde9f6fb2ac670fd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Doc: Fix most qdoc errors in QtSql.Casper van Donderen2012-04-2835-167/+3667
| | | | | | | | | - Move 2 images from qtdoc. - Add "make docs" command for qtsql - Fix qdoc command usage errors. Change-Id: Id2f0548d09ed8f77b2317863d443c19d1cccdd83 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix memory leaks in 64-bits ODBC driverHonglei Zhang2012-04-261-2/+4
| | | | | | | | | | | | | | On 64-bits Windows system, integers and longs are still 4 bytes values. Several functions that were previously defined with SQLINTEGER and SQLUINTEGER parameters have been changed where appropiate to use new SQLLEN and SQLULEN typedefs. SQLGetStmtAttr() is one of these functions. This fix replaces SQLINTEGER with SQLULEN in appropriate functions to avoid memory leaks. Task-number: QTBUG-25256 Change-Id: I744927f42b8578ece60815df360e3b337ebf452a Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* QSqlQueryModel::setQuery() don't use deprecated reset()Mark Brand2012-04-234-50/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the method attempted to reset only as a last resort. Now reset() is deprecated and resetting must happen between emitting modelAboutToBeReset() and modelReset(). Since this suffices in all cases to notify views that they must reinterrogate the model, it is no longer necessary to signal explicitly row removals and insertions within the scope of the reset. Additionally, fetchMore() is now called within the scope of the reset so insert signals do not have to be emitted here either. This improved handling of resetting in QSqlQueryModel also allows the cache in QSqlTableModel to be cleared directly at select(). This change may actually allow views to operate more efficiently since they no longer have to react to separate row removal and insert signals. Views can avoid pointless deallocation and reallocation by considering row count only after the reset is finished. The cost is that the columns and horizontal headers must be considered in the view at each setQuery() call. In any case, it is not clear that trying to be smart about this in the model justifies additional complexity. Tests had to be adjusted where they expected explicit row removal and insert signals. Change-Id: I4f7eac1419824361d7d9bdcc6a87092b33e80d7a Task-Id: QTBUG-25419 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
* QSqlQueryModel::fetchMore() documentation fixMark Brand2012-04-231-1/+1
| | | | | | Change-Id: If046e674abad9c2dcff934a2fdd80d4133e1f4ad Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* remove useless workaroundMark Brand2012-04-171-2/+1
| | | | | | | | | | | | | | The workaround attempts to let the application reserve memory in QString for receiving the stored procedure output parameter. This does not work because the reserved capacity is not preserved through QVariant. Unfortunately, the application must actually populate QString with at least the number of characters that will be received. Change-Id: Icb3be60d6bd570ad2349f20fb7d93b340e395627 Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* QTBUG-18435 fix stored procedure output parameters on ODBCMark Brand2012-04-171-5/+6
| | | | | | | | | | | | | | | | Follow-up to c55a99965d8c08d5f924d49db4fe4aa49df8096. 3 problems prevented stored procedure output parameters from working. - SQLBindParameter needs access to buffer provided by QByteArray. - The length of the buffer is measured in bytes. - A typo corrupted conversion back to QString. Also, data() makes more sense than constData() to expose the buffer. Task-Id: QTBUG-18435 Change-Id: I66444b13c0f584ed79bcf026e5a23caff83c22cb Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Merge remote-tracking branch 'origin/master' into api_changesLars Knoll2012-04-161-5/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure src/corelib/io/qurl.cpp src/gui/kernel/qwindow.cpp src/tools/moc/generator.cpp src/widgets/kernel/qwidget_qpa.cpp src/widgets/styles/qstyle.h src/widgets/widgets/qtabbar.cpp tests/auto/corelib/codecs/utf8/tst_utf8.cpp Change-Id: Ia457228d6f684ec8184e13e8fcc9d25857b1751e
| * QTBUG-1363: fix QSqlField.length() for ODBCMark Brand2012-04-131-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Applied Bill King's suggestion in QTBUG-1363. Columns of hStmt must be accessed in order. Verified using ODBC driver on SQL Server 2005 on Windows 7. Added test for length of text field for MS SQL Server over ODBC. Task-Id: QTBUG-1363 Change-Id: I6673dafe75e3ef394d41e439adb45096c1421068 Reviewed-by: Bill King <bill.king@nokia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | Merge remote-tracking branch 'origin/master' into api_changesOswald Buddenhagen2012-04-1010-112/+123
|\| | | | | | | | | | | | | | | | | | | Conflicts: configure src/widgets/styles/qwindowsxpstyle.cpp tests/auto/gui/kernel/qwindow/qwindow.pro tests/auto/gui/kernel/qwindow/tst_qwindow.cpp Change-Id: I624b6d26abce9874c610c04954c1c45bc074bef3
| * Convert Boolean value into integerHonglei Zhang2012-04-021-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | According to documentation, SQLite doesn't have a separate Boolean storage class. Instead, values are stored as integers 0(false) and 1(true). In QSqlQuery::bindValue(), if a boolean value is bound to a placeholder, it is converted to text true and false. This fix converts boolean value to integer 0 and 1. Task-number: QTBUG-23895 Change-Id: I4945971172f0b5e5819446700390033a1a4ce301 Reviewed-by: Michael Goddard <michael.goddard@nokia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
| * Documentation cleanupDebao Zhang2012-03-311-24/+0
| | | | | | | | | | | | | | They are comments of Qt3 support members which have been removed already. Change-Id: I4b3dfaac1e5e1c3c13b83e41d0505dd16a4b6a8e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
| * Add payload to QSqlDriver notification with PSQL implementation.Matt Newell2012-03-314-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Postgres async notifications can contain a payload parameter that is currently discarded. This patch provides the QSqlDriver api change necessary to deliver a payload with each emitted notification by adding a QVariant parameter to the notification signal. It also provides the implementation for the qsqlpsql driver. The qsql_ibase driver has been updated to reflect the change to the notification signal signature. The eventNotificationPSQL test in the qsqldatabase test has been expanded to test proper payload sending and receiving. All tests/auto/sql/kernel tests have been run with sqllite and postgres with no regressions. Task-number: QTBUG-13500 Change-Id: I9137f6acc8cfca93f45791ca930e0287d93d5d0d Reviewed-by: Mark Brand <mabrand@mabrand.nl>
| * Fix postgres notification support in the QPSQLDriver.Matt Newell2012-03-302-42/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes a critical bug in the qsqlpsql driver where notifications aren't delivered when received. Any blocking libpq function(specifically PQexec) will read all the incoming data from the socket, including any pending notifications. This would cause the socket notifier to never be fired for incoming notifications that are already queued inside libpq. The qsqldriver test case was skipping the postgres notification test because of this bug, now its enabled and passing. In order to fix this bug I made a wrapper function for PQexec in QPSQLDriverPrivate that calls _q_handleNotification via QMetaObject::callMethod QueuedConnection in order to deliver pending notifications when control returns to the event loop. I also added a flag to ensure only one call is made each time the event loop is entered. Change-Id: I19f5297094ae7ae46bfb0717e4fca744d69f7b92 Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
| * Fix crash when an invalid filter is setHonglei Zhang2012-03-302-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | QSqlTableModel::headerData() generates a crash if an invalid filter is set. QSqlQueryModel::indexInQuery() should check the index value before applied to d->colOffsets[]. QSqlQueryModel::initRecordAndPrimaryIndex() is updated to sync the size of rec and colOffsets. Task-number: QTBUG-23879 Change-Id: Ic9f88bb288592aa6fb3c1415cc818632dadaab56 Reviewed-by: Michael Goddard <michael.goddard@nokia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
| * Update QSqlRelationalTableModel about reference table aliasHonglei Zhang2012-03-301-6/+11
| | | | | | | | | | | | | | | | | | | | | | The current documentation does not mention how the reference table name is aliased in the relational table model. This makes it difficult to use function setFilter(). This commit adds relevant information to the documentation. Task-number: QTBUG-15989 Change-Id: I02cbefb3f2b66c9772557a1fea3d93c2d1696ee9 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
| * Allow named bind values to be used multiple times per queryMatt Newell2012-03-301-35/+42
| | | | | | | | | | | | | | | | | | | | | | Prepared queries should be able to use a name parameter more than once. Currently this will result in undefined behavior and crashes. This patch fixes the bug and implements the needed test case. Task-number: QTBUG-6420 Change-Id: I07d6537e432a9b2781e9ef3d9f597bceb054527e Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
* | QSqlDriver functions made virtualMatt Newell2012-04-0210-207/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Certain QSqlDriver functions were marked to be made virtual in Qt5. subscribeToNotification, unsubscribeFromNotification, subscribedToNotifications, isIdentifierEscaped, and stripDelimiters. This patch makes them virtual and removes the no longer needed Implementation counterpart functions. It also updates the relevant drivers. This patch has no regressions on the tests in tests/auto/sql/kernel/, tested with sqlite and postgres. Change-Id: Ia2e1c18dfb803531523a456eb4e710031048e594 Reviewed-by: Mark Brand <mabrand@mabrand.nl>