summaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/coreSQLiteStudio/db/abstractdb3.h
diff options
context:
space:
mode:
Diffstat (limited to 'SQLiteStudio3/coreSQLiteStudio/db/abstractdb3.h')
-rw-r--r--SQLiteStudio3/coreSQLiteStudio/db/abstractdb3.h23
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)),