summaryrefslogtreecommitdiffstats
path: root/src/sql
Commit message (Collapse)AuthorAgeFilesLines
* QSqlResult: private d -> protected d_ptrMark Brand2013-03-062-6/+43
| | | | | | | | | This QObject-style convention will allow the usual private class macros to be used. Change-Id: I992ee2a2d2e7984d57feb4cbe785a267f2fd83ce Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* add QSqlResult constructor suitable for inheritanceMark Brand2013-03-062-0/+12
| | | | | | | | The new constructor accepts reference to the private class provided by a subclass. Change-Id: I568e31727bb90de12ee8bb7bf0ed442737056470 Reviewed-by: Andy Shaw <andy.shaw@digia.com>
* QSqlResultPrivate: private q -> protected q_ptrMark Brand2013-03-062-3/+4
| | | | | | | | This QObject-style convention will allow the usual private class macros to be used. Change-Id: Ib1cee0b3aca949b75511868ad4914e5b8530929b Reviewed-by: Andy Shaw <andy.shaw@digia.com>
* prepare QSqlResultPrivate() to allow subclassingMark Brand2013-03-062-6/+7
| | | | | | | | | | | | Allow the private class to be instantiated before the public class. Public subclasses will need to first instantiate the private subclass and pass the reference to QSqlResult. Add virtual constructor so QSqlResult can delete private class polymorphically. Change-Id: Ide7115dbb4150d6604677b542dbec16e6956a142 Reviewed-by: Andy Shaw <andy.shaw@digia.com>
* Distinguish between 'mac' and 'macx' qmake scopesTor Arne Vestbø2013-03-051-1/+1
| | | | | | | | | | | | | | The former applies both on Mac OS X and iOS, but 'macx' is specific to Mac OS X. ios.conf and macx.conf now share most of their settings in the common mac.conf. We set the default QMAKE_MAC_SDK before loading mac.conf, so that any overrides in the device config will apply afterwards. This means configure's mkspec parsing will be able to read the QMAKE_MAC_SDK. Change-Id: I0c7e26a6a0103e19b23ef152aa9e4ab461cee632 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* PSQL: lastInsertId without OID on tableIsrael Lins2013-02-281-1/+6
| | | | | | | | | | | | Make lastInsertID work for tables without OIDs. The use of OID in tables is now deprecated in PostgeSQL and lastval() is now provided. http://www.postgresql.org/docs/8.1/interactive/runtime-config-compatible.html#GUC-DEFAULT-WITH-OIDS Change-Id: I01dfdd7a2aab8826487657f691fea3c9268c16b2 Reviewed-by: Israel Lins Albuquerque <israelins85@yahoo.com.br> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* ODBC: implementation of lastInsertId()Israel Lins2013-02-272-1/+38
| | | | | | | Implemented lastInsertId() for some ODBC compatible databases. Change-Id: I0b75a8e68369af39e258e4761b384767ab8a371e Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* ODBC: improve detection of DBMSIsrael Lins2013-02-261-11/+19
| | | | | Change-Id: Ia93c3adb54fd28e290ff6fc85cb98138514885f1 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* make static function a class memberMark Brand2013-02-261-7/+8
| | | | | Change-Id: I8c18c746185f6b7530ed985f4d482a1c9073fb10 Reviewed-by: Andy Shaw <andy.shaw@digia.com>
* rename private driver to privDriverMark Brand2013-02-261-12/+12
| | | | | | | | This avoids confusion now with the actual driver and avoids a name collision in later refactoring. Change-Id: I83055213f3a7b7998640662d49ba33749fdadd18 Reviewed-by: Andy Shaw <andy.shaw@digia.com>
* qpsql: simplify expressionMark Brand2013-02-261-1/+1
| | | | | Change-Id: I1cff816ca5e8f683015186a2b5815e564ad454e6 Reviewed-by: Andy Shaw <andy.shaw@digia.com>
* Adapt the newly-renamed SQL driver headers to proper private headersThiago Macieira2013-02-269-45/+99
| | | | | | | | | | Add the "We mean it" text and remove the now-unnecessary syncqt macros that used to prevent those headers from being added to the master includes. Change-Id: I03ac2a452bc6ac43ebba502bc0ecbf5ee1adf314 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Rename the SQL driver header files to _p.h (make private)Thiago Macieira2013-02-2628-27/+27
| | | | | | | | | | | | | The drivers were never public API. They were exposed by mistake in public headers. What's more, they have #include'd a private header (qsqlcachedresult_p.h) since at least Qt 4.5.1. That means no one used those headers in Qt 4 (private headers weren't installed then) and it's unlikely anyone did in 5.0. Change-Id: Ie0a47bcf0260ee6bdd3d8494b78fd1eec28a2d6b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Deprecate QSqlError setters.Marcel Krems2013-02-242-13/+42
| | | | | | | | | The constructor is sufficient, since it has a parameter for each member variable. Even the drivers, which were mentioned in the class description don't use them. Change-Id: Ie8ba0467c7dc1928c539b4b19db8cc2ea0f44ea0 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-02-184-62/+78
|\ | | | | | | | | | | | | Conflicts: src/widgets/styles/qmacstyle_mac.mm Change-Id: If8326db9e7da3cbf45dbf7475fdff9915c7723b1
| * QSqlResult: fix parsing of bound SQL statementsIsrael Lins2013-02-151-21/+54
| | | | | | | | | | | | | | | | | | | | | | | | Parsing for bound SQL parameters now handles identifier quoting using double quotes (") and square brackets ([]). The following has only 1 bound value but previously 2 were detected: SELECT 1 AS "A?b[?']]]de?ghi", ? Task-number: QTBUG-27159 Change-Id: Icfd02187e1126ff3b5ed11df8d4e599f574e61bf Reviewed-by: Mark Brand <mabrand@mabrand.nl>
| * Fix DB2 driver X64 Linux BuildKarim Pinter2013-02-151-1/+1
| | | | | | | | | | | | | | | | | | On X64 Linux DB2 driver build give an error on BIGINT conversion to QVariant, casting it to qint64 solved the problem. Task-number: QTBUG-20172 Change-Id: I7ef31cbe643c90b40b86cf3d7c4d3b711eabf2f5 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
| * qpsql: reuse QSqlResultPrivate::positionalToNamedBindingMark Brand2013-02-151-24/+3
| | | | | | | | | | | | | | | | | | reuse QSqlResultPrivate::positionalToNamedBinding for psql Change-Id: I48713c3f94eb880cafff5fddbeadaa0746a405a9 Reviewed-by: Israel Lins Albuquerque <israelins85@yahoo.com.br> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
| * QSqlResultPrivate: parameterize fieldSerial function for parsingMark Brand2013-02-152-3/+8
| | | | | | | | | | | | | | Change-Id: Ibaffadec9bf9e6e0d5609b7327b369d560e8e2ce Reviewed-by: Israel Lins Albuquerque <israelins85@yahoo.com.br> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
| * QSqlResultPrivate: parameterize input query for parsingMark Brand2013-02-152-15/+15
| | | | | | | | | | | | | | Change-Id: If57f4fcea2e00a1910df5a5bd2b556289f4ffb21 Reviewed-by: Israel Lins Albuquerque <israelins85@yahoo.com.br> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
| * move qFieldSerial() to static QSqlResultPrivate::fieldSerial()Mark Brand2013-02-152-6/+5
| | | | | | | | | | | | | | Change-Id: Ic2db719437a11019262cf299929115ffa11d3d34 Reviewed-by: Israel Lins Albuquerque <israelins85@yahoo.com.br> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-02-1414-128/+196
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/concurrent/doc/qtconcurrent.qdocconf src/corelib/doc/qtcore.qdocconf src/corelib/global/qglobal.h src/dbus/doc/qtdbus.qdocconf src/dbus/qdbusmessage.h src/gui/doc/qtgui.qdocconf src/gui/image/qimagereader.cpp src/network/doc/qtnetwork.qdocconf src/opengl/doc/qtopengl.qdocconf src/opengl/qgl.h src/plugins/platforms/windows/qwindowswindow.cpp src/printsupport/doc/qtprintsupport.qdocconf src/sql/doc/qtsql.qdocconf src/testlib/doc/qttestlib.qdocconf src/tools/qdoc/doc/config/qt-cpp-ignore.qdocconf src/widgets/doc/qtwidgets.qdocconf src/xml/doc/qtxml.qdocconf Change-Id: Ie9a1fa2cc44bec22a0b942e817a1095ca3414629
| * qpsql: fix spelling in commentMark Brand2013-02-121-2/+1
| | | | | | | | | | Change-Id: I3d1abd6041a4adf425ba7851146659655fc12183 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
| * move QSqlResultPrivate to private headerMark Brand2013-02-113-68/+140
| | | | | | | | | | | | | | Change-Id: Ice5464989530d521f65703daa080cb2094afef3c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Israel Lins Albuquerque <israelins85@yahoo.com.br> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
| * QSqlResult::savePrepare() simplify logicMark Brand2013-02-091-6/+5
| | | | | | | | | | | | Change-Id: If0b54a4c17f1c71c2bb33ae4d514ad6a9cc17e4c Reviewed-by: Israel Lins Albuquerque <israelins85@yahoo.com.br> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
| * QSqlResult: consolidate SQL parsing for bindingIsrael Lins2013-02-091-26/+3
| | | | | | | | | | | | | | Consolidated SQL parsing for binding values, removing repeated code. Change-Id: I77aadcfd2673b067f7deb52b826d7b5a2ba2ae2a Reviewed-by: Mark Brand <mabrand@mabrand.nl>
| * QSqlResult: note in doc about misnamed methodMark Brand2013-02-091-0/+2
| | | | | | | | | | | | Change-Id: I488a915622445527c529b35db639ec3b6e887d1d Reviewed-by: Israel Lins Albuquerque <israelins85@yahoo.com.br> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
| * fix QSqlTableModel:revert() for OnFieldChangeMark Brand2013-02-091-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | revert() should operate in OnFieldChange edit strategy just as submit() does. The reason in Qt 4 for excluding OnFieldChange was that there was no opportunity to revert. The model was refreshed, causing all changes to be lost. In Qt 5 a failed edit remains in the cache until user action, which could be to revert. Change-Id: Ide021c4f83a53834b7ed81f2abfa3aa49317704d Reviewed-by: Mark Brand <mabrand@mabrand.nl>
| * QSqlTableModel: support refreshing inserted rows with auto columnsMark Brand2013-02-062-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, selectRow() did not work after INSERTing a new row into a table with an automatically populated column. It did not work because the model did not know the primary values for the new row. Newly inserted rows were therefore not refreshed in OnFieldChange and OnRowChange edit strategies. This change provides support for the typical simple case where a single column is populated by the database and can be retrieved with QSqlQuery::lastInsertId(). Task-Number: QTBUG-29102 Change-Id: Ibf0f0ac8661185bde57034ddf40c2178bece4778 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Lukas Geyer <lgeyer@gmx.at> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
| * QSqlTableModel::setData(): fix non-change detectionMark Brand2013-02-061-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 10ff9de91bedf93852f13a58287afd8831644759 introduced the optimization of ignoring non-changes, but it overshot the mark. It neglected to consider that QVariant's equality operator does not compare the null flag. It also failed to consider that setData() has a useful side effect of setting the generated flag in a column of a pending INSERT. This is important when the application actually wants a NULL to be inserted into the column. Task-number: QTBUG-29217 Change-Id: I1368f7acc21eebfeb5a8d23746fc38f6f30fd395 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
| * fix QSqlTableModel::headerData() for empty query with inserted rowMark Brand2013-02-062-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QSqlQueryModel::headerData() relied on virtual indexInQuery() to detect whether the requested column at row 0 mapped to an index in the query. This failed when row 0 was a pending insert managed by QSqlTableModel, and therefore not in the query. The only thing that matters here is the column. Task-number: QTBUG-29108 Change-Id: I3e0ae85ba223e444781ec8033386d394bb44f0e8 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
| * remove misleading statement from ~QSqlDatabase()Mark Brand2013-02-051-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The presence of the sentence "If this is the last QSqlDatabase object that uses a certain database connection, the database connection is automatically closed" is misleading, whether or not the statement is true. It is about an internal detail of QSqlDatabase's implementation. As such it is not appropriate for user documentation. The user should be focused on how to use addDatabase(), cloneDatabase() and removeDatabase() correctly. Task-number: QTBUG-29481 Change-Id: I0c39584be260e13340834c34098368fcce4a7419 Reviewed-by: Florian Paul Schmidt <mista.tapas@gmx.net> Reviewed-by: Sune Vuorela <sune@vuorela.dk> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
| * fix doc page urlsOswald Buddenhagen2013-02-041-1/+1
| | | | | | | | | | | | | | they are versioned nowadays Change-Id: I839db633e9d7d63c9d445f8e914b529bd7ce60a2 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
| * substitute fixed version numbers in qdocconf files with variablesOswald Buddenhagen2013-02-011-5/+5
| | | | | | | | | | | | Change-Id: Ie57765c10a8e90d6fc74ee5a8fd84bfc7cd8bcf2 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
| * don't prematurely reduce LIBS when adding sql link listsMark Brand2013-01-284-4/+4
| | | | | | | | | | | | | | | | | | | | It's possible that different database libraries share dependencies. We need to keep their link lists intact here so that QtSql's .prl and .pc files will have them in the right order. Particularly important when building the drivers into QtSql and using static linking. Change-Id: Id371b127099f2790fe7cccd0c7059607600f447d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* | qsql ibase: remove duplicate class definitionMark Brand2013-02-051-23/+0
| | | | | | | | | | | | | | | | Follow-up to 1580f558472e2c37936fe817fc546a79a8b0a9a5 Task-number: QTBUG-29455 Change-Id: Id254a166ac901fb0cc0ba81db4bf1051a2acb53f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* | Remove dependency of DB driver headers on qsqlcachedresult_p.h.Friedemann Kleint2013-02-0110-125/+152
| | | | | | | | | | | | | | | | | | | | | | | | Move the QXXResult classes inheriting the private class QSqlCachedResult from header into the source files for SQLite, SQLite2, Interbase/Firebird and TDS/Sybase and Oracle. Task-number: QTBUG-28088 Change-Id: Ia16d30e442e313c8165282b8a3f012fd95d96759 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Frederik Gladhorn2013-01-291-1/+1
|\ \ | | | | | | | | | refs/staging/dev
| * | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-01-281-1/+1
| |\| | | | | | | | | | Change-Id: I12b4d8b99bdccae53b1a978cd6eb8f4ac6fb3c76
| | * Doc: Fix module name formatSze Howe Koh2013-01-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow the conventions at http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation QtCore -> Qt Core QtDBus -> Qt D-Bus QtDesigner -> Qt Designer QtGui -> Qt GUI QtImageFormats -> Qt Image Formats QtNetwork -> Qt Network QtPrintSupport -> Qt Print Support QtScript -> Qt Script QtSql -> Qt SQL QtSvg -> Qt SVG QtTest -> Qt Test QtWebKit -> Qt WebKit QtWidgets -> Qt Widgets QtXml -> Qt XML QtConcurrent -> Qt Concurrent (partial) QtQuick -> Qt Quick (partial) Also, distinguish between "module" and "library" Change-Id: Icb8aa695ae60b0e45920b0c8fce4dc763a12b0cd Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* | | Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-2923-91/+0
|/ / | | | | | | | | | | | | | | | | | | | | The macro was made empty in ba3dc5f3b56d1fab6fe37fe7ae08096d7dc68bcb and is no longer necessary or used. Discussed-on: http://lists.qt-project.org/pipermail/development/2013-January/009284.html Change-Id: Id2bb2e2cabde059305d4af5f12593344ba30f001 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* | Fix warning about type-punned pointersThiago Macieira2013-01-261-18/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The d->buffer array was 2x the required size and every other void* actually stored a DBINT (int) indicating the binding status of the null. The qIsNull function checked that value, but got the warning printed. Instead, let's just do the right thing and have a struct for each column. Solves the problem more neatly. Change-Id: I2daaf05c876da7e0e13fb983c58916d946518846 Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-01-2265-65/+65
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qsavefile_p.h src/corelib/tools/qregularexpression.cpp src/gui/util/qvalidator.cpp src/gui/util/qvalidator.h Change-Id: I58fdf0358bd86e2fad5d9ad0556f3d3f1f535825
| * Update copyright year in Digia's license headersSergio Ahumada2013-01-1865-65/+65
| | | | | | | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | 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>