diff options
| author | 2016-06-13 18:42:42 -0400 | |
|---|---|---|
| committer | 2016-06-13 18:42:42 -0400 | |
| commit | 5d9314f134ddd3dc4c853e398ac90ba247fb2e4f (patch) | |
| tree | 5c457fc188036988d7abd29a3eb09931e406510f /SQLiteStudio3/coreSQLiteStudio/db/abstractdb3.h | |
| parent | 8e640722c62692818ab840d50b3758f89a41a54e (diff) | |
Imported Upstream version 3.1.0upstream/3.1.0
Diffstat (limited to 'SQLiteStudio3/coreSQLiteStudio/db/abstractdb3.h')
| -rw-r--r-- | SQLiteStudio3/coreSQLiteStudio/db/abstractdb3.h | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/SQLiteStudio3/coreSQLiteStudio/db/abstractdb3.h b/SQLiteStudio3/coreSQLiteStudio/db/abstractdb3.h index e7b0a4b..db9bc02 100644 --- a/SQLiteStudio3/coreSQLiteStudio/db/abstractdb3.h +++ b/SQLiteStudio3/coreSQLiteStudio/db/abstractdb3.h @@ -68,10 +68,10 @@ class AbstractDb3 : public AbstractDb class Row : public SqlResultsRow { public: - int init(const QStringList& columns, typename T::stmt* stmt); + int init(const QStringList& columns, typename T::stmt* stmt, Db::Flags flags); private: - int getValue(typename T::stmt* stmt, int col, QVariant& value); + int getValue(typename T::stmt* stmt, int col, QVariant& value, Db::Flags flags); }; Query(AbstractDb3<T>* db, const QString& query); @@ -888,7 +888,7 @@ bool AbstractDb3<T>::Query::execInternal(const QList<QVariant>& args) } bool ok = (fetchFirst() == T::OK); - if (ok) + if (ok && !flags.testFlag(Db::Flag::SKIP_DROP_DETECTION)) db->checkForDroppedObject(query); return ok; @@ -942,7 +942,7 @@ bool AbstractDb3<T>::Query::execInternal(const QHash<QString, QVariant>& args) } bool ok = (fetchFirst() == T::OK); - if (ok) + if (ok && !flags.testFlag(Db::Flag::SKIP_DROP_DETECTION)) db->checkForDroppedObject(query); return ok; @@ -1044,7 +1044,7 @@ template <class T> SqlResultsRowPtr AbstractDb3<T>::Query::nextInternal() { Row* row = new Row; - int res = row->init(colNames, stmt); + int res = row->init(colNames, stmt, flags); if (res != T::OK) { delete row; @@ -1131,13 +1131,13 @@ int AbstractDb3<T>::Query::fetchNext() //------------------------------------------------------------------------------------ template <class T> -int AbstractDb3<T>::Query::Row::init(const QStringList& columns, typename T::stmt* stmt) +int AbstractDb3<T>::Query::Row::init(const QStringList& columns, typename T::stmt* stmt, Db::Flags flags) { int res = T::OK; QVariant value; for (int i = 0; i < columns.size(); i++) { - res = getValue(stmt, i, value); + res = getValue(stmt, i, value, flags); if (res != T::OK) return res; @@ -1148,8 +1148,9 @@ int AbstractDb3<T>::Query::Row::init(const QStringList& columns, typename T::stm } template <class T> -int AbstractDb3<T>::Query::Row::getValue(typename T::stmt* stmt, int col, QVariant& value) +int AbstractDb3<T>::Query::Row::getValue(typename T::stmt* stmt, int col, QVariant& value, Db::Flags flags) { + UNUSED(flags); int dataType = T::column_type(stmt, col); switch (dataType) { @@ -1162,12 +1163,12 @@ int AbstractDb3<T>::Query::Row::getValue(typename T::stmt* stmt, int col, QVaria T::column_bytes(stmt, col) ); break; - case T::FLOAT: - value = T::column_double(stmt, col); - break; case T::NULL_TYPE: value = QVariant(QVariant::String); break; + case T::FLOAT: + value = T::column_double(stmt, col); + break; default: value = QString( reinterpret_cast<const QChar*>(T::column_text16(stmt, col)), |
