diff options
author | axis <qt-info@nokia.com> | 2010-01-21 12:20:33 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2010-01-21 12:20:33 (GMT) |
commit | 833bea1f71ed685e5f371d93f6f5c2da7be546e5 (patch) | |
tree | 09e3f60311ebf8af123a9e61f27908dd87118109 /src/sql/drivers | |
parent | d609f7d1963e06d05fa6f7e4a098a304a177bc68 (diff) | |
parent | d83e82e5c8a7fa0f6b1dcc4b1ab56f22afd942f6 (diff) | |
download | Qt-833bea1f71ed685e5f371d93f6f5c2da7be546e5.zip Qt-833bea1f71ed685e5f371d93f6f5c2da7be546e5.tar.gz Qt-833bea1f71ed685e5f371d93f6f5c2da7be546e5.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public
Conflicts:
mkspecs/features/symbian/platform_paths.prf
Diffstat (limited to 'src/sql/drivers')
-rw-r--r-- | src/sql/drivers/db2/qsql_db2.cpp | 2 | ||||
-rw-r--r-- | src/sql/drivers/db2/qsql_db2.h | 2 | ||||
-rw-r--r-- | src/sql/drivers/ibase/qsql_ibase.cpp | 2 | ||||
-rw-r--r-- | src/sql/drivers/ibase/qsql_ibase.h | 2 | ||||
-rw-r--r-- | src/sql/drivers/mysql/qsql_mysql.cpp | 2 | ||||
-rw-r--r-- | src/sql/drivers/mysql/qsql_mysql.h | 2 | ||||
-rw-r--r-- | src/sql/drivers/oci/qsql_oci.cpp | 2 | ||||
-rw-r--r-- | src/sql/drivers/oci/qsql_oci.h | 2 | ||||
-rw-r--r-- | src/sql/drivers/odbc/qsql_odbc.cpp | 9 | ||||
-rw-r--r-- | src/sql/drivers/odbc/qsql_odbc.h | 2 | ||||
-rw-r--r-- | src/sql/drivers/psql/qsql_psql.cpp | 2 | ||||
-rw-r--r-- | src/sql/drivers/psql/qsql_psql.h | 2 | ||||
-rw-r--r-- | src/sql/drivers/sqlite/qsql_sqlite.cpp | 2 | ||||
-rw-r--r-- | src/sql/drivers/sqlite/qsql_sqlite.h | 2 | ||||
-rw-r--r-- | src/sql/drivers/sqlite2/qsql_sqlite2.cpp | 18 | ||||
-rw-r--r-- | src/sql/drivers/sqlite2/qsql_sqlite2.h | 2 | ||||
-rw-r--r-- | src/sql/drivers/tds/qsql_tds.cpp | 2 | ||||
-rw-r--r-- | src/sql/drivers/tds/qsql_tds.h | 2 |
18 files changed, 36 insertions, 23 deletions
diff --git a/src/sql/drivers/db2/qsql_db2.cpp b/src/sql/drivers/db2/qsql_db2.cpp index 5d039cf..d5b3984 100644 --- a/src/sql/drivers/db2/qsql_db2.cpp +++ b/src/sql/drivers/db2/qsql_db2.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/src/sql/drivers/db2/qsql_db2.h b/src/sql/drivers/db2/qsql_db2.h index ef02dbc..300c9bc 100644 --- a/src/sql/drivers/db2/qsql_db2.h +++ b/src/sql/drivers/db2/qsql_db2.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/src/sql/drivers/ibase/qsql_ibase.cpp b/src/sql/drivers/ibase/qsql_ibase.cpp index bc425fc..6b68536 100644 --- a/src/sql/drivers/ibase/qsql_ibase.cpp +++ b/src/sql/drivers/ibase/qsql_ibase.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/src/sql/drivers/ibase/qsql_ibase.h b/src/sql/drivers/ibase/qsql_ibase.h index e8f6609..33e684a 100644 --- a/src/sql/drivers/ibase/qsql_ibase.h +++ b/src/sql/drivers/ibase/qsql_ibase.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/src/sql/drivers/mysql/qsql_mysql.cpp b/src/sql/drivers/mysql/qsql_mysql.cpp index b74babc..c0f866e 100644 --- a/src/sql/drivers/mysql/qsql_mysql.cpp +++ b/src/sql/drivers/mysql/qsql_mysql.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/src/sql/drivers/mysql/qsql_mysql.h b/src/sql/drivers/mysql/qsql_mysql.h index 7ed2b2e..ae3aaaa 100644 --- a/src/sql/drivers/mysql/qsql_mysql.h +++ b/src/sql/drivers/mysql/qsql_mysql.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/src/sql/drivers/oci/qsql_oci.cpp b/src/sql/drivers/oci/qsql_oci.cpp index a384ba0..01c4124 100644 --- a/src/sql/drivers/oci/qsql_oci.cpp +++ b/src/sql/drivers/oci/qsql_oci.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/src/sql/drivers/oci/qsql_oci.h b/src/sql/drivers/oci/qsql_oci.h index badcf03..424fb1a 100644 --- a/src/sql/drivers/oci/qsql_oci.h +++ b/src/sql/drivers/oci/qsql_oci.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp index fdf0c2c..2049a76 100644 --- a/src/sql/drivers/odbc/qsql_odbc.cpp +++ b/src/sql/drivers/odbc/qsql_odbc.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** @@ -888,12 +888,17 @@ bool QODBCResult::reset (const QString& query) (SQLCHAR*) query8.constData(), (SQLINTEGER) query8.length()); #endif - if (r != SQL_SUCCESS && r != SQL_SUCCESS_WITH_INFO) { + if (r != SQL_SUCCESS && r != SQL_SUCCESS_WITH_INFO && r!= SQL_NO_DATA) { setLastError(qMakeError(QCoreApplication::translate("QODBCResult", "Unable to execute statement"), QSqlError::StatementError, d)); return false; } + if(r == SQL_NO_DATA) { + setSelect(false); + return true; + } + SQLINTEGER isScrollable, bufferLength; r = SQLGetStmtAttr(d->hStmt, SQL_ATTR_CURSOR_SCROLLABLE, &isScrollable, SQL_IS_INTEGER, &bufferLength); if(r == SQL_SUCCESS || r == SQL_SUCCESS_WITH_INFO) diff --git a/src/sql/drivers/odbc/qsql_odbc.h b/src/sql/drivers/odbc/qsql_odbc.h index 8bd7660..145a902 100644 --- a/src/sql/drivers/odbc/qsql_odbc.h +++ b/src/sql/drivers/odbc/qsql_odbc.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/src/sql/drivers/psql/qsql_psql.cpp b/src/sql/drivers/psql/qsql_psql.cpp index 981b750..2a4e595 100644 --- a/src/sql/drivers/psql/qsql_psql.cpp +++ b/src/sql/drivers/psql/qsql_psql.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/src/sql/drivers/psql/qsql_psql.h b/src/sql/drivers/psql/qsql_psql.h index b9d108d..22871ff 100644 --- a/src/sql/drivers/psql/qsql_psql.h +++ b/src/sql/drivers/psql/qsql_psql.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/src/sql/drivers/sqlite/qsql_sqlite.cpp b/src/sql/drivers/sqlite/qsql_sqlite.cpp index c62f15c..9dbefaf 100644 --- a/src/sql/drivers/sqlite/qsql_sqlite.cpp +++ b/src/sql/drivers/sqlite/qsql_sqlite.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/src/sql/drivers/sqlite/qsql_sqlite.h b/src/sql/drivers/sqlite/qsql_sqlite.h index 7d30c4a..d0f589b 100644 --- a/src/sql/drivers/sqlite/qsql_sqlite.h +++ b/src/sql/drivers/sqlite/qsql_sqlite.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/src/sql/drivers/sqlite2/qsql_sqlite2.cpp b/src/sql/drivers/sqlite2/qsql_sqlite2.cpp index 1c1a411..ea476e5 100644 --- a/src/sql/drivers/sqlite2/qsql_sqlite2.cpp +++ b/src/sql/drivers/sqlite2/qsql_sqlite2.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** @@ -110,10 +110,11 @@ public: const char *currentTail; sqlite_vm *currentMachine; - uint skippedStatus: 1; // the status of the fetchNext() that's skipped - uint skipRow: 1; // skip the next fetchNext()? - uint utf8: 1; + bool skippedStatus; // the status of the fetchNext() that's skipped + bool skipRow; // skip the next fetchNext()? + bool utf8; QSqlRecord rInf; + QVector<QVariant> firstRow; }; static const uint initial_cache_size = 128; @@ -192,6 +193,8 @@ bool QSQLite2ResultPrivate::fetchNext(QSqlCachedResult::ValueCache &values, int // already fetched Q_ASSERT(!initialFetch); skipRow = false; + for(int i=0;i<firstRow.count(); i++) + values[i] = firstRow[i]; return skippedStatus; } skipRow = initialFetch; @@ -209,6 +212,11 @@ bool QSQLite2ResultPrivate::fetchNext(QSqlCachedResult::ValueCache &values, int #endif } + if(initialFetch) { + firstRow.clear(); + firstRow.resize(colNum); + } + switch(res) { case SQLITE_ROW: // check to see if should fill out columns @@ -299,7 +307,7 @@ bool QSQLite2Result::reset (const QString& query) } // we have to fetch one row to find out about // the structure of the result set - d->skippedStatus = d->fetchNext(cache(), 0, true); + d->skippedStatus = d->fetchNext(d->firstRow, 0, true); if (lastError().isValid()) { setSelect(false); setActive(false); diff --git a/src/sql/drivers/sqlite2/qsql_sqlite2.h b/src/sql/drivers/sqlite2/qsql_sqlite2.h index 3a2b5b1..1deadbc 100644 --- a/src/sql/drivers/sqlite2/qsql_sqlite2.h +++ b/src/sql/drivers/sqlite2/qsql_sqlite2.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/src/sql/drivers/tds/qsql_tds.cpp b/src/sql/drivers/tds/qsql_tds.cpp index ca1502c..f7f0961 100644 --- a/src/sql/drivers/tds/qsql_tds.cpp +++ b/src/sql/drivers/tds/qsql_tds.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/src/sql/drivers/tds/qsql_tds.h b/src/sql/drivers/tds/qsql_tds.h index 0ceae6d..f23a672 100644 --- a/src/sql/drivers/tds/qsql_tds.h +++ b/src/sql/drivers/tds/qsql_tds.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** |