diff options
| author | 2015-11-25 16:48:49 -0500 | |
|---|---|---|
| committer | 2015-11-25 16:48:49 -0500 | |
| commit | 7412693e086a7eafaa7ea861164caf523943e5fa (patch) | |
| tree | 0aee322e40572df306b9813546c7a12b3093bcea /SQLiteStudio3/coreSQLiteStudio/db | |
| parent | 640196993d31cf5d6fdf36386990ec05f473a048 (diff) | |
| parent | 8e640722c62692818ab840d50b3758f89a41a54e (diff) | |
Merge tag 'upstream/3.0.7'
Upstream version 3.0.7
# gpg: Signature made Wed 25 Nov 2015 04:48:48 PM EST using RSA key ID EBE9BD91
# gpg: Good signature from "Unit 193 <unit193@gmail.com>"
# gpg: aka "Unit 193 <unit193@ninthfloor.org>"
# gpg: aka "Unit 193 <unit193@ubuntu.com>"
# gpg: aka "Unit 193 <unit193@ninthfloor.com>"
Diffstat (limited to 'SQLiteStudio3/coreSQLiteStudio/db')
4 files changed, 26 insertions, 14 deletions
diff --git a/SQLiteStudio3/coreSQLiteStudio/db/queryexecutor.cpp b/SQLiteStudio3/coreSQLiteStudio/db/queryexecutor.cpp index b790ffa..f8d7fd2 100644 --- a/SQLiteStudio3/coreSQLiteStudio/db/queryexecutor.cpp +++ b/SQLiteStudio3/coreSQLiteStudio/db/queryexecutor.cpp @@ -201,6 +201,12 @@ void QueryExecutor::run() void QueryExecutor::execInternal() { + if (forceSimpleMode) + { + executeSimpleMethod(); + return; + } + simpleExecution = false; interrupted = false; @@ -456,7 +462,8 @@ void QueryExecutor::simpleExecutionFinished(SqlQueryPtr results) context->resultsHandler = nullptr; } - notifyWarn(tr("SQLiteStudio was unable to extract metadata from the query. Results won't be editable.")); + if (!forceSimpleMode) + notifyWarn(tr("SQLiteStudio was unable to extract metadata from the query. Results won't be editable.")); emit executionFinished(results); } @@ -551,6 +558,16 @@ bool QueryExecutor::handleRowCountingResults(quint32 asyncId, SqlQueryPtr result return true; } +bool QueryExecutor::getForceSimpleMode() const +{ + return forceSimpleMode; +} + +void QueryExecutor::setForceSimpleMode(bool value) +{ + forceSimpleMode = value; +} + const QStringList& QueryExecutor::getRequiredDbAttaches() const { diff --git a/SQLiteStudio3/coreSQLiteStudio/db/queryexecutor.h b/SQLiteStudio3/coreSQLiteStudio/db/queryexecutor.h index 83d0436..95c6a0c 100644 --- a/SQLiteStudio3/coreSQLiteStudio/db/queryexecutor.h +++ b/SQLiteStudio3/coreSQLiteStudio/db/queryexecutor.h @@ -1029,6 +1029,9 @@ class API_EXPORT QueryExecutor : public QObject, public QRunnable const QStringList& getRequiredDbAttaches() const; + bool getForceSimpleMode() const; + void setForceSimpleMode(bool value); + private: /** * @brief Executes query. @@ -1322,6 +1325,8 @@ class API_EXPORT QueryExecutor : public QObject, public QRunnable */ Db::QueryResultsHandler resultsHandler = nullptr; + bool forceSimpleMode = false; + signals: /** * @brief Emitted on successful query execution. diff --git a/SQLiteStudio3/coreSQLiteStudio/db/queryexecutorsteps/queryexecutoraddrowids.cpp b/SQLiteStudio3/coreSQLiteStudio/db/queryexecutorsteps/queryexecutoraddrowids.cpp index ea42baf..8cc344c 100644 --- a/SQLiteStudio3/coreSQLiteStudio/db/queryexecutorsteps/queryexecutoraddrowids.cpp +++ b/SQLiteStudio3/coreSQLiteStudio/db/queryexecutorsteps/queryexecutoraddrowids.cpp @@ -59,16 +59,6 @@ QHash<SelectResolver::Table,QHash<QString,QString>> QueryExecutorAddRowIds::addR return rowIdColsMap; } - bool hasStar = false; - for (SqliteSelect::Core::ResultColumn* resCol : core->resultColumns) - { - if (resCol->star) - { - hasStar = true; - break; - } - } - // Getting all tables we need to get ROWID for SelectResolver resolver(db, select->tokens.detokenize(), context->dbNameToAttach); resolver.resolveMultiCore = false; // multicore subselects result in not editable columns, skip them @@ -79,7 +69,7 @@ QHash<SelectResolver::Table,QHash<QString,QString>> QueryExecutorAddRowIds::addR if (table.flags & (SelectResolver::FROM_COMPOUND_SELECT | SelectResolver::FROM_DISTINCT_SELECT | SelectResolver::FROM_GROUPED_SELECT)) continue; // we don't get ROWID from compound, distinct or aggregated subselects - if (!addResultColumns(core, table, rowIdColsMap, isTopSelect, hasStar)) + if (!addResultColumns(core, table, rowIdColsMap, isTopSelect)) { ok = false; return rowIdColsMap; @@ -156,7 +146,7 @@ QHash<QString,QString> QueryExecutorAddRowIds::getNextColNames(const SelectResol } bool QueryExecutorAddRowIds::addResultColumns(SqliteSelect::Core* core, const SelectResolver::Table& table, - QHash<SelectResolver::Table,QHash<QString,QString>>& rowIdColsMap, bool isTopSelect, bool hasStar) + QHash<SelectResolver::Table,QHash<QString,QString>>& rowIdColsMap, bool isTopSelect) { QHash<QString, QString> executorToRealColumns; bool aliasOnlyAsSelectColumn = false; diff --git a/SQLiteStudio3/coreSQLiteStudio/db/queryexecutorsteps/queryexecutoraddrowids.h b/SQLiteStudio3/coreSQLiteStudio/db/queryexecutorsteps/queryexecutoraddrowids.h index fa2167f..61bc302 100644 --- a/SQLiteStudio3/coreSQLiteStudio/db/queryexecutorsteps/queryexecutoraddrowids.h +++ b/SQLiteStudio3/coreSQLiteStudio/db/queryexecutorsteps/queryexecutoraddrowids.h @@ -31,7 +31,7 @@ class QueryExecutorAddRowIds : public QueryExecutorStep * Finds columns representing ROWID for the \p table and adds them to result columns and to the context. */ bool addResultColumns(SqliteSelect::Core* core, const SelectResolver::Table& table, - QHash<SelectResolver::Table, QHash<QString, QString> >& rowIdColsMap, bool isTopSelect, bool hasStar); + QHash<SelectResolver::Table, QHash<QString, QString> >& rowIdColsMap, bool isTopSelect); /** * @brief Adds the column to result columns list. |
