Introduce a template function to determine the special values
via macro and use that for QVariant::Double and QMetaType::Float.
Task-number: QTBUG-44381
Change-Id: I379dd82b22d467b0aebaa42f4f0f5c52472a5c47
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
The current SQL plugins path are still Qt 4 style. This patch adds
qtbase to ensure users will be directed to the right place.
Change-Id: I11bf933864f0a8955079bf7175eb1e33bb5bc07f
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
...where passing them by value was not intentional.
Change-Id: Ifd5036d57b41fddeeacfbd3f5890881605b80647
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Qt copyrights are now in The Qt Company, so we could update the source
code headers accordingly. In the same go we should also fix the links to
point to qt.io.
Outdated header.LGPL removed (use header.LGPL21 instead)
Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing
combination. New header.LGPL-COMM taken in the use file which were
using old header.LGPL3 (src/plugins/platforms/android/extract.cpp)
Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license
combination
Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe
Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
The postfix increment(decrement) creates a temp copy of *this before the
modification and then returns that copy. It's needed only when using the
old iterator and then incrementing it.
Change-Id: I7f6702de78f5f987cec3556047e76049b4ee063a
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Until now, QSqlQuery::execBatch did not call resetBindCount, which lead
the next call to QSqlQuery::addBindValue to start at non zero index.
This is problematic in case of a prepared query which is called several
times.
Task-number: QTBUG-43874
Change-Id: I1a0f46e39b74d9538009967fd98a269e05aac6f2
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
SQL Server 2012 Native Client (version 11.0.2100.60) or later introduced
a change in the behavior of the SQLGetData method when converted string values
are involved. In older version a (sometimes wrong) size was returned. Now always
SQL_NO_TOTAL is returned which signals to read as much data as available.
SQL_NO_TOTAL was handled like SQL_NULL_DATA in the code before which indicates a
NULL value so the returned string was empty.
See link for more info: http://msdn.microsoft.com/en-us/library/jj219209.aspx
Change-Id: Ia0d2296caf593890b301ee1848d1bf3eb8d7b6fe
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
This patch adds correct timezone support in PSQL plugin. Prior to this
patch, no timezone support was provided, so only the following case
worked :
* using local time in both client application and postgresql server
* datetime were using second precision
This patch tries to take care that postgresql has two different
datatypes for date time, respectively :
* timestamp with time zone
* timestamp without time zone
Both are internally stored as UTC values, but are not parsed the same.
* timestamp with time zone assumes that there is a time zone
information and will parse date time accordingly, and then, convert
into UTC before storing them
* timestamp without time zone assumes that there is no time zone
information and will silently ignore any, unless the datetime is
explicitly specified as having a time zone, in case it will convert
it into UTC before storing it
Both are retrieved as local time values, with the following difference
* timestamp with time zone includes the timezone information
(2014-02-12 10:20:12+0100 for example)
* timestamp without time zone does not include it
The patch does the following :
* parse the date retrieved by postgresql server using QDateTime
functions, which work correctly
* always convert the date to UTC before giving it to postgresql
* force time zone so that timezone information is taken into account
by postgresql
* also adds the milliseconds when storing QDateTime values
The following configurations are tested to work :
* client and server using same timezone, timestamp with or without tz
* client and server using different timezone, timestamp with tz
The following configuration will *not* work :
* client and server using different timezones, timestamp without tz
Because data will be converted to local time by the postgresql server,
so when returned it will be different from what had been serialized.
Prior to this patch, it gave the illusion to work because since TZ
information was lost, time was stored as local time from postgresql.
Lots of inconsistencies occurred, though, in case client tz changes...
I don't expect this to be an issue since having different TZ in server
and client and *not* handling this is a broken setup anyway.
Almost based on changes proposed by julien.blanc@nmc-company.fr
[ChangeLog][QtSql] Added timezone support for datetime fields in PSQL
Task-number: QTBUG-36211
Change-Id: I5650a5ef60cb3f14f0ab619825612831c7e90c12
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
This fixes the tst_QSqlQuery::isNull test case when run against a
MySQL database driver.
Change-Id: I8248ba956472bae97a64247594055e6f02840557
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
Done automatically with clang-modernize on linux
(But does not add Q_DECL_OVERRIDE to the function that are marked
as inline because it a compilation error with MSVC2010)
Change-Id: I2196ee26e3e6fe20816834ecea5ea389eeab3171
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Conflicts:
dist/changes-5.4.0
7231e1fbe2 went into 5.4 instead of the
5.4.0 branch, thus the conflict.
Change-Id: I70b8597ab52506490dcaf700427183950d42cbd1
The enum was made public in f84b00c6d2, but this
makes it follow the convention to camel case acronyms too before it's too late
to change it.
Change-Id: Ibb81e9221cb73fe0502d0a26f2d73512dd142f08
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
so that it can build with configure -no-feature-DEPRECATED
Change-Id: Id2decc05974bad249c79936d99ab63d3cfc375ad
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Introduce a static function returning the value called from
qMakeFieldInfo(SQLHANDLE). The field is currently only populated
when executing a query. Populating it from QODBCDriver::record()
would require executing a dummy query, which is problematic since
QSqlField does not have any provisions for delayed evaluation.
Document the limitation.
Task-number: QTBUG-39388
Change-Id: Ib2d2f2653b8b757389f627142c61c13a117fef72
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Refactor code to extract an overload of qMakeFieldInfo()
that only takes an SQLHANDLE hStmt parameter. This allows
for easy debugging and inspecting driver-dependent additional
columns in QODBCDriver::record().
Task-number: QTBUG-39388
Change-Id: Id338838f837746beff1b2711bf2cd66ca8c7afe6
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
qsql_odbc.cpp(360) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
qsql_odbc.cpp(380) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
qsql_odbc.cpp(2052) : warning C4267: 'argument' : conversion from 'size_t' to 'SQLSMALLINT', possible loss of data
qsql_odbc.cpp(2070) : warning C4267: 'argument' : conversion from 'size_t' to 'SQLSMALLINT', possible loss of data
qsql_odbc.cpp(2096) : warning C4267: 'argument' : conversion from 'size_t' to 'SQLSMALLINT', possible loss of data
Task-number: QTBUG-39388
Change-Id: Ie97d9e968d5c7b013b0d364c64175aa9b329ae97
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
dbmsType was previously kept as a private variable in QSqlDriverPrivate,
however it's particularly useful for QODBC users.
[ChangeLog][QtSql][QSqlDriver] Add support for determining DBMS type from SQL driver.
Change-Id: If1c221520da9ac4ccef85a02db078679d76eac92
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
As fb_types.h says, Firebird requires (S)LONG to be 32 bit, and it defines
SLONG to int. This leads to sqllen being 4, so qsql_ibase.cpp allocates
4 bytes... and was writing 8 bytes into it.
Fixed by checking sqllen, the same way QIBaseResult::gotoNext does.
Change-Id: Ie8680d32f98c354dfc8430b8efbfe95450556956
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
Since 5.0 it is possible to use one call to bindValue to bind
values to multiple placeholders with the same name.
Task-number: QTBUG-23360
Change-Id: Ic838150d25dd07bca7bc9e5d91ab3362a73833d6
Reviewed-by: Matt Newell <newellm@blur.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
This also coincidentally fixes logging of prepared queries, which previously
weren't logged.
Change-Id: I41b3559080662284699ac3dfa4fa4236342c61d2
Done-by: John Brooks <john.brooks@jollamobile.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This patch aims to provide an additional tip for users having trouble
with e.g. the MySQL plugin. After a successful build most users are
struggling with loading failure due the fact that the client libraries
folder is not contained in the PATH environment variable. This tip
helps them overcome that in a controlled manner with Qt Creator.
Change-Id: I2dc5c9c6d8d8976686d74c369b6e1683c479f35c
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
url is set in qtbase/doc/global which is inherited by the
Qt 5 module qdocconf files.
Change-Id: Ieffa174f598f4a3b8ce8be9bfae7ca9b6981f12b
Reviewed-by: Martin Smith <martin.smith@digia.com>
There doesn't seem to be any reason why the macro is actually
necessary. My guess is that someone wrote the code on Windows without
"const", then it failed to compile everywhere else. Instead of fixing
the code by adding the "const", the developer must have added this
macro.
Microsoft Visual Studio mangles the constness of the variable, so we
can't remove it now from existing compilers. But we can for the new
version.
This is also required to compile QtSql with the MSVC option
/Zc:strictStrings, which is enabled in Qt 5.4.
Change-Id: Ibf2c2cb7287a4332d69aa81080a37aab4327677d
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
If the call to SQLNumResultCols fails for whatever reason then it will
not be correctly caught since the count might be higher than 0 since it is
uninitalized. This ensures that if it fails then it does not try to act as
if it succeeded.
Task-number: QTBUG-39137
Change-Id: Ifae8c1f7fac8416643f2317747f87295642a7935
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
QSqlResult::bindValue(int index, ...) is increasing the memory usage
when called multiple times for same index
Task-number: QTBUG-33169
Change-Id: I4f26125f6bb994bb430dc054df5761b6ddf03075
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>