diff options
| author | 2015-01-30 17:00:24 -0500 | |
|---|---|---|
| committer | 2015-01-30 17:00:24 -0500 | |
| commit | e4767514ed04e6a0bddf3f4a47f5f0b09e65e0ee (patch) | |
| tree | 86cadc2137831d44fa29fd40a2964f7fb1326de4 /SQLiteStudio3/coreSQLiteStudio | |
| parent | 26ddfe11c2b7fac52e5f57dcd9f5223a50b2a9a7 (diff) | |
| parent | 016003905ca0e8e459e3dc33e786beda8ec92f45 (diff) | |
Merge tag 'upstream/3.0.2'
Upstream version 3.0.2
# gpg: Signature made Fri 30 Jan 2015 05:00:11 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>"
Diffstat (limited to 'SQLiteStudio3/coreSQLiteStudio')
49 files changed, 2583 insertions, 791 deletions
diff --git a/SQLiteStudio3/coreSQLiteStudio/ChangeLog.txt b/SQLiteStudio3/coreSQLiteStudio/ChangeLog.txt index 0baf02c..c890b69 100644 --- a/SQLiteStudio3/coreSQLiteStudio/ChangeLog.txt +++ b/SQLiteStudio3/coreSQLiteStudio/ChangeLog.txt @@ -1,3 +1,33 @@ +[3.0.2] + * [ADDED]: Full support for the interface translations. + * [ADDED]: Polish translation. + * [ADDED]: #219, #2711 Reset autoincrement feature to context menu of table and to structure toolbar in table window. + * [ADDED]: #2715 Added "rows affected" to the execution result message for INSERT/DELETE/UPDATE queries. + * [BUGFIX]: Fixed deleting column from table that is the only column covered by an index or an "UPDATE OF" trigger. + * [BUGFIX]: #2703 Fixed compilation errors on GCC 4.9. + * [BUGFIX]: #2707 Fixed crash when importing CSV file with empty value for last column. + * [BUGFIX]: Valid objects in SQL editor are now highlighted and are Ctrl+clickable (the feature was there, but was broken and it didn't work). + * [BUGFIX]: Fixed invalid 'modified' status when focusing out NumberMultiEditor in FormView, resulting in uncommited change on FormView, even there was no change. + * [BUGFIX]: #2698 Fixed double precision numbers displaying in the Grid View. + * [BUGFIX]: #2696 Fixed handling foreign keys when the main table was not renamed, just columns changed. + * [BUGFIX]: #2713 Fixed foreign key actions in Foreign Key dialog, so they are no longer the same for ON UPDATE and ON DELETE, even they were configured differently. + * [BUGFIX]: #2715 Fixed storing rows affected/selected in SQL Editor history (bug since version 3.0.0 caused "rows" column in SQL history to be always 0). + * [BUGFIX]: Main window toolbar is updated after creating/deleting database objects (it was not). + * [BUGFIX]: #2722 Fixed crash when exporting database without data. + * [BUGFIX]: #2727 Fixed error message when calling SELECT with table from (transparently) attached database and selecting invalid column - message was misleading. + * [BUGFIX]: #2728, #2729 Fixed DEFAULT constraint dialog, so 1) it works when creating first column for new table, 2) it allows a single word as a default value, even the word is not an explicit string. + * [BUGFIX]: #2697 Fixed data populate dialog. + * [BUGFIX]: #2731 Fixed problem with attached databases not detaching after transparent attach in cross-database queries. + * [BUGFIX]: #2734 Fixed code assistant crash in Trigger Dialog. + * [BUGFIX]: #2721 Fixed initial selection of database in SQL Editor window, so it's set to the database currently selected in databases list on the left. + * [BUGFIX]: #2721 Added database name to error message when the SQL query execution failed. + * [BUGFIX]: #2718 Checkbox in CSV import plugin renamed to "Skip first row of data". + * [BUGFIX]: Fixed staring edition of data in grid by pressing Enter key. + * [BUGFIX]: #2745 Fixed crash when ctrl+right_clicking in SQL editor. + * [BUGFIX]: #2733 Fixed handling of foreign keys when changing table structure. + * [BUGFIX]: #2749 Fixed handling of function(distinct arg), resulting in incorrect results when executed. + * [BUGFIX]: Fixed logging SQL queries when --debug-sql is enabled. Queries from query executor were not logged. + [3.0.1] * [ADDED]: When the data is being read into the Gird View, columns width gets automatically adjusted, so for small values they are shrinked and for bigger values they're enlarged, but never above the configured limit (a new option in config dialog). * [ADDED]: Implemented support for immediate editing of rows just added to the WITHOUT ROWID tables (previously the manual refresh of data view was required). diff --git a/SQLiteStudio3/coreSQLiteStudio/completionhelper.h b/SQLiteStudio3/coreSQLiteStudio/completionhelper.h index 63b7225..2cb3c01 100644 --- a/SQLiteStudio3/coreSQLiteStudio/completionhelper.h +++ b/SQLiteStudio3/coreSQLiteStudio/completionhelper.h @@ -18,6 +18,8 @@ class DbAttacher; class API_EXPORT CompletionHelper : public QObject { + Q_OBJECT + friend class CompletionComparer; public: diff --git a/SQLiteStudio3/coreSQLiteStudio/coreSQLiteStudio.pro b/SQLiteStudio3/coreSQLiteStudio/coreSQLiteStudio.pro index 1ce7520..e58e2a8 100644 --- a/SQLiteStudio3/coreSQLiteStudio/coreSQLiteStudio.pro +++ b/SQLiteStudio3/coreSQLiteStudio/coreSQLiteStudio.pro @@ -45,6 +45,8 @@ portable { CONFIG += c++11 QMAKE_CXXFLAGS += -pedantic +TRANSLATIONS += translations/coreSQLiteStudio_pl.ts + SOURCES += sqlitestudio.cpp \ returncode.cpp \ services/config.cpp \ @@ -200,7 +202,8 @@ SOURCES += sqlitestudio.cpp \ rsa/Key.cpp \ rsa/KeyPair.cpp \ rsa/PrimeGenerator.cpp \ - rsa/RSA.cpp + rsa/RSA.cpp \ + translations.cpp HEADERS += sqlitestudio.h\ coreSQLiteStudio_global.h \ @@ -386,7 +389,8 @@ HEADERS += sqlitestudio.h\ rsa/Key.h \ rsa/KeyPair.h \ rsa/PrimeGenerator.h \ - rsa/RSA.h + rsa/RSA.h \ + translations.h unix: { target.path = $$LIBDIR diff --git a/SQLiteStudio3/coreSQLiteStudio/coresqlitestudio.qrc b/SQLiteStudio3/coreSQLiteStudio/coresqlitestudio.qrc index 2b58106..6f2f925 100644 --- a/SQLiteStudio3/coreSQLiteStudio/coresqlitestudio.qrc +++ b/SQLiteStudio3/coreSQLiteStudio/coresqlitestudio.qrc @@ -18,4 +18,7 @@ <file>licenses/diff_match.txt</file> <file>licenses/gpl.txt</file> </qresource> + <qresource prefix="/msg"> + <file>translations/coreSQLiteStudio_pl.qm</file> + </qresource> </RCC> diff --git a/SQLiteStudio3/coreSQLiteStudio/csvserializer.cpp b/SQLiteStudio3/coreSQLiteStudio/csvserializer.cpp index 97cc739..3672527 100644 --- a/SQLiteStudio3/coreSQLiteStudio/csvserializer.cpp +++ b/SQLiteStudio3/coreSQLiteStudio/csvserializer.cpp @@ -43,12 +43,14 @@ QList<QStringList> CsvSerializer::deserialize(const QString& data, const CsvForm int pos = 0; int lgt = data.length(); bool quotes = false; + bool sepAsLast = false; QString field = ""; QChar c; while (pos < lgt) { c = data[pos]; + sepAsLast = false; if (!quotes && c == '"' ) { quotes = true; @@ -69,6 +71,7 @@ QList<QStringList> CsvSerializer::deserialize(const QString& data, const CsvForm { cells << field; field.clear(); + sepAsLast = true; } else if (!quotes && format.rowSeparator.contains(c)) { @@ -84,7 +87,7 @@ QList<QStringList> CsvSerializer::deserialize(const QString& data, const CsvForm pos++; } - if (field.size() > 0) + if (field.size() > 0 || sepAsLast) cells << field; if (cells.size() > 0) diff --git a/SQLiteStudio3/coreSQLiteStudio/db/abstractdb.cpp b/SQLiteStudio3/coreSQLiteStudio/db/abstractdb.cpp index 56275aa..4b3165b 100644 --- a/SQLiteStudio3/coreSQLiteStudio/db/abstractdb.cpp +++ b/SQLiteStudio3/coreSQLiteStudio/db/abstractdb.cpp @@ -305,7 +305,6 @@ SqlQueryPtr AbstractDb::execHashArg(const QString& query, const QHash<QString,QV if (!isOpenInternal()) return SqlQueryPtr(new SqlErrorResults(SqlErrorCode::DB_NOT_OPEN, tr("Cannot execute query on closed database."))); - logSql(this, query, args, flags); QString newQuery = query; SqlQueryPtr queryStmt = prepare(newQuery); queryStmt->setArgs(args); @@ -323,7 +322,6 @@ SqlQueryPtr AbstractDb::execListArg(const QString& query, const QList<QVariant>& if (!isOpenInternal()) return SqlQueryPtr(new SqlErrorResults(SqlErrorCode::DB_NOT_OPEN, tr("Cannot execute query on closed database."))); - logSql(this, query, args, flags); QString newQuery = query; SqlQueryPtr queryStmt = prepare(newQuery); queryStmt->setArgs(args); @@ -636,7 +634,13 @@ void AbstractDb::detachInternal(Db* otherDb) return; } - exec(QString("DETACH %1;").arg(attachedDbMap.valueByRight(otherDb)), Flag::NO_LOCK); + QString dbName = attachedDbMap.valueByRight(otherDb); + SqlQueryPtr res = exec(QString("DETACH %1;").arg(dbName), Flag::NO_LOCK); + if (res->isError()) + { + qCritical() << "Cannot detach" << dbName << " / " << otherDb->getName() << ":" << res->getErrorText(); + return; + } attachedDbMap.removeRight(otherDb); emit detached(otherDb); } diff --git a/SQLiteStudio3/coreSQLiteStudio/db/abstractdb2.h b/SQLiteStudio3/coreSQLiteStudio/db/abstractdb2.h index e35e038..c521bfa 100644 --- a/SQLiteStudio3/coreSQLiteStudio/db/abstractdb2.h +++ b/SQLiteStudio3/coreSQLiteStudio/db/abstractdb2.h @@ -7,6 +7,7 @@ #include "common/unused.h" #include "db/sqlerrorcodes.h" #include "db/sqlerrorresults.h" +#include "log.h" #include <sqlite.h> #include <QThread> #include <QPointer> @@ -195,7 +196,7 @@ bool AbstractDb2<T>::openInternal() if (errMsg) { - dbErrorMessage = tr("Could not open database: %1").arg(QString::fromUtf8(errMsg)); + dbErrorMessage = QObject::tr("Could not open database: %1").arg(QString::fromUtf8(errMsg)); sqlite_freemem(errMsg); } return false; @@ -570,6 +571,8 @@ bool AbstractDb2<T>::Query::execInternal(const QList<QVariant>& args) ReadWriteLocker locker(&(db->dbOperLock), query, Dialect::Sqlite2, flags.testFlag(Db::Flag::NO_LOCK)); + logSql(db.data(), query, args, flags); + QueryWithParamCount queryWithParams = getQueryWithParamCount(query, Dialect::Sqlite2); QString singleStr = replaceNamedParams(queryWithParams.first); @@ -604,6 +607,8 @@ bool AbstractDb2<T>::Query::execInternal(const QHash<QString, QVariant>& args) ReadWriteLocker locker(&(db->dbOperLock), query, Dialect::Sqlite2, flags.testFlag(Db::Flag::NO_LOCK)); + logSql(db.data(), query, args, flags); + QueryWithParamNames queryWithParams = getQueryWithParamNames(query, Dialect::Sqlite2); QString singleStr = replaceNamedParams(queryWithParams.first); @@ -788,7 +793,7 @@ int AbstractDb2<T>::Query::fetchNext() if (!rowAvailable || !stmt) { - setError(SQLITE_MISUSE, tr("Result set expired or no row available.")); + setError(SQLITE_MISUSE, QObject::tr("Result set expired or no row available.")); return SQLITE_MISUSE; } diff --git a/SQLiteStudio3/coreSQLiteStudio/db/abstractdb3.h b/SQLiteStudio3/coreSQLiteStudio/db/abstractdb3.h index 89c3d96..7a84ec2 100644 --- a/SQLiteStudio3/coreSQLiteStudio/db/abstractdb3.h +++ b/SQLiteStudio3/coreSQLiteStudio/db/abstractdb3.h @@ -8,6 +8,7 @@ #include "services/collationmanager.h" #include "sqlitestudio.h" #include "db/sqlerrorcodes.h" +#include "log.h" #include <QThread> #include <QPointer> #include <QDebug> @@ -352,7 +353,7 @@ bool AbstractDb3<T>::openInternal() if (handle) T::close(handle); - dbErrorMessage = tr("Could not open database: %1").arg(extractLastError()); + dbErrorMessage = QObject::tr("Could not open database: %1").arg(extractLastError()); dbErrorCode = res; return false; } @@ -372,7 +373,7 @@ bool AbstractDb3<T>::closeInternal() int res = T::close(dbHandle); if (res != T::OK) { - dbErrorMessage = tr("Could not close database: %1").arg(extractLastError()); + dbErrorMessage = QObject::tr("Could not close database: %1").arg(extractLastError()); dbErrorCode = res; qWarning() << "Error closing database. That's weird:" << dbErrorMessage; return false; @@ -854,6 +855,8 @@ bool AbstractDb3<T>::Query::execInternal(const QList<QVariant>& args) return false; ReadWriteLocker locker(&(db->dbOperLock), query, Dialect::Sqlite3, flags.testFlag(Db::Flag::NO_LOCK)); + logSql(db.data(), query, args, flags); + QueryWithParamCount queryWithParams = getQueryWithParamCount(query, Dialect::Sqlite3); int res; @@ -890,6 +893,7 @@ bool AbstractDb3<T>::Query::execInternal(const QHash<QString, QVariant>& args) return false; ReadWriteLocker locker(&(db->dbOperLock), query, Dialect::Sqlite3, flags.testFlag(Db::Flag::NO_LOCK)); + logSql(db.data(), query, args, flags); QueryWithParamNames queryWithParams = getQueryWithParamNames(query, Dialect::Sqlite3); @@ -1075,7 +1079,7 @@ int AbstractDb3<T>::Query::fetchNext() if (!rowAvailable || !stmt) { - setError(T::MISUSE, tr("Result set expired or no row available.")); + setError(T::MISUSE, QObject::tr("Result set expired or no row available.")); return T::MISUSE; } diff --git a/SQLiteStudio3/coreSQLiteStudio/db/queryexecutor.cpp b/SQLiteStudio3/coreSQLiteStudio/db/queryexecutor.cpp index c840947..97b3f1d 100644 --- a/SQLiteStudio3/coreSQLiteStudio/db/queryexecutor.cpp +++ b/SQLiteStudio3/coreSQLiteStudio/db/queryexecutor.cpp @@ -39,7 +39,6 @@ QueryExecutor::QueryExecutor(Db* db, const QString& query, QObject *parent) : setDb(db); setAutoDelete(false); - connect(this, SIGNAL(executionFinished(SqlQueryPtr)), this, SLOT(cleanupAfterExecFinished(SqlQueryPtr))); connect(this, SIGNAL(executionFailed(int,QString)), this, SLOT(cleanupAfterExecFailed(int,QString))); connect(DBLIST, SIGNAL(dbAboutToBeUnloaded(Db*, DbPlugin*)), this, SLOT(cleanupBeforeDbDestroy(Db*, DbPlugin*))); } @@ -138,12 +137,6 @@ void QueryExecutor::stepFailed(QueryExecutorStep* currentStep) executeSimpleMethod(); } -void QueryExecutor::cleanupAfterExecFinished(SqlQueryPtr results) -{ - UNUSED(results); - cleanup(); -} - void QueryExecutor::cleanupAfterExecFailed(int code, QString errorMessage) { UNUSED(code); @@ -213,6 +206,7 @@ void QueryExecutor::execInternal() { resultsCountingAsyncId = 0; db->interrupt(); + releaseResultsAndCleanup(); } // Reset context @@ -242,13 +236,13 @@ void QueryExecutor::interrupt() db->asyncInterrupt(); } -void QueryExecutor::countResults() +bool QueryExecutor::countResults() { if (context->skipRowCounting) - return; + return false; if (context->countingQuery.isEmpty()) // simple method doesn't provide that - return; + return false; if (asyncMode) { @@ -267,8 +261,10 @@ void QueryExecutor::countResults() { notifyError(tr("An error occured while executing the count(*) query, thus data paging will be disabled. Error details from the database: %1") .arg(results->getErrorText())); + return false; } } + return true; } qint64 QueryExecutor::getLastExecutionTime() const @@ -416,7 +412,7 @@ void QueryExecutor::simpleExecutionFinished(SqlQueryPtr results) executionMutex.lock(); executionInProgress = false; executionMutex.unlock(); - error(results->getErrorCode(), results->getErrorText()); + handleErrorsFromSmartAndSimpleMethods(results); return; } @@ -552,6 +548,44 @@ void QueryExecutor::setNoMetaColumns(bool value) noMetaColumns = value; } +void QueryExecutor::handleErrorsFromSmartAndSimpleMethods(SqlQueryPtr results) +{ + QString simpleText = results->getErrorText(); + + // Smart text may contain messages from steps before the actual execution, but they will have negative error code. + // Positive error code means that the error came directly from SQLite. + QString smartText = context->errorCodeFromSmartExecution > 0 ? context->errorMessageFromSmartExecution : QString(); + + if (simpleText.contains("no such") && smartText.contains("no such")) + { + // This happens if user refers to invalid column in attached database. + // Smart execution will tell "no such column: xxx", while simple method will tell: + // "no such table: attach.table". In that case we're more interested in smart method message. + // This also applies to views. + error(context->errorCodeFromSmartExecution, smartText); + return; + } + + if (simpleText.contains("no such") && smartText.contains("ambiguous")) + { + // This happens when smart execution raised "amigous column name" or something like that, + // but simple method failed to work because of transparent database attaching. We prefer smart method error. + error(context->errorCodeFromSmartExecution, smartText); + return; + } + + // No special case, use simple method error + error(results->getErrorCode(), simpleText); +} + +void QueryExecutor::releaseResultsAndCleanup() +{ + // The results have to be releases, otherwise attached databases cannot be detached. + // Results handle cannot be kept elsewhere, otherwise detach will fail. + context->executionResults.clear(); + cleanup(); +} + SqlQueryPtr QueryExecutor::getResults() const { return context->executionResults; @@ -562,6 +596,11 @@ bool QueryExecutor::wasSchemaModified() const return context->schemaModified; } +bool QueryExecutor::wasDataModifyingQuery() const +{ + return context->dataModifyingQuery; +} + QList<DataType> QueryExecutor::resolveColumnTypes(Db* db, QList<QueryExecutor::ResultColumnPtr>& columns, bool noDbLocking) { QSet<Table> tables; diff --git a/SQLiteStudio3/coreSQLiteStudio/db/queryexecutor.h b/SQLiteStudio3/coreSQLiteStudio/db/queryexecutor.h index c4a3e4d..72c7fed 100644 --- a/SQLiteStudio3/coreSQLiteStudio/db/queryexecutor.h +++ b/SQLiteStudio3/coreSQLiteStudio/db/queryexecutor.h @@ -604,11 +604,36 @@ class API_EXPORT QueryExecutor : public QObject, public QRunnable bool schemaModified = false; /** + * @brief Tells if executed query was one of DELETE, UPDATE or INSERT. + */ + bool dataModifyingQuery = false; + + /** * @brief Forbids QueryExecutor to return meta columns. * * See QueryExecutor::noMetaColumns for details. */ bool noMetaColumns = false; + + /** + * @brief Contains error code from smart execution. + * + * This is always set by the smart execution method. It's useful if the smart execution + * failed and the simple execution method is being performed. In that case the query + * result will contain error code from simple execution, hiding the original error code + * from smart execution. + */ + int errorCodeFromSmartExecution = 0; + + /** + * @brief Contains error message from smart execution. + * + * This is always set by the smart execution method. It's useful if the smart execution + * failed and the simple execution method is being performed. In that case the query + * result will contain error message from simple execution, hiding the original error + * message from smart execution. + */ + QString errorMessageFromSmartExecution; }; /** @@ -654,6 +679,7 @@ class API_EXPORT QueryExecutor : public QObject, public QRunnable /** * @brief Executes counting query. + * @return true if counting query is executed (in async mode) or was executed correctly (in sync mode), false on error. * * Executes (asynchronously) counting query for currently defined query. After execution is done, the resultsCountingFinished() * signal is emitted. @@ -661,8 +687,10 @@ class API_EXPORT QueryExecutor : public QObject, public QRunnable * Counting query is made of original query wrapped with "SELECT count(*) FROM (original_query)". * * It is executed after the main query execution has finished. + * + * If query is being executed in async mode, the true result (sucess/fail) will be known from later, not from this method. */ - void countResults(); + bool countResults(); /** * @brief Gets time of how long it took to execute query. @@ -976,12 +1004,20 @@ class API_EXPORT QueryExecutor : public QObject, public QRunnable SqlQueryPtr getResults() const; bool wasSchemaModified() const; + bool wasDataModifyingQuery() const; static QList<DataType> resolveColumnTypes(Db* db, QList<ResultColumnPtr>& columns, bool noDbLocking = false); bool getNoMetaColumns() const; void setNoMetaColumns(bool value); + void handleErrorsFromSmartAndSimpleMethods(SqlQueryPtr results); + + /** + * @brief Clears results handle and detaches any attached databases. + */ + void releaseResultsAndCleanup(); + private: /** * @brief Executes query. @@ -1335,14 +1371,6 @@ class API_EXPORT QueryExecutor : public QObject, public QRunnable void stepFailed(QueryExecutorStep *currentStep); /** - * @brief Cleanup routines after successful query execution. - * @param results Query results. - * - * Releases resources that are no longer used. Currently simply calls cleanup(). - */ - void cleanupAfterExecFinished(SqlQueryPtr results); - - /** * @brief Cleanup routines after failed query execution. * @param code Error code. * @param errorMessage Error message. diff --git a/SQLiteStudio3/coreSQLiteStudio/db/queryexecutorsteps/queryexecutordetectschemaalter.cpp b/SQLiteStudio3/coreSQLiteStudio/db/queryexecutorsteps/queryexecutordetectschemaalter.cpp index c3c8a5c..02a73d2 100644 --- a/SQLiteStudio3/coreSQLiteStudio/db/queryexecutorsteps/queryexecutordetectschemaalter.cpp +++ b/SQLiteStudio3/coreSQLiteStudio/db/queryexecutorsteps/queryexecutordetectschemaalter.cpp @@ -18,6 +18,10 @@ bool QueryExecutorDetectSchemaAlter::exec() case SqliteQueryType::CreateVirtualTable: context->schemaModified = true; break; + case SqliteQueryType::Insert: + case SqliteQueryType::Delete: + case SqliteQueryType::Update: + context->dataModifyingQuery = true; default: break; } diff --git a/SQLiteStudio3/coreSQLiteStudio/db/queryexecutorsteps/queryexecutorexecute.cpp b/SQLiteStudio3/coreSQLiteStudio/db/queryexecutorsteps/queryexecutorexecute.cpp index 7e0abe5..f42f647 100644 --- a/SQLiteStudio3/coreSQLiteStudio/db/queryexecutorsteps/queryexecutorexecute.cpp +++ b/SQLiteStudio3/coreSQLiteStudio/db/queryexecutorsteps/queryexecutorexecute.cpp @@ -11,7 +11,7 @@ bool QueryExecutorExecute::exec() { - qDebug() << "q:" << context->processedQuery; +// qDebug() << "q:" << context->processedQuery; startTime = QDateTime::currentMSecsSinceEpoch(); return executeQueries(); @@ -32,6 +32,7 @@ bool QueryExecutorExecute::executeQueries() { QHash<QString, QVariant> bindParamsForQuery; SqlQueryPtr results; + context->rowsAffected = 0; Db::Flags flags; if (context->preloadResults) @@ -56,6 +57,8 @@ bool QueryExecutorExecute::executeQueries() handleFailResult(results); return false; } + + context->rowsAffected += results->rowsAffected(); } handleSuccessfulResult(results); return true; @@ -72,7 +75,6 @@ void QueryExecutorExecute::handleSuccessfulResult(SqlQueryPtr results) } context->executionTime = QDateTime::currentMSecsSinceEpoch() - startTime; - context->rowsAffected = results->rowsAffected(); // For PRAGMA and EXPLAIN we simply count results for rows returned SqliteQueryPtr lastQuery = context->parsedQueries.last(); @@ -92,6 +94,8 @@ void QueryExecutorExecute::handleFailResult(SqlQueryPtr results) { if (!results->isInterrupted()) { + context->errorCodeFromSmartExecution = results->getErrorCode(); + context->errorMessageFromSmartExecution = results->getErrorText(); qWarning() << "Could not execute query with smart method:" << queryExecutor->getOriginalQuery() << "\nError message:" << results->getErrorText() << "\nSkipping smart execution."; diff --git a/SQLiteStudio3/coreSQLiteStudio/db/sqlquery.h b/SQLiteStudio3/coreSQLiteStudio/db/sqlquery.h index a7610fa..4e0d9cf 100644 --- a/SQLiteStudio3/coreSQLiteStudio/db/sqlquery.h +++ b/SQLiteStudio3/coreSQLiteStudio/db/sqlquery.h @@ -133,7 +133,6 @@ class API_EXPORT SqlQuery * @brief Gets number of rows that were affected by the query. * @return Number of rows affected. * - * For SELECT statements this is number of returned rows. * For UPDATE this is number of rows updated. * For DELETE this is number of rows deleted. * FOR INSERT this is number of rows inserted (starting with SQLite 3.7.11 you can insert multiple rows with single INSERT statement). diff --git a/SQLiteStudio3/coreSQLiteStudio/dbversionconverter.cpp b/SQLiteStudio3/coreSQLiteStudio/dbversionconverter.cpp index bf13eac..d31d536 100644 --- a/SQLiteStudio3/coreSQLiteStudio/dbversionconverter.cpp +++ b/SQLiteStudio3/coreSQLiteStudio/dbversionconverter.cpp @@ -134,12 +134,12 @@ SqliteQueryPtr DbVersionConverter::convert3To2(SqliteQueryPtr query) switch (query->queryType) { case SqliteQueryType::AlterTable: - errors << QObject::tr("SQLite 2 does not support 'ALTER TABLE' statement."); + errors << QObject::tr("SQLite %1 does not support '%2' statement.").arg("2", "ALTER TABLE"); newQuery = SqliteEmptyQueryPtr::create(); storeErrorDiff(query.data()); break; case SqliteQueryType::Analyze: - errors << QObject::tr("SQLite 2 does not support 'ANAYLZE' statement."); + errors << QObject::tr("SQLite %1 does not support '%2' statement.").arg("2", "ANAYLZE"); newQuery = SqliteEmptyQueryPtr::create(); storeErrorDiff(query.data()); break; @@ -192,13 +192,14 @@ SqliteQueryPtr DbVersionConverter::convert3To2(SqliteQueryPtr query) newQuery = copyQuery<SqliteCreateVirtualTable>(query); if (!modifyVirtualTableForVesion2(newQuery, newQuery.dynamicCast<SqliteCreateVirtualTable>().data())) { - errors << QObject::tr("SQLite 2 does not support 'CREATE VIRTUAL TABLE' statement."); + errors << QObject::tr("SQLite %1 does not support '%2' statement.").arg("2", "CREATE VIRTUAL TABLE"); newQuery = SqliteEmptyQueryPtr::create(); storeErrorDiff(query.data()); } else { - errors << QObject::tr("SQLite 2 does not support 'CREATE VIRTUAL TABLE' statement. The regular table can be created instead if you proceed."); + errors << QObject::tr("SQLite %1 does not support '%2' statement, but the regular table can be created instead if you proceed.") + .arg("2", "CREATE VIRTUAL TABLE"); } break; case SqliteQueryType::Delete: @@ -236,12 +237,12 @@ SqliteQueryPtr DbVersionConverter::convert3To2(SqliteQueryPtr query) newQuery = copyQuery<SqlitePragma>(query); break; case SqliteQueryType::Reindex: - errors << QObject::tr("SQLite 2 does not support 'REINDEX' statement."); + errors << QObject::tr("SQLite %1 does not support '%2' statement.").arg("2", "REINDEX"); newQuery = SqliteEmptyQueryPtr::create(); storeErrorDiff(query.data()); break; case SqliteQueryType::Release: - errors << QObject::tr("SQLite 2 does not support 'RELEASE' statement."); + errors << QObject::tr("SQLite %1 does not support '%2' statement.").arg("2", "RELEASE"); newQuery = SqliteEmptyQueryPtr::create(); storeErrorDiff(query.data()); break; @@ -249,7 +250,7 @@ SqliteQueryPtr DbVersionConverter::convert3To2(SqliteQueryPtr query) newQuery = copyQuery<SqliteRollback>(query); break; case SqliteQueryType::Savepoint: - errors << QObject::tr("SQLite 2 does not support 'SAVEPOINT' statement."); + errors << QObject::tr("SQLite %1 does not support '%2' statement.").arg("2", "SAVEPOINT"); newQuery = SqliteEmptyQueryPtr::create(); storeErrorDiff(query.data()); break; @@ -327,7 +328,7 @@ SqliteQueryPtr DbVersionConverter::convert2To3(SqliteQueryPtr query) newQuery = copyQuery<SqliteCommitTrans>(query); break; case SqliteQueryType::Copy: - errors << QObject::tr("SQLite 3 does not support 'COPY' statement."); + errors << QObject::tr("SQLite %1 does not support '%2' statement.").arg("3", "COPY"); newQuery = SqliteEmptyQueryPtr::create(); storeErrorDiff(query.data()); break; @@ -431,7 +432,7 @@ bool DbVersionConverter::modifySelectForVersion2(SqliteSelect* select) { if (select->with) { - errors << QObject::tr("SQLite 2 does not support the 'WITH' clause. Cannot convert '%1' statement with that clause.").arg("SELECT"); + errors << QObject::tr("SQLite %1 does not support the '%2' clause. Cannot convert '%3' statement with that clause.").arg("2", "WITH", "SELECT"); return false; } @@ -457,7 +458,7 @@ bool DbVersionConverter::modifyDeleteForVersion2(SqliteDelete* del) { if (del->with) { - errors << QObject::tr("SQLite 2 does not support the 'WITH' clause. Cannot convert '%1' statement with that clause.").arg("DELETE"); + errors << QObject::tr("SQLite %1 does not support the '%2' clause. Cannot convert '%3' statement with that clause.").arg("2", "WITH", "DELETE"); return false; } @@ -478,13 +479,13 @@ bool DbVersionConverter::modifyInsertForVersion2(SqliteInsert* insert) { if (insert->with) { - errors << QObject::tr("SQLite 2 does not support the 'WITH' clause. Cannot convert '%1' statement with that clause.").arg("INSERT"); + errors << QObject::tr("SQLite %1 does not support the '%2' clause. Cannot convert '%3' statement with that clause.").arg("2", "WITH", "INSERT"); return false; } if (insert->defaultValuesKw) { - errors << QObject::tr("SQLite 2 does not support the 'DEFAULT VALUES' clause in the 'INSERT' clause."); + errors << QObject::tr("SQLite %1 does not support the '%2' clause in the '%3' statement.").arg("2", "DEFAULT VALUES", "INSERT"); return false; } @@ -511,7 +512,7 @@ bool DbVersionConverter::modifyUpdateForVersion2(SqliteUpdate* update) { if (update->with) { - errors << QObject::tr("SQLite 2 does not support the 'WITH' clause. Cannot convert '%1' statement with that clause.").arg("UPDATE"); + errors << QObject::tr("SQLite %1 does not support the '%2' clause. Cannot convert '%3' statement with that clause.").arg("2", "WITH", "UPDATE"); return false; } @@ -752,7 +753,7 @@ bool DbVersionConverter::modifySingleExprForVersion2(SqliteExpr* expr) case SqliteExpr::Mode::RAISE: break; case SqliteExpr::Mode::CTIME: - errors << QObject::tr("SQLite 2 does not support current date or time clauses in expressions."); + errors << QObject::tr("SQLite %1 does not support current date or time clauses in expressions.").arg("2"); return false; case SqliteExpr::Mode::IN: case SqliteExpr::Mode::SUB_SELECT: @@ -763,10 +764,10 @@ bool DbVersionConverter::modifySingleExprForVersion2(SqliteExpr* expr) break; } case SqliteExpr::Mode::CAST: - errors << QObject::tr("SQLite 2 does not support 'CAST' clause in expressions."); + errors << QObject::tr("SQLite %1 does not support '%2' clause in expressions.").arg("2", "CAST"); return false; case SqliteExpr::Mode::EXISTS: - errors << QObject::tr("SQLite 2 does not support 'EXISTS' clause in expressions."); + errors << QObject::tr("SQLite %1 does not support '%2' clause in expressions.").arg("2", "EXISTS"); return false; case SqliteExpr::Mode::COLLATE: { @@ -777,7 +778,7 @@ bool DbVersionConverter::modifySingleExprForVersion2(SqliteExpr* expr) } else { - errors << QObject::tr("SQLite 2 does not support 'COLLATE' clause in expressions."); + errors << QObject::tr("SQLite %1 does not support '%2' clause in expressions.").arg("2", "COLLATE"); return false; } } diff --git a/SQLiteStudio3/coreSQLiteStudio/exportworker.cpp b/SQLiteStudio3/coreSQLiteStudio/exportworker.cpp index 9d227de..b14bbf1 100644 --- a/SQLiteStudio3/coreSQLiteStudio/exportworker.cpp +++ b/SQLiteStudio3/coreSQLiteStudio/exportworker.cpp @@ -172,7 +172,7 @@ QHash<ExportManager::ExportProviderFlag, QVariant> ExportWorker::getProviderData } else if (results->isError()) { - notifyError(tr("Error while counting data column width to export from query results: %2").arg(results->getErrorText())); + notifyError(tr("Error while counting data column width to export from query results: %1").arg(results->getErrorText())); } else { @@ -378,14 +378,21 @@ bool ExportWorker::exportTableInternal(const QString& database, const QString& t SqliteCreateTablePtr createTable = parsedDdl.dynamicCast<SqliteCreateTable>(); SqliteCreateVirtualTablePtr createVirtualTable = parsedDdl.dynamicCast<SqliteCreateVirtualTable>(); + QStringList colNames; + if (results) + colNames = results->getColumnNames(); + if (createTable) { - if (!plugin->exportTable(database, table, results->getColumnNames(), ddl, createTable, providerData)) + if (!results) + colNames = createTable->getColumnNames(); + + if (!plugin->exportTable(database, table, colNames, ddl, createTable, providerData)) return false; } else { - if (!plugin->exportVirtualTable(database, table, results->getColumnNames(), ddl, createVirtualTable, providerData)) + if (!plugin->exportVirtualTable(database, table, colNames, ddl, createVirtualTable, providerData)) return false; } @@ -393,14 +400,17 @@ bool ExportWorker::exportTableInternal(const QString& database, const QString& t return false; SqlResultsRowPtr row; - while (results->hasNext()) + if (results) { - row = results->next(); - if (!plugin->exportTableRow(row)) - return false; + while (results->hasNext()) + { + row = results->next(); + if (!plugin->exportTableRow(row)) + return false; - if (isInterrupted()) - return false; + if (isInterrupted()) + return false; + } } if (!plugin->afterExportTable()) @@ -467,7 +477,6 @@ void ExportWorker::queryTableDataToExport(Db* db, const QString& table, SqlQuery if (config->exportData) { QString wrappedTable = wrapObjIfNeeded(table, db->getDialect()); - dataPtr = db->exec(sql.arg(wrappedTable)); if (dataPtr->isError()) *errorMessage = tr("Error while reading data to export from table %1: %2").arg(table, dataPtr->getErrorText()); diff --git a/SQLiteStudio3/coreSQLiteStudio/parser/ast/sqliteexpr.cpp b/SQLiteStudio3/coreSQLiteStudio/parser/ast/sqliteexpr.cpp index 969f029..1429cef 100644 --- a/SQLiteStudio3/coreSQLiteStudio/parser/ast/sqliteexpr.cpp +++ b/SQLiteStudio3/coreSQLiteStudio/parser/ast/sqliteexpr.cpp @@ -457,7 +457,11 @@ TokenList SqliteExpr::rebuildTokensFromContents() builder.withStatement(expr1).withSpace().withOperator(binaryOp).withSpace().withStatement(expr2); break; case SqliteExpr::Mode::FUNCTION: - builder.withOther(function).withParLeft().withStatementList(exprList).withParRight(); + builder.withOther(function).withParLeft(); + if (distinctKw) + builder.withKeyword("DISTINCT"); + + builder.withStatementList(exprList).withParRight(); break; case SqliteExpr::Mode::SUB_EXPR: builder.withParLeft().withStatement(expr1).withParRight(); diff --git a/SQLiteStudio3/coreSQLiteStudio/parser/parser_helper_stubs.cpp b/SQLiteStudio3/coreSQLiteStudio/parser/parser_helper_stubs.cpp index 039c9a5..9299c52 100644 --- a/SQLiteStudio3/coreSQLiteStudio/parser/parser_helper_stubs.cpp +++ b/SQLiteStudio3/coreSQLiteStudio/parser/parser_helper_stubs.cpp @@ -21,6 +21,7 @@ ParserIndexedBy::ParserIndexedBy(bool notIndexed) ParserStubInsertOrReplace::ParserStubInsertOrReplace(bool replace) { this->replace = replace; + this->orConflict = SqliteConflictAlgo::null; } ParserStubInsertOrReplace::ParserStubInsertOrReplace(bool replace, SqliteConflictAlgo orConflict) diff --git a/SQLiteStudio3/coreSQLiteStudio/parser/parsercontext.cpp b/SQLiteStudio3/coreSQLiteStudio/parser/parsercontext.cpp index 7394e75..e9444e5 100644 --- a/SQLiteStudio3/coreSQLiteStudio/parser/parsercontext.cpp +++ b/SQLiteStudio3/coreSQLiteStudio/parser/parsercontext.cpp @@ -27,7 +27,12 @@ void ParserContext::error(TokenPtr token, const QString &text) void ParserContext::error(Token* token, const QString& text) { - error(getTokenPtr(token), text); + if (token->type != Token::INVALID) + error(getTokenPtr(token), text); + else if (managedTokens.size() > 0) + error(managedTokens.last(), text); + else + error(text); } void ParserContext::error(const QString &text) diff --git a/SQLiteStudio3/coreSQLiteStudio/parser/sqlite2_parse.cpp b/SQLiteStudio3/coreSQLiteStudio/parser/sqlite2_parse.cpp index fa61c21..656444a 100644 --- a/SQLiteStudio3/coreSQLiteStudio/parser/sqlite2_parse.cpp +++ b/SQLiteStudio3/coreSQLiteStudio/parser/sqlite2_parse.cpp @@ -165,7 +165,7 @@ typedef union { #define sqlite2_parseARG_FETCH ParserContext* parserContext = yypParser->parserContext #define sqlite2_parseARG_STORE yypParser->parserContext = parserContext #define YYNSTATE 584 -#define YYNRULE 352 +#define YYNRULE 353 #define YYFALLBACK 1 #define YY_NO_ACTION (YYNSTATE+YYNRULE+2) #define YY_ACCEPT_ACTION (YYNSTATE+YYNRULE+1) @@ -241,16 +241,16 @@ static const YYMINORTYPE yyzerominor = { 0 }; static const YYACTIONTYPE yy_action[] = { /* 0 */ 338, 191, 186, 242, 476, 511, 576, 193, 332, 16, /* 10 */ 511, 384, 189, 322, 239, 519, 518, 570, 337, 450, - /* 20 */ 15, 851, 125, 58, 575, 179, 851, 574, 63, 143, + /* 20 */ 15, 852, 125, 58, 575, 179, 852, 574, 63, 143, /* 30 */ 401, 581, 328, 26, 84, 569, 114, 322, 573, 519, - /* 40 */ 518, 851, 851, 35, 851, 851, 851, 851, 851, 851, - /* 50 */ 851, 851, 851, 851, 851, 851, 851, 851, 851, 32, - /* 60 */ 33, 851, 851, 851, 851, 320, 379, 34, 240, 238, + /* 40 */ 518, 852, 852, 35, 852, 852, 852, 852, 852, 852, + /* 50 */ 852, 852, 852, 852, 852, 852, 852, 852, 852, 32, + /* 60 */ 33, 852, 852, 852, 852, 320, 379, 34, 240, 238, /* 70 */ 121, 556, 291, 251, 57, 7, 217, 577, 265, 264, /* 80 */ 523, 179, 555, 336, 335, 338, 569, 549, 548, 550, /* 90 */ 271, 569, 10, 724, 199, 297, 203, 489, 459, 332, /* 100 */ 568, 567, 451, 253, 158, 523, 449, 444, 443, 337, - /* 110 */ 187, 870, 266, 187, 580, 517, 168, 328, 505, 343, + /* 110 */ 187, 871, 266, 187, 580, 517, 168, 328, 505, 343, /* 120 */ 143, 235, 490, 108, 101, 489, 523, 164, 35, 531, /* 130 */ 187, 13, 523, 252, 234, 547, 236, 119, 340, 232, /* 140 */ 339, 120, 216, 155, 32, 33, 481, 547, 322, 215, @@ -258,23 +258,23 @@ static const YYACTIONTYPE yy_action[] = { /* 160 */ 7, 714, 400, 321, 251, 523, 714, 563, 336, 335, /* 170 */ 500, 553, 549, 548, 550, 188, 465, 500, 401, 466, /* 180 */ 366, 365, 552, 364, 293, 435, 39, 39, 39, 38, - /* 190 */ 523, 562, 60, 255, 714, 569, 714, 714, 852, 570, - /* 200 */ 271, 714, 502, 852, 500, 714, 570, 714, 714, 714, + /* 190 */ 523, 562, 60, 255, 714, 569, 714, 714, 853, 570, + /* 200 */ 271, 714, 502, 853, 500, 714, 570, 714, 714, 714, /* 210 */ 714, 523, 569, 178, 531, 422, 13, 523, 44, 45, - /* 220 */ 330, 42, 42, 530, 530, 223, 852, 852, 43, 43, + /* 220 */ 330, 42, 42, 530, 530, 223, 853, 853, 43, 43, /* 230 */ 43, 43, 41, 41, 41, 41, 40, 40, 39, 39, /* 240 */ 39, 38, 199, 297, 203, 55, 236, 92, 340, 232, /* 250 */ 339, 120, 216, 500, 106, 570, 268, 19, 187, 215, /* 260 */ 500, 105, 553, 41, 41, 41, 41, 40, 40, 39, /* 270 */ 39, 39, 38, 552, 40, 40, 39, 39, 39, 38, - /* 280 */ 852, 3, 568, 567, 187, 852, 512, 500, 219, 568, + /* 280 */ 853, 3, 568, 567, 187, 853, 512, 500, 219, 568, /* 290 */ 567, 17, 496, 156, 322, 345, 519, 518, 569, 292, - /* 300 */ 44, 45, 330, 42, 42, 530, 530, 223, 852, 852, + /* 300 */ 44, 45, 330, 42, 42, 530, 530, 223, 853, 853, /* 310 */ 43, 43, 43, 43, 41, 41, 41, 41, 40, 40, - /* 320 */ 39, 39, 39, 38, 547, 533, 852, 100, 308, 306, - /* 330 */ 305, 852, 448, 447, 418, 418, 316, 245, 568, 567, - /* 340 */ 304, 937, 122, 344, 1, 582, 44, 45, 330, 42, - /* 350 */ 42, 530, 530, 223, 852, 852, 43, 43, 43, 43, + /* 320 */ 39, 39, 39, 38, 547, 533, 853, 100, 308, 306, + /* 330 */ 305, 853, 448, 447, 418, 418, 316, 245, 568, 567, + /* 340 */ 304, 938, 122, 344, 1, 582, 44, 45, 330, 42, + /* 350 */ 42, 530, 530, 223, 853, 853, 43, 43, 43, 43, /* 360 */ 41, 41, 41, 41, 40, 40, 39, 39, 39, 38, /* 370 */ 338, 442, 44, 45, 330, 42, 42, 530, 530, 223, /* 380 */ 524, 569, 43, 43, 43, 43, 41, 41, 41, 41, @@ -287,14 +287,14 @@ static const YYACTIONTYPE yy_action[] = { /* 450 */ 523, 524, 569, 336, 335, 285, 781, 549, 548, 550, /* 460 */ 43, 43, 43, 43, 41, 41, 41, 41, 40, 40, /* 470 */ 39, 39, 39, 38, 332, 523, 332, 425, 470, 774, - /* 480 */ 560, 774, 774, 850, 337, 426, 337, 455, 850, 613, + /* 480 */ 560, 774, 774, 851, 337, 426, 337, 455, 851, 613, /* 490 */ 774, 181, 774, 774, 774, 143, 523, 143, 30, 531, - /* 500 */ 614, 13, 523, 850, 850, 850, 850, 850, 850, 850, - /* 510 */ 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, - /* 520 */ 850, 850, 850, 850, 850, 850, 850, 852, 500, 460, - /* 530 */ 357, 320, 852, 318, 75, 570, 401, 570, 311, 251, + /* 500 */ 614, 13, 523, 851, 851, 851, 851, 851, 851, 851, + /* 510 */ 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + /* 520 */ 851, 851, 851, 851, 851, 851, 851, 853, 500, 460, + /* 530 */ 357, 320, 853, 318, 75, 570, 401, 570, 311, 251, /* 540 */ 569, 251, 446, 445, 570, 358, 359, 44, 45, 330, - /* 550 */ 42, 42, 530, 530, 223, 852, 852, 43, 43, 43, + /* 550 */ 42, 42, 530, 530, 223, 853, 853, 43, 43, 43, /* 560 */ 43, 41, 41, 41, 41, 40, 40, 39, 39, 39, /* 570 */ 38, 338, 44, 45, 330, 42, 42, 530, 530, 223, /* 580 */ 615, 570, 43, 43, 43, 43, 41, 41, 41, 41, @@ -305,14 +305,14 @@ static const YYACTIONTYPE yy_action[] = { /* 630 */ 32, 33, 337, 356, 482, 355, 569, 85, 34, 759, /* 640 */ 532, 111, 70, 78, 487, 483, 7, 759, 90, 494, /* 650 */ 508, 523, 493, 160, 336, 335, 782, 528, 549, 548, - /* 660 */ 550, 532, 440, 434, 568, 567, 118, 54, 332, 919, + /* 660 */ 550, 532, 440, 434, 568, 567, 118, 54, 332, 920, /* 670 */ 214, 100, 308, 306, 305, 75, 523, 333, 337, 571, /* 680 */ 759, 529, 759, 759, 304, 48, 177, 522, 31, 143, /* 690 */ 29, 759, 568, 567, 759, 759, 159, 523, 568, 567, /* 700 */ 531, 464, 13, 523, 44, 45, 330, 42, 42, 530, /* 710 */ 530, 223, 568, 567, 43, 43, 43, 43, 41, 41, /* 720 */ 41, 41, 40, 40, 39, 39, 39, 38, 463, 570, - /* 730 */ 498, 919, 570, 323, 514, 570, 222, 44, 45, 330, + /* 730 */ 498, 920, 570, 323, 514, 570, 222, 44, 45, 330, /* 740 */ 42, 42, 530, 530, 223, 393, 392, 43, 43, 43, /* 750 */ 43, 41, 41, 41, 41, 40, 40, 39, 39, 39, /* 760 */ 38, 44, 45, 330, 42, 42, 530, 530, 223, 540, @@ -324,7 +324,7 @@ static const YYACTIONTYPE yy_action[] = { /* 820 */ 110, 570, 218, 44, 45, 330, 42, 42, 530, 530, /* 830 */ 223, 27, 468, 43, 43, 43, 43, 41, 41, 41, /* 840 */ 41, 40, 40, 39, 39, 39, 38, 486, 547, 44, - /* 850 */ 45, 330, 42, 42, 530, 530, 223, 859, 212, 43, + /* 850 */ 45, 330, 42, 42, 530, 530, 223, 860, 212, 43, /* 860 */ 43, 43, 43, 41, 41, 41, 41, 40, 40, 39, /* 870 */ 39, 39, 38, 44, 47, 330, 42, 42, 530, 530, /* 880 */ 223, 535, 284, 43, 43, 43, 43, 41, 41, 41, @@ -339,7 +339,7 @@ static const YYACTIONTYPE yy_action[] = { /* 970 */ 520, 569, 395, 547, 569, 569, 23, 328, 213, 254, /* 980 */ 358, 275, 547, 75, 182, 32, 33, 310, 35, 569, /* 990 */ 361, 66, 164, 34, 160, 396, 398, 317, 397, 293, - /* 1000 */ 570, 7, 862, 516, 32, 33, 523, 570, 538, 336, + /* 1000 */ 570, 7, 863, 516, 32, 33, 523, 570, 538, 336, /* 1010 */ 335, 522, 34, 549, 548, 550, 25, 4, 289, 338, /* 1020 */ 7, 471, 395, 547, 12, 523, 568, 567, 336, 335, /* 1030 */ 302, 523, 549, 548, 550, 75, 570, 404, 338, 276, @@ -356,7 +356,7 @@ static const YYACTIONTYPE yy_action[] = { /* 1140 */ 312, 391, 202, 523, 296, 523, 568, 567, 531, 198, /* 1150 */ 13, 523, 569, 413, 345, 328, 568, 567, 532, 569, /* 1160 */ 474, 570, 307, 570, 523, 495, 35, 531, 53, 13, - /* 1170 */ 523, 496, 860, 456, 473, 568, 567, 570, 413, 532, + /* 1170 */ 523, 496, 861, 456, 473, 568, 567, 570, 413, 532, /* 1180 */ 570, 485, 32, 33, 407, 439, 10, 568, 567, 500, /* 1190 */ 34, 489, 730, 570, 568, 567, 431, 403, 7, 52, /* 1200 */ 568, 567, 570, 523, 582, 234, 336, 335, 338, 407, @@ -367,7 +367,7 @@ static const YYACTIONTYPE yy_action[] = { /* 1250 */ 99, 35, 531, 124, 13, 523, 492, 368, 497, 148, /* 1260 */ 568, 567, 570, 568, 567, 82, 376, 32, 33, 350, /* 1270 */ 2, 570, 568, 567, 570, 34, 568, 567, 570, 73, - /* 1280 */ 179, 259, 570, 7, 862, 568, 567, 417, 523, 338, + /* 1280 */ 179, 259, 570, 7, 863, 568, 567, 417, 523, 338, /* 1290 */ 569, 336, 335, 22, 491, 549, 548, 550, 416, 69, /* 1300 */ 568, 567, 371, 522, 568, 567, 570, 415, 405, 568, /* 1310 */ 567, 261, 21, 523, 568, 567, 568, 567, 196, 368, @@ -411,8 +411,8 @@ static const YYACTIONTYPE yy_action[] = { /* 1690 */ 283, 402, 382, 117, 89, 87, 86, 116, 175, 280, /* 1700 */ 347, 349, 173, 233, 113, 126, 230, 509, 541, 470, /* 1710 */ 506, 537, 458, 282, 154, 410, 273, 190, 348, 438, - /* 1720 */ 467, 462, 329, 461, 578, 231, 62, 938, 37, 412, - /* 1730 */ 165, 433, 938, 938, 938, 327, 299, + /* 1720 */ 467, 462, 329, 461, 578, 231, 62, 939, 37, 412, + /* 1730 */ 165, 433, 939, 939, 939, 327, 299, }; static const YYCODETYPE yy_lookahead[] = { /* 0 */ 4, 8, 195, 10, 80, 25, 5, 14, 156, 202, @@ -664,61 +664,61 @@ static const short yy_reduce_ofst[] = { /* 250 */ 1242, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 589, 936, 936, 862, 903, 851, 851, 851, 936, 936, - /* 10 */ 730, 936, 851, 851, 851, 936, 851, 851, 851, 851, - /* 20 */ 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, - /* 30 */ 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, - /* 40 */ 851, 851, 851, 851, 851, 851, 851, 841, 724, 608, - /* 50 */ 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, - /* 60 */ 616, 720, 730, 936, 936, 936, 936, 790, 777, 768, - /* 70 */ 936, 800, 800, 783, 679, 936, 800, 756, 752, 936, - /* 80 */ 839, 936, 936, 731, 936, 839, 936, 936, 936, 936, - /* 90 */ 936, 791, 784, 778, 769, 936, 936, 936, 936, 936, - /* 100 */ 936, 936, 936, 936, 720, 720, 936, 720, 936, 936, - /* 110 */ 936, 840, 594, 936, 882, 936, 936, 936, 936, 936, - /* 120 */ 936, 605, 589, 936, 936, 936, 710, 736, 773, 761, - /* 130 */ 863, 856, 857, 855, 852, 852, 852, 852, 852, 852, - /* 140 */ 852, 852, 852, 852, 823, 816, 827, 815, 831, 826, - /* 150 */ 818, 817, 819, 936, 936, 936, 936, 723, 936, 936, - /* 160 */ 936, 820, 936, 789, 698, 936, 910, 693, 601, 618, - /* 170 */ 936, 936, 936, 936, 936, 936, 936, 772, 670, 756, - /* 180 */ 645, 738, 756, 858, 936, 936, 721, 708, 756, 934, - /* 190 */ 931, 934, 739, 683, 739, 739, 739, 681, 739, 683, - /* 200 */ 796, 739, 739, 683, 772, 739, 918, 915, 739, 739, - /* 210 */ 871, 681, 681, 681, 681, 662, 936, 871, 681, 739, - /* 220 */ 936, 739, 936, 852, 821, 752, 762, 748, 760, 757, - /* 230 */ 772, 936, 681, 681, 662, 681, 681, 665, 593, 593, + /* 0 */ 589, 937, 937, 863, 904, 852, 852, 852, 937, 937, + /* 10 */ 730, 937, 852, 852, 852, 937, 852, 852, 852, 852, + /* 20 */ 852, 852, 852, 852, 852, 852, 852, 852, 852, 852, + /* 30 */ 852, 852, 852, 852, 852, 852, 852, 852, 852, 852, + /* 40 */ 852, 852, 852, 852, 852, 852, 852, 841, 724, 608, + /* 50 */ 937, 937, 937, 937, 937, 937, 937, 937, 937, 937, + /* 60 */ 616, 720, 730, 937, 937, 937, 937, 790, 777, 768, + /* 70 */ 937, 800, 800, 783, 679, 937, 800, 756, 752, 937, + /* 80 */ 839, 937, 937, 731, 937, 839, 937, 937, 937, 937, + /* 90 */ 937, 791, 784, 778, 769, 937, 937, 937, 937, 937, + /* 100 */ 937, 937, 937, 937, 720, 720, 937, 720, 937, 937, + /* 110 */ 937, 840, 594, 937, 883, 937, 937, 937, 937, 937, + /* 120 */ 937, 605, 589, 937, 937, 937, 710, 736, 773, 761, + /* 130 */ 864, 857, 858, 856, 853, 853, 853, 853, 853, 844, + /* 140 */ 853, 853, 853, 853, 823, 816, 827, 815, 831, 826, + /* 150 */ 818, 817, 819, 937, 937, 937, 937, 723, 937, 937, + /* 160 */ 937, 820, 937, 789, 698, 937, 911, 693, 601, 618, + /* 170 */ 937, 937, 937, 937, 937, 937, 937, 772, 670, 756, + /* 180 */ 645, 738, 756, 859, 937, 937, 721, 708, 756, 935, + /* 190 */ 932, 935, 739, 683, 739, 739, 739, 681, 739, 683, + /* 200 */ 796, 739, 739, 683, 772, 739, 919, 916, 739, 739, + /* 210 */ 872, 681, 681, 681, 681, 662, 937, 872, 681, 739, + /* 220 */ 937, 739, 937, 853, 821, 752, 762, 748, 760, 757, + /* 230 */ 772, 937, 681, 681, 662, 681, 681, 665, 593, 593, /* 240 */ 593, 681, 593, 649, 649, 726, 830, 829, 828, 822, - /* 250 */ 629, 864, 936, 936, 936, 936, 936, 936, 936, 936, - /* 260 */ 936, 936, 936, 936, 936, 936, 936, 936, 936, 763, - /* 270 */ 936, 936, 936, 936, 936, 936, 936, 936, 936, 881, - /* 280 */ 936, 936, 936, 936, 936, 936, 914, 913, 936, 936, - /* 290 */ 936, 936, 936, 936, 936, 936, 936, 936, 902, 936, - /* 300 */ 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, - /* 310 */ 936, 936, 936, 936, 936, 936, 936, 936, 758, 936, - /* 320 */ 861, 843, 701, 850, 936, 936, 936, 936, 936, 842, - /* 330 */ 853, 810, 936, 749, 936, 809, 806, 808, 611, 936, - /* 340 */ 936, 936, 936, 936, 586, 590, 935, 933, 932, 930, - /* 350 */ 890, 889, 888, 886, 895, 894, 893, 892, 891, 887, - /* 360 */ 885, 884, 883, 880, 787, 775, 766, 697, 929, 927, - /* 370 */ 928, 879, 877, 878, 696, 695, 692, 691, 690, 869, - /* 380 */ 868, 866, 865, 867, 604, 906, 909, 908, 907, 912, - /* 390 */ 911, 904, 917, 916, 921, 925, 924, 923, 922, 920, - /* 400 */ 901, 795, 794, 792, 797, 788, 793, 780, 786, 785, - /* 410 */ 776, 779, 684, 771, 767, 770, 905, 694, 603, 741, + /* 250 */ 629, 865, 937, 937, 937, 937, 937, 937, 937, 937, + /* 260 */ 937, 937, 937, 937, 937, 937, 937, 937, 937, 763, + /* 270 */ 937, 937, 937, 937, 937, 937, 937, 937, 937, 882, + /* 280 */ 937, 937, 937, 937, 937, 937, 915, 914, 937, 937, + /* 290 */ 937, 937, 937, 937, 937, 937, 937, 937, 903, 937, + /* 300 */ 937, 937, 937, 937, 937, 937, 937, 937, 937, 937, + /* 310 */ 937, 937, 937, 937, 937, 937, 937, 937, 758, 937, + /* 320 */ 862, 843, 701, 851, 937, 937, 937, 937, 937, 842, + /* 330 */ 854, 810, 937, 749, 937, 809, 806, 808, 611, 937, + /* 340 */ 937, 937, 937, 937, 586, 590, 936, 934, 933, 931, + /* 350 */ 891, 890, 889, 887, 896, 895, 894, 893, 892, 888, + /* 360 */ 886, 885, 884, 881, 787, 775, 766, 697, 930, 928, + /* 370 */ 929, 880, 878, 879, 696, 695, 692, 691, 690, 870, + /* 380 */ 869, 867, 866, 868, 604, 907, 910, 909, 908, 913, + /* 390 */ 912, 905, 918, 917, 922, 926, 925, 924, 923, 921, + /* 400 */ 902, 795, 794, 792, 797, 788, 793, 780, 786, 785, + /* 410 */ 776, 779, 684, 771, 767, 770, 906, 694, 603, 741, /* 420 */ 602, 607, 668, 669, 677, 680, 675, 678, 674, 673, /* 430 */ 672, 676, 671, 667, 610, 609, 623, 621, 622, 620, /* 440 */ 619, 617, 639, 638, 635, 637, 634, 636, 633, 632, - /* 450 */ 631, 630, 628, 661, 647, 646, 874, 876, 875, 873, - /* 460 */ 872, 654, 653, 659, 658, 657, 656, 652, 655, 651, + /* 450 */ 631, 630, 628, 661, 647, 646, 875, 877, 876, 874, + /* 460 */ 873, 654, 653, 659, 658, 657, 656, 652, 655, 651, /* 470 */ 650, 648, 644, 814, 813, 807, 835, 707, 706, 715, /* 480 */ 713, 712, 711, 747, 746, 745, 744, 743, 742, 735, /* 490 */ 733, 729, 728, 734, 732, 727, 719, 717, 718, 716, /* 500 */ 612, 802, 799, 801, 798, 737, 725, 722, 709, 751, - /* 510 */ 753, 854, 844, 834, 845, 740, 832, 833, 704, 703, - /* 520 */ 702, 853, 850, 846, 926, 838, 849, 837, 836, 825, - /* 530 */ 824, 812, 847, 848, 811, 750, 765, 898, 897, 900, - /* 540 */ 899, 896, 764, 625, 624, 705, 700, 699, 805, 804, + /* 510 */ 753, 855, 845, 834, 846, 740, 832, 833, 704, 703, + /* 520 */ 702, 854, 851, 847, 927, 838, 850, 837, 836, 825, + /* 530 */ 824, 812, 848, 849, 811, 750, 765, 899, 898, 901, + /* 540 */ 900, 897, 764, 625, 624, 705, 700, 699, 805, 804, /* 550 */ 803, 643, 755, 754, 642, 664, 663, 660, 641, 640, /* 560 */ 627, 626, 606, 600, 599, 598, 597, 615, 614, 613, /* 570 */ 611, 596, 595, 689, 688, 687, 686, 685, 682, 592, @@ -1258,98 +1258,99 @@ static const char *const yyRuleName[] = { /* 257 */ "exprx ::= expr not_opt BETWEEN expr AND", /* 258 */ "exprx ::= CASE case_operand case_exprlist case_else", /* 259 */ "exprx ::= expr not_opt IN LP exprlist", - /* 260 */ "exprx ::= expr not_opt IN ID_DB", - /* 261 */ "exprx ::= expr not_opt IN nm DOT ID_TAB", - /* 262 */ "exprx ::= ID_DB|ID_TAB|ID_COL|ID_FN", - /* 263 */ "exprx ::= nm DOT ID_TAB|ID_COL", - /* 264 */ "exprx ::= nm DOT nm DOT ID_COL", - /* 265 */ "exprx ::= RAISE LP raisetype COMMA ID_ERR_MSG RP", - /* 266 */ "expr ::= exprx", - /* 267 */ "expr ::=", - /* 268 */ "not_opt ::=", - /* 269 */ "not_opt ::= NOT", - /* 270 */ "likeop ::= LIKE|GLOB", - /* 271 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr", - /* 272 */ "case_exprlist ::= WHEN expr THEN expr", - /* 273 */ "case_else ::= ELSE expr", - /* 274 */ "case_else ::=", - /* 275 */ "case_operand ::= exprx", - /* 276 */ "case_operand ::=", - /* 277 */ "exprlist ::= nexprlist", - /* 278 */ "exprlist ::=", - /* 279 */ "nexprlist ::= nexprlist COMMA expr", - /* 280 */ "nexprlist ::= exprx", - /* 281 */ "cmd ::= CREATE uniqueflag INDEX nm ON nm dbnm LP idxlist RP onconf", - /* 282 */ "cmd ::= CREATE uniqueflag INDEX nm dbnm ON ID_TAB", - /* 283 */ "cmd ::= CREATE uniqueflag INDEX nm DOT ID_IDX_NEW", - /* 284 */ "cmd ::= CREATE uniqueflag INDEX ID_DB|ID_IDX_NEW", - /* 285 */ "uniqueflag ::= UNIQUE", - /* 286 */ "uniqueflag ::=", - /* 287 */ "idxlist_opt ::=", - /* 288 */ "idxlist_opt ::= LP idxlist RP", - /* 289 */ "idxlist ::= idxlist COMMA idxlist_single", - /* 290 */ "idxlist ::= idxlist_single", - /* 291 */ "idxlist_single ::= nm sortorder", - /* 292 */ "idxlist_single ::= ID_COL", - /* 293 */ "cmd ::= DROP INDEX fullname", - /* 294 */ "cmd ::= DROP INDEX nm DOT ID_IDX", - /* 295 */ "cmd ::= DROP INDEX ID_DB|ID_IDX", - /* 296 */ "cmd ::= COPY orconf nm dbnm FROM nm USING DELIMITERS STRING", - /* 297 */ "cmd ::= COPY orconf nm dbnm FROM nm", - /* 298 */ "cmd ::= VACUUM", - /* 299 */ "cmd ::= VACUUM nm", - /* 300 */ "cmd ::= PRAGMA ids", - /* 301 */ "cmd ::= PRAGMA nm EQ nmnum", - /* 302 */ "cmd ::= PRAGMA nm LP nmnum RP", - /* 303 */ "cmd ::= PRAGMA nm EQ minus_num", - /* 304 */ "cmd ::= PRAGMA nm LP minus_num RP", - /* 305 */ "cmd ::= PRAGMA nm DOT ID_PRAGMA", - /* 306 */ "cmd ::= PRAGMA ID_DB|ID_PRAGMA", - /* 307 */ "nmnum ::= plus_num", - /* 308 */ "nmnum ::= nm", - /* 309 */ "nmnum ::= ON", - /* 310 */ "nmnum ::= DELETE", - /* 311 */ "nmnum ::= DEFAULT", - /* 312 */ "plus_num ::= PLUS number", - /* 313 */ "plus_num ::= number", - /* 314 */ "minus_num ::= MINUS number", - /* 315 */ "number ::= INTEGER", - /* 316 */ "number ::= FLOAT", - /* 317 */ "cmd ::= CREATE temp TRIGGER nm trigger_time trigger_event ON nm dbnm foreach_clause when_clause BEGIN trigger_cmd_list END", - /* 318 */ "cmd ::= CREATE temp TRIGGER nm trigger_time trigger_event ON nm dbnm foreach_clause when_clause", - /* 319 */ "cmd ::= CREATE temp TRIGGER nm trigger_time trigger_event ON nm dbnm foreach_clause when_clause BEGIN trigger_cmd_list", - /* 320 */ "cmd ::= CREATE temp TRIGGER nm trigger_time trigger_event ON ID_TAB|ID_DB", - /* 321 */ "cmd ::= CREATE temp TRIGGER nm trigger_time trigger_event ON nm DOT ID_TAB", - /* 322 */ "cmd ::= CREATE temp TRIGGER ID_TRIG_NEW", - /* 323 */ "trigger_time ::= BEFORE", - /* 324 */ "trigger_time ::= AFTER", - /* 325 */ "trigger_time ::= INSTEAD OF", - /* 326 */ "trigger_time ::=", - /* 327 */ "trigger_event ::= DELETE", - /* 328 */ "trigger_event ::= INSERT", - /* 329 */ "trigger_event ::= UPDATE", - /* 330 */ "trigger_event ::= UPDATE OF inscollist", - /* 331 */ "foreach_clause ::=", - /* 332 */ "foreach_clause ::= FOR EACH ROW", - /* 333 */ "foreach_clause ::= FOR EACH STATEMENT", - /* 334 */ "when_clause ::=", - /* 335 */ "when_clause ::= WHEN expr", - /* 336 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI", - /* 337 */ "trigger_cmd_list ::= trigger_cmd SEMI", - /* 338 */ "trigger_cmd ::= update_stmt", - /* 339 */ "trigger_cmd ::= insert_stmt", - /* 340 */ "trigger_cmd ::= delete_stmt", - /* 341 */ "trigger_cmd ::= select_stmt", - /* 342 */ "raisetype ::= ROLLBACK|ABORT|FAIL", - /* 343 */ "cmd ::= DROP TRIGGER fullname", - /* 344 */ "cmd ::= DROP TRIGGER nm DOT ID_TRIG", - /* 345 */ "cmd ::= DROP TRIGGER ID_DB|ID_TRIG", - /* 346 */ "cmd ::= ATTACH database_kw_opt ids AS ids key_opt", - /* 347 */ "key_opt ::=", - /* 348 */ "key_opt ::= USING ids", - /* 349 */ "database_kw_opt ::= DATABASE", - /* 350 */ "database_kw_opt ::=", - /* 351 */ "cmd ::= DETACH database_kw_opt nm", + /* 260 */ "exprx ::= LP expr", + /* 261 */ "exprx ::= expr not_opt IN ID_DB", + /* 262 */ "exprx ::= expr not_opt IN nm DOT ID_TAB", + /* 263 */ "exprx ::= ID_DB|ID_TAB|ID_COL|ID_FN", + /* 264 */ "exprx ::= nm DOT ID_TAB|ID_COL", + /* 265 */ "exprx ::= nm DOT nm DOT ID_COL", + /* 266 */ "exprx ::= RAISE LP raisetype COMMA ID_ERR_MSG RP", + /* 267 */ "expr ::= exprx", + /* 268 */ "expr ::=", + /* 269 */ "not_opt ::=", + /* 270 */ "not_opt ::= NOT", + /* 271 */ "likeop ::= LIKE|GLOB", + /* 272 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr", + /* 273 */ "case_exprlist ::= WHEN expr THEN expr", + /* 274 */ "case_else ::= ELSE expr", + /* 275 */ "case_else ::=", + /* 276 */ "case_operand ::= exprx", + /* 277 */ "case_operand ::=", + /* 278 */ "exprlist ::= nexprlist", + /* 279 */ "exprlist ::=", + /* 280 */ "nexprlist ::= nexprlist COMMA expr", + /* 281 */ "nexprlist ::= exprx", + /* 282 */ "cmd ::= CREATE uniqueflag INDEX nm ON nm dbnm LP idxlist RP onconf", + /* 283 */ "cmd ::= CREATE uniqueflag INDEX nm dbnm ON ID_TAB", + /* 284 */ "cmd ::= CREATE uniqueflag INDEX nm DOT ID_IDX_NEW", + /* 285 */ "cmd ::= CREATE uniqueflag INDEX ID_DB|ID_IDX_NEW", + /* 286 */ "uniqueflag ::= UNIQUE", + /* 287 */ "uniqueflag ::=", + /* 288 */ "idxlist_opt ::=", + /* 289 */ "idxlist_opt ::= LP idxlist RP", + /* 290 */ "idxlist ::= idxlist COMMA idxlist_single", + /* 291 */ "idxlist ::= idxlist_single", + /* 292 */ "idxlist_single ::= nm sortorder", + /* 293 */ "idxlist_single ::= ID_COL", + /* 294 */ "cmd ::= DROP INDEX fullname", + /* 295 */ "cmd ::= DROP INDEX nm DOT ID_IDX", + /* 296 */ "cmd ::= DROP INDEX ID_DB|ID_IDX", + /* 297 */ "cmd ::= COPY orconf nm dbnm FROM nm USING DELIMITERS STRING", + /* 298 */ "cmd ::= COPY orconf nm dbnm FROM nm", + /* 299 */ "cmd ::= VACUUM", + /* 300 */ "cmd ::= VACUUM nm", + /* 301 */ "cmd ::= PRAGMA ids", + /* 302 */ "cmd ::= PRAGMA nm EQ nmnum", + /* 303 */ "cmd ::= PRAGMA nm LP nmnum RP", + /* 304 */ "cmd ::= PRAGMA nm EQ minus_num", + /* 305 */ "cmd ::= PRAGMA nm LP minus_num RP", + /* 306 */ "cmd ::= PRAGMA nm DOT ID_PRAGMA", + /* 307 */ "cmd ::= PRAGMA ID_DB|ID_PRAGMA", + /* 308 */ "nmnum ::= plus_num", + /* 309 */ "nmnum ::= nm", + /* 310 */ "nmnum ::= ON", + /* 311 */ "nmnum ::= DELETE", + /* 312 */ "nmnum ::= DEFAULT", + /* 313 */ "plus_num ::= PLUS number", + /* 314 */ "plus_num ::= number", + /* 315 */ "minus_num ::= MINUS number", + /* 316 */ "number ::= INTEGER", + /* 317 */ "number ::= FLOAT", + /* 318 */ "cmd ::= CREATE temp TRIGGER nm trigger_time trigger_event ON nm dbnm foreach_clause when_clause BEGIN trigger_cmd_list END", + /* 319 */ "cmd ::= CREATE temp TRIGGER nm trigger_time trigger_event ON nm dbnm foreach_clause when_clause", + /* 320 */ "cmd ::= CREATE temp TRIGGER nm trigger_time trigger_event ON nm dbnm foreach_clause when_clause BEGIN trigger_cmd_list", + /* 321 */ "cmd ::= CREATE temp TRIGGER nm trigger_time trigger_event ON ID_TAB|ID_DB", + /* 322 */ "cmd ::= CREATE temp TRIGGER nm trigger_time trigger_event ON nm DOT ID_TAB", + /* 323 */ "cmd ::= CREATE temp TRIGGER ID_TRIG_NEW", + /* 324 */ "trigger_time ::= BEFORE", + /* 325 */ "trigger_time ::= AFTER", + /* 326 */ "trigger_time ::= INSTEAD OF", + /* 327 */ "trigger_time ::=", + /* 328 */ "trigger_event ::= DELETE", + /* 329 */ "trigger_event ::= INSERT", + /* 330 */ "trigger_event ::= UPDATE", + /* 331 */ "trigger_event ::= UPDATE OF inscollist", + /* 332 */ "foreach_clause ::=", + /* 333 */ "foreach_clause ::= FOR EACH ROW", + /* 334 */ "foreach_clause ::= FOR EACH STATEMENT", + /* 335 */ "when_clause ::=", + /* 336 */ "when_clause ::= WHEN expr", + /* 337 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI", + /* 338 */ "trigger_cmd_list ::= trigger_cmd SEMI", + /* 339 */ "trigger_cmd ::= update_stmt", + /* 340 */ "trigger_cmd ::= insert_stmt", + /* 341 */ "trigger_cmd ::= delete_stmt", + /* 342 */ "trigger_cmd ::= select_stmt", + /* 343 */ "raisetype ::= ROLLBACK|ABORT|FAIL", + /* 344 */ "cmd ::= DROP TRIGGER fullname", + /* 345 */ "cmd ::= DROP TRIGGER nm DOT ID_TRIG", + /* 346 */ "cmd ::= DROP TRIGGER ID_DB|ID_TRIG", + /* 347 */ "cmd ::= ATTACH database_kw_opt ids AS ids key_opt", + /* 348 */ "key_opt ::=", + /* 349 */ "key_opt ::= USING ids", + /* 350 */ "database_kw_opt ::= DATABASE", + /* 351 */ "database_kw_opt ::=", + /* 352 */ "cmd ::= DETACH database_kw_opt nm", }; #endif /* NDEBUG */ @@ -2219,6 +2220,7 @@ static const struct { { 221, 5 }, { 221, 4 }, { 221, 5 }, + { 221, 2 }, { 221, 4 }, { 221, 6 }, { 221, 1 }, @@ -2394,10 +2396,10 @@ static void yy_reduce( {yygotominor.yy91 = new ParserStubExplain(true, false);} break; case 7: /* cmdx ::= cmd */ - case 338: /* trigger_cmd ::= update_stmt */ yytestcase(yyruleno==338); - case 339: /* trigger_cmd ::= insert_stmt */ yytestcase(yyruleno==339); - case 340: /* trigger_cmd ::= delete_stmt */ yytestcase(yyruleno==340); - case 341: /* trigger_cmd ::= select_stmt */ yytestcase(yyruleno==341); + case 339: /* trigger_cmd ::= update_stmt */ yytestcase(yyruleno==339); + case 340: /* trigger_cmd ::= insert_stmt */ yytestcase(yyruleno==340); + case 341: /* trigger_cmd ::= delete_stmt */ yytestcase(yyruleno==341); + case 342: /* trigger_cmd ::= select_stmt */ yytestcase(yyruleno==342); {yygotominor.yy203 = yymsp[0].minor.yy203;} break; case 8: /* cmd ::= BEGIN trans_opt onconf */ @@ -2500,7 +2502,7 @@ static void yy_reduce( break; case 19: /* cmd ::= CREATE temp TABLE ID_DB|ID_TAB_NEW */ case 110: /* cmd ::= CREATE temp VIEW ID_VIEW_NEW */ yytestcase(yyruleno==110); - case 322: /* cmd ::= CREATE temp TRIGGER ID_TRIG_NEW */ yytestcase(yyruleno==322); + case 323: /* cmd ::= CREATE temp TRIGGER ID_TRIG_NEW */ yytestcase(yyruleno==323); { yy_destructor(yypParser,157,&yymsp[-2].minor); } break; @@ -2597,9 +2599,9 @@ static void yy_reduce( break; case 40: /* signed ::= plus_num */ case 41: /* signed ::= minus_num */ yytestcase(yyruleno==41); - case 307: /* nmnum ::= plus_num */ yytestcase(yyruleno==307); - case 312: /* plus_num ::= PLUS number */ yytestcase(yyruleno==312); - case 313: /* plus_num ::= number */ yytestcase(yyruleno==313); + case 308: /* nmnum ::= plus_num */ yytestcase(yyruleno==308); + case 313: /* plus_num ::= PLUS number */ yytestcase(yyruleno==313); + case 314: /* plus_num ::= number */ yytestcase(yyruleno==314); {yygotominor.yy69 = yymsp[0].minor.yy69;} break; case 42: /* carglist ::= carglist ccons */ @@ -2847,15 +2849,15 @@ static void yy_reduce( } break; case 85: /* tconscomma ::= COMMA */ - case 269: /* not_opt ::= NOT */ yytestcase(yyruleno==269); - case 285: /* uniqueflag ::= UNIQUE */ yytestcase(yyruleno==285); - case 349: /* database_kw_opt ::= DATABASE */ yytestcase(yyruleno==349); + case 270: /* not_opt ::= NOT */ yytestcase(yyruleno==270); + case 286: /* uniqueflag ::= UNIQUE */ yytestcase(yyruleno==286); + case 350: /* database_kw_opt ::= DATABASE */ yytestcase(yyruleno==350); {yygotominor.yy291 = new bool(true);} break; case 86: /* tconscomma ::= */ - case 268: /* not_opt ::= */ yytestcase(yyruleno==268); - case 286: /* uniqueflag ::= */ yytestcase(yyruleno==286); - case 350: /* database_kw_opt ::= */ yytestcase(yyruleno==350); + case 269: /* not_opt ::= */ yytestcase(yyruleno==269); + case 287: /* uniqueflag ::= */ yytestcase(yyruleno==287); + case 351: /* database_kw_opt ::= */ yytestcase(yyruleno==351); {yygotominor.yy291 = new bool(false);} break; case 87: /* tcons ::= CONSTRAINT nm */ @@ -2959,15 +2961,15 @@ static void yy_reduce( case 187: /* delete_stmt ::= DELETE FROM ID_DB|ID_TAB */ yytestcase(yyruleno==187); case 195: /* update_stmt ::= UPDATE orconf nm DOT ID_TAB */ yytestcase(yyruleno==195); case 196: /* update_stmt ::= UPDATE orconf ID_DB|ID_TAB */ yytestcase(yyruleno==196); - case 263: /* exprx ::= nm DOT ID_TAB|ID_COL */ yytestcase(yyruleno==263); - case 283: /* cmd ::= CREATE uniqueflag INDEX nm DOT ID_IDX_NEW */ yytestcase(yyruleno==283); - case 284: /* cmd ::= CREATE uniqueflag INDEX ID_DB|ID_IDX_NEW */ yytestcase(yyruleno==284); - case 294: /* cmd ::= DROP INDEX nm DOT ID_IDX */ yytestcase(yyruleno==294); - case 295: /* cmd ::= DROP INDEX ID_DB|ID_IDX */ yytestcase(yyruleno==295); - case 305: /* cmd ::= PRAGMA nm DOT ID_PRAGMA */ yytestcase(yyruleno==305); - case 306: /* cmd ::= PRAGMA ID_DB|ID_PRAGMA */ yytestcase(yyruleno==306); - case 344: /* cmd ::= DROP TRIGGER nm DOT ID_TRIG */ yytestcase(yyruleno==344); - case 345: /* cmd ::= DROP TRIGGER ID_DB|ID_TRIG */ yytestcase(yyruleno==345); + case 264: /* exprx ::= nm DOT ID_TAB|ID_COL */ yytestcase(yyruleno==264); + case 284: /* cmd ::= CREATE uniqueflag INDEX nm DOT ID_IDX_NEW */ yytestcase(yyruleno==284); + case 285: /* cmd ::= CREATE uniqueflag INDEX ID_DB|ID_IDX_NEW */ yytestcase(yyruleno==285); + case 295: /* cmd ::= DROP INDEX nm DOT ID_IDX */ yytestcase(yyruleno==295); + case 296: /* cmd ::= DROP INDEX ID_DB|ID_IDX */ yytestcase(yyruleno==296); + case 306: /* cmd ::= PRAGMA nm DOT ID_PRAGMA */ yytestcase(yyruleno==306); + case 307: /* cmd ::= PRAGMA ID_DB|ID_PRAGMA */ yytestcase(yyruleno==307); + case 345: /* cmd ::= DROP TRIGGER nm DOT ID_TRIG */ yytestcase(yyruleno==345); + case 346: /* cmd ::= DROP TRIGGER ID_DB|ID_TRIG */ yytestcase(yyruleno==346); { yy_destructor(yypParser,156,&yymsp[-2].minor); } break; @@ -3339,11 +3341,11 @@ static void yy_reduce( {yygotominor.yy389 = new SqliteSortOrder(SqliteSortOrder::null);} break; case 173: /* groupby_opt ::= */ - case 278: /* exprlist ::= */ yytestcase(yyruleno==278); + case 279: /* exprlist ::= */ yytestcase(yyruleno==279); {yygotominor.yy231 = new ParserExprList();} break; case 174: /* groupby_opt ::= GROUP BY nexprlist */ - case 277: /* exprlist ::= nexprlist */ yytestcase(yyruleno==277); + case 278: /* exprlist ::= nexprlist */ yytestcase(yyruleno==278); {yygotominor.yy231 = yymsp[0].minor.yy231;} break; case 175: /* groupby_opt ::= GROUP BY */ @@ -3354,18 +3356,18 @@ static void yy_reduce( break; case 176: /* having_opt ::= */ case 188: /* where_opt ::= */ yytestcase(yyruleno==188); - case 274: /* case_else ::= */ yytestcase(yyruleno==274); - case 276: /* case_operand ::= */ yytestcase(yyruleno==276); - case 334: /* when_clause ::= */ yytestcase(yyruleno==334); - case 347: /* key_opt ::= */ yytestcase(yyruleno==347); + case 275: /* case_else ::= */ yytestcase(yyruleno==275); + case 277: /* case_operand ::= */ yytestcase(yyruleno==277); + case 335: /* when_clause ::= */ yytestcase(yyruleno==335); + case 348: /* key_opt ::= */ yytestcase(yyruleno==348); {yygotominor.yy192 = nullptr;} break; case 177: /* having_opt ::= HAVING expr */ case 189: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==189); - case 266: /* expr ::= exprx */ yytestcase(yyruleno==266); - case 273: /* case_else ::= ELSE expr */ yytestcase(yyruleno==273); - case 275: /* case_operand ::= exprx */ yytestcase(yyruleno==275); - case 335: /* when_clause ::= WHEN expr */ yytestcase(yyruleno==335); + case 267: /* expr ::= exprx */ yytestcase(yyruleno==267); + case 274: /* case_else ::= ELSE expr */ yytestcase(yyruleno==274); + case 276: /* case_operand ::= exprx */ yytestcase(yyruleno==276); + case 336: /* when_clause ::= WHEN expr */ yytestcase(yyruleno==336); {yygotominor.yy192 = yymsp[0].minor.yy192;} break; case 178: /* limit_opt ::= */ @@ -3917,60 +3919,68 @@ static void yy_reduce( parserContext->minorErrorBeforeNextToken("Syntax error"); } break; - case 260: /* exprx ::= expr not_opt IN ID_DB */ + case 260: /* exprx ::= LP expr */ +{ + yygotominor.yy192 = new SqliteExpr(); + yygotominor.yy192->initSubExpr(yymsp[0].minor.yy192); + objectForTokens = yygotominor.yy192; + parserContext->minorErrorBeforeNextToken("Syntax error"); + } + break; + case 261: /* exprx ::= expr not_opt IN ID_DB */ { yy_destructor(yypParser,177,&yymsp[-3].minor); } break; - case 261: /* exprx ::= expr not_opt IN nm DOT ID_TAB */ - case 262: /* exprx ::= ID_DB|ID_TAB|ID_COL|ID_FN */ yytestcase(yyruleno==262); + case 262: /* exprx ::= expr not_opt IN nm DOT ID_TAB */ + case 263: /* exprx ::= ID_DB|ID_TAB|ID_COL|ID_FN */ yytestcase(yyruleno==263); { yy_destructor(yypParser,177,&yymsp[-5].minor); yy_destructor(yypParser,156,&yymsp[-2].minor); } break; - case 264: /* exprx ::= nm DOT nm DOT ID_COL */ - case 265: /* exprx ::= RAISE LP raisetype COMMA ID_ERR_MSG RP */ yytestcase(yyruleno==265); + case 265: /* exprx ::= nm DOT nm DOT ID_COL */ + case 266: /* exprx ::= RAISE LP raisetype COMMA ID_ERR_MSG RP */ yytestcase(yyruleno==266); { yy_destructor(yypParser,156,&yymsp[-4].minor); yy_destructor(yypParser,156,&yymsp[-2].minor); } break; - case 267: /* expr ::= */ + case 268: /* expr ::= */ { yygotominor.yy192 = new SqliteExpr(); objectForTokens = yygotominor.yy192; parserContext->minorErrorAfterLastToken("Syntax error"); } break; - case 270: /* likeop ::= LIKE|GLOB */ + case 271: /* likeop ::= LIKE|GLOB */ {yygotominor.yy41 = new SqliteExpr::LikeOp(SqliteExpr::likeOp(yymsp[0].minor.yy0->value));} break; - case 271: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */ + case 272: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */ { yymsp[-4].minor.yy231->append(yymsp[-2].minor.yy192); yymsp[-4].minor.yy231->append(yymsp[0].minor.yy192); yygotominor.yy231 = yymsp[-4].minor.yy231; } break; - case 272: /* case_exprlist ::= WHEN expr THEN expr */ + case 273: /* case_exprlist ::= WHEN expr THEN expr */ { yygotominor.yy231 = new ParserExprList(); yygotominor.yy231->append(yymsp[-2].minor.yy192); yygotominor.yy231->append(yymsp[0].minor.yy192); } break; - case 279: /* nexprlist ::= nexprlist COMMA expr */ + case 280: /* nexprlist ::= nexprlist COMMA expr */ { yymsp[-2].minor.yy231->append(yymsp[0].minor.yy192); yygotominor.yy231 = yymsp[-2].minor.yy231; DONT_INHERIT_TOKENS("nexprlist"); } break; - case 280: /* nexprlist ::= exprx */ + case 281: /* nexprlist ::= exprx */ { yygotominor.yy231 = new ParserExprList(); yygotominor.yy231->append(yymsp[0].minor.yy192); } break; - case 281: /* cmd ::= CREATE uniqueflag INDEX nm ON nm dbnm LP idxlist RP onconf */ + case 282: /* cmd ::= CREATE uniqueflag INDEX nm ON nm dbnm LP idxlist RP onconf */ { yygotominor.yy203 = new SqliteCreateIndex( *(yymsp[-9].minor.yy291), @@ -3990,31 +4000,31 @@ static void yy_reduce( objectForTokens = yygotominor.yy203; } break; - case 282: /* cmd ::= CREATE uniqueflag INDEX nm dbnm ON ID_TAB */ + case 283: /* cmd ::= CREATE uniqueflag INDEX nm dbnm ON ID_TAB */ { yy_destructor(yypParser,156,&yymsp[-3].minor); } break; - case 287: /* idxlist_opt ::= */ + case 288: /* idxlist_opt ::= */ {yygotominor.yy63 = new ParserIndexedColumnList();} break; - case 288: /* idxlist_opt ::= LP idxlist RP */ + case 289: /* idxlist_opt ::= LP idxlist RP */ {yygotominor.yy63 = yymsp[-1].minor.yy63;} break; - case 289: /* idxlist ::= idxlist COMMA idxlist_single */ + case 290: /* idxlist ::= idxlist COMMA idxlist_single */ { yymsp[-2].minor.yy63->append(yymsp[0].minor.yy428); yygotominor.yy63 = yymsp[-2].minor.yy63; DONT_INHERIT_TOKENS("idxlist"); } break; - case 290: /* idxlist ::= idxlist_single */ + case 291: /* idxlist ::= idxlist_single */ { yygotominor.yy63 = new ParserIndexedColumnList(); yygotominor.yy63->append(yymsp[0].minor.yy428); } break; - case 291: /* idxlist_single ::= nm sortorder */ - case 292: /* idxlist_single ::= ID_COL */ yytestcase(yyruleno==292); + case 292: /* idxlist_single ::= nm sortorder */ + case 293: /* idxlist_single ::= ID_COL */ yytestcase(yyruleno==293); { SqliteIndexedColumn* obj = new SqliteIndexedColumn( @@ -4028,14 +4038,14 @@ static void yy_reduce( objectForTokens = yygotominor.yy428; } break; - case 293: /* cmd ::= DROP INDEX fullname */ + case 294: /* cmd ::= DROP INDEX fullname */ { yygotominor.yy203 = new SqliteDropIndex(false, yymsp[0].minor.yy120->name1, yymsp[0].minor.yy120->name2); delete yymsp[0].minor.yy120; objectForTokens = yygotominor.yy203; } break; - case 296: /* cmd ::= COPY orconf nm dbnm FROM nm USING DELIMITERS STRING */ + case 297: /* cmd ::= COPY orconf nm dbnm FROM nm USING DELIMITERS STRING */ { yygotominor.yy203 = new SqliteCopy( *(yymsp[-7].minor.yy418), @@ -4051,7 +4061,7 @@ static void yy_reduce( objectForTokens = yygotominor.yy203; } break; - case 297: /* cmd ::= COPY orconf nm dbnm FROM nm */ + case 298: /* cmd ::= COPY orconf nm dbnm FROM nm */ { yygotominor.yy203 = new SqliteCopy( *(yymsp[-4].minor.yy418), @@ -4066,28 +4076,28 @@ static void yy_reduce( objectForTokens = yygotominor.yy203; } break; - case 298: /* cmd ::= VACUUM */ + case 299: /* cmd ::= VACUUM */ { yygotominor.yy203 = new SqliteVacuum(); objectForTokens = yygotominor.yy203; } break; - case 299: /* cmd ::= VACUUM nm */ + case 300: /* cmd ::= VACUUM nm */ { yygotominor.yy203 = new SqliteVacuum(*(yymsp[0].minor.yy319)); delete yymsp[0].minor.yy319; objectForTokens = yygotominor.yy203; } break; - case 300: /* cmd ::= PRAGMA ids */ + case 301: /* cmd ::= PRAGMA ids */ { yygotominor.yy203 = new SqlitePragma(*(yymsp[0].minor.yy319), QString::null); delete yymsp[0].minor.yy319; objectForTokens = yygotominor.yy203; } break; - case 301: /* cmd ::= PRAGMA nm EQ nmnum */ - case 303: /* cmd ::= PRAGMA nm EQ minus_num */ yytestcase(yyruleno==303); + case 302: /* cmd ::= PRAGMA nm EQ nmnum */ + case 304: /* cmd ::= PRAGMA nm EQ minus_num */ yytestcase(yyruleno==304); { yygotominor.yy203 = new SqlitePragma(*(yymsp[-2].minor.yy319), QString::null, *(yymsp[0].minor.yy69), true); delete yymsp[-2].minor.yy319; @@ -4095,8 +4105,8 @@ static void yy_reduce( objectForTokens = yygotominor.yy203; } break; - case 302: /* cmd ::= PRAGMA nm LP nmnum RP */ - case 304: /* cmd ::= PRAGMA nm LP minus_num RP */ yytestcase(yyruleno==304); + case 303: /* cmd ::= PRAGMA nm LP nmnum RP */ + case 305: /* cmd ::= PRAGMA nm LP minus_num RP */ yytestcase(yyruleno==305); { yygotominor.yy203 = new SqlitePragma(*(yymsp[-3].minor.yy319), QString::null, *(yymsp[-1].minor.yy69), false); delete yymsp[-3].minor.yy319; @@ -4104,18 +4114,18 @@ static void yy_reduce( objectForTokens = yygotominor.yy203; } break; - case 308: /* nmnum ::= nm */ + case 309: /* nmnum ::= nm */ { yygotominor.yy69 = new QVariant(*(yymsp[0].minor.yy319)); delete yymsp[0].minor.yy319; } break; - case 309: /* nmnum ::= ON */ - case 310: /* nmnum ::= DELETE */ yytestcase(yyruleno==310); - case 311: /* nmnum ::= DEFAULT */ yytestcase(yyruleno==311); + case 310: /* nmnum ::= ON */ + case 311: /* nmnum ::= DELETE */ yytestcase(yyruleno==311); + case 312: /* nmnum ::= DEFAULT */ yytestcase(yyruleno==312); {yygotominor.yy69 = new QVariant(yymsp[0].minor.yy0->value);} break; - case 314: /* minus_num ::= MINUS number */ + case 315: /* minus_num ::= MINUS number */ { if (yymsp[0].minor.yy69->type() == QVariant::Double) *(yymsp[0].minor.yy69) = -(yymsp[0].minor.yy69->toDouble()); @@ -4127,13 +4137,13 @@ static void yy_reduce( yygotominor.yy69 = yymsp[0].minor.yy69; } break; - case 315: /* number ::= INTEGER */ + case 316: /* number ::= INTEGER */ {yygotominor.yy69 = new QVariant(QVariant(yymsp[0].minor.yy0->value).toLongLong());} break; - case 316: /* number ::= FLOAT */ + case 317: /* number ::= FLOAT */ {yygotominor.yy69 = new QVariant(QVariant(yymsp[0].minor.yy0->value).toDouble());} break; - case 317: /* cmd ::= CREATE temp TRIGGER nm trigger_time trigger_event ON nm dbnm foreach_clause when_clause BEGIN trigger_cmd_list END */ + case 318: /* cmd ::= CREATE temp TRIGGER nm trigger_time trigger_event ON nm dbnm foreach_clause when_clause BEGIN trigger_cmd_list END */ { yygotominor.yy203 = new SqliteCreateTrigger( *(yymsp[-12].minor.yy226), @@ -4158,7 +4168,7 @@ static void yy_reduce( objectForTokens = yygotominor.yy203; } break; - case 318: /* cmd ::= CREATE temp TRIGGER nm trigger_time trigger_event ON nm dbnm foreach_clause when_clause */ + case 319: /* cmd ::= CREATE temp TRIGGER nm trigger_time trigger_event ON nm dbnm foreach_clause when_clause */ { QList<SqliteQuery *> CL; @@ -4185,7 +4195,7 @@ static void yy_reduce( parserContext->minorErrorAfterLastToken("Syntax error"); } break; - case 319: /* cmd ::= CREATE temp TRIGGER nm trigger_time trigger_event ON nm dbnm foreach_clause when_clause BEGIN trigger_cmd_list */ + case 320: /* cmd ::= CREATE temp TRIGGER nm trigger_time trigger_event ON nm dbnm foreach_clause when_clause BEGIN trigger_cmd_list */ { yygotominor.yy203 = new SqliteCreateTrigger( *(yymsp[-11].minor.yy226), @@ -4211,14 +4221,14 @@ static void yy_reduce( parserContext->minorErrorAfterLastToken("Syntax error"); } break; - case 320: /* cmd ::= CREATE temp TRIGGER nm trigger_time trigger_event ON ID_TAB|ID_DB */ + case 321: /* cmd ::= CREATE temp TRIGGER nm trigger_time trigger_event ON ID_TAB|ID_DB */ { yy_destructor(yypParser,157,&yymsp[-6].minor); yy_destructor(yypParser,156,&yymsp[-4].minor); yy_destructor(yypParser,232,&yymsp[-3].minor); yy_destructor(yypParser,233,&yymsp[-2].minor); } break; - case 321: /* cmd ::= CREATE temp TRIGGER nm trigger_time trigger_event ON nm DOT ID_TAB */ + case 322: /* cmd ::= CREATE temp TRIGGER nm trigger_time trigger_event ON nm DOT ID_TAB */ { yy_destructor(yypParser,157,&yymsp[-8].minor); yy_destructor(yypParser,156,&yymsp[-6].minor); yy_destructor(yypParser,232,&yymsp[-5].minor); @@ -4226,76 +4236,76 @@ static void yy_reduce( yy_destructor(yypParser,156,&yymsp[-2].minor); } break; - case 323: /* trigger_time ::= BEFORE */ + case 324: /* trigger_time ::= BEFORE */ {yygotominor.yy372 = new SqliteCreateTrigger::Time(SqliteCreateTrigger::Time::BEFORE);} break; - case 324: /* trigger_time ::= AFTER */ + case 325: /* trigger_time ::= AFTER */ {yygotominor.yy372 = new SqliteCreateTrigger::Time(SqliteCreateTrigger::Time::AFTER);} break; - case 325: /* trigger_time ::= INSTEAD OF */ + case 326: /* trigger_time ::= INSTEAD OF */ {yygotominor.yy372 = new SqliteCreateTrigger::Time(SqliteCreateTrigger::Time::INSTEAD_OF);} break; - case 326: /* trigger_time ::= */ + case 327: /* trigger_time ::= */ {yygotominor.yy372 = new SqliteCreateTrigger::Time(SqliteCreateTrigger::Time::null);} break; - case 327: /* trigger_event ::= DELETE */ + case 328: /* trigger_event ::= DELETE */ { yygotominor.yy151 = new SqliteCreateTrigger::Event(SqliteCreateTrigger::Event::DELETE); objectForTokens = yygotominor.yy151; } break; - case 328: /* trigger_event ::= INSERT */ + case 329: /* trigger_event ::= INSERT */ { yygotominor.yy151 = new SqliteCreateTrigger::Event(SqliteCreateTrigger::Event::INSERT); objectForTokens = yygotominor.yy151; } break; - case 329: /* trigger_event ::= UPDATE */ + case 330: /* trigger_event ::= UPDATE */ { yygotominor.yy151 = new SqliteCreateTrigger::Event(SqliteCreateTrigger::Event::UPDATE); objectForTokens = yygotominor.yy151; } break; - case 330: /* trigger_event ::= UPDATE OF inscollist */ + case 331: /* trigger_event ::= UPDATE OF inscollist */ { yygotominor.yy151 = new SqliteCreateTrigger::Event(*(yymsp[0].minor.yy207)); delete yymsp[0].minor.yy207; objectForTokens = yygotominor.yy151; } break; - case 331: /* foreach_clause ::= */ + case 332: /* foreach_clause ::= */ {yygotominor.yy83 = new SqliteCreateTrigger::Scope(SqliteCreateTrigger::Scope::null);} break; - case 332: /* foreach_clause ::= FOR EACH ROW */ + case 333: /* foreach_clause ::= FOR EACH ROW */ {yygotominor.yy83 = new SqliteCreateTrigger::Scope(SqliteCreateTrigger::Scope::FOR_EACH_ROW);} break; - case 333: /* foreach_clause ::= FOR EACH STATEMENT */ + case 334: /* foreach_clause ::= FOR EACH STATEMENT */ {yygotominor.yy83 = new SqliteCreateTrigger::Scope(SqliteCreateTrigger::Scope::FOR_EACH_STATEMENT);} break; - case 336: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */ + case 337: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */ { yymsp[-2].minor.yy270->append(yymsp[-1].minor.yy203); yygotominor.yy270 = yymsp[-2].minor.yy270; DONT_INHERIT_TOKENS("trigger_cmd_list"); } break; - case 337: /* trigger_cmd_list ::= trigger_cmd SEMI */ + case 338: /* trigger_cmd_list ::= trigger_cmd SEMI */ { yygotominor.yy270 = new ParserQueryList(); yygotominor.yy270->append(yymsp[-1].minor.yy203); } break; - case 342: /* raisetype ::= ROLLBACK|ABORT|FAIL */ + case 343: /* raisetype ::= ROLLBACK|ABORT|FAIL */ {yygotominor.yy0 = yymsp[0].minor.yy0;} break; - case 343: /* cmd ::= DROP TRIGGER fullname */ + case 344: /* cmd ::= DROP TRIGGER fullname */ { yygotominor.yy203 = new SqliteDropTrigger(false, yymsp[0].minor.yy120->name1, yymsp[0].minor.yy120->name2); delete yymsp[0].minor.yy120; objectForTokens = yygotominor.yy203; } break; - case 346: /* cmd ::= ATTACH database_kw_opt ids AS ids key_opt */ + case 347: /* cmd ::= ATTACH database_kw_opt ids AS ids key_opt */ { SqliteExpr* e1 = new SqliteExpr(); SqliteExpr* e2 = new SqliteExpr(); @@ -4308,7 +4318,7 @@ static void yy_reduce( objectForTokens = yygotominor.yy203; } break; - case 348: /* key_opt ::= USING ids */ + case 349: /* key_opt ::= USING ids */ { SqliteExpr* e = new SqliteExpr(); e->initLiteral(*(yymsp[0].minor.yy319)); @@ -4316,7 +4326,7 @@ static void yy_reduce( yygotominor.yy192 = e; } break; - case 351: /* cmd ::= DETACH database_kw_opt nm */ + case 352: /* cmd ::= DETACH database_kw_opt nm */ { SqliteExpr* e = new SqliteExpr(); e->initLiteral(*(yymsp[0].minor.yy319)); diff --git a/SQLiteStudio3/coreSQLiteStudio/parser/sqlite2_parse.y b/SQLiteStudio3/coreSQLiteStudio/parser/sqlite2_parse.y index 04da6cb..2fd9c0d 100644 --- a/SQLiteStudio3/coreSQLiteStudio/parser/sqlite2_parse.y +++ b/SQLiteStudio3/coreSQLiteStudio/parser/sqlite2_parse.y @@ -1586,6 +1586,12 @@ exprx(X) ::= expr(E) not_opt(N) IN LP objectForTokens = X; parserContext->minorErrorBeforeNextToken("Syntax error"); } +exprx(X) ::= LP expr(E). { + X = new SqliteExpr(); + X->initSubExpr(E); + objectForTokens = X; + parserContext->minorErrorBeforeNextToken("Syntax error"); + } exprx ::= expr not_opt IN ID_DB. [IN] {} exprx ::= expr not_opt IN nm DOT diff --git a/SQLiteStudio3/coreSQLiteStudio/parser/sqlite3_parse.cpp b/SQLiteStudio3/coreSQLiteStudio/parser/sqlite3_parse.cpp index 8786832..7e4f3c0 100644 --- a/SQLiteStudio3/coreSQLiteStudio/parser/sqlite3_parse.cpp +++ b/SQLiteStudio3/coreSQLiteStudio/parser/sqlite3_parse.cpp @@ -170,7 +170,7 @@ typedef union { #define sqlite3_parseARG_FETCH ParserContext* parserContext = yypParser->parserContext #define sqlite3_parseARG_STORE yypParser->parserContext = parserContext #define YYNSTATE 724 -#define YYNRULE 424 +#define YYNRULE 425 #define YYFALLBACK 1 #define YY_NO_ACTION (YYNSTATE+YYNRULE+2) #define YY_ACCEPT_ACTION (YYNSTATE+YYNRULE+1) @@ -246,22 +246,22 @@ static const YYMINORTYPE yyzerominor = { 0 }; static const YYACTIONTYPE yy_action[] = { /* 0 */ 431, 48, 48, 47, 47, 47, 46, 216, 716, 339, /* 10 */ 643, 425, 51, 51, 51, 51, 44, 49, 49, 49, - /* 20 */ 49, 48, 48, 47, 47, 47, 46, 216, 721, 1026, - /* 30 */ 1026, 643, 131, 580, 51, 51, 51, 51, 411, 49, + /* 20 */ 49, 48, 48, 47, 47, 47, 46, 216, 721, 1027, + /* 30 */ 1027, 643, 131, 580, 51, 51, 51, 51, 411, 49, /* 40 */ 49, 49, 49, 48, 48, 47, 47, 47, 46, 216, - /* 50 */ 579, 81, 58, 643, 157, 685, 301, 282, 1026, 1026, - /* 60 */ 41, 1026, 1026, 1026, 1026, 1026, 1026, 1026, 1026, 1026, - /* 70 */ 1026, 1026, 563, 1026, 1026, 1026, 1026, 38, 39, 1026, - /* 80 */ 1026, 1026, 1026, 1026, 40, 431, 528, 385, 716, 595, + /* 50 */ 579, 81, 58, 643, 157, 685, 301, 282, 1027, 1027, + /* 60 */ 41, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, + /* 70 */ 1027, 1027, 563, 1027, 1027, 1027, 1027, 38, 39, 1027, + /* 80 */ 1027, 1027, 1027, 1027, 40, 431, 528, 385, 716, 595, /* 90 */ 594, 280, 4, 377, 716, 630, 425, 642, 608, 422, /* 100 */ 12, 134, 687, 429, 562, 609, 483, 690, 331, 279, /* 110 */ 714, 713, 564, 565, 642, 689, 688, 687, 235, 506, /* 120 */ 60, 320, 610, 411, 47, 47, 47, 46, 216, 122, - /* 130 */ 243, 213, 247, 59, 1142, 1142, 486, 609, 607, 603, + /* 130 */ 243, 213, 247, 59, 1143, 1143, 486, 609, 607, 603, /* 140 */ 685, 306, 485, 584, 716, 41, 507, 509, 642, 508, /* 150 */ 676, 9, 642, 144, 95, 281, 379, 276, 378, 132, /* 160 */ 297, 716, 38, 39, 601, 200, 199, 7, 355, 40, - /* 170 */ 884, 307, 1134, 274, 249, 716, 17, 4, 884, 1134, + /* 170 */ 884, 307, 1135, 274, 249, 716, 17, 4, 884, 1135, /* 180 */ 56, 717, 642, 431, 422, 884, 329, 687, 429, 716, /* 190 */ 687, 643, 690, 687, 425, 690, 714, 713, 690, 642, /* 200 */ 689, 688, 687, 689, 688, 687, 689, 688, 687, 98, @@ -269,16 +269,16 @@ static const YYACTIONTYPE yy_action[] = { /* 220 */ 716, 411, 239, 884, 303, 582, 512, 581, 884, 884, /* 230 */ 884, 884, 884, 642, 643, 676, 9, 642, 685, 217, /* 240 */ 245, 673, 102, 41, 287, 300, 714, 713, 67, 302, - /* 250 */ 148, 307, 1133, 151, 306, 484, 81, 715, 97, 1133, + /* 250 */ 148, 307, 1134, 151, 306, 484, 81, 715, 97, 1134, /* 260 */ 38, 39, 551, 714, 713, 771, 130, 40, 946, 376, /* 270 */ 373, 372, 447, 46, 216, 4, 946, 714, 713, 334, /* 280 */ 642, 682, 422, 946, 606, 687, 429, 371, 448, 447, /* 290 */ 690, 714, 713, 304, 265, 146, 267, 642, 689, 688, /* 300 */ 687, 287, 68, 677, 691, 255, 362, 259, 359, 692, - /* 310 */ 1027, 1027, 682, 946, 715, 946, 946, 447, 698, 234, + /* 310 */ 1028, 1028, 682, 946, 715, 946, 946, 447, 698, 234, /* 320 */ 386, 715, 714, 713, 773, 651, 946, 946, 946, 946, /* 330 */ 110, 642, 317, 676, 9, 642, 222, 677, 299, 52, - /* 340 */ 53, 426, 289, 1027, 1027, 675, 675, 50, 50, 51, + /* 340 */ 53, 426, 289, 1028, 1028, 675, 675, 50, 50, 51, /* 350 */ 51, 51, 51, 716, 49, 49, 49, 49, 48, 48, /* 360 */ 47, 47, 47, 46, 216, 431, 428, 340, 716, 335, /* 370 */ 671, 670, 287, 283, 716, 138, 425, 209, 219, 430, @@ -293,27 +293,27 @@ static const YYACTIONTYPE yy_action[] = { /* 460 */ 92, 143, 642, 358, 422, 931, 674, 687, 429, 14, /* 470 */ 714, 713, 690, 131, 456, 551, 714, 713, 953, 642, /* 480 */ 689, 688, 687, 668, 667, 210, 593, 458, 384, 457, - /* 490 */ 576, 88, 1027, 1027, 13, 931, 672, 931, 931, 54, + /* 490 */ 576, 88, 1028, 1028, 13, 931, 672, 931, 931, 54, /* 500 */ 575, 678, 42, 368, 37, 401, 35, 381, 931, 1, /* 510 */ 931, 931, 641, 642, 634, 676, 9, 642, 661, 714, - /* 520 */ 713, 52, 53, 426, 289, 1027, 1027, 675, 675, 50, + /* 520 */ 713, 52, 53, 426, 289, 1028, 1028, 675, 675, 50, /* 530 */ 50, 51, 51, 51, 51, 660, 49, 49, 49, 49, /* 540 */ 48, 48, 47, 47, 47, 46, 216, 657, 648, 714, /* 550 */ 713, 496, 542, 569, 714, 713, 714, 713, 656, 691, /* 560 */ 543, 614, 320, 30, 692, 27, 716, 585, 274, 682, - /* 570 */ 160, 1027, 1027, 426, 289, 693, 613, 675, 675, 50, + /* 570 */ 160, 1028, 1028, 426, 289, 693, 613, 675, 675, 50, /* 580 */ 50, 51, 51, 51, 51, 398, 49, 49, 49, 49, - /* 590 */ 48, 48, 47, 47, 47, 46, 216, 1025, 1025, 81, - /* 600 */ 52, 53, 426, 289, 1027, 1027, 675, 675, 50, 50, + /* 590 */ 48, 48, 47, 47, 47, 46, 216, 1026, 1026, 81, + /* 600 */ 52, 53, 426, 289, 1028, 1028, 675, 675, 50, 50, /* 610 */ 51, 51, 51, 51, 496, 49, 49, 49, 49, 48, - /* 620 */ 48, 47, 47, 47, 46, 216, 1025, 1025, 1025, 1025, - /* 630 */ 1025, 1025, 1025, 1025, 1025, 1025, 1025, 1025, 1025, 1025, - /* 640 */ 716, 1025, 1025, 1025, 1025, 1025, 1025, 1025, 1025, 1025, - /* 650 */ 1025, 1025, 1027, 1027, 357, 49, 49, 49, 49, 48, + /* 620 */ 48, 47, 47, 47, 46, 216, 1026, 1026, 1026, 1026, + /* 630 */ 1026, 1026, 1026, 1026, 1026, 1026, 1026, 1026, 1026, 1026, + /* 640 */ 716, 1026, 1026, 1026, 1026, 1026, 1026, 1026, 1026, 1026, + /* 650 */ 1026, 1026, 1028, 1028, 357, 49, 49, 49, 49, 48, /* 660 */ 48, 47, 47, 47, 46, 216, 288, 552, 714, 713, /* 670 */ 495, 682, 298, 662, 346, 153, 538, 69, 694, 715, - /* 680 */ 715, 52, 53, 426, 289, 1027, 1027, 675, 675, 50, - /* 690 */ 50, 51, 51, 51, 51, 1094, 49, 49, 49, 49, + /* 680 */ 715, 52, 53, 426, 289, 1028, 1028, 675, 675, 50, + /* 690 */ 50, 51, 51, 51, 51, 1095, 49, 49, 49, 49, /* 700 */ 48, 48, 47, 47, 47, 46, 216, 52, 53, 426, /* 710 */ 289, 418, 511, 675, 675, 50, 50, 51, 51, 51, /* 720 */ 51, 159, 49, 49, 49, 49, 48, 48, 47, 47, @@ -321,12 +321,12 @@ static const YYACTIONTYPE yy_action[] = { /* 740 */ 215, 650, 714, 713, 81, 52, 53, 426, 289, 954, /* 750 */ 414, 675, 675, 50, 50, 51, 51, 51, 51, 397, /* 760 */ 49, 49, 49, 49, 48, 48, 47, 47, 47, 46, - /* 770 */ 216, 158, 1094, 21, 716, 627, 459, 716, 1079, 716, - /* 780 */ 647, 1045, 140, 89, 716, 1149, 154, 435, 2, 715, + /* 770 */ 216, 158, 1095, 21, 716, 627, 459, 716, 1080, 716, + /* 780 */ 647, 1046, 140, 89, 716, 1150, 154, 435, 2, 715, /* 790 */ 424, 671, 670, 396, 460, 461, 954, 52, 53, 426, /* 800 */ 289, 573, 716, 675, 675, 50, 50, 51, 51, 51, /* 810 */ 51, 321, 49, 49, 49, 49, 48, 48, 47, 47, - /* 820 */ 47, 46, 216, 431, 1108, 81, 206, 205, 204, 52, + /* 820 */ 47, 46, 216, 431, 1109, 81, 206, 205, 204, 52, /* 830 */ 53, 426, 289, 716, 425, 675, 675, 50, 50, 51, /* 840 */ 51, 51, 51, 344, 49, 49, 49, 49, 48, 48, /* 850 */ 47, 47, 47, 46, 216, 597, 715, 666, 600, 462, @@ -334,17 +334,17 @@ static const YYACTIONTYPE yy_action[] = { /* 870 */ 667, 609, 724, 434, 81, 656, 714, 713, 685, 714, /* 880 */ 713, 714, 713, 41, 528, 272, 714, 713, 610, 349, /* 890 */ 528, 450, 89, 677, 12, 633, 633, 338, 636, 609, - /* 900 */ 38, 39, 649, 609, 714, 713, 716, 40, 1142, 1142, + /* 900 */ 38, 39, 649, 609, 714, 713, 716, 40, 1143, 1143, /* 910 */ 716, 524, 682, 581, 716, 4, 610, 468, 60, 450, /* 920 */ 642, 208, 422, 506, 60, 687, 429, 677, 32, 109, /* 930 */ 690, 609, 500, 501, 352, 714, 713, 642, 689, 688, /* 940 */ 687, 428, 900, 900, 467, 466, 552, 465, 421, 383, - /* 950 */ 507, 509, 142, 508, 430, 440, 69, 1142, 1142, 715, + /* 950 */ 507, 509, 142, 508, 430, 440, 69, 1143, 1143, 715, /* 960 */ 444, 722, 686, 182, 646, 714, 713, 645, 231, 230, /* 970 */ 437, 642, 356, 676, 9, 642, 417, 444, 52, 53, /* 980 */ 426, 289, 91, 91, 675, 675, 50, 50, 51, 51, /* 990 */ 51, 51, 644, 49, 49, 49, 49, 48, 48, 47, - /* 1000 */ 47, 47, 46, 216, 1034, 444, 668, 667, 714, 713, + /* 1000 */ 47, 47, 46, 216, 1035, 444, 668, 667, 714, 713, /* 1010 */ 91, 453, 714, 713, 682, 641, 714, 713, 324, 202, /* 1020 */ 52, 53, 426, 289, 446, 680, 675, 675, 50, 50, /* 1030 */ 51, 51, 51, 51, 639, 49, 49, 49, 49, 48, @@ -367,10 +367,10 @@ static const YYACTIONTYPE yy_action[] = { /* 1200 */ 47, 47, 47, 46, 216, 532, 8, 517, 696, 87, /* 1210 */ 137, 52, 53, 426, 289, 22, 557, 675, 675, 50, /* 1220 */ 50, 51, 51, 51, 51, 135, 49, 49, 49, 49, - /* 1230 */ 48, 48, 47, 47, 47, 46, 216, 81, 1109, 91, + /* 1230 */ 48, 48, 47, 47, 47, 46, 216, 81, 1110, 91, /* 1240 */ 716, 91, 52, 53, 426, 289, 615, 722, 675, 675, /* 1250 */ 50, 50, 51, 51, 51, 51, 620, 49, 49, 49, - /* 1260 */ 49, 48, 48, 47, 47, 47, 46, 216, 604, 1107, + /* 1260 */ 49, 48, 48, 47, 47, 47, 46, 216, 604, 1108, /* 1270 */ 99, 504, 390, 491, 52, 53, 426, 289, 714, 713, /* 1280 */ 675, 675, 50, 50, 51, 51, 51, 51, 682, 49, /* 1290 */ 49, 49, 49, 48, 48, 47, 47, 47, 46, 216, @@ -395,7 +395,7 @@ static const YYACTIONTYPE yy_action[] = { /* 1480 */ 530, 714, 713, 651, 715, 714, 713, 38, 39, 64, /* 1490 */ 18, 399, 370, 431, 40, 129, 716, 366, 326, 534, /* 1500 */ 534, 63, 4, 270, 425, 714, 713, 642, 475, 422, - /* 1510 */ 316, 530, 687, 429, 716, 714, 713, 690, 279, 716, + /* 1510 */ 316, 530, 714, 429, 716, 714, 713, 690, 279, 716, /* 1520 */ 533, 716, 156, 624, 642, 689, 688, 687, 525, 716, /* 1530 */ 125, 411, 519, 714, 713, 514, 715, 714, 713, 3, /* 1540 */ 714, 713, 714, 713, 79, 525, 682, 85, 685, 519, @@ -408,9 +408,9 @@ static const YYACTIONTYPE yy_action[] = { /* 1610 */ 687, 438, 428, 411, 497, 62, 714, 713, 430, 119, /* 1620 */ 254, 714, 713, 714, 713, 430, 686, 181, 438, 704, /* 1630 */ 685, 714, 713, 686, 163, 41, 251, 629, 311, 161, - /* 1640 */ 138, 642, 715, 676, 9, 642, 455, 1035, 682, 531, + /* 1640 */ 138, 642, 715, 676, 9, 642, 455, 1036, 682, 531, /* 1650 */ 701, 702, 38, 39, 152, 641, 498, 469, 431, 40, - /* 1660 */ 499, 478, 699, 428, 715, 714, 713, 4, 1037, 425, + /* 1660 */ 499, 478, 699, 428, 715, 714, 713, 4, 1038, 425, /* 1670 */ 714, 713, 642, 416, 422, 715, 430, 687, 429, 641, /* 1680 */ 428, 350, 690, 619, 686, 172, 641, 494, 454, 642, /* 1690 */ 689, 688, 687, 430, 111, 428, 411, 286, 337, 714, @@ -794,59 +794,59 @@ static const short yy_reduce_ofst[] = { /* 310 */ 1573, 1506, 1462, 1462, 1462, 1540, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 729, 1037, 1142, 1142, 1026, 1026, 1026, 1142, 1026, 1026, - /* 10 */ 1026, 1026, 900, 1148, 1148, 1148, 1026, 1026, 1026, 1026, - /* 20 */ 1026, 1026, 1026, 1026, 1026, 1026, 1026, 1026, 1026, 1026, - /* 30 */ 1026, 1026, 1026, 1026, 1026, 1026, 1026, 1026, 1026, 1026, - /* 40 */ 1026, 1026, 1026, 1026, 1026, 1026, 1026, 1026, 1026, 1026, - /* 50 */ 1026, 1026, 1026, 1026, 1026, 1026, 1026, 1015, 1148, 894, - /* 60 */ 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 774, - /* 70 */ 890, 900, 1148, 1148, 1148, 1148, 1148, 962, 949, 940, - /* 80 */ 1148, 1148, 1148, 972, 972, 955, 842, 972, 1148, 1148, - /* 90 */ 1148, 1148, 928, 928, 1027, 1148, 766, 1112, 1117, 1013, - /* 100 */ 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 901, 1148, - /* 110 */ 1013, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, - /* 120 */ 1148, 963, 956, 950, 941, 1148, 1148, 1148, 1148, 1148, - /* 130 */ 1148, 1148, 1148, 1148, 1148, 890, 890, 1148, 1148, 890, - /* 140 */ 1148, 1148, 1148, 1014, 1148, 1148, 763, 1148, 1148, 1148, - /* 150 */ 735, 1058, 1148, 1148, 729, 1142, 1142, 1142, 1142, 1142, - /* 160 */ 1142, 1135, 880, 935, 906, 945, 933, 937, 1038, 1031, - /* 170 */ 1032, 1030, 936, 1027, 1027, 1027, 1027, 1027, 1027, 1027, - /* 180 */ 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 988, 1000, - /* 190 */ 987, 995, 1004, 999, 996, 990, 989, 991, 1148, 1148, - /* 200 */ 1148, 992, 1148, 1148, 1148, 1148, 1148, 893, 1148, 1148, - /* 210 */ 864, 1148, 1086, 1148, 1148, 776, 1148, 878, 738, 944, - /* 220 */ 918, 918, 809, 833, 798, 928, 918, 908, 1033, 928, - /* 230 */ 1148, 1148, 993, 891, 878, 1126, 909, 909, 909, 1111, - /* 240 */ 1111, 909, 909, 855, 909, 855, 909, 855, 909, 855, + /* 0 */ 729, 1038, 1143, 1143, 1027, 1027, 1027, 1143, 1027, 1027, + /* 10 */ 1027, 1027, 900, 1149, 1149, 1149, 1027, 1027, 1027, 1027, + /* 20 */ 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, + /* 30 */ 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, + /* 40 */ 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, + /* 50 */ 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1015, 1149, 894, + /* 60 */ 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 774, + /* 70 */ 890, 900, 1149, 1149, 1149, 1149, 1149, 962, 949, 940, + /* 80 */ 1149, 1149, 1149, 972, 972, 955, 842, 972, 1149, 1149, + /* 90 */ 1149, 1149, 928, 928, 1028, 1149, 766, 1113, 1118, 1013, + /* 100 */ 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 901, 1149, + /* 110 */ 1013, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, + /* 120 */ 1149, 963, 956, 950, 941, 1149, 1149, 1149, 1149, 1149, + /* 130 */ 1149, 1149, 1149, 1149, 1149, 890, 890, 1149, 1149, 890, + /* 140 */ 1149, 1149, 1149, 1014, 1149, 1149, 763, 1149, 1149, 1149, + /* 150 */ 735, 1059, 1149, 1149, 729, 1143, 1143, 1143, 1143, 1143, + /* 160 */ 1143, 1136, 880, 935, 906, 945, 933, 937, 1039, 1032, + /* 170 */ 1033, 1031, 936, 1028, 1028, 1028, 1028, 1028, 1028, 1028, + /* 180 */ 1028, 1028, 1018, 1028, 1028, 1028, 1028, 1028, 988, 1000, + /* 190 */ 987, 995, 1004, 999, 996, 990, 989, 991, 1149, 1149, + /* 200 */ 1149, 992, 1149, 1149, 1149, 1149, 1149, 893, 1149, 1149, + /* 210 */ 864, 1149, 1087, 1149, 1149, 776, 1149, 878, 738, 944, + /* 220 */ 918, 918, 809, 833, 798, 928, 918, 908, 1034, 928, + /* 230 */ 1149, 1149, 993, 891, 878, 1127, 909, 909, 909, 1112, + /* 240 */ 1112, 909, 909, 855, 909, 855, 909, 855, 909, 855, /* 250 */ 909, 760, 944, 909, 760, 846, 968, 909, 909, 846, - /* 260 */ 944, 909, 1093, 1091, 909, 760, 909, 760, 909, 1046, - /* 270 */ 844, 844, 844, 844, 825, 1046, 844, 809, 844, 825, - /* 280 */ 844, 844, 1148, 909, 909, 1148, 1046, 1052, 1046, 1027, - /* 290 */ 994, 934, 922, 932, 929, 944, 1148, 757, 828, 760, - /* 300 */ 746, 746, 734, 734, 734, 734, 1139, 1139, 1135, 811, - /* 310 */ 811, 896, 1003, 1002, 1001, 785, 1039, 1148, 1148, 1148, - /* 320 */ 1148, 1148, 1148, 1060, 1148, 1148, 1148, 1148, 1148, 1148, - /* 330 */ 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 730, 1148, - /* 340 */ 1148, 1148, 1148, 1148, 1129, 1148, 1148, 1148, 1148, 1148, - /* 350 */ 1148, 1090, 1089, 1148, 1148, 1148, 1148, 1148, 1148, 1148, - /* 360 */ 1148, 1148, 1148, 1078, 1148, 1148, 1148, 1148, 1148, 1148, - /* 370 */ 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, - /* 380 */ 1148, 1148, 1148, 1148, 867, 869, 1148, 1148, 1148, 868, - /* 390 */ 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 930, - /* 400 */ 1148, 923, 1148, 1036, 1148, 1017, 1025, 1148, 1148, 1148, - /* 410 */ 1148, 1148, 1016, 1148, 1148, 1148, 1144, 1148, 1148, 1148, - /* 420 */ 1143, 1148, 1148, 1148, 1148, 1148, 1028, 980, 1148, 979, - /* 430 */ 978, 769, 1148, 744, 1148, 726, 731, 1128, 1125, 1127, - /* 440 */ 1122, 1123, 1121, 1124, 1120, 1118, 1119, 1116, 1114, 1113, - /* 450 */ 1115, 1110, 1106, 1066, 1064, 1062, 1071, 1070, 1069, 1068, - /* 460 */ 1067, 1063, 1061, 1065, 1059, 959, 947, 938, 862, 1105, - /* 470 */ 1103, 1104, 1057, 1055, 1056, 861, 860, 859, 854, 853, - /* 480 */ 852, 851, 1132, 1141, 1140, 1138, 1137, 1136, 1130, 1131, - /* 490 */ 1044, 1043, 1041, 1040, 1042, 762, 1082, 1085, 1084, 1083, - /* 500 */ 1088, 1087, 1080, 1092, 1097, 1096, 1101, 1100, 1099, 1098, - /* 510 */ 1095, 1077, 967, 966, 964, 969, 961, 960, 965, 952, - /* 520 */ 958, 957, 948, 951, 847, 943, 939, 942, 863, 1081, + /* 260 */ 944, 909, 1094, 1092, 909, 760, 909, 760, 909, 1047, + /* 270 */ 844, 844, 844, 844, 825, 1047, 844, 809, 844, 825, + /* 280 */ 844, 844, 1149, 909, 909, 1149, 1047, 1053, 1047, 1028, + /* 290 */ 994, 934, 922, 932, 929, 944, 1149, 757, 828, 760, + /* 300 */ 746, 746, 734, 734, 734, 734, 1140, 1140, 1136, 811, + /* 310 */ 811, 896, 1003, 1002, 1001, 785, 1040, 1149, 1149, 1149, + /* 320 */ 1149, 1149, 1149, 1061, 1149, 1149, 1149, 1149, 1149, 1149, + /* 330 */ 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 730, 1149, + /* 340 */ 1149, 1149, 1149, 1149, 1130, 1149, 1149, 1149, 1149, 1149, + /* 350 */ 1149, 1091, 1090, 1149, 1149, 1149, 1149, 1149, 1149, 1149, + /* 360 */ 1149, 1149, 1149, 1079, 1149, 1149, 1149, 1149, 1149, 1149, + /* 370 */ 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, + /* 380 */ 1149, 1149, 1149, 1149, 867, 869, 1149, 1149, 1149, 868, + /* 390 */ 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 930, + /* 400 */ 1149, 923, 1149, 1037, 1149, 1017, 1026, 1149, 1149, 1149, + /* 410 */ 1149, 1149, 1016, 1149, 1149, 1149, 1145, 1149, 1149, 1149, + /* 420 */ 1144, 1149, 1149, 1149, 1149, 1149, 1029, 980, 1149, 979, + /* 430 */ 978, 769, 1149, 744, 1149, 726, 731, 1129, 1126, 1128, + /* 440 */ 1123, 1124, 1122, 1125, 1121, 1119, 1120, 1117, 1115, 1114, + /* 450 */ 1116, 1111, 1107, 1067, 1065, 1063, 1072, 1071, 1070, 1069, + /* 460 */ 1068, 1064, 1062, 1066, 1060, 959, 947, 938, 862, 1106, + /* 470 */ 1104, 1105, 1058, 1056, 1057, 861, 860, 859, 854, 853, + /* 480 */ 852, 851, 1133, 1142, 1141, 1139, 1138, 1137, 1131, 1132, + /* 490 */ 1045, 1044, 1042, 1041, 1043, 762, 1083, 1086, 1085, 1084, + /* 500 */ 1089, 1088, 1081, 1093, 1098, 1097, 1102, 1101, 1100, 1099, + /* 510 */ 1096, 1078, 967, 966, 964, 969, 961, 960, 965, 952, + /* 520 */ 958, 957, 948, 951, 847, 943, 939, 942, 863, 1082, /* 530 */ 858, 857, 856, 761, 756, 911, 755, 754, 765, 831, /* 540 */ 832, 840, 843, 838, 841, 837, 836, 835, 839, 834, /* 550 */ 830, 768, 767, 775, 824, 802, 800, 799, 803, 816, @@ -857,12 +857,12 @@ static const YYACTIONTYPE yy_default[] = { /* 600 */ 883, 882, 881, 917, 916, 915, 914, 913, 912, 905, /* 610 */ 903, 899, 898, 904, 902, 920, 921, 919, 897, 889, /* 620 */ 887, 888, 886, 974, 971, 973, 970, 907, 895, 892, - /* 630 */ 879, 925, 924, 1029, 1018, 1008, 1019, 910, 1007, 1005, - /* 640 */ 1028, 1025, 1020, 1102, 1024, 1012, 1011, 1010, 1147, 1145, - /* 650 */ 1146, 1049, 1051, 1054, 1053, 1050, 927, 926, 1048, 1047, - /* 660 */ 1009, 984, 781, 779, 780, 1074, 1073, 1076, 1075, 1072, - /* 670 */ 783, 782, 778, 777, 998, 997, 982, 1021, 1022, 981, - /* 680 */ 1023, 983, 770, 873, 866, 976, 975, 808, 807, 806, + /* 630 */ 879, 925, 924, 1030, 1019, 1008, 1020, 910, 1007, 1005, + /* 640 */ 1029, 1026, 1021, 1103, 1025, 1012, 1011, 1010, 1148, 1146, + /* 650 */ 1147, 1050, 1052, 1055, 1054, 1051, 927, 926, 1049, 1048, + /* 660 */ 1009, 984, 781, 779, 780, 1075, 1074, 1077, 1076, 1073, + /* 670 */ 783, 782, 778, 777, 998, 997, 982, 1022, 1023, 981, + /* 680 */ 1024, 983, 770, 873, 866, 976, 975, 808, 807, 806, /* 690 */ 805, 877, 876, 787, 801, 786, 784, 764, 759, 758, /* 700 */ 753, 751, 748, 750, 747, 752, 749, 745, 743, 742, /* 710 */ 741, 740, 739, 773, 772, 771, 769, 737, 736, 733, @@ -1462,136 +1462,137 @@ static const char *const yyRuleName[] = { /* 291 */ "exprx ::= expr not_opt BETWEEN expr AND", /* 292 */ "exprx ::= CASE case_operand case_exprlist case_else", /* 293 */ "exprx ::= expr not_opt IN LP exprlist", - /* 294 */ "exprx ::= expr not_opt IN ID_DB", - /* 295 */ "exprx ::= expr not_opt IN nm DOT ID_TAB", - /* 296 */ "exprx ::= ID_DB|ID_TAB|ID_COL|ID_FN", - /* 297 */ "exprx ::= nm DOT ID_TAB|ID_COL", - /* 298 */ "exprx ::= nm DOT nm DOT ID_COL", - /* 299 */ "exprx ::= expr COLLATE ID_COLLATE", - /* 300 */ "exprx ::= RAISE LP raisetype COMMA ID_ERR_MSG RP", - /* 301 */ "expr ::= exprx", - /* 302 */ "expr ::=", - /* 303 */ "not_opt ::=", - /* 304 */ "not_opt ::= NOT", - /* 305 */ "likeop ::= LIKE_KW|MATCH", - /* 306 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr", - /* 307 */ "case_exprlist ::= WHEN expr THEN expr", - /* 308 */ "case_else ::= ELSE expr", - /* 309 */ "case_else ::=", - /* 310 */ "case_operand ::= exprx", - /* 311 */ "case_operand ::=", - /* 312 */ "exprlist ::= nexprlist", - /* 313 */ "exprlist ::=", - /* 314 */ "nexprlist ::= nexprlist COMMA expr", - /* 315 */ "nexprlist ::= exprx", - /* 316 */ "cmd ::= CREATE uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP where_opt", - /* 317 */ "cmd ::= CREATE uniqueflag INDEX ifnotexists nm dbnm ON ID_TAB", - /* 318 */ "cmd ::= CREATE uniqueflag INDEX ifnotexists nm DOT ID_IDX_NEW", - /* 319 */ "cmd ::= CREATE uniqueflag INDEX ifnotexists ID_DB|ID_IDX_NEW", - /* 320 */ "uniqueflag ::= UNIQUE", - /* 321 */ "uniqueflag ::=", - /* 322 */ "idxlist_opt ::=", - /* 323 */ "idxlist_opt ::= LP idxlist RP", - /* 324 */ "idxlist ::= idxlist COMMA idxlist_single", - /* 325 */ "idxlist ::= idxlist_single", - /* 326 */ "idxlist_single ::= nm collate sortorder", - /* 327 */ "idxlist_single ::= ID_COL", - /* 328 */ "collate ::=", - /* 329 */ "collate ::= COLLATE ids", - /* 330 */ "collate ::= COLLATE ID_COLLATE", - /* 331 */ "cmd ::= DROP INDEX ifexists fullname", - /* 332 */ "cmd ::= DROP INDEX ifexists nm DOT ID_IDX", - /* 333 */ "cmd ::= DROP INDEX ifexists ID_DB|ID_IDX", - /* 334 */ "cmd ::= VACUUM", - /* 335 */ "cmd ::= VACUUM nm", - /* 336 */ "cmd ::= PRAGMA nm dbnm", - /* 337 */ "cmd ::= PRAGMA nm dbnm EQ nmnum", - /* 338 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP", - /* 339 */ "cmd ::= PRAGMA nm dbnm EQ minus_num", - /* 340 */ "cmd ::= PRAGMA nm dbnm LP minus_num RP", - /* 341 */ "cmd ::= PRAGMA nm DOT ID_PRAGMA", - /* 342 */ "cmd ::= PRAGMA ID_DB|ID_PRAGMA", - /* 343 */ "nmnum ::= plus_num", - /* 344 */ "nmnum ::= nm", - /* 345 */ "nmnum ::= ON", - /* 346 */ "nmnum ::= DELETE", - /* 347 */ "nmnum ::= DEFAULT", - /* 348 */ "plus_num ::= PLUS number", - /* 349 */ "plus_num ::= number", - /* 350 */ "minus_num ::= MINUS number", - /* 351 */ "number ::= INTEGER", - /* 352 */ "number ::= FLOAT", - /* 353 */ "cmd ::= CREATE temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON nm foreach_clause when_clause BEGIN trigger_cmd_list END", - /* 354 */ "cmd ::= CREATE temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON nm foreach_clause when_clause", - /* 355 */ "cmd ::= CREATE temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON nm foreach_clause when_clause BEGIN trigger_cmd_list", - /* 356 */ "cmd ::= CREATE temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON ID_TAB", - /* 357 */ "cmd ::= CREATE temp TRIGGER ifnotexists nm DOT ID_TRIG_NEW", - /* 358 */ "cmd ::= CREATE temp TRIGGER ifnotexists ID_DB|ID_TRIG_NEW", - /* 359 */ "trigger_time ::= BEFORE", - /* 360 */ "trigger_time ::= AFTER", - /* 361 */ "trigger_time ::= INSTEAD OF", - /* 362 */ "trigger_time ::=", - /* 363 */ "trigger_event ::= DELETE", - /* 364 */ "trigger_event ::= INSERT", - /* 365 */ "trigger_event ::= UPDATE", - /* 366 */ "trigger_event ::= UPDATE OF inscollist", - /* 367 */ "foreach_clause ::=", - /* 368 */ "foreach_clause ::= FOR EACH ROW", - /* 369 */ "when_clause ::=", - /* 370 */ "when_clause ::= WHEN expr", - /* 371 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI", - /* 372 */ "trigger_cmd_list ::= trigger_cmd SEMI", - /* 373 */ "trigger_cmd_list ::= SEMI", - /* 374 */ "trigger_cmd ::= update_stmt", - /* 375 */ "trigger_cmd ::= insert_stmt", - /* 376 */ "trigger_cmd ::= delete_stmt", - /* 377 */ "trigger_cmd ::= select_stmt", - /* 378 */ "raisetype ::= ROLLBACK|ABORT|FAIL", - /* 379 */ "cmd ::= DROP TRIGGER ifexists fullname", - /* 380 */ "cmd ::= DROP TRIGGER ifexists nm DOT ID_TRIG", - /* 381 */ "cmd ::= DROP TRIGGER ifexists ID_DB|ID_TRIG", - /* 382 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt", - /* 383 */ "cmd ::= DETACH database_kw_opt expr", - /* 384 */ "key_opt ::=", - /* 385 */ "key_opt ::= KEY expr", - /* 386 */ "database_kw_opt ::= DATABASE", - /* 387 */ "database_kw_opt ::=", - /* 388 */ "cmd ::= REINDEX", - /* 389 */ "cmd ::= REINDEX nm dbnm", - /* 390 */ "cmd ::= REINDEX ID_COLLATE", - /* 391 */ "cmd ::= REINDEX nm DOT ID_TAB|ID_IDX", - /* 392 */ "cmd ::= REINDEX ID_DB|ID_IDX|ID_TAB", - /* 393 */ "cmd ::= ANALYZE", - /* 394 */ "cmd ::= ANALYZE nm dbnm", - /* 395 */ "cmd ::= ANALYZE nm DOT ID_TAB|ID_IDX", - /* 396 */ "cmd ::= ANALYZE ID_DB|ID_IDX|ID_TAB", - /* 397 */ "cmd ::= ALTER TABLE fullname RENAME TO nm", - /* 398 */ "cmd ::= ALTER TABLE fullname ADD kwcolumn_opt column", - /* 399 */ "cmd ::= ALTER TABLE fullname RENAME TO ID_TAB_NEW", - /* 400 */ "cmd ::= ALTER TABLE nm DOT ID_TAB", - /* 401 */ "cmd ::= ALTER TABLE ID_DB|ID_TAB", - /* 402 */ "kwcolumn_opt ::=", - /* 403 */ "kwcolumn_opt ::= COLUMNKW", - /* 404 */ "cmd ::= create_vtab", - /* 405 */ "create_vtab ::= CREATE VIRTUAL TABLE ifnotexists nm dbnm USING nm", - /* 406 */ "create_vtab ::= CREATE VIRTUAL TABLE ifnotexists nm dbnm USING nm LP vtabarglist RP", - /* 407 */ "create_vtab ::= CREATE VIRTUAL TABLE ifnotexists nm DOT ID_TAB_NEW", - /* 408 */ "create_vtab ::= CREATE VIRTUAL TABLE ifnotexists ID_DB|ID_TAB_NEW", - /* 409 */ "vtabarglist ::= vtabarg", - /* 410 */ "vtabarglist ::= vtabarglist COMMA vtabarg", - /* 411 */ "vtabarg ::=", - /* 412 */ "vtabarg ::= vtabarg vtabargtoken", - /* 413 */ "vtabargtoken ::= ANY", - /* 414 */ "vtabargtoken ::= LP anylist RP", - /* 415 */ "anylist ::=", - /* 416 */ "anylist ::= anylist LP anylist RP", - /* 417 */ "anylist ::= anylist ANY", - /* 418 */ "with ::=", - /* 419 */ "with ::= WITH wqlist", - /* 420 */ "with ::= WITH RECURSIVE wqlist", - /* 421 */ "wqlist ::= nm idxlist_opt AS LP select RP", - /* 422 */ "wqlist ::= wqlist COMMA nm idxlist_opt AS LP select RP", - /* 423 */ "wqlist ::= ID_TAB_NEW", + /* 294 */ "exprx ::= LP expr", + /* 295 */ "exprx ::= expr not_opt IN ID_DB", + /* 296 */ "exprx ::= expr not_opt IN nm DOT ID_TAB", + /* 297 */ "exprx ::= ID_DB|ID_TAB|ID_COL|ID_FN", + /* 298 */ "exprx ::= nm DOT ID_TAB|ID_COL", + /* 299 */ "exprx ::= nm DOT nm DOT ID_COL", + /* 300 */ "exprx ::= expr COLLATE ID_COLLATE", + /* 301 */ "exprx ::= RAISE LP raisetype COMMA ID_ERR_MSG RP", + /* 302 */ "expr ::= exprx", + /* 303 */ "expr ::=", + /* 304 */ "not_opt ::=", + /* 305 */ "not_opt ::= NOT", + /* 306 */ "likeop ::= LIKE_KW|MATCH", + /* 307 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr", + /* 308 */ "case_exprlist ::= WHEN expr THEN expr", + /* 309 */ "case_else ::= ELSE expr", + /* 310 */ "case_else ::=", + /* 311 */ "case_operand ::= exprx", + /* 312 */ "case_operand ::=", + /* 313 */ "exprlist ::= nexprlist", + /* 314 */ "exprlist ::=", + /* 315 */ "nexprlist ::= nexprlist COMMA expr", + /* 316 */ "nexprlist ::= exprx", + /* 317 */ "cmd ::= CREATE uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP where_opt", + /* 318 */ "cmd ::= CREATE uniqueflag INDEX ifnotexists nm dbnm ON ID_TAB", + /* 319 */ "cmd ::= CREATE uniqueflag INDEX ifnotexists nm DOT ID_IDX_NEW", + /* 320 */ "cmd ::= CREATE uniqueflag INDEX ifnotexists ID_DB|ID_IDX_NEW", + /* 321 */ "uniqueflag ::= UNIQUE", + /* 322 */ "uniqueflag ::=", + /* 323 */ "idxlist_opt ::=", + /* 324 */ "idxlist_opt ::= LP idxlist RP", + /* 325 */ "idxlist ::= idxlist COMMA idxlist_single", + /* 326 */ "idxlist ::= idxlist_single", + /* 327 */ "idxlist_single ::= nm collate sortorder", + /* 328 */ "idxlist_single ::= ID_COL", + /* 329 */ "collate ::=", + /* 330 */ "collate ::= COLLATE ids", + /* 331 */ "collate ::= COLLATE ID_COLLATE", + /* 332 */ "cmd ::= DROP INDEX ifexists fullname", + /* 333 */ "cmd ::= DROP INDEX ifexists nm DOT ID_IDX", + /* 334 */ "cmd ::= DROP INDEX ifexists ID_DB|ID_IDX", + /* 335 */ "cmd ::= VACUUM", + /* 336 */ "cmd ::= VACUUM nm", + /* 337 */ "cmd ::= PRAGMA nm dbnm", + /* 338 */ "cmd ::= PRAGMA nm dbnm EQ nmnum", + /* 339 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP", + /* 340 */ "cmd ::= PRAGMA nm dbnm EQ minus_num", + /* 341 */ "cmd ::= PRAGMA nm dbnm LP minus_num RP", + /* 342 */ "cmd ::= PRAGMA nm DOT ID_PRAGMA", + /* 343 */ "cmd ::= PRAGMA ID_DB|ID_PRAGMA", + /* 344 */ "nmnum ::= plus_num", + /* 345 */ "nmnum ::= nm", + /* 346 */ "nmnum ::= ON", + /* 347 */ "nmnum ::= DELETE", + /* 348 */ "nmnum ::= DEFAULT", + /* 349 */ "plus_num ::= PLUS number", + /* 350 */ "plus_num ::= number", + /* 351 */ "minus_num ::= MINUS number", + /* 352 */ "number ::= INTEGER", + /* 353 */ "number ::= FLOAT", + /* 354 */ "cmd ::= CREATE temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON nm foreach_clause when_clause BEGIN trigger_cmd_list END", + /* 355 */ "cmd ::= CREATE temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON nm foreach_clause when_clause", + /* 356 */ "cmd ::= CREATE temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON nm foreach_clause when_clause BEGIN trigger_cmd_list", + /* 357 */ "cmd ::= CREATE temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON ID_TAB", + /* 358 */ "cmd ::= CREATE temp TRIGGER ifnotexists nm DOT ID_TRIG_NEW", + /* 359 */ "cmd ::= CREATE temp TRIGGER ifnotexists ID_DB|ID_TRIG_NEW", + /* 360 */ "trigger_time ::= BEFORE", + /* 361 */ "trigger_time ::= AFTER", + /* 362 */ "trigger_time ::= INSTEAD OF", + /* 363 */ "trigger_time ::=", + /* 364 */ "trigger_event ::= DELETE", + /* 365 */ "trigger_event ::= INSERT", + /* 366 */ "trigger_event ::= UPDATE", + /* 367 */ "trigger_event ::= UPDATE OF inscollist", + /* 368 */ "foreach_clause ::=", + /* 369 */ "foreach_clause ::= FOR EACH ROW", + /* 370 */ "when_clause ::=", + /* 371 */ "when_clause ::= WHEN expr", + /* 372 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI", + /* 373 */ "trigger_cmd_list ::= trigger_cmd SEMI", + /* 374 */ "trigger_cmd_list ::= SEMI", + /* 375 */ "trigger_cmd ::= update_stmt", + /* 376 */ "trigger_cmd ::= insert_stmt", + /* 377 */ "trigger_cmd ::= delete_stmt", + /* 378 */ "trigger_cmd ::= select_stmt", + /* 379 */ "raisetype ::= ROLLBACK|ABORT|FAIL", + /* 380 */ "cmd ::= DROP TRIGGER ifexists fullname", + /* 381 */ "cmd ::= DROP TRIGGER ifexists nm DOT ID_TRIG", + /* 382 */ "cmd ::= DROP TRIGGER ifexists ID_DB|ID_TRIG", + /* 383 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt", + /* 384 */ "cmd ::= DETACH database_kw_opt expr", + /* 385 */ "key_opt ::=", + /* 386 */ "key_opt ::= KEY expr", + /* 387 */ "database_kw_opt ::= DATABASE", + /* 388 */ "database_kw_opt ::=", + /* 389 */ "cmd ::= REINDEX", + /* 390 */ "cmd ::= REINDEX nm dbnm", + /* 391 */ "cmd ::= REINDEX ID_COLLATE", + /* 392 */ "cmd ::= REINDEX nm DOT ID_TAB|ID_IDX", + /* 393 */ "cmd ::= REINDEX ID_DB|ID_IDX|ID_TAB", + /* 394 */ "cmd ::= ANALYZE", + /* 395 */ "cmd ::= ANALYZE nm dbnm", + /* 396 */ "cmd ::= ANALYZE nm DOT ID_TAB|ID_IDX", + /* 397 */ "cmd ::= ANALYZE ID_DB|ID_IDX|ID_TAB", + /* 398 */ "cmd ::= ALTER TABLE fullname RENAME TO nm", + /* 399 */ "cmd ::= ALTER TABLE fullname ADD kwcolumn_opt column", + /* 400 */ "cmd ::= ALTER TABLE fullname RENAME TO ID_TAB_NEW", + /* 401 */ "cmd ::= ALTER TABLE nm DOT ID_TAB", + /* 402 */ "cmd ::= ALTER TABLE ID_DB|ID_TAB", + /* 403 */ "kwcolumn_opt ::=", + /* 404 */ "kwcolumn_opt ::= COLUMNKW", + /* 405 */ "cmd ::= create_vtab", + /* 406 */ "create_vtab ::= CREATE VIRTUAL TABLE ifnotexists nm dbnm USING nm", + /* 407 */ "create_vtab ::= CREATE VIRTUAL TABLE ifnotexists nm dbnm USING nm LP vtabarglist RP", + /* 408 */ "create_vtab ::= CREATE VIRTUAL TABLE ifnotexists nm DOT ID_TAB_NEW", + /* 409 */ "create_vtab ::= CREATE VIRTUAL TABLE ifnotexists ID_DB|ID_TAB_NEW", + /* 410 */ "vtabarglist ::= vtabarg", + /* 411 */ "vtabarglist ::= vtabarglist COMMA vtabarg", + /* 412 */ "vtabarg ::=", + /* 413 */ "vtabarg ::= vtabarg vtabargtoken", + /* 414 */ "vtabargtoken ::= ANY", + /* 415 */ "vtabargtoken ::= LP anylist RP", + /* 416 */ "anylist ::=", + /* 417 */ "anylist ::= anylist LP anylist RP", + /* 418 */ "anylist ::= anylist ANY", + /* 419 */ "with ::=", + /* 420 */ "with ::= WITH wqlist", + /* 421 */ "with ::= WITH RECURSIVE wqlist", + /* 422 */ "wqlist ::= nm idxlist_opt AS LP select RP", + /* 423 */ "wqlist ::= wqlist COMMA nm idxlist_opt AS LP select RP", + /* 424 */ "wqlist ::= ID_TAB_NEW", }; #endif /* NDEBUG */ @@ -2519,6 +2520,7 @@ static const struct { { 251, 5 }, { 251, 4 }, { 251, 5 }, + { 251, 2 }, { 251, 4 }, { 251, 6 }, { 251, 1 }, @@ -2735,11 +2737,11 @@ static void yy_reduce( {yygotominor.yy225 = new ParserStubExplain(true, true);} break; case 8: /* cmdx ::= cmd */ - case 374: /* trigger_cmd ::= update_stmt */ yytestcase(yyruleno==374); - case 375: /* trigger_cmd ::= insert_stmt */ yytestcase(yyruleno==375); - case 376: /* trigger_cmd ::= delete_stmt */ yytestcase(yyruleno==376); - case 377: /* trigger_cmd ::= select_stmt */ yytestcase(yyruleno==377); - case 404: /* cmd ::= create_vtab */ yytestcase(yyruleno==404); + case 375: /* trigger_cmd ::= update_stmt */ yytestcase(yyruleno==375); + case 376: /* trigger_cmd ::= insert_stmt */ yytestcase(yyruleno==376); + case 377: /* trigger_cmd ::= delete_stmt */ yytestcase(yyruleno==377); + case 378: /* trigger_cmd ::= select_stmt */ yytestcase(yyruleno==378); + case 405: /* cmd ::= create_vtab */ yytestcase(yyruleno==405); {yygotominor.yy399 = yymsp[0].minor.yy399;} break; case 9: /* cmd ::= BEGIN transtype trans_opt */ @@ -2828,10 +2830,10 @@ static void yy_reduce( case 86: /* autoinc ::= AUTOINCR */ yytestcase(yyruleno==86); case 108: /* tconscomma ::= COMMA */ yytestcase(yyruleno==108); case 130: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==130); - case 304: /* not_opt ::= NOT */ yytestcase(yyruleno==304); - case 320: /* uniqueflag ::= UNIQUE */ yytestcase(yyruleno==320); - case 386: /* database_kw_opt ::= DATABASE */ yytestcase(yyruleno==386); - case 402: /* kwcolumn_opt ::= */ yytestcase(yyruleno==402); + case 305: /* not_opt ::= NOT */ yytestcase(yyruleno==305); + case 321: /* uniqueflag ::= UNIQUE */ yytestcase(yyruleno==321); + case 387: /* database_kw_opt ::= DATABASE */ yytestcase(yyruleno==387); + case 403: /* kwcolumn_opt ::= */ yytestcase(yyruleno==403); {yygotominor.yy237 = new bool(true);} break; case 22: /* savepoint_opt ::= */ @@ -2839,10 +2841,10 @@ static void yy_reduce( case 85: /* autoinc ::= */ yytestcase(yyruleno==85); case 109: /* tconscomma ::= */ yytestcase(yyruleno==109); case 131: /* ifexists ::= */ yytestcase(yyruleno==131); - case 303: /* not_opt ::= */ yytestcase(yyruleno==303); - case 321: /* uniqueflag ::= */ yytestcase(yyruleno==321); - case 387: /* database_kw_opt ::= */ yytestcase(yyruleno==387); - case 403: /* kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==403); + case 304: /* not_opt ::= */ yytestcase(yyruleno==304); + case 322: /* uniqueflag ::= */ yytestcase(yyruleno==322); + case 388: /* database_kw_opt ::= */ yytestcase(yyruleno==388); + case 404: /* kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==404); {yygotominor.yy237 = new bool(false);} break; case 23: /* cmd ::= SAVEPOINT nm */ @@ -2914,22 +2916,22 @@ static void yy_reduce( break; case 31: /* cmd ::= CREATE temp TABLE ifnotexists nm DOT ID_TAB_NEW */ case 133: /* cmd ::= CREATE temp VIEW ifnotexists nm DOT ID_VIEW_NEW */ yytestcase(yyruleno==133); - case 357: /* cmd ::= CREATE temp TRIGGER ifnotexists nm DOT ID_TRIG_NEW */ yytestcase(yyruleno==357); + case 358: /* cmd ::= CREATE temp TRIGGER ifnotexists nm DOT ID_TRIG_NEW */ yytestcase(yyruleno==358); { yy_destructor(yypParser,179,&yymsp[-5].minor); yy_destructor(yypParser,177,&yymsp[-2].minor); } break; case 32: /* cmd ::= CREATE temp TABLE ifnotexists ID_DB|ID_TAB_NEW */ case 134: /* cmd ::= CREATE temp VIEW ifnotexists ID_DB|ID_VIEW_NEW */ yytestcase(yyruleno==134); - case 358: /* cmd ::= CREATE temp TRIGGER ifnotexists ID_DB|ID_TRIG_NEW */ yytestcase(yyruleno==358); + case 359: /* cmd ::= CREATE temp TRIGGER ifnotexists ID_DB|ID_TRIG_NEW */ yytestcase(yyruleno==359); { yy_destructor(yypParser,179,&yymsp[-3].minor); } break; case 33: /* table_options ::= */ case 185: /* dbnm ::= */ yytestcase(yyruleno==185); - case 328: /* collate ::= */ yytestcase(yyruleno==328); - case 411: /* vtabarg ::= */ yytestcase(yyruleno==411); - case 415: /* anylist ::= */ yytestcase(yyruleno==415); + case 329: /* collate ::= */ yytestcase(yyruleno==329); + case 412: /* vtabarg ::= */ yytestcase(yyruleno==412); + case 416: /* anylist ::= */ yytestcase(yyruleno==416); {yygotominor.yy211 = new QString();} break; case 34: /* table_options ::= WITHOUT nm */ @@ -2974,8 +2976,8 @@ static void yy_reduce( case 47: /* nm ::= id */ yytestcase(yyruleno==47); case 55: /* typename ::= ids */ yytestcase(yyruleno==55); case 186: /* dbnm ::= DOT nm */ yytestcase(yyruleno==186); - case 329: /* collate ::= COLLATE ids */ yytestcase(yyruleno==329); - case 330: /* collate ::= COLLATE ID_COLLATE */ yytestcase(yyruleno==330); + case 330: /* collate ::= COLLATE ids */ yytestcase(yyruleno==330); + case 331: /* collate ::= COLLATE ID_COLLATE */ yytestcase(yyruleno==331); {yygotominor.yy211 = yymsp[0].minor.yy211;} break; case 45: /* id ::= ID */ @@ -3035,9 +3037,9 @@ static void yy_reduce( break; case 58: /* signed ::= plus_num */ case 59: /* signed ::= minus_num */ yytestcase(yyruleno==59); - case 343: /* nmnum ::= plus_num */ yytestcase(yyruleno==343); - case 348: /* plus_num ::= PLUS number */ yytestcase(yyruleno==348); - case 349: /* plus_num ::= number */ yytestcase(yyruleno==349); + case 344: /* nmnum ::= plus_num */ yytestcase(yyruleno==344); + case 349: /* plus_num ::= PLUS number */ yytestcase(yyruleno==349); + case 350: /* plus_num ::= number */ yytestcase(yyruleno==350); {yygotominor.yy21 = yymsp[0].minor.yy21;} break; case 60: /* carglist ::= carglist ccons */ @@ -3202,9 +3204,9 @@ static void yy_reduce( } break; case 84: /* term ::= STRING|BLOB */ - case 345: /* nmnum ::= ON */ yytestcase(yyruleno==345); - case 346: /* nmnum ::= DELETE */ yytestcase(yyruleno==346); - case 347: /* nmnum ::= DEFAULT */ yytestcase(yyruleno==347); + case 346: /* nmnum ::= ON */ yytestcase(yyruleno==346); + case 347: /* nmnum ::= DELETE */ yytestcase(yyruleno==347); + case 348: /* nmnum ::= DEFAULT */ yytestcase(yyruleno==348); {yygotominor.yy21 = new QVariant(yymsp[0].minor.yy0->value);} break; case 87: /* refargs ::= */ @@ -3389,23 +3391,23 @@ static void yy_reduce( case 179: /* singlesrc ::= ID_DB|ID_TAB */ yytestcase(yyruleno==179); case 180: /* singlesrc ::= nm DOT ID_VIEW */ yytestcase(yyruleno==180); case 181: /* singlesrc ::= ID_DB|ID_VIEW */ yytestcase(yyruleno==181); - case 297: /* exprx ::= nm DOT ID_TAB|ID_COL */ yytestcase(yyruleno==297); - case 318: /* cmd ::= CREATE uniqueflag INDEX ifnotexists nm DOT ID_IDX_NEW */ yytestcase(yyruleno==318); - case 319: /* cmd ::= CREATE uniqueflag INDEX ifnotexists ID_DB|ID_IDX_NEW */ yytestcase(yyruleno==319); - case 332: /* cmd ::= DROP INDEX ifexists nm DOT ID_IDX */ yytestcase(yyruleno==332); - case 333: /* cmd ::= DROP INDEX ifexists ID_DB|ID_IDX */ yytestcase(yyruleno==333); - case 341: /* cmd ::= PRAGMA nm DOT ID_PRAGMA */ yytestcase(yyruleno==341); - case 342: /* cmd ::= PRAGMA ID_DB|ID_PRAGMA */ yytestcase(yyruleno==342); - case 380: /* cmd ::= DROP TRIGGER ifexists nm DOT ID_TRIG */ yytestcase(yyruleno==380); - case 381: /* cmd ::= DROP TRIGGER ifexists ID_DB|ID_TRIG */ yytestcase(yyruleno==381); - case 391: /* cmd ::= REINDEX nm DOT ID_TAB|ID_IDX */ yytestcase(yyruleno==391); - case 392: /* cmd ::= REINDEX ID_DB|ID_IDX|ID_TAB */ yytestcase(yyruleno==392); - case 395: /* cmd ::= ANALYZE nm DOT ID_TAB|ID_IDX */ yytestcase(yyruleno==395); - case 396: /* cmd ::= ANALYZE ID_DB|ID_IDX|ID_TAB */ yytestcase(yyruleno==396); - case 400: /* cmd ::= ALTER TABLE nm DOT ID_TAB */ yytestcase(yyruleno==400); - case 401: /* cmd ::= ALTER TABLE ID_DB|ID_TAB */ yytestcase(yyruleno==401); - case 407: /* create_vtab ::= CREATE VIRTUAL TABLE ifnotexists nm DOT ID_TAB_NEW */ yytestcase(yyruleno==407); - case 408: /* create_vtab ::= CREATE VIRTUAL TABLE ifnotexists ID_DB|ID_TAB_NEW */ yytestcase(yyruleno==408); + case 298: /* exprx ::= nm DOT ID_TAB|ID_COL */ yytestcase(yyruleno==298); + case 319: /* cmd ::= CREATE uniqueflag INDEX ifnotexists nm DOT ID_IDX_NEW */ yytestcase(yyruleno==319); + case 320: /* cmd ::= CREATE uniqueflag INDEX ifnotexists ID_DB|ID_IDX_NEW */ yytestcase(yyruleno==320); + case 333: /* cmd ::= DROP INDEX ifexists nm DOT ID_IDX */ yytestcase(yyruleno==333); + case 334: /* cmd ::= DROP INDEX ifexists ID_DB|ID_IDX */ yytestcase(yyruleno==334); + case 342: /* cmd ::= PRAGMA nm DOT ID_PRAGMA */ yytestcase(yyruleno==342); + case 343: /* cmd ::= PRAGMA ID_DB|ID_PRAGMA */ yytestcase(yyruleno==343); + case 381: /* cmd ::= DROP TRIGGER ifexists nm DOT ID_TRIG */ yytestcase(yyruleno==381); + case 382: /* cmd ::= DROP TRIGGER ifexists ID_DB|ID_TRIG */ yytestcase(yyruleno==382); + case 392: /* cmd ::= REINDEX nm DOT ID_TAB|ID_IDX */ yytestcase(yyruleno==392); + case 393: /* cmd ::= REINDEX ID_DB|ID_IDX|ID_TAB */ yytestcase(yyruleno==393); + case 396: /* cmd ::= ANALYZE nm DOT ID_TAB|ID_IDX */ yytestcase(yyruleno==396); + case 397: /* cmd ::= ANALYZE ID_DB|ID_IDX|ID_TAB */ yytestcase(yyruleno==397); + case 401: /* cmd ::= ALTER TABLE nm DOT ID_TAB */ yytestcase(yyruleno==401); + case 402: /* cmd ::= ALTER TABLE ID_DB|ID_TAB */ yytestcase(yyruleno==402); + case 408: /* create_vtab ::= CREATE VIRTUAL TABLE ifnotexists nm DOT ID_TAB_NEW */ yytestcase(yyruleno==408); + case 409: /* create_vtab ::= CREATE VIRTUAL TABLE ifnotexists ID_DB|ID_TAB_NEW */ yytestcase(yyruleno==409); { yy_destructor(yypParser,177,&yymsp[-2].minor); } break; @@ -3801,11 +3803,11 @@ static void yy_reduce( {yygotominor.yy226 = new SqliteSortOrder(SqliteSortOrder::null);} break; case 205: /* groupby_opt ::= */ - case 313: /* exprlist ::= */ yytestcase(yyruleno==313); + case 314: /* exprlist ::= */ yytestcase(yyruleno==314); {yygotominor.yy13 = new ParserExprList();} break; case 206: /* groupby_opt ::= GROUP BY nexprlist */ - case 312: /* exprlist ::= nexprlist */ yytestcase(yyruleno==312); + case 313: /* exprlist ::= nexprlist */ yytestcase(yyruleno==313); {yygotominor.yy13 = yymsp[0].minor.yy13;} break; case 207: /* groupby_opt ::= GROUP BY */ @@ -3816,19 +3818,19 @@ static void yy_reduce( break; case 208: /* having_opt ::= */ case 220: /* where_opt ::= */ yytestcase(yyruleno==220); - case 309: /* case_else ::= */ yytestcase(yyruleno==309); - case 311: /* case_operand ::= */ yytestcase(yyruleno==311); - case 369: /* when_clause ::= */ yytestcase(yyruleno==369); - case 384: /* key_opt ::= */ yytestcase(yyruleno==384); + case 310: /* case_else ::= */ yytestcase(yyruleno==310); + case 312: /* case_operand ::= */ yytestcase(yyruleno==312); + case 370: /* when_clause ::= */ yytestcase(yyruleno==370); + case 385: /* key_opt ::= */ yytestcase(yyruleno==385); {yygotominor.yy490 = nullptr;} break; case 209: /* having_opt ::= HAVING expr */ case 221: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==221); - case 301: /* expr ::= exprx */ yytestcase(yyruleno==301); - case 308: /* case_else ::= ELSE expr */ yytestcase(yyruleno==308); - case 310: /* case_operand ::= exprx */ yytestcase(yyruleno==310); - case 370: /* when_clause ::= WHEN expr */ yytestcase(yyruleno==370); - case 385: /* key_opt ::= KEY expr */ yytestcase(yyruleno==385); + case 302: /* expr ::= exprx */ yytestcase(yyruleno==302); + case 309: /* case_else ::= ELSE expr */ yytestcase(yyruleno==309); + case 311: /* case_operand ::= exprx */ yytestcase(yyruleno==311); + case 371: /* when_clause ::= WHEN expr */ yytestcase(yyruleno==371); + case 386: /* key_opt ::= KEY expr */ yytestcase(yyruleno==386); {yygotominor.yy490 = yymsp[0].minor.yy490;} break; case 210: /* limit_opt ::= */ @@ -4401,64 +4403,72 @@ static void yy_reduce( parserContext->minorErrorBeforeNextToken("Syntax error"); } break; - case 294: /* exprx ::= expr not_opt IN ID_DB */ + case 294: /* exprx ::= LP expr */ +{ + yygotominor.yy490 = new SqliteExpr(); + yygotominor.yy490->initSubExpr(yymsp[0].minor.yy490); + objectForTokens = yygotominor.yy490; + parserContext->minorErrorBeforeNextToken("Syntax error"); + } + break; + case 295: /* exprx ::= expr not_opt IN ID_DB */ { yy_destructor(yypParser,199,&yymsp[-3].minor); } break; - case 295: /* exprx ::= expr not_opt IN nm DOT ID_TAB */ - case 296: /* exprx ::= ID_DB|ID_TAB|ID_COL|ID_FN */ yytestcase(yyruleno==296); + case 296: /* exprx ::= expr not_opt IN nm DOT ID_TAB */ + case 297: /* exprx ::= ID_DB|ID_TAB|ID_COL|ID_FN */ yytestcase(yyruleno==297); { yy_destructor(yypParser,199,&yymsp[-5].minor); yy_destructor(yypParser,177,&yymsp[-2].minor); } break; - case 298: /* exprx ::= nm DOT nm DOT ID_COL */ + case 299: /* exprx ::= nm DOT nm DOT ID_COL */ { yy_destructor(yypParser,177,&yymsp[-4].minor); yy_destructor(yypParser,177,&yymsp[-2].minor); } break; - case 299: /* exprx ::= expr COLLATE ID_COLLATE */ - case 300: /* exprx ::= RAISE LP raisetype COMMA ID_ERR_MSG RP */ yytestcase(yyruleno==300); + case 300: /* exprx ::= expr COLLATE ID_COLLATE */ + case 301: /* exprx ::= RAISE LP raisetype COMMA ID_ERR_MSG RP */ yytestcase(yyruleno==301); { yy_destructor(yypParser,199,&yymsp[-2].minor); } break; - case 302: /* expr ::= */ + case 303: /* expr ::= */ { yygotominor.yy490 = new SqliteExpr(); objectForTokens = yygotominor.yy490; parserContext->minorErrorAfterLastToken("Syntax error"); } break; - case 305: /* likeop ::= LIKE_KW|MATCH */ + case 306: /* likeop ::= LIKE_KW|MATCH */ {yygotominor.yy374 = new SqliteExpr::LikeOp(SqliteExpr::likeOp(yymsp[0].minor.yy0->value));} break; - case 306: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */ + case 307: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */ { yymsp[-4].minor.yy13->append(yymsp[-2].minor.yy490); yymsp[-4].minor.yy13->append(yymsp[0].minor.yy490); yygotominor.yy13 = yymsp[-4].minor.yy13; } break; - case 307: /* case_exprlist ::= WHEN expr THEN expr */ + case 308: /* case_exprlist ::= WHEN expr THEN expr */ { yygotominor.yy13 = new ParserExprList(); yygotominor.yy13->append(yymsp[-2].minor.yy490); yygotominor.yy13->append(yymsp[0].minor.yy490); } break; - case 314: /* nexprlist ::= nexprlist COMMA expr */ + case 315: /* nexprlist ::= nexprlist COMMA expr */ { yymsp[-2].minor.yy13->append(yymsp[0].minor.yy490); yygotominor.yy13 = yymsp[-2].minor.yy13; DONT_INHERIT_TOKENS("nexprlist"); } break; - case 315: /* nexprlist ::= exprx */ + case 316: /* nexprlist ::= exprx */ { yygotominor.yy13 = new ParserExprList(); yygotominor.yy13->append(yymsp[0].minor.yy490); } break; - case 316: /* cmd ::= CREATE uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP where_opt */ + case 317: /* cmd ::= CREATE uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP where_opt */ { yygotominor.yy399 = new SqliteCreateIndex( *(yymsp[-10].minor.yy237), @@ -4478,31 +4488,31 @@ static void yy_reduce( objectForTokens = yygotominor.yy399; } break; - case 317: /* cmd ::= CREATE uniqueflag INDEX ifnotexists nm dbnm ON ID_TAB */ + case 318: /* cmd ::= CREATE uniqueflag INDEX ifnotexists nm dbnm ON ID_TAB */ { yy_destructor(yypParser,177,&yymsp[-3].minor); } break; - case 322: /* idxlist_opt ::= */ + case 323: /* idxlist_opt ::= */ {yygotominor.yy139 = new ParserIndexedColumnList();} break; - case 323: /* idxlist_opt ::= LP idxlist RP */ + case 324: /* idxlist_opt ::= LP idxlist RP */ {yygotominor.yy139 = yymsp[-1].minor.yy139;} break; - case 324: /* idxlist ::= idxlist COMMA idxlist_single */ + case 325: /* idxlist ::= idxlist COMMA idxlist_single */ { yymsp[-2].minor.yy139->append(yymsp[0].minor.yy90); yygotominor.yy139 = yymsp[-2].minor.yy139; DONT_INHERIT_TOKENS("idxlist"); } break; - case 325: /* idxlist ::= idxlist_single */ + case 326: /* idxlist ::= idxlist_single */ { yygotominor.yy139 = new ParserIndexedColumnList(); yygotominor.yy139->append(yymsp[0].minor.yy90); } break; - case 326: /* idxlist_single ::= nm collate sortorder */ - case 327: /* idxlist_single ::= ID_COL */ yytestcase(yyruleno==327); + case 327: /* idxlist_single ::= nm collate sortorder */ + case 328: /* idxlist_single ::= ID_COL */ yytestcase(yyruleno==328); { SqliteIndexedColumn* obj = new SqliteIndexedColumn( @@ -4517,7 +4527,7 @@ static void yy_reduce( objectForTokens = yygotominor.yy90; } break; - case 331: /* cmd ::= DROP INDEX ifexists fullname */ + case 332: /* cmd ::= DROP INDEX ifexists fullname */ { yygotominor.yy399 = new SqliteDropIndex(*(yymsp[-1].minor.yy237), yymsp[0].minor.yy66->name1, yymsp[0].minor.yy66->name2); delete yymsp[-1].minor.yy237; @@ -4525,20 +4535,20 @@ static void yy_reduce( objectForTokens = yygotominor.yy399; } break; - case 334: /* cmd ::= VACUUM */ + case 335: /* cmd ::= VACUUM */ { yygotominor.yy399 = new SqliteVacuum(); objectForTokens = yygotominor.yy399; } break; - case 335: /* cmd ::= VACUUM nm */ + case 336: /* cmd ::= VACUUM nm */ { yygotominor.yy399 = new SqliteVacuum(*(yymsp[0].minor.yy211)); delete yymsp[0].minor.yy211; objectForTokens = yygotominor.yy399; } break; - case 336: /* cmd ::= PRAGMA nm dbnm */ + case 337: /* cmd ::= PRAGMA nm dbnm */ { yygotominor.yy399 = new SqlitePragma(*(yymsp[-1].minor.yy211), *(yymsp[0].minor.yy211)); delete yymsp[-1].minor.yy211; @@ -4546,8 +4556,8 @@ static void yy_reduce( objectForTokens = yygotominor.yy399; } break; - case 337: /* cmd ::= PRAGMA nm dbnm EQ nmnum */ - case 339: /* cmd ::= PRAGMA nm dbnm EQ minus_num */ yytestcase(yyruleno==339); + case 338: /* cmd ::= PRAGMA nm dbnm EQ nmnum */ + case 340: /* cmd ::= PRAGMA nm dbnm EQ minus_num */ yytestcase(yyruleno==340); { yygotominor.yy399 = new SqlitePragma(*(yymsp[-3].minor.yy211), *(yymsp[-2].minor.yy211), *(yymsp[0].minor.yy21), true); delete yymsp[-3].minor.yy211; @@ -4556,8 +4566,8 @@ static void yy_reduce( objectForTokens = yygotominor.yy399; } break; - case 338: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */ - case 340: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */ yytestcase(yyruleno==340); + case 339: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */ + case 341: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */ yytestcase(yyruleno==341); { yygotominor.yy399 = new SqlitePragma(*(yymsp[-4].minor.yy211), *(yymsp[-3].minor.yy211), *(yymsp[-1].minor.yy21), false); delete yymsp[-4].minor.yy211; @@ -4566,13 +4576,13 @@ static void yy_reduce( objectForTokens = yygotominor.yy399; } break; - case 344: /* nmnum ::= nm */ + case 345: /* nmnum ::= nm */ { yygotominor.yy21 = new QVariant(*(yymsp[0].minor.yy211)); delete yymsp[0].minor.yy211; } break; - case 350: /* minus_num ::= MINUS number */ + case 351: /* minus_num ::= MINUS number */ { if (yymsp[0].minor.yy21->type() == QVariant::Double) *(yymsp[0].minor.yy21) = -(yymsp[0].minor.yy21->toDouble()); @@ -4584,13 +4594,13 @@ static void yy_reduce( yygotominor.yy21 = yymsp[0].minor.yy21; } break; - case 351: /* number ::= INTEGER */ + case 352: /* number ::= INTEGER */ {yygotominor.yy21 = new QVariant(QVariant(yymsp[0].minor.yy0->value).toLongLong());} break; - case 352: /* number ::= FLOAT */ + case 353: /* number ::= FLOAT */ {yygotominor.yy21 = new QVariant(QVariant(yymsp[0].minor.yy0->value).toDouble());} break; - case 353: /* cmd ::= CREATE temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON nm foreach_clause when_clause BEGIN trigger_cmd_list END */ + case 354: /* cmd ::= CREATE temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON nm foreach_clause when_clause BEGIN trigger_cmd_list END */ { yygotominor.yy399 = new SqliteCreateTrigger( *(yymsp[-13].minor.yy376), @@ -4616,7 +4626,7 @@ static void yy_reduce( objectForTokens = yygotominor.yy399; } break; - case 354: /* cmd ::= CREATE temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON nm foreach_clause when_clause */ + case 355: /* cmd ::= CREATE temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON nm foreach_clause when_clause */ { QList<SqliteQuery *> CL; @@ -4644,7 +4654,7 @@ static void yy_reduce( parserContext->minorErrorAfterLastToken("Syntax error"); } break; - case 355: /* cmd ::= CREATE temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON nm foreach_clause when_clause BEGIN trigger_cmd_list */ + case 356: /* cmd ::= CREATE temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON nm foreach_clause when_clause BEGIN trigger_cmd_list */ { yygotominor.yy399 = new SqliteCreateTrigger( *(yymsp[-12].minor.yy376), @@ -4671,79 +4681,79 @@ static void yy_reduce( parserContext->minorErrorAfterLastToken("Syntax error"); } break; - case 356: /* cmd ::= CREATE temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON ID_TAB */ + case 357: /* cmd ::= CREATE temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON ID_TAB */ { yy_destructor(yypParser,179,&yymsp[-8].minor); yy_destructor(yypParser,177,&yymsp[-5].minor); yy_destructor(yypParser,262,&yymsp[-3].minor); yy_destructor(yypParser,263,&yymsp[-2].minor); } break; - case 359: /* trigger_time ::= BEFORE */ + case 360: /* trigger_time ::= BEFORE */ {yygotominor.yy152 = new SqliteCreateTrigger::Time(SqliteCreateTrigger::Time::BEFORE);} break; - case 360: /* trigger_time ::= AFTER */ + case 361: /* trigger_time ::= AFTER */ {yygotominor.yy152 = new SqliteCreateTrigger::Time(SqliteCreateTrigger::Time::AFTER);} break; - case 361: /* trigger_time ::= INSTEAD OF */ + case 362: /* trigger_time ::= INSTEAD OF */ {yygotominor.yy152 = new SqliteCreateTrigger::Time(SqliteCreateTrigger::Time::INSTEAD_OF);} break; - case 362: /* trigger_time ::= */ + case 363: /* trigger_time ::= */ {yygotominor.yy152 = new SqliteCreateTrigger::Time(SqliteCreateTrigger::Time::null);} break; - case 363: /* trigger_event ::= DELETE */ + case 364: /* trigger_event ::= DELETE */ { yygotominor.yy309 = new SqliteCreateTrigger::Event(SqliteCreateTrigger::Event::DELETE); objectForTokens = yygotominor.yy309; } break; - case 364: /* trigger_event ::= INSERT */ + case 365: /* trigger_event ::= INSERT */ { yygotominor.yy309 = new SqliteCreateTrigger::Event(SqliteCreateTrigger::Event::INSERT); objectForTokens = yygotominor.yy309; } break; - case 365: /* trigger_event ::= UPDATE */ + case 366: /* trigger_event ::= UPDATE */ { yygotominor.yy309 = new SqliteCreateTrigger::Event(SqliteCreateTrigger::Event::UPDATE); objectForTokens = yygotominor.yy309; } break; - case 366: /* trigger_event ::= UPDATE OF inscollist */ + case 367: /* trigger_event ::= UPDATE OF inscollist */ { yygotominor.yy309 = new SqliteCreateTrigger::Event(*(yymsp[0].minor.yy445)); delete yymsp[0].minor.yy445; objectForTokens = yygotominor.yy309; } break; - case 367: /* foreach_clause ::= */ + case 368: /* foreach_clause ::= */ {yygotominor.yy409 = new SqliteCreateTrigger::Scope(SqliteCreateTrigger::Scope::null);} break; - case 368: /* foreach_clause ::= FOR EACH ROW */ + case 369: /* foreach_clause ::= FOR EACH ROW */ {yygotominor.yy409 = new SqliteCreateTrigger::Scope(SqliteCreateTrigger::Scope::FOR_EACH_ROW);} break; - case 371: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */ + case 372: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */ { yymsp[-2].minor.yy214->append(yymsp[-1].minor.yy399); yygotominor.yy214 = yymsp[-2].minor.yy214; DONT_INHERIT_TOKENS("trigger_cmd_list"); } break; - case 372: /* trigger_cmd_list ::= trigger_cmd SEMI */ + case 373: /* trigger_cmd_list ::= trigger_cmd SEMI */ { yygotominor.yy214 = new ParserQueryList(); yygotominor.yy214->append(yymsp[-1].minor.yy399); } break; - case 373: /* trigger_cmd_list ::= SEMI */ + case 374: /* trigger_cmd_list ::= SEMI */ { yygotominor.yy214 = new ParserQueryList(); parserContext->minorErrorAfterLastToken("Syntax error"); } break; - case 378: /* raisetype ::= ROLLBACK|ABORT|FAIL */ + case 379: /* raisetype ::= ROLLBACK|ABORT|FAIL */ {yygotominor.yy0 = yymsp[0].minor.yy0;} break; - case 379: /* cmd ::= DROP TRIGGER ifexists fullname */ + case 380: /* cmd ::= DROP TRIGGER ifexists fullname */ { yygotominor.yy399 = new SqliteDropTrigger(*(yymsp[-1].minor.yy237), yymsp[0].minor.yy66->name1, yymsp[0].minor.yy66->name2); delete yymsp[-1].minor.yy237; @@ -4751,25 +4761,25 @@ static void yy_reduce( objectForTokens = yygotominor.yy399; } break; - case 382: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */ + case 383: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */ { yygotominor.yy399 = new SqliteAttach(*(yymsp[-4].minor.yy237), yymsp[-3].minor.yy490, yymsp[-1].minor.yy490, yymsp[0].minor.yy490); delete yymsp[-4].minor.yy237; objectForTokens = yygotominor.yy399; } break; - case 383: /* cmd ::= DETACH database_kw_opt expr */ + case 384: /* cmd ::= DETACH database_kw_opt expr */ { yygotominor.yy399 = new SqliteDetach(*(yymsp[-1].minor.yy237), yymsp[0].minor.yy490); delete yymsp[-1].minor.yy237; objectForTokens = yygotominor.yy399; } break; - case 388: /* cmd ::= REINDEX */ + case 389: /* cmd ::= REINDEX */ {yygotominor.yy399 = new SqliteReindex();} break; - case 389: /* cmd ::= REINDEX nm dbnm */ - case 390: /* cmd ::= REINDEX ID_COLLATE */ yytestcase(yyruleno==390); + case 390: /* cmd ::= REINDEX nm dbnm */ + case 391: /* cmd ::= REINDEX ID_COLLATE */ yytestcase(yyruleno==391); { yygotominor.yy399 = new SqliteReindex(*(yymsp[-1].minor.yy211), *(yymsp[0].minor.yy211)); delete yymsp[-1].minor.yy211; @@ -4777,13 +4787,13 @@ static void yy_reduce( objectForTokens = yygotominor.yy399; } break; - case 393: /* cmd ::= ANALYZE */ + case 394: /* cmd ::= ANALYZE */ { yygotominor.yy399 = new SqliteAnalyze(); objectForTokens = yygotominor.yy399; } break; - case 394: /* cmd ::= ANALYZE nm dbnm */ + case 395: /* cmd ::= ANALYZE nm dbnm */ { yygotominor.yy399 = new SqliteAnalyze(*(yymsp[-1].minor.yy211), *(yymsp[0].minor.yy211)); delete yymsp[-1].minor.yy211; @@ -4791,7 +4801,7 @@ static void yy_reduce( objectForTokens = yygotominor.yy399; } break; - case 397: /* cmd ::= ALTER TABLE fullname RENAME TO nm */ + case 398: /* cmd ::= ALTER TABLE fullname RENAME TO nm */ { yygotominor.yy399 = new SqliteAlterTable( yymsp[-3].minor.yy66->name1, @@ -4803,7 +4813,7 @@ static void yy_reduce( objectForTokens = yygotominor.yy399; } break; - case 398: /* cmd ::= ALTER TABLE fullname ADD kwcolumn_opt column */ + case 399: /* cmd ::= ALTER TABLE fullname ADD kwcolumn_opt column */ { yygotominor.yy399 = new SqliteAlterTable( yymsp[-3].minor.yy66->name1, @@ -4816,11 +4826,11 @@ static void yy_reduce( objectForTokens = yygotominor.yy399; } break; - case 399: /* cmd ::= ALTER TABLE fullname RENAME TO ID_TAB_NEW */ + case 400: /* cmd ::= ALTER TABLE fullname RENAME TO ID_TAB_NEW */ { yy_destructor(yypParser,181,&yymsp[-3].minor); } break; - case 405: /* create_vtab ::= CREATE VIRTUAL TABLE ifnotexists nm dbnm USING nm */ + case 406: /* create_vtab ::= CREATE VIRTUAL TABLE ifnotexists nm dbnm USING nm */ { yygotominor.yy399 = new SqliteCreateVirtualTable( *(yymsp[-4].minor.yy237), @@ -4835,7 +4845,7 @@ static void yy_reduce( objectForTokens = yygotominor.yy399; } break; - case 406: /* create_vtab ::= CREATE VIRTUAL TABLE ifnotexists nm dbnm USING nm LP vtabarglist RP */ + case 407: /* create_vtab ::= CREATE VIRTUAL TABLE ifnotexists nm dbnm USING nm LP vtabarglist RP */ { yygotominor.yy399 = new SqliteCreateVirtualTable( *(yymsp[-7].minor.yy237), @@ -4852,14 +4862,14 @@ static void yy_reduce( objectForTokens = yygotominor.yy399; } break; - case 409: /* vtabarglist ::= vtabarg */ + case 410: /* vtabarglist ::= vtabarg */ { yygotominor.yy445 = new ParserStringList(); yygotominor.yy445->append((yymsp[0].minor.yy211)->mid(1)); // mid(1) to skip the first whitespace added in vtabarg delete yymsp[0].minor.yy211; } break; - case 410: /* vtabarglist ::= vtabarglist COMMA vtabarg */ + case 411: /* vtabarglist ::= vtabarglist COMMA vtabarg */ { yymsp[-2].minor.yy445->append((yymsp[0].minor.yy211)->mid(1)); // mid(1) to skip the first whitespace added in vtabarg yygotominor.yy445 = yymsp[-2].minor.yy445; @@ -4867,19 +4877,19 @@ static void yy_reduce( DONT_INHERIT_TOKENS("vtabarglist"); } break; - case 412: /* vtabarg ::= vtabarg vtabargtoken */ + case 413: /* vtabarg ::= vtabarg vtabargtoken */ { yymsp[-1].minor.yy211->append(" "+ *(yymsp[0].minor.yy211)); yygotominor.yy211 = yymsp[-1].minor.yy211; delete yymsp[0].minor.yy211; } break; - case 413: /* vtabargtoken ::= ANY */ + case 414: /* vtabargtoken ::= ANY */ { yygotominor.yy211 = new QString(yymsp[0].minor.yy0->value); } break; - case 414: /* vtabargtoken ::= LP anylist RP */ + case 415: /* vtabargtoken ::= LP anylist RP */ { yygotominor.yy211 = new QString("("); yygotominor.yy211->append(*(yymsp[-1].minor.yy211)); @@ -4887,7 +4897,7 @@ static void yy_reduce( delete yymsp[-1].minor.yy211; } break; - case 416: /* anylist ::= anylist LP anylist RP */ + case 417: /* anylist ::= anylist LP anylist RP */ { yygotominor.yy211 = yymsp[-3].minor.yy211; yygotominor.yy211->append("("); @@ -4897,37 +4907,37 @@ static void yy_reduce( DONT_INHERIT_TOKENS("anylist"); } break; - case 417: /* anylist ::= anylist ANY */ + case 418: /* anylist ::= anylist ANY */ { yygotominor.yy211 = yymsp[-1].minor.yy211; yygotominor.yy211->append(yymsp[0].minor.yy0->value); DONT_INHERIT_TOKENS("anylist"); } break; - case 418: /* with ::= */ + case 419: /* with ::= */ {yygotominor.yy367 = nullptr;} break; - case 419: /* with ::= WITH wqlist */ + case 420: /* with ::= WITH wqlist */ { yygotominor.yy367 = yymsp[0].minor.yy367; objectForTokens = yygotominor.yy367; } break; - case 420: /* with ::= WITH RECURSIVE wqlist */ + case 421: /* with ::= WITH RECURSIVE wqlist */ { yygotominor.yy367 = yymsp[0].minor.yy367; yygotominor.yy367->recursive = true; objectForTokens = yygotominor.yy367; } break; - case 421: /* wqlist ::= nm idxlist_opt AS LP select RP */ + case 422: /* wqlist ::= nm idxlist_opt AS LP select RP */ { yygotominor.yy367 = SqliteWith::append(*(yymsp[-5].minor.yy211), *(yymsp[-4].minor.yy139), yymsp[-1].minor.yy123); delete yymsp[-5].minor.yy211; delete yymsp[-4].minor.yy139; } break; - case 422: /* wqlist ::= wqlist COMMA nm idxlist_opt AS LP select RP */ + case 423: /* wqlist ::= wqlist COMMA nm idxlist_opt AS LP select RP */ { yygotominor.yy367 = SqliteWith::append(yymsp[-7].minor.yy367, *(yymsp[-5].minor.yy211), *(yymsp[-4].minor.yy139), yymsp[-1].minor.yy123); delete yymsp[-5].minor.yy211; @@ -4935,7 +4945,7 @@ static void yy_reduce( DONT_INHERIT_TOKENS("wqlist"); } break; - case 423: /* wqlist ::= ID_TAB_NEW */ + case 424: /* wqlist ::= ID_TAB_NEW */ { parserContext->minorErrorBeforeNextToken("Syntax error"); yygotominor.yy367 = new SqliteWith(); diff --git a/SQLiteStudio3/coreSQLiteStudio/parser/sqlite3_parse.y b/SQLiteStudio3/coreSQLiteStudio/parser/sqlite3_parse.y index a249f6e..65a4dd7 100644 --- a/SQLiteStudio3/coreSQLiteStudio/parser/sqlite3_parse.y +++ b/SQLiteStudio3/coreSQLiteStudio/parser/sqlite3_parse.y @@ -1738,7 +1738,12 @@ exprx(X) ::= expr(E) not_opt(N) IN LP objectForTokens = X; parserContext->minorErrorBeforeNextToken("Syntax error"); } - +exprx(X) ::= LP expr(E). { + X = new SqliteExpr(); + X->initSubExpr(E); + objectForTokens = X; + parserContext->minorErrorBeforeNextToken("Syntax error"); + } exprx ::= expr not_opt IN ID_DB. [IN] {} exprx ::= expr not_opt IN nm DOT ID_TAB. [IN] {} diff --git a/SQLiteStudio3/coreSQLiteStudio/plugins/exportplugin.h b/SQLiteStudio3/coreSQLiteStudio/plugins/exportplugin.h index 06aded7..8c269e2 100644 --- a/SQLiteStudio3/coreSQLiteStudio/plugins/exportplugin.h +++ b/SQLiteStudio3/coreSQLiteStudio/plugins/exportplugin.h @@ -224,6 +224,7 @@ class ExportPlugin : virtual public Plugin * @param database "Attach" name of the database that the table belongs to. Can be "main", "temp", or any attach name. * @param table Name of the table to export. * @param columnNames Name of columns in the table, in order they will appear in the rows passed to exportTableRow(). + * This will be empty if data is not being exported. This is different than for exportTable(), where columnNames are always present. * @param ddl The DDL of the table. * @param createTable Table DDL parsed into an object. * @param providedData All data entries requested by the plugin in the return value of getProviderFlags(). diff --git a/SQLiteStudio3/coreSQLiteStudio/plugins/genericexportplugin.h b/SQLiteStudio3/coreSQLiteStudio/plugins/genericexportplugin.h index 1719baa..0edbde6 100644 --- a/SQLiteStudio3/coreSQLiteStudio/plugins/genericexportplugin.h +++ b/SQLiteStudio3/coreSQLiteStudio/plugins/genericexportplugin.h @@ -6,6 +6,8 @@ class API_EXPORT GenericExportPlugin : virtual public GenericPlugin, public ExportPlugin { + Q_OBJECT + public: bool initBeforeExport(Db* db, QIODevice* output, const ExportManager::StandardExportConfig& config); ExportManager::ExportModes getSupportedModes() const; diff --git a/SQLiteStudio3/coreSQLiteStudio/plugins/populateconstant.ui b/SQLiteStudio3/coreSQLiteStudio/plugins/populateconstant.ui index 39e80e1..ddd1131 100644 --- a/SQLiteStudio3/coreSQLiteStudio/plugins/populateconstant.ui +++ b/SQLiteStudio3/coreSQLiteStudio/plugins/populateconstant.ui @@ -11,7 +11,7 @@ </rect> </property> <property name="windowTitle"> - <string>Form</string> + <string notr="true">Form</string> </property> <layout class="QVBoxLayout" name="verticalLayout"> <item> @@ -23,7 +23,7 @@ <item> <widget class="QLineEdit" name="valueEdit"> <property name="cfg" stdset="0"> - <string>PopulateConstant.Value</string> + <string notr="true">PopulateConstant.Value</string> </property> </widget> </item> diff --git a/SQLiteStudio3/coreSQLiteStudio/plugins/populatedictionary.ui b/SQLiteStudio3/coreSQLiteStudio/plugins/populatedictionary.ui index f99491f..6a28476 100644 --- a/SQLiteStudio3/coreSQLiteStudio/plugins/populatedictionary.ui +++ b/SQLiteStudio3/coreSQLiteStudio/plugins/populatedictionary.ui @@ -11,7 +11,7 @@ </rect> </property> <property name="windowTitle"> - <string>Form</string> + <string notr="true">Form</string> </property> <layout class="QVBoxLayout" name="verticalLayout"> <item> @@ -23,7 +23,7 @@ <item> <widget class="FileEdit" name="fileEdit" native="true"> <property name="cfg" stdset="0"> - <string>PopulateDictionary.File</string> + <string notr="true">PopulateDictionary.File</string> </property> <property name="dialogTitle" stdset="0"> <string>Pick dictionary file</string> @@ -41,12 +41,12 @@ <layout class="QVBoxLayout" name="verticalLayout_2"> <item> <widget class="ConfigRadioButton" name="whitespaceRadio"> - <property name="cfg" stdset="0"> - <string>PopulateDictionary.Lines</string> - </property> <property name="text"> <string>Whitespace</string> </property> + <property name="cfg" stdset="0"> + <string notr="true">PopulateDictionary.Lines</string> + </property> <property name="assignedValue" stdset="0"> <bool>false</bool> </property> @@ -54,12 +54,12 @@ </item> <item> <widget class="ConfigRadioButton" name="libeBreakRadio"> - <property name="cfg" stdset="0"> - <string>PopulateDictionary.Lines</string> - </property> <property name="text"> <string>Line break</string> </property> + <property name="cfg" stdset="0"> + <string notr="true">PopulateDictionary.Lines</string> + </property> <property name="assignedValue" stdset="0"> <bool>true</bool> </property> @@ -76,12 +76,12 @@ <layout class="QVBoxLayout" name="verticalLayout_3"> <item> <widget class="ConfigRadioButton" name="orderedRadio"> - <property name="cfg" stdset="0"> - <string>PopulateDictionary.Random</string> - </property> <property name="text"> <string>Ordered</string> </property> + <property name="cfg" stdset="0"> + <string notr="true">PopulateDictionary.Random</string> + </property> <property name="assignedValue" stdset="0"> <bool>false</bool> </property> @@ -89,12 +89,12 @@ </item> <item> <widget class="ConfigRadioButton" name="randomlyRadio"> - <property name="cfg" stdset="0"> - <string>PopulateDictionary.Random</string> - </property> <property name="text"> <string>Randomly</string> </property> + <property name="cfg" stdset="0"> + <string notr="true">PopulateDictionary.Random</string> + </property> <property name="assignedValue" stdset="0"> <bool>true</bool> </property> diff --git a/SQLiteStudio3/coreSQLiteStudio/plugins/populaterandom.ui b/SQLiteStudio3/coreSQLiteStudio/plugins/populaterandom.ui index fb304ea..4e7853e 100644 --- a/SQLiteStudio3/coreSQLiteStudio/plugins/populaterandom.ui +++ b/SQLiteStudio3/coreSQLiteStudio/plugins/populaterandom.ui @@ -11,7 +11,7 @@ </rect> </property> <property name="windowTitle"> - <string>Form</string> + <string notr="true">Form</string> </property> <layout class="QGridLayout" name="gridLayout"> <item row="2" column="0"> @@ -22,12 +22,12 @@ <layout class="QVBoxLayout" name="verticalLayout_4"> <item> <widget class="QLineEdit" name="prefixEdit"> - <property name="cfg" stdset="0"> - <string>PopulateRandom.Prefix</string> - </property> <property name="placeholderText"> <string>No prefix</string> </property> + <property name="cfg" stdset="0"> + <string notr="true">PopulateRandom.Prefix</string> + </property> </widget> </item> </layout> @@ -41,15 +41,15 @@ <layout class="QVBoxLayout" name="verticalLayout_2"> <item> <widget class="QSpinBox" name="minSpin"> - <property name="cfg" stdset="0"> - <string>PopulateRandom.MinValue</string> - </property> <property name="minimum"> <number>-999999999</number> </property> <property name="maximum"> <number>999999999</number> </property> + <property name="cfg" stdset="0"> + <string notr="true">PopulateRandom.MinValue</string> + </property> </widget> </item> </layout> @@ -63,9 +63,6 @@ <layout class="QVBoxLayout" name="verticalLayout_3"> <item> <widget class="QSpinBox" name="maxSpin"> - <property name="cfg" stdset="0"> - <string>PopulateRandom.MaxValue</string> - </property> <property name="minimum"> <number>-999999999</number> </property> @@ -75,6 +72,9 @@ <property name="value"> <number>999999999</number> </property> + <property name="cfg" stdset="0"> + <string notr="true">PopulateRandom.MaxValue</string> + </property> </widget> </item> </layout> @@ -88,12 +88,12 @@ <layout class="QHBoxLayout" name="horizontalLayout"> <item> <widget class="QLineEdit" name="suffixEdit"> - <property name="cfg" stdset="0"> - <string>PopulateRandom.Suffix</string> - </property> <property name="placeholderText"> <string>No suffix</string> </property> + <property name="cfg" stdset="0"> + <string notr="true">PopulateRandom.Suffix</string> + </property> </widget> </item> </layout> diff --git a/SQLiteStudio3/coreSQLiteStudio/plugins/populaterandomtext.ui b/SQLiteStudio3/coreSQLiteStudio/plugins/populaterandomtext.ui index 28febde..00ff1e5 100644 --- a/SQLiteStudio3/coreSQLiteStudio/plugins/populaterandomtext.ui +++ b/SQLiteStudio3/coreSQLiteStudio/plugins/populaterandomtext.ui @@ -11,20 +11,20 @@ </rect> </property> <property name="windowTitle"> - <string>Form</string> + <string notr="true">Form</string> </property> <layout class="QGridLayout" name="gridLayout"> <item row="1" column="0" colspan="2"> <widget class="ConfigRadioButton" name="commonSetRadio"> - <property name="cfg" stdset="0"> - <string>PopulateRandomText.UseCustomSets</string> - </property> <property name="text"> <string>Use characters from common sets:</string> </property> <property name="checked"> <bool>true</bool> </property> + <property name="cfg" stdset="0"> + <string notr="true">PopulateRandomText.UseCustomSets</string> + </property> <property name="assignedValue" stdset="0"> <bool>false</bool> </property> @@ -38,12 +38,12 @@ <layout class="QVBoxLayout" name="verticalLayout_3"> <item> <widget class="QSpinBox" name="minLengthSpin"> - <property name="cfg" stdset="0"> - <string>PopulateRandomText.MinLength</string> - </property> <property name="maximum"> <number>999999999</number> </property> + <property name="cfg" stdset="0"> + <string notr="true">PopulateRandomText.MinLength</string> + </property> </widget> </item> </layout> @@ -63,12 +63,12 @@ <property name="toolTip"> <string>Letters from a to z.</string> </property> - <property name="cfg" stdset="0"> - <string>PopulateRandomText.IncludeAlpha</string> - </property> <property name="text"> <string>Alpha</string> </property> + <property name="cfg" stdset="0"> + <string notr="true">PopulateRandomText.IncludeAlpha</string> + </property> </widget> </item> <item> @@ -76,12 +76,12 @@ <property name="toolTip"> <string>Numbers from 0 to 9.</string> </property> - <property name="cfg" stdset="0"> - <string>PopulateRandomText.IncludeNumeric</string> - </property> <property name="text"> <string>Numeric</string> </property> + <property name="cfg" stdset="0"> + <string notr="true">PopulateRandomText.IncludeNumeric</string> + </property> </widget> </item> <item> @@ -89,12 +89,12 @@ <property name="toolTip"> <string>A whitespace, a tab and a new line character.</string> </property> - <property name="cfg" stdset="0"> - <string>PopulateRandomText.IncludeWhitespace</string> - </property> <property name="text"> <string>Whitespace</string> </property> + <property name="cfg" stdset="0"> + <string notr="true">PopulateRandomText.IncludeWhitespace</string> + </property> </widget> </item> <item> @@ -102,12 +102,12 @@ <property name="toolTip"> <string>Includes all above and all others.</string> </property> - <property name="cfg" stdset="0"> - <string>PopulateRandomText.IncludeBinary</string> - </property> <property name="text"> <string>Binary</string> </property> + <property name="cfg" stdset="0"> + <string notr="true">PopulateRandomText.IncludeBinary</string> + </property> </widget> </item> </layout> @@ -115,12 +115,12 @@ </item> <item row="3" column="0" colspan="2"> <widget class="ConfigRadioButton" name="customSetRadio"> - <property name="cfg" stdset="0"> - <string>PopulateRandomText.UseCustomSets</string> - </property> <property name="text"> <string>Use characters from my custom set:</string> </property> + <property name="cfg" stdset="0"> + <string notr="true">PopulateRandomText.UseCustomSets</string> + </property> <property name="assignedValue" stdset="0"> <bool>true</bool> </property> @@ -134,12 +134,12 @@ <layout class="QVBoxLayout" name="verticalLayout_4"> <item> <widget class="QSpinBox" name="maxLengthSpin"> - <property name="cfg" stdset="0"> - <string>PopulateRandomText.MaxLength</string> - </property> <property name="maximum"> <number>999999999</number> </property> + <property name="cfg" stdset="0"> + <string notr="true">PopulateRandomText.MaxLength</string> + </property> </widget> </item> </layout> @@ -160,7 +160,7 @@ <string>If you type some character multiple times, it's more likely to be used.</string> </property> <property name="cfg" stdset="0"> - <string>PopulateRandomText.CustomCharacters</string> + <string notr="true">PopulateRandomText.CustomCharacters</string> </property> </widget> </item> diff --git a/SQLiteStudio3/coreSQLiteStudio/plugins/populatescript.ui b/SQLiteStudio3/coreSQLiteStudio/plugins/populatescript.ui index 8d37994..7e530f5 100644 --- a/SQLiteStudio3/coreSQLiteStudio/plugins/populatescript.ui +++ b/SQLiteStudio3/coreSQLiteStudio/plugins/populatescript.ui @@ -11,7 +11,7 @@ </rect> </property> <property name="windowTitle"> - <string>Form</string> + <string notr="true">Form</string> </property> <property name="initialSize" stdset="0"> <size> @@ -29,7 +29,7 @@ <item> <widget class="QPlainTextEdit" name="initCodeEdit"> <property name="cfg" stdset="0"> - <string>PopulateScript.InitCode</string> + <string notr="true">PopulateScript.InitCode</string> </property> <property name="scriptingEdit" stdset="0"> <bool>true</bool> @@ -48,7 +48,7 @@ <item> <widget class="QPlainTextEdit" name="codeEdit"> <property name="cfg" stdset="0"> - <string>PopulateScript.Code</string> + <string notr="true">PopulateScript.Code</string> </property> <property name="scriptingEdit" stdset="0"> <bool>true</bool> @@ -73,7 +73,7 @@ <item> <widget class="QComboBox" name="langCombo"> <property name="cfg" stdset="0"> - <string>PopulateScript.Language</string> + <string notr="true">PopulateScript.Language</string> </property> <property name="ScriptingLangCombo" stdset="0"> <bool>true</bool> @@ -92,13 +92,13 @@ <item> <widget class="QToolButton" name="toolButton"> <property name="text"> - <string>...</string> + <string notr="true">...</string> </property> <property name="openUrl" stdset="0"> - <string>http://sqlitestudio.pl/wiki/index.php/Official_plugins#Script_.28built-in.29</string> + <string notr="true">http://sqlitestudio.pl/wiki/index.php/Official_plugins#Script_.28built-in.29</string> </property> <property name="customIcon" stdset="0"> - <string>help</string> + <string notr="true">help</string> </property> </widget> </item> diff --git a/SQLiteStudio3/coreSQLiteStudio/plugins/populatesequence.ui b/SQLiteStudio3/coreSQLiteStudio/plugins/populatesequence.ui index 231af85..20c7064 100644 --- a/SQLiteStudio3/coreSQLiteStudio/plugins/populatesequence.ui +++ b/SQLiteStudio3/coreSQLiteStudio/plugins/populatesequence.ui @@ -11,20 +11,20 @@ </rect> </property> <property name="windowTitle"> - <string>Form</string> + <string notr="true">Form</string> </property> <layout class="QGridLayout" name="gridLayout"> <item row="0" column="1"> <widget class="QSpinBox" name="startValueSpin"> - <property name="cfg" stdset="0"> - <string>PopulateSequence.StartValue</string> - </property> <property name="minimum"> <number>-99999999</number> </property> <property name="maximum"> <number>99999999</number> </property> + <property name="cfg" stdset="0"> + <string notr="true">PopulateSequence.StartValue</string> + </property> </widget> </item> <item row="0" column="0"> @@ -36,9 +36,6 @@ </item> <item row="1" column="1"> <widget class="QSpinBox" name="stepSpin"> - <property name="cfg" stdset="0"> - <string>PopulateSequence.Step</string> - </property> <property name="minimum"> <number>-999999</number> </property> @@ -48,6 +45,9 @@ <property name="value"> <number>1</number> </property> + <property name="cfg" stdset="0"> + <string notr="true">PopulateSequence.Step</string> + </property> </widget> </item> <item row="1" column="0"> diff --git a/SQLiteStudio3/coreSQLiteStudio/populateworker.cpp b/SQLiteStudio3/coreSQLiteStudio/populateworker.cpp index 71ab9a4..0b08526 100644 --- a/SQLiteStudio3/coreSQLiteStudio/populateworker.cpp +++ b/SQLiteStudio3/coreSQLiteStudio/populateworker.cpp @@ -48,12 +48,7 @@ void PopulateWorker::run() args.clear(); for (PopulateEngine* engine : engines) - { args << engine->nextValue(nextValueError); - db->rollback(); - emit finished(false); - return; - } query->setArgs(args); if (!query->execute()) diff --git a/SQLiteStudio3/coreSQLiteStudio/schemaresolver.cpp b/SQLiteStudio3/coreSQLiteStudio/schemaresolver.cpp index a1ceca5..f14d23d 100644 --- a/SQLiteStudio3/coreSQLiteStudio/schemaresolver.cpp +++ b/SQLiteStudio3/coreSQLiteStudio/schemaresolver.cpp @@ -306,7 +306,7 @@ QString SchemaResolver::getObjectDdl(const QString &database, const QString &nam // Validate query results if (!results.isValid() || results.isNull()) { - qDebug() << "Could not get object's DDL:" << database << "." << name; + qDebug() << "Could not get object's DDL:" << dbName << "." << name; return QString::null; } @@ -458,9 +458,10 @@ QStringList SchemaResolver::getAllObjects(const QString& database) return resList; } -QString SchemaResolver::getUniqueName(const QString& database, const QString& namePrefix) +QString SchemaResolver::getUniqueName(const QString& database, const QString& namePrefix, const QStringList& forbiddenNames) { QStringList allObjects = getAllObjects(database); + allObjects += forbiddenNames; QString baseName = namePrefix; QString name = baseName; for (int i = 0; allObjects.contains(name); i++) @@ -469,9 +470,9 @@ QString SchemaResolver::getUniqueName(const QString& database, const QString& na return name; } -QString SchemaResolver::getUniqueName(const QString& namePrefix) +QString SchemaResolver::getUniqueName(const QString& namePrefix, const QStringList& forbiddenNames) { - return getUniqueName("main", namePrefix); + return getUniqueName("main", namePrefix, forbiddenNames); } QStringList SchemaResolver::getFkReferencingTables(const QString& table) diff --git a/SQLiteStudio3/coreSQLiteStudio/schemaresolver.h b/SQLiteStudio3/coreSQLiteStudio/schemaresolver.h index e1a8d5d..5316f5a 100644 --- a/SQLiteStudio3/coreSQLiteStudio/schemaresolver.h +++ b/SQLiteStudio3/coreSQLiteStudio/schemaresolver.h @@ -52,8 +52,8 @@ class API_EXPORT SchemaResolver QStringList getObjects(const QString& database, const QString& type); QStringList getAllObjects(); QStringList getAllObjects(const QString& database); - QString getUniqueName(const QString& database, const QString& namePrefix); - QString getUniqueName(const QString& namePrefix = QString::null); + QString getUniqueName(const QString& database, const QString& namePrefix, const QStringList& forbiddenNames = QStringList()); + QString getUniqueName(const QString& namePrefix = QString::null, const QStringList& forbiddenNames = QStringList()); QStringList getFkReferencingTables(const QString& table); QStringList getFkReferencingTables(const QString& database, const QString& table); diff --git a/SQLiteStudio3/coreSQLiteStudio/services/config.h b/SQLiteStudio3/coreSQLiteStudio/services/config.h index 5a3f594..6e1fd95 100644 --- a/SQLiteStudio3/coreSQLiteStudio/services/config.h +++ b/SQLiteStudio3/coreSQLiteStudio/services/config.h @@ -23,6 +23,7 @@ CFG_CATEGORIES(Core, CFG_ENTRY(QString, LoadedPlugins, "") CFG_ENTRY(QVariantHash, ActiveCodeFormatter, QVariantHash()) CFG_ENTRY(bool, CheckUpdatesOnStartup, true) + CFG_ENTRY(QString, Language, "en") ) CFG_CATEGORY(Console, CFG_ENTRY(int, HistorySize, 100) diff --git a/SQLiteStudio3/coreSQLiteStudio/services/exportmanager.cpp b/SQLiteStudio3/coreSQLiteStudio/services/exportmanager.cpp index 6f916bc..c9b272d 100644 --- a/SQLiteStudio3/coreSQLiteStudio/services/exportmanager.cpp +++ b/SQLiteStudio3/coreSQLiteStudio/services/exportmanager.cpp @@ -221,7 +221,7 @@ void ExportManager::finalizeExport(bool result, QIODevice* output) else if (!config->outputFileName.isEmpty()) notifyInfo(tr("Export to the file '%1' was successful.").arg(config->outputFileName)); else - notifyInfo(tr("Export to was successful.").arg(config->outputFileName)); + notifyInfo(tr("Export was successful.")); emit exportSuccessful(); } diff --git a/SQLiteStudio3/coreSQLiteStudio/services/extralicensemanager.cpp b/SQLiteStudio3/coreSQLiteStudio/services/extralicensemanager.cpp index 23fb513..2bdc712 100644 --- a/SQLiteStudio3/coreSQLiteStudio/services/extralicensemanager.cpp +++ b/SQLiteStudio3/coreSQLiteStudio/services/extralicensemanager.cpp @@ -1,16 +1,63 @@ #include "extralicensemanager.h" +#include <QDebug> +#include <QFile> ExtraLicenseManager::ExtraLicenseManager() { } +ExtraLicenseManager::~ExtraLicenseManager() +{ + for (License* lic : licenses.values()) + delete lic; + + licenses.clear(); +} + bool ExtraLicenseManager::addLicense(const QString& title, const QString& filePath) { - if (licenses.contains(title)) + return addLicense(title, filePath, Type::FILE); +} + +bool ExtraLicenseManager::addLicenseContents(const QString& title, const QString& contents) +{ + return addLicense(title, contents, Type::CONTENTS); +} + +void ExtraLicenseManager::setViolatedLicense(const QString& title, const QString& violationMessage) +{ + if (!licenses.contains(title)) + return; + + License* lic = licenses[title]; + lic->violated = true; + lic->violationMessage = violationMessage; +} + +void ExtraLicenseManager::unsetViolatedLicense(const QString& title) +{ + if (!licenses.contains(title)) + return; + + License* lic = licenses[title]; + lic->violated = false; + lic->violationMessage = QString(); +} + +bool ExtraLicenseManager::isViolatedLicense(const QString& title) +{ + if (!licenses.contains(title)) return false; - licenses[title] = filePath; - return true; + return licenses[title]->violated; +} + +QString ExtraLicenseManager::getViolationMessage(const QString& title) +{ + if (!licenses.contains(title)) + return QString::null; + + return licenses[title]->violationMessage; } bool ExtraLicenseManager::removeLicense(const QString& title) @@ -18,11 +65,53 @@ bool ExtraLicenseManager::removeLicense(const QString& title) if (!licenses.contains(title)) return false; + delete licenses[title]; licenses.remove(title); return true; } -const QHash<QString, QString>&ExtraLicenseManager::getLicenses() const +QHash<QString, QString> ExtraLicenseManager::getLicensesContents() const +{ + QHash<QString, QString> result; + License* lic = nullptr; + for (const QString& title : licenses.keys()) + { + lic = licenses[title]; + switch (lic->type) + { + case Type::CONTENTS: + result[title] = lic->data; + break; + case Type::FILE: + result[title] = readLicenseFile(lic->data); + break; + } + } + return result; +} + +bool ExtraLicenseManager::addLicense(const QString& title, const QString& data, ExtraLicenseManager::Type type) +{ + if (licenses.contains(title)) + return false; + + License* lic = new License; + lic->title = title; + lic->data = data; + lic->type = type; + licenses[title] = lic; + return true; +} + +QString ExtraLicenseManager::readLicenseFile(const QString& path) const { - return licenses; + QFile file(path); + if (!file.open(QIODevice::ReadOnly)) + { + qCritical() << "Error opening" << file.fileName(); + return QString::null; + } + QString contents = QString::fromLatin1(file.readAll()); + file.close(); + return contents; } diff --git a/SQLiteStudio3/coreSQLiteStudio/services/extralicensemanager.h b/SQLiteStudio3/coreSQLiteStudio/services/extralicensemanager.h index fcf1203..c8da6f9 100644 --- a/SQLiteStudio3/coreSQLiteStudio/services/extralicensemanager.h +++ b/SQLiteStudio3/coreSQLiteStudio/services/extralicensemanager.h @@ -8,14 +8,38 @@ class API_EXPORT ExtraLicenseManager { public: + enum class Type + { + FILE, + CONTENTS + }; + + struct License + { + QString title; + QString data; + Type type; + QString violationMessage; + bool violated = false; + }; + ExtraLicenseManager(); + virtual ~ExtraLicenseManager(); bool addLicense(const QString& title, const QString& filePath); + bool addLicenseContents(const QString& title, const QString& contents); + void setViolatedLicense(const QString& title, const QString& violationMessage); + void unsetViolatedLicense(const QString& title); + bool isViolatedLicense(const QString& title); + QString getViolationMessage(const QString& title); bool removeLicense(const QString& title); - const QHash<QString,QString>& getLicenses() const; + QHash<QString,QString> getLicensesContents() const; private: - QHash<QString,QString> licenses; + bool addLicense(const QString& title, const QString& data, Type type); + QString readLicenseFile(const QString& path) const; + + QHash<QString,License*> licenses; }; #endif // EXTRALISENCEMANAGER_H diff --git a/SQLiteStudio3/coreSQLiteStudio/services/impl/configimpl.cpp b/SQLiteStudio3/coreSQLiteStudio/services/impl/configimpl.cpp index e210f01..bbfec32 100644 --- a/SQLiteStudio3/coreSQLiteStudio/services/impl/configimpl.cpp +++ b/SQLiteStudio3/coreSQLiteStudio/services/impl/configimpl.cpp @@ -278,13 +278,14 @@ qint64 ConfigImpl::addSqlHistory(const QString& sql, const QString& dbName, int sqlHistoryId = 0; } + sqlHistoryMutex.lock(); QtConcurrent::run(this, &ConfigImpl::asyncAddSqlHistory, sqlHistoryId, sql, dbName, timeSpentMillis, rowsAffected); - sqlHistoryId++; - return sqlHistoryId; + return sqlHistoryId++; } void ConfigImpl::updateSqlHistory(qint64 id, const QString& sql, const QString& dbName, int timeSpentMillis, int rowsAffected) { + sqlHistoryMutex.lock(); QtConcurrent::run(this, &ConfigImpl::asyncUpdateSqlHistory, id, sql, dbName, timeSpentMillis, rowsAffected); } @@ -638,6 +639,7 @@ void ConfigImpl::asyncAddSqlHistory(qint64 id, const QString& sql, const QString { qDebug() << "Error adding SQL history:" << results->getErrorText(); db->rollback(); + sqlHistoryMutex.unlock(); return; } @@ -657,6 +659,7 @@ void ConfigImpl::asyncAddSqlHistory(qint64 id, const QString& sql, const QString db->commit(); emit sqlHistoryRefreshNeeded(); + sqlHistoryMutex.unlock(); } void ConfigImpl::asyncUpdateSqlHistory(qint64 id, const QString& sql, const QString& dbName, int timeSpentMillis, int rowsAffected) @@ -665,6 +668,7 @@ void ConfigImpl::asyncUpdateSqlHistory(qint64 id, const QString& sql, const QStr {dbName, timeSpentMillis, rowsAffected, sql, id}); emit sqlHistoryRefreshNeeded(); + sqlHistoryMutex.unlock(); } void ConfigImpl::asyncClearSqlHistory() diff --git a/SQLiteStudio3/coreSQLiteStudio/services/impl/configimpl.h b/SQLiteStudio3/coreSQLiteStudio/services/impl/configimpl.h index ec32e8d..63d1e1f 100644 --- a/SQLiteStudio3/coreSQLiteStudio/services/impl/configimpl.h +++ b/SQLiteStudio3/coreSQLiteStudio/services/impl/configimpl.h @@ -4,6 +4,7 @@ #include "coreSQLiteStudio_global.h" #include "services/config.h" #include "db/sqlquery.h" +#include <QMutex> class AsyncConfigHandler; class SqlHistoryModel; @@ -118,6 +119,7 @@ class API_EXPORT ConfigImpl : public Config bool massSaving = false; SqlHistoryModel* sqlHistoryModel = nullptr; DdlHistoryModel* ddlHistoryModel = nullptr; + QMutex sqlHistoryMutex; public slots: void refreshDdlHistory(); diff --git a/SQLiteStudio3/coreSQLiteStudio/services/impl/pluginmanagerimpl.cpp b/SQLiteStudio3/coreSQLiteStudio/services/impl/pluginmanagerimpl.cpp index 5d7a517..c3bc581 100644 --- a/SQLiteStudio3/coreSQLiteStudio/services/impl/pluginmanagerimpl.cpp +++ b/SQLiteStudio3/coreSQLiteStudio/services/impl/pluginmanagerimpl.cpp @@ -3,6 +3,7 @@ #include "plugins/genericplugin.h" #include "services/notifymanager.h" #include "common/unused.h" +#include "translations.h" #include <QCoreApplication> #include <QDir> #include <QDebug> @@ -465,6 +466,7 @@ void PluginManagerImpl::unload(const QString& pluginName) // Deinitializing and unloading plugin emit aboutToUnload(container->plugin, container->type); container->plugin->deinit(); + unloadTranslation(container->name); QPluginLoader* loader = container->loader; if (!loader->isLoaded()) @@ -586,6 +588,7 @@ void PluginManagerImpl::pluginLoaded(PluginManagerImpl::PluginContainer* contain { if (!container->builtIn) { + loadTranslation(container->name); container->plugin = dynamic_cast<Plugin*>(container->loader->instance()); container->loaded = true; } diff --git a/SQLiteStudio3/coreSQLiteStudio/sqlhistorymodel.h b/SQLiteStudio3/coreSQLiteStudio/sqlhistorymodel.h index 0f6b25d..17e1bc3 100644 --- a/SQLiteStudio3/coreSQLiteStudio/sqlhistorymodel.h +++ b/SQLiteStudio3/coreSQLiteStudio/sqlhistorymodel.h @@ -7,6 +7,8 @@ class Db; class SqlHistoryModel : public QueryModel { + Q_OBJECT + public: SqlHistoryModel(Db* db, QObject *parent = nullptr); diff --git a/SQLiteStudio3/coreSQLiteStudio/sqlitestudio.cpp b/SQLiteStudio3/coreSQLiteStudio/sqlitestudio.cpp index 3595b21..8ff4f0d 100644 --- a/SQLiteStudio3/coreSQLiteStudio/sqlitestudio.cpp +++ b/SQLiteStudio3/coreSQLiteStudio/sqlitestudio.cpp @@ -32,13 +32,14 @@ #include "plugins/populateplugin.h" #include "services/bugreporter.h" #include "services/extralicensemanager.h" +#include "translations.h" #include <QProcessEnvironment> #include <QThreadPool> #include <QCoreApplication> DEFINE_SINGLETON(SQLiteStudio) -static const int sqlitestudioVersion = 30001; +static const int sqlitestudioVersion = 30002; SQLiteStudio::SQLiteStudio() { @@ -49,6 +50,21 @@ SQLiteStudio::SQLiteStudio() SQLiteStudio::~SQLiteStudio() { } +QStringList SQLiteStudio::getInitialTranslationFiles() const +{ + return initialTranslationFiles; +} + +void SQLiteStudio::setInitialTranslationFiles(const QStringList& value) +{ + initialTranslationFiles = value; +} + + +QString SQLiteStudio::getCurrentLang() const +{ + return currentLang; +} ExtraLicenseManager* SQLiteStudio::getExtraLicenseManager() const { @@ -263,6 +279,9 @@ void SQLiteStudio::init(const QStringList& cmdListArguments, bool guiAvailable) config = new ConfigImpl(); config->init(); + currentLang = CFG_CORE.General.Language.get(); + loadTranslations(initialTranslationFiles); + pluginManager = new PluginManagerImpl(); dbManager = new DbManagerImpl(); @@ -325,7 +344,9 @@ void SQLiteStudio::cleanUp() disconnect(pluginManager, SIGNAL(unloaded(QString,PluginType*)), this, SLOT(pluginUnloaded(QString,PluginType*))); if (!immediateQuit) { - pluginManager->deinit(); + if (pluginManager) + pluginManager->deinit(); + safe_delete(pluginManager); // PluginManager before DbManager, so Db objects are deleted while DbManager still exists safe_delete(updateManager); safe_delete(bugReporter); diff --git a/SQLiteStudio3/coreSQLiteStudio/sqlitestudio.h b/SQLiteStudio3/coreSQLiteStudio/sqlitestudio.h index a41867a..f338e92 100644 --- a/SQLiteStudio3/coreSQLiteStudio/sqlitestudio.h +++ b/SQLiteStudio3/coreSQLiteStudio/sqlitestudio.h @@ -147,6 +147,11 @@ class API_EXPORT SQLiteStudio : public QObject ExtraLicenseManager* getExtraLicenseManager() const; void setExtraLicenseManager(ExtraLicenseManager* value); + QString getCurrentLang() const; + + QStringList getInitialTranslationFiles() const; + void setInitialTranslationFiles(const QStringList& value); + private: /** * @brief Creates singleton instance. @@ -197,6 +202,8 @@ class API_EXPORT SQLiteStudio : public QObject BugReporter* bugReporter = nullptr; UpdateManager* updateManager = nullptr; ExtraLicenseManager* extraLicenseManager = nullptr; + QString currentLang; + QStringList initialTranslationFiles; private slots: void pluginLoaded(Plugin* plugin,PluginType* pluginType); diff --git a/SQLiteStudio3/coreSQLiteStudio/tablemodifier.cpp b/SQLiteStudio3/coreSQLiteStudio/tablemodifier.cpp index 7555714..d064cb1 100644 --- a/SQLiteStudio3/coreSQLiteStudio/tablemodifier.cpp +++ b/SQLiteStudio3/coreSQLiteStudio/tablemodifier.cpp @@ -44,11 +44,12 @@ void TableModifier::alterTable(SqliteCreateTablePtr newCreateTable) sqls << newCreateTable->detokenize(); copyDataTo(newCreateTable); + handleFks(tempTableName); + // If temp table was created, it means that table name hasn't changed. In that case we need to cleanup temp table (drop it). // Otherwise, the table name has changed, therefor there still remains the old table which we copied data from - we need to drop it here. sqls << QString("DROP TABLE %1;").arg(wrapObjIfNeeded(tempTableName.isNull() ? originalTable : tempTableName, dialect)); - handleFks(); handleIndexes(); handleTriggers(); handleViews(); @@ -92,7 +93,7 @@ void TableModifier::copyDataTo(const QString& targetTable) copyDataTo(targetTable, colsToCopy, colsToCopy); } -void TableModifier::handleFks() +void TableModifier::handleFks(const QString& tempTableName) { SchemaResolver resolver(db); @@ -108,10 +109,11 @@ void TableModifier::handleFks() continue; } + subModifier.usedTempTableNames = usedTempTableNames; subModifier.tableColMap = tableColMap; subModifier.existingColumns = existingColumns; subModifier.newName = newName; - subModifier.subHandleFks(originalTable); + subModifier.subHandleFks(originalTable, tempTableName); sqls += subModifier.generateSqls(); modifiedTables << fkTable; @@ -125,18 +127,18 @@ void TableModifier::handleFks() } } -void TableModifier::subHandleFks(const QString& oldName) +void TableModifier::subHandleFks(const QString& oldName, const QString& oldTempName) { bool modified = false; foreach (SqliteCreateTable::Constraint* fk, createTable->getForeignKeysByTable(oldName)) { - if (subHandleFks(fk->foreignKey, oldName)) + if (subHandleFks(fk->foreignKey, oldName, oldTempName)) modified = true; } foreach (SqliteCreateTable::Column::Constraint* fk, createTable->getColumnForeignKeysByTable(oldName)) { - if (subHandleFks(fk->foreignKey, oldName)) + if (subHandleFks(fk->foreignKey, oldName, oldTempName)) modified = true; } @@ -151,19 +153,29 @@ void TableModifier::subHandleFks(const QString& oldName) copyDataTo(originalTable); + handleFks(tempName); + sqls << QString("DROP TABLE %1;").arg(wrapObjIfNeeded(tempName, dialect)); simpleHandleIndexes(); simpleHandleTriggers(); } -bool TableModifier::subHandleFks(SqliteForeignKey* fk, const QString& oldName) +bool TableModifier::subHandleFks(SqliteForeignKey* fk, const QString& oldName, const QString& oldTempName) { + // If table was not renamed (but uses temp table name), we will rename temp name into target name. + // If table was renamed, we will rename old name to new name. bool modified = false; // Table if (handleName(oldName, fk->foreignTable)) modified = true; + else if (!oldTempName.isNull() && fk->foreignTable.compare(oldName, Qt::CaseInsensitive) == 0) + { + // This is the case when main table was not renamed - we will stay with the original name, but we need to mark it as modified, + // so the table gets recreated (the temp table is changed to the original table name in this FK). + modified = true; + } // Columns if (handleIndexedColumns(fk->indexedColumns)) @@ -354,9 +366,16 @@ void TableModifier::handleIndex(SqliteCreateIndexPtr index) { handleName(originalTable, index->table); handleIndexedColumns(index->indexedColumns); - index->rebuildTokens(); - sqls << index->detokenize(); - modifiedIndexes << index->index; + if (index->indexedColumns.size() > 0) + { + index->rebuildTokens(); + sqls << index->detokenize(); + modifiedIndexes << index->index; + } + else + { + warnings << QObject::tr("All columns indexed by the index %1 are gone. The index will not be recreated after table modification.").arg(index->index); + } // TODO partial index needs handling expr here } @@ -388,9 +407,16 @@ void TableModifier::handleTrigger(SqliteCreateTriggerPtr trigger) } trigger->queries = newQueries; - trigger->rebuildTokens(); - sqls << trigger->detokenize(); - modifiedTriggers << trigger->trigger; + if (trigger->event->type == SqliteCreateTrigger::Event::UPDATE_OF && trigger->event->columnNames.size() == 0) + { + warnings << QObject::tr("All columns covered by the trigger %1 are gone. The trigger will not be recreated after table modification.").arg(trigger->trigger); + } + else + { + trigger->rebuildTokens(); + sqls << trigger->detokenize(); + modifiedTriggers << trigger->trigger; + } } void TableModifier::handleViews() @@ -688,8 +714,10 @@ void TableModifier::parseDdl() this->createTable = createTable; } -QString TableModifier::getTempTableName() const +QString TableModifier::getTempTableName() { SchemaResolver resolver(db); - return resolver.getUniqueName("sqlitestudio_temp_table"); + QString name = resolver.getUniqueName("sqlitestudio_temp_table", usedTempTableNames); + usedTempTableNames << name; + return name; } diff --git a/SQLiteStudio3/coreSQLiteStudio/tablemodifier.h b/SQLiteStudio3/coreSQLiteStudio/tablemodifier.h index 6a39b33..62af492 100644 --- a/SQLiteStudio3/coreSQLiteStudio/tablemodifier.h +++ b/SQLiteStudio3/coreSQLiteStudio/tablemodifier.h @@ -31,7 +31,7 @@ class API_EXPORT TableModifier private: void init(); void parseDdl(); - QString getTempTableName() const; + QString getTempTableName(); void copyDataTo(const QString& targetTable, const QStringList& srcCols, const QStringList& dstCols); void renameTo(const QString& newName); QString renameToTemp(); @@ -60,9 +60,9 @@ class API_EXPORT TableModifier * @param newCreateTable * Finds all tables referencing currently modified table and updates their referenced table name and columns. */ - void handleFks(); - void subHandleFks(const QString& oldName); - bool subHandleFks(SqliteForeignKey* fk, const QString& oldName); + void handleFks(const QString& tempTableName); + void subHandleFks(const QString& oldName, const QString& oldTempName); + bool subHandleFks(SqliteForeignKey* fk, const QString& oldName, const QString& oldTempName); bool handleName(const QString& oldName, QString& valueToUpdate); bool handleIndexedColumns(QList<SqliteIndexedColumn*>& columnsToUpdate); @@ -74,18 +74,18 @@ class API_EXPORT TableModifier Dialect dialect; /** - * @brief database Database name. The "main" is default. + * @brief Database name. The "main" is default. * Other databases (temp, attached...) are not supported at the moment. */ QString database; /** - * @brief table Current table name (after renaming) + * @brief Current table name (after renaming) */ QString table; /** - * @brief originalTable Initial table name, before any renaming. + * @brief Initial table name, before any renaming. */ QString originalTable; @@ -95,7 +95,7 @@ class API_EXPORT TableModifier SqliteCreateTablePtr createTable; /** - * @brief sqls Statements to be executed to make changes real. + * @brief Statements to be executed to make changes real. */ QStringList sqls; @@ -109,6 +109,7 @@ class API_EXPORT TableModifier QStringList modifiedIndexes; QStringList modifiedTriggers; QStringList modifiedViews; + QStringList usedTempTableNames; }; #endif // TABLEMODIFIER_H diff --git a/SQLiteStudio3/coreSQLiteStudio/translations.cpp b/SQLiteStudio3/coreSQLiteStudio/translations.cpp new file mode 100644 index 0000000..56dc5f6 --- /dev/null +++ b/SQLiteStudio3/coreSQLiteStudio/translations.cpp @@ -0,0 +1,108 @@ +#include "translations.h" +#include "sqlitestudio.h" +#include <QTranslator> +#include <QCoreApplication> +#include <QDir> +#include <QDebug> +#include <QRegularExpression> + +QHash<QString,QTranslator*> SQLITESTUDIO_TRANSLATIONS; +QStringList SQLITESTUDIO_TRANSLATION_DIRS = QStringList({":/msg", ":/msg/translations", "msg", "translations"}); + +void loadTranslation(const QString& baseName) +{ + if (SQLITESTUDIO_TRANSLATIONS.contains(baseName)) + return; + + QTranslator* translator = new QTranslator(); + + QString fName; + bool res = false; + QString lang = SQLITESTUDIO->getCurrentLang(); + QStringList filters = QStringList({baseName+"_"+lang+".qm"}); + QDir dir; + + for (const QString& dirPath : SQLITESTUDIO_TRANSLATION_DIRS) + { + dir = dirPath; + for (const QString& f : dir.entryList(filters)) + { + res = translator->load(f, dirPath); + if (res) + { + fName = dirPath + "/" + f; + break; + } + } + + if (res) + break; + } + + if (!res) + return; + + qApp->installTranslator(translator); + SQLITESTUDIO_TRANSLATIONS[baseName] = translator; + qDebug() << "Loaded:" << fName; +} + +void unloadTranslation(const QString& baseName) +{ + if (!SQLITESTUDIO_TRANSLATIONS.contains(baseName)) + return; + + QTranslator* trans = SQLITESTUDIO_TRANSLATIONS[baseName]; + SQLITESTUDIO_TRANSLATIONS.remove(baseName); + qApp->removeTranslator(trans); + delete trans; +} + +void loadTranslations(const QStringList& baseNames) +{ + for (const QString& name : baseNames) + loadTranslation(name); +} + +QStringList getAvailableTranslations() +{ + QSet<QString> locales; + QRegularExpression re("[^\\_]+\\_(\\w+)\\.qm"); + QRegularExpressionMatch match; + QDir dir; + QStringList filters = QStringList({"*_*.qm"}); + for (const QString& dirPath : SQLITESTUDIO_TRANSLATION_DIRS) + { + dir = dirPath; + for (const QString& f : dir.entryList(filters)) + { + match = re.match(f); + if (!match.isValid()) + continue; + + locales << match.captured(1).toLower(); + } + } + locales << "en"; + + return locales.toList(); +} + +QMap<QString,QString> getAvailableLanguages() +{ + QMap<QString,QString> langs; + QStringList translations = getAvailableTranslations(); + QLocale locale; + QString langName; + for (const QString& trans : translations) + { + locale = QLocale(trans); + langName = locale.nativeLanguageName(); + if (langName.isEmpty()) + langName = trans; + + langs[langName] = trans; + } + + return langs; +} diff --git a/SQLiteStudio3/coreSQLiteStudio/translations.h b/SQLiteStudio3/coreSQLiteStudio/translations.h new file mode 100644 index 0000000..c130064 --- /dev/null +++ b/SQLiteStudio3/coreSQLiteStudio/translations.h @@ -0,0 +1,25 @@ +#ifndef TRANSLATIONS_H +#define TRANSLATIONS_H + +#include <QString> +#include <QMap> + +void loadTranslations(const QStringList& baseNames); +void loadTranslation(const QString& baseName); +void unloadTranslation(const QString& baseName); + +/** + * @brief Provides list of translations as code names. + * @return List of available translations in their code names (pl, pt, de, ...). + */ +QStringList getAvailableTranslations(); + +/** + * @brief Provides list of languages and their code names. + * @return A map of pairs, there key is a translated (with a current language) name of language and value is its translation code name (pl, pt, de, ...). + * + * As the result is a QMap, it comes sorted by a translated names of languages. + */ +QMap<QString, QString> getAvailableLanguages(); + +#endif // TRANSLATIONS_H diff --git a/SQLiteStudio3/coreSQLiteStudio/translations/coreSQLiteStudio_pl.qm b/SQLiteStudio3/coreSQLiteStudio/translations/coreSQLiteStudio_pl.qm Binary files differnew file mode 100644 index 0000000..8011cf1 --- /dev/null +++ b/SQLiteStudio3/coreSQLiteStudio/translations/coreSQLiteStudio_pl.qm diff --git a/SQLiteStudio3/coreSQLiteStudio/translations/coreSQLiteStudio_pl.ts b/SQLiteStudio3/coreSQLiteStudio/translations/coreSQLiteStudio_pl.ts new file mode 100644 index 0000000..dc64023 --- /dev/null +++ b/SQLiteStudio3/coreSQLiteStudio/translations/coreSQLiteStudio_pl.ts @@ -0,0 +1,1298 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0" language="pl_PL"> +<context> + <name>AbstractDb</name> + <message> + <location filename="../db/abstractdb.cpp" line="306"/> + <location filename="../db/abstractdb.cpp" line="324"/> + <source>Cannot execute query on closed database.</source> + <translation>Nie można wykonać zapytania na zamkniętej bazie danych.</translation> + </message> + <message> + <location filename="../db/abstractdb.cpp" line="605"/> + <source>Error attaching database %1: %2</source> + <translation>Błąd podczas dołączania bazy danych %1: %2</translation> + </message> +</context> +<context> + <name>BugReporter</name> + <message> + <location filename="../services/bugreporter.cpp" line="46"/> + <source>Invalid login or password</source> + <translation>Niepoprawny login lub hasło</translation> + </message> +</context> +<context> + <name>ChainExecutor</name> + <message> + <location filename="../db/chainexecutor.cpp" line="35"/> + <source>The database for executing queries was not defined.</source> + <comment>chain executor</comment> + <translation>Nie zdefiniowano bazy danych do wykonywania zapytań.</translation> + </message> + <message> + <location filename="../db/chainexecutor.cpp" line="41"/> + <source>The database for executing queries was not open.</source> + <comment>chain executor</comment> + <translation>Baza danych do wykonywania zapytań nie jest otwarta.</translation> + </message> + <message> + <location filename="../db/chainexecutor.cpp" line="47"/> + <source>Could not start a database transaction. Details: %1</source> + <comment>chain executor</comment> + <translation>Nie udało się rozpocząć transakcji bazy danych. Szczegóły: %1</translation> + </message> + <message> + <location filename="../db/chainexecutor.cpp" line="74"/> + <source>Interrupted</source> + <comment>chain executor</comment> + <translation>Przerwane</translation> + </message> + <message> + <location filename="../db/chainexecutor.cpp" line="134"/> + <source>Could not commit a database transaction. Details: %1</source> + <comment>chain executor</comment> + <translation>Nie udało się zatwierdzić transakcji bazy danych. Szczegóły: %1</translation> + </message> +</context> +<context> + <name>CompletionHelper</name> + <message> + <location filename="../completionhelper.cpp" line="196"/> + <source>New row reference</source> + <translation>Odnośnik do nowego wiersza</translation> + </message> + <message> + <location filename="../completionhelper.cpp" line="203"/> + <source>Old row reference</source> + <translation>Odnośnik do starego wiersza</translation> + </message> + <message> + <location filename="../completionhelper.cpp" line="208"/> + <source>New table name</source> + <translation>Nazwa nowej tabeli</translation> + </message> + <message> + <location filename="../completionhelper.cpp" line="211"/> + <source>New index name</source> + <translation>Nazwa nowego indeksu</translation> + </message> + <message> + <location filename="../completionhelper.cpp" line="214"/> + <source>New view name</source> + <translation>Nazwa nowego widoku</translation> + </message> + <message> + <location filename="../completionhelper.cpp" line="217"/> + <source>New trigger name</source> + <translation>Nazwa nowego wyzwalacza</translation> + </message> + <message> + <location filename="../completionhelper.cpp" line="220"/> + <source>Table or column alias</source> + <translation>Alias tabeli lub kolumny</translation> + </message> + <message> + <location filename="../completionhelper.cpp" line="223"/> + <source>transaction name</source> + <translation>Nazwa transakcji</translation> + </message> + <message> + <location filename="../completionhelper.cpp" line="226"/> + <source>New column name</source> + <translation>Nazwa nowej kolumny</translation> + </message> + <message> + <location filename="../completionhelper.cpp" line="229"/> + <source>Column data type</source> + <translation>Typ danych kolumny</translation> + </message> + <message> + <location filename="../completionhelper.cpp" line="232"/> + <source>Constraint name</source> + <translation>Nazwa ograniczenia</translation> + </message> + <message> + <location filename="../completionhelper.cpp" line="245"/> + <source>Error message</source> + <translation>Treść błędu</translation> + </message> + <message> + <location filename="../completionhelper.cpp" line="289"/> + <source>Collation name</source> + <translation>Nazwa zestawienia</translation> + </message> + <message> + <location filename="../completionhelper.cpp" line="304"/> + <source>Any word</source> + <translation>Dowolne słowo</translation> + </message> + <message> + <location filename="../completionhelper.cpp" line="485"/> + <source>Default database</source> + <translation>Domyślna baza danych</translation> + </message> + <message> + <location filename="../completionhelper.cpp" line="486"/> + <source>Temporary objects database</source> + <translation>Baza danych obiektów tymczasowych</translation> + </message> +</context> +<context> + <name>DbManagerImpl</name> + <message> + <location filename="../services/impl/dbmanagerimpl.cpp" line="56"/> + <source>Could not add database %1: %2</source> + <translation>Nie udało się dodać bazę danych %1: %2</translation> + </message> + <message> + <location filename="../services/impl/dbmanagerimpl.cpp" line="115"/> + <source>Database %1 could not be updated, because of an error: %2</source> + <translation>Nie udało się zaktualizować baza danych %1 z powodu błędu: %2</translation> + </message> + <message> + <location filename="../services/impl/dbmanagerimpl.cpp" line="284"/> + <location filename="../services/impl/dbmanagerimpl.cpp" line="313"/> + <source>Database file doesn't exist.</source> + <translation>Plik bazy danych nie istnieje.</translation> + </message> + <message> + <location filename="../services/impl/dbmanagerimpl.cpp" line="286"/> + <location filename="../services/impl/dbmanagerimpl.cpp" line="315"/> + <location filename="../services/impl/dbmanagerimpl.cpp" line="467"/> + <source>No supporting plugin loaded.</source> + <translation>Nie załadowano obsługującej wtyczki.</translation> + </message> + <message> + <location filename="../services/impl/dbmanagerimpl.cpp" line="386"/> + <source>Database could not be initialized.</source> + <translation>Nie udało się zainicjalizować bazy danych.</translation> + </message> + <message> + <location filename="../services/impl/dbmanagerimpl.cpp" line="396"/> + <source>No suitable database driver plugin found.</source> + <translation>Nie znaleziono odpowiedniej wtyczki sterownika.</translation> + </message> +</context> +<context> + <name>DbObjectOrganizer</name> + <message> + <location filename="../dbobjectorganizer.cpp" line="380"/> + <location filename="../dbobjectorganizer.cpp" line="412"/> + <source>Error while creating table in target database: %1</source> + <translation>Błąd podczas tworzenia tabeli w docelowej bazie danych: %1</translation> + </message> + <message> + <location filename="../dbobjectorganizer.cpp" line="380"/> + <source>Could not parse table.</source> + <translation>Nie udało się przeanalizować tabeli.</translation> + </message> + <message> + <location filename="../dbobjectorganizer.cpp" line="426"/> + <source>Database %1 could not be attached to database %2, so the data of table %3 will be copied with SQLiteStudio as a mediator. This method can be slow for huge tables, so please be patient.</source> + <translation>Nie udało się dołączyć bazy danych %1 do bazy danych %2, więc dane tabeli %3 będą skopiowane przez SQLiteStudio jako pośrednika. Ta metoda może być powolna dla dużych tabel, więc proszę o cierpliwość.</translation> + </message> + <message> + <location filename="../dbobjectorganizer.cpp" line="447"/> + <source>Error while copying data for table %1: %2</source> + <translation>Błąd podczas copiowania danych tabeli %1: %2</translation> + </message> + <message> + <location filename="../dbobjectorganizer.cpp" line="466"/> + <location filename="../dbobjectorganizer.cpp" line="473"/> + <location filename="../dbobjectorganizer.cpp" line="496"/> + <source>Error while copying data to table %1: %2</source> + <translation>Błąd podczas kopiowania danych do tabeli %1: %2</translation> + </message> + <message> + <location filename="../dbobjectorganizer.cpp" line="535"/> + <source>Error while dropping source view %1: %2 +Tables, indexes, triggers and views copied to database %3 will remain.</source> + <translation>Błąd podczas upuszczania widoku źródłowego %1: %2 +Tabele, indeksy, wyzwalacze i widoki skopiowane do bazy danych %3 pozostaną na miejscu.</translation> + </message> + <message> + <location filename="../dbobjectorganizer.cpp" line="542"/> + <source>Error while creating view in target database: %1</source> + <translation>Błąd podczas tworzenia widoku w docelowej bazie danych: %1</translation> + </message> + <message> + <location filename="../dbobjectorganizer.cpp" line="547"/> + <source>Error while creating index in target database: %1</source> + <translation>Błąd podczas tworzenia indeksu w docelowej bazie danych: %1</translation> + </message> + <message> + <location filename="../dbobjectorganizer.cpp" line="552"/> + <source>Error while creating trigger in target database: %1</source> + <translation>Błąd podczas tworzenia wyzwalacza w docelowej bazie danych: %1</translation> + </message> +</context> +<context> + <name>DbVersionConverter</name> + <message> + <location filename="../dbversionconverter.cpp" line="923"/> + <source>Target file exists, but could not be overwritten.</source> + <translation>Plik docelowy istnieje, ale nie może być nadpisany.</translation> + </message> + <message> + <location filename="../dbversionconverter.cpp" line="942"/> + <source>Could not find proper database plugin to create target database.</source> + <translation>Nie znaleziono odpowiedniej wtyczki bazy danych, aby utworzyć docelową bazę danych.</translation> + </message> + <message> + <location filename="../dbversionconverter.cpp" line="1176"/> + <source>Error while converting database: %1</source> + <translation>Błąd podczas konwersji bazy danych: %1</translation> + </message> +</context> +<context> + <name>DdlHistoryModel</name> + <message> + <location filename="../ddlhistorymodel.cpp" line="65"/> + <source>Database name</source> + <comment>ddl history header</comment> + <translation>Nazwa bazy danych</translation> + </message> + <message> + <location filename="../ddlhistorymodel.cpp" line="67"/> + <source>Database file</source> + <comment>ddl history header</comment> + <translation>Plik bazy danych</translation> + </message> + <message> + <location filename="../ddlhistorymodel.cpp" line="69"/> + <source>Date of execution</source> + <comment>ddl history header</comment> + <translation>Data wykonania</translation> + </message> + <message> + <location filename="../ddlhistorymodel.cpp" line="71"/> + <source>Changes</source> + <comment>ddl history header</comment> + <translation>Zmiany</translation> + </message> +</context> +<context> + <name>ExportManager</name> + <message> + <location filename="../services/exportmanager.cpp" line="72"/> + <source>Export plugin %1 doesn't support exporing query results.</source> + <translation>Wtyczka eksportu %1 nie obsługuje exportowania wyników zapytania.</translation> + </message> + <message> + <location filename="../services/exportmanager.cpp" line="98"/> + <source>Export plugin %1 doesn't support exporing tables.</source> + <translation>Wtyczka exportu %1 nie obsługuje eksportowania tabel.</translation> + </message> + <message> + <location filename="../services/exportmanager.cpp" line="122"/> + <source>Export plugin %1 doesn't support exporing databases.</source> + <translation>Wtyczka exportu %1 nie obsługuje eksportowania baz danych.</translation> + </message> + <message> + <location filename="../services/exportmanager.cpp" line="155"/> + <source>Export format '%1' is not supported. Supported formats are: %2.</source> + <translation>Format eksportu %1 nie jest obsługiwany. Obsługiwane formaty to: %2</translation> + </message> + <message> + <location filename="../services/exportmanager.cpp" line="218"/> + <source>Export to the clipboard was successful.</source> + <translation>Eksport do schowka przebiegł pomyślnie.</translation> + </message> + <message> + <location filename="../services/exportmanager.cpp" line="222"/> + <source>Export to the file '%1' was successful.</source> + <translation>Eksport do pliku '%1' przebiegł pomyślnie.</translation> + </message> + <message> + <location filename="../services/exportmanager.cpp" line="224"/> + <source>Export was successful.</source> + <translation>Export przebiegł pomyślnie.</translation> + </message> + <message> + <location filename="../services/exportmanager.cpp" line="266"/> + <source>Could not export to file %1. File cannot be open for writting.</source> + <translation>Eksport do pliku %1 nie powiódł się. Plik nie może być otwarty do zapisu.</translation> + </message> + <message> + <source>Export to was successful.</source> + <translation type="obsolete">Eksport do przebiegł pomyślnie.</translation> + </message> +</context> +<context> + <name>ExportWorker</name> + <message> + <location filename="../exportworker.cpp" line="116"/> + <source>Error while exporting query results: %1</source> + <translation>Błąd podczas eksportowania wyników zapytania: %1</translation> + </message> + <message> + <source>Error while counting data column width to export from query results: %2</source> + <translation type="obsolete">Błąd podczas liczenia szerokości kolumn danych do eksportu wyników zapytania: %2</translation> + </message> + <message> + <location filename="../exportworker.cpp" line="175"/> + <source>Error while counting data column width to export from query results: %1</source> + <translation>Błąd podczas liczenia szerokości kolumn danych do eksportu wyników zapytania: %1</translation> + </message> + <message> + <location filename="../exportworker.cpp" line="275"/> + <location filename="../exportworker.cpp" line="326"/> + <source>Could not parse %1 in order to export it. It will be excluded from the export output.</source> + <translation>Nie udało się przeanalizować %1 w celu wyeksportowania. Element ten zostanie pominięty w wynikach eksportu.</translation> + </message> + <message> + <location filename="../exportworker.cpp" line="482"/> + <source>Error while reading data to export from table %1: %2</source> + <translation>Błąd podczas odczytu danych do eksportu z tabeli %1: %2</translation> + </message> + <message> + <location filename="../exportworker.cpp" line="490"/> + <source>Error while counting data to export from table %1: %2</source> + <translation>Błąd podczas liczenia danych do eksportu z tabeli %1: %2</translation> + </message> + <message> + <location filename="../exportworker.cpp" line="506"/> + <source>Error while counting data column width to export from table %1: %2</source> + <translation>Błąd podczas obliczania szerokości kolumn danych do eksportu z tabeli %1: %2</translation> + </message> +</context> +<context> + <name>FunctionManagerImpl</name> + <message> + <location filename="../services/impl/functionmanagerimpl.cpp" line="232"/> + <source>Invalid number of arguments to function '%1'. Expected %2, but got %3.</source> + <translation>Niepoprawna liczba argumentów do funkcji '%1'. Oczekiwano %2, a jest %3.</translation> + </message> + <message> + <location filename="../services/impl/functionmanagerimpl.cpp" line="341"/> + <source>No such function registered in SQLiteStudio: %1(%2)</source> + <translation>Nie znaleziono funkcji zarejestrowanej w SQLiteStudio: %1 (%2)</translation> + </message> + <message> + <location filename="../services/impl/functionmanagerimpl.cpp" line="347"/> + <source>Function %1(%2) was registered with language %3, but the plugin supporting that language is not currently loaded.</source> + <translation>Funkcja %1 (%2) została zarejestrowana dla języka %3, ale wtyczka obsługująca ten język nie jest aktualnie załadowana.</translation> + </message> + <message> + <location filename="../services/impl/functionmanagerimpl.cpp" line="365"/> + <source>Invalid regular expression pattern: %1</source> + <translation>Niepoprawne wyrażenie regularne: %1</translation> + </message> + <message> + <location filename="../services/impl/functionmanagerimpl.cpp" line="384"/> + <location filename="../services/impl/functionmanagerimpl.cpp" line="417"/> + <source>Could not open file %1 for reading: %2</source> + <translation>Nie udało się otworzyć pliku %1 do odczytu: %2</translation> + </message> + <message> + <location filename="../services/impl/functionmanagerimpl.cpp" line="439"/> + <source>Could not open file %1 for writting: %2</source> + <translation>Nie udało się otworzyć pliku %2 do zapisu: %2</translation> + </message> + <message> + <location filename="../services/impl/functionmanagerimpl.cpp" line="459"/> + <source>Error while writting to file %1: %2</source> + <translation>Błąd podczas zapisu do pliku %1: %2</translation> + </message> + <message> + <location filename="../services/impl/functionmanagerimpl.cpp" line="477"/> + <source>Unsupported scripting language: %1</source> + <translation>Nieobsługiwany język skryptowy: %1</translation> + </message> +</context> +<context> + <name>GenericExportPlugin</name> + <message> + <location filename="../plugins/genericexportplugin.cpp" line="20"/> + <source>Could not initialize text codec for exporting. Using default codec: %1</source> + <translation>Nie udało się zainicjalizować kodeka do exportu. Użyty będzie domyślny kodek: %1</translation> + </message> +</context> +<context> + <name>ImportManager</name> + <message> + <location filename="../services/importmanager.cpp" line="93"/> + <source>Imported data to the table '%1' successfully.</source> + <translation>Pomyślnie zaimportowano dane do tabeli '%1'.</translation> + </message> +</context> +<context> + <name>ImportWorker</name> + <message> + <location filename="../importworker.cpp" line="24"/> + <source>No columns provided by the import plugin.</source> + <translation>Wtyczka importu nie dostarczyła żadnych kolumn.</translation> + </message> + <message> + <location filename="../importworker.cpp" line="30"/> + <source>Could not start transaction in order to import a data: %1</source> + <translation>Nie udało się wystartować transakcji w celu zaimportowania danych: %1</translation> + </message> + <message> + <location filename="../importworker.cpp" line="48"/> + <source>Could not commit transaction for imported data: %1</source> + <translation>Nie udało się zatwierdzić transakcji w celu zaimportowania danych: %1</translation> + </message> + <message> + <location filename="../importworker.cpp" line="93"/> + <source>Table '%1' has less columns than there are columns in the data to be imported. Excessive data columns will be ignored.</source> + <translation>Tabela '%1' ma mniej kolumn, niż jest kolumn w danych do importu. Nadmiarowe kolumny zostaną zignorowane.</translation> + </message> + <message> + <location filename="../importworker.cpp" line="98"/> + <source>Table '%1' has more columns than there are columns in the data to be imported. Some columns in the table will be left empty.</source> + <translation>Tabela '%1' ma więcej kolumn, niż jest kolumn w danych do importu. Część kolumn w tabeli będzie pozostawiona pusta.</translation> + </message> + <message> + <location filename="../importworker.cpp" line="116"/> + <source>Could not create table to import to: %1</source> + <translation>Nie udało się stworzyć tabeli do zaimportowania: %1</translation> + </message> + <message> + <location filename="../importworker.cpp" line="125"/> + <location filename="../importworker.cpp" line="152"/> + <location filename="../importworker.cpp" line="158"/> + <source>Error while importing data: %1</source> + <translation>Błąd podczas importowania danych: %1</translation> + </message> + <message> + <location filename="../importworker.cpp" line="125"/> + <location filename="../importworker.cpp" line="158"/> + <source>Interrupted.</source> + <comment>import process status update</comment> + <translation>Przerwano.</translation> + </message> +</context> +<context> + <name>PluginManagerImpl</name> + <message> + <location filename="../services/impl/pluginmanagerimpl.cpp" line="541"/> + <source>Cannot load plugin %1, because it's in conflict with plugin %2.</source> + <translation>Nie udało się załadować wtyczki %1, ponieważ jest ona w konflikcie z wtyczką %2.</translation> + </message> + <message> + <location filename="../services/impl/pluginmanagerimpl.cpp" line="552"/> + <source>Cannot load plugin %1, because its dependency was not loaded: %2.</source> + <translation>Nie udało się załadować wtyczki %1, ponieważ jej zależność nie została załadowana: %2</translation> + </message> + <message> + <location filename="../services/impl/pluginmanagerimpl.cpp" line="561"/> + <source>Cannot load plugin %1. Error details: %2</source> + <translation>Nie udało się załadować wtyczki %1. Szczegóły błędu: %2</translation> + </message> + <message> + <location filename="../services/impl/pluginmanagerimpl.cpp" line="577"/> + <source>Cannot load plugin %1 (error while initializing plugin).</source> + <translation>Nie udało się załadować wtyczki %1 (błąd podczas inicjalizacji wtyczki).</translation> + </message> + <message> + <location filename="../services/impl/pluginmanagerimpl.cpp" line="730"/> + <source>min: %1</source> + <comment>plugin dependency version</comment> + <translation>min: %1</translation> + </message> + <message> + <location filename="../services/impl/pluginmanagerimpl.cpp" line="731"/> + <source>max: %1</source> + <comment>plugin dependency version</comment> + <translation>maks: %1</translation> + </message> +</context> +<context> + <name>PopulateConstant</name> + <message> + <location filename="../plugins/populateconstant.cpp" line="10"/> + <source>Constant</source> + <comment>populate constant plugin name</comment> + <translation>Stała</translation> + </message> +</context> +<context> + <name>PopulateConstantConfig</name> + <message> + <location filename="../plugins/populateconstant.ui" line="20"/> + <source>Constant value:</source> + <translation>Stała wartość:</translation> + </message> +</context> +<context> + <name>PopulateDictionary</name> + <message> + <location filename="../plugins/populatedictionary.cpp" line="15"/> + <source>Dictionary</source> + <comment>dictionary populating plugin name</comment> + <translation>Słownik</translation> + </message> +</context> +<context> + <name>PopulateDictionaryConfig</name> + <message> + <location filename="../plugins/populatedictionary.ui" line="20"/> + <source>Dictionary file</source> + <translation>Plik słownika</translation> + </message> + <message> + <location filename="../plugins/populatedictionary.ui" line="29"/> + <source>Pick dictionary file</source> + <translation>Wybierz plik słownika</translation> + </message> + <message> + <location filename="../plugins/populatedictionary.ui" line="39"/> + <source>Word separator</source> + <translation>Separator słowa</translation> + </message> + <message> + <location filename="../plugins/populatedictionary.ui" line="45"/> + <source>Whitespace</source> + <translation>Biały znak</translation> + </message> + <message> + <location filename="../plugins/populatedictionary.ui" line="58"/> + <source>Line break</source> + <translation>Nowa linia</translation> + </message> + <message> + <location filename="../plugins/populatedictionary.ui" line="74"/> + <source>Method of using words</source> + <translation>Metoda używania słów</translation> + </message> + <message> + <location filename="../plugins/populatedictionary.ui" line="80"/> + <source>Ordered</source> + <translation>Uporządkowana</translation> + </message> + <message> + <location filename="../plugins/populatedictionary.ui" line="93"/> + <source>Randomly</source> + <translation>Losowa</translation> + </message> +</context> +<context> + <name>PopulateManager</name> + <message> + <location filename="../services/populatemanager.cpp" line="88"/> + <source>Table '%1' populated successfully.</source> + <translation>Zaludnianie tabeli '%1' przebiegło pomyślnie.</translation> + </message> +</context> +<context> + <name>PopulateRandom</name> + <message> + <location filename="../plugins/populaterandom.cpp" line="12"/> + <source>Random number</source> + <translation>Losowa liczba</translation> + </message> +</context> +<context> + <name>PopulateRandomConfig</name> + <message> + <location filename="../plugins/populaterandom.ui" line="20"/> + <source>Constant prefix</source> + <translation>Stały przedrostek</translation> + </message> + <message> + <location filename="../plugins/populaterandom.ui" line="26"/> + <source>No prefix</source> + <translation>Bez predrostka</translation> + </message> + <message> + <location filename="../plugins/populaterandom.ui" line="39"/> + <source>Minimum value</source> + <translation>Wartość minimalna</translation> + </message> + <message> + <location filename="../plugins/populaterandom.ui" line="61"/> + <source>Maximum value</source> + <translation>Wartość maksymalna</translation> + </message> + <message> + <location filename="../plugins/populaterandom.ui" line="86"/> + <source>Constant suffix</source> + <translation>Stały przyrostek</translation> + </message> + <message> + <location filename="../plugins/populaterandom.ui" line="92"/> + <source>No suffix</source> + <translation>Brak przyrostka</translation> + </message> +</context> +<context> + <name>PopulateRandomText</name> + <message> + <location filename="../plugins/populaterandomtext.cpp" line="12"/> + <source>Random text</source> + <translation>Losowy tekst</translation> + </message> +</context> +<context> + <name>PopulateRandomTextConfig</name> + <message> + <location filename="../plugins/populaterandomtext.ui" line="20"/> + <source>Use characters from common sets:</source> + <translation>Użyj znaków z zestawów:</translation> + </message> + <message> + <location filename="../plugins/populaterandomtext.ui" line="36"/> + <source>Minimum length</source> + <translation>Długość minimalna</translation> + </message> + <message> + <location filename="../plugins/populaterandomtext.ui" line="64"/> + <source>Letters from a to z.</source> + <translation>Litery od a do z.</translation> + </message> + <message> + <location filename="../plugins/populaterandomtext.ui" line="67"/> + <source>Alpha</source> + <translation>Litery</translation> + </message> + <message> + <location filename="../plugins/populaterandomtext.ui" line="77"/> + <source>Numbers from 0 to 9.</source> + <translation>Liczby od 0 do 9.</translation> + </message> + <message> + <location filename="../plugins/populaterandomtext.ui" line="80"/> + <source>Numeric</source> + <translation>Liczby</translation> + </message> + <message> + <location filename="../plugins/populaterandomtext.ui" line="90"/> + <source>A whitespace, a tab and a new line character.</source> + <translation>Znak biały, znak tabulacji, znak nowej linii.</translation> + </message> + <message> + <location filename="../plugins/populaterandomtext.ui" line="93"/> + <source>Whitespace</source> + <translation>Znak biały</translation> + </message> + <message> + <location filename="../plugins/populaterandomtext.ui" line="103"/> + <source>Includes all above and all others.</source> + <translation>Zawiera wszystkie powyższe, oraz wszystkie pozostałe.</translation> + </message> + <message> + <location filename="../plugins/populaterandomtext.ui" line="106"/> + <source>Binary</source> + <translation>Binarne</translation> + </message> + <message> + <location filename="../plugins/populaterandomtext.ui" line="119"/> + <source>Use characters from my custom set:</source> + <translation>Użyj znaków z mojego zestawu:</translation> + </message> + <message> + <location filename="../plugins/populaterandomtext.ui" line="132"/> + <source>Maximum length</source> + <translation>Długość maksymalna</translation> + </message> + <message> + <location filename="../plugins/populaterandomtext.ui" line="160"/> + <source>If you type some character multiple times, it's more likely to be used.</source> + <translation>Jeśli wpiszesz dany znak kilka razy, będzie on miał większą szansę na wylosowanie.</translation> + </message> +</context> +<context> + <name>PopulateScript</name> + <message> + <location filename="../plugins/populatescript.cpp" line="13"/> + <source>Script</source> + <translation>Skrypt</translation> + </message> +</context> +<context> + <name>PopulateScriptConfig</name> + <message> + <location filename="../plugins/populatescript.ui" line="26"/> + <source>Initialization code (optional)</source> + <translation>Kod inicjalizujący (opcjonalny)</translation> + </message> + <message> + <location filename="../plugins/populatescript.ui" line="45"/> + <source>Per step code</source> + <translation>Kod dla każdego kroku</translation> + </message> + <message> + <location filename="../plugins/populatescript.ui" line="70"/> + <source>Language</source> + <translation>Język</translation> + </message> + <message> + <location filename="../plugins/populatescript.ui" line="89"/> + <source>Help</source> + <translation>Pomoc</translation> + </message> +</context> +<context> + <name>PopulateSequence</name> + <message> + <location filename="../plugins/populatesequence.cpp" line="13"/> + <source>Sequence</source> + <translation>Sekwencja</translation> + </message> +</context> +<context> + <name>PopulateSequenceConfig</name> + <message> + <location filename="../plugins/populatesequence.ui" line="33"/> + <source>Start value:</source> + <translation>Wartość początkowa:</translation> + </message> + <message> + <location filename="../plugins/populatesequence.ui" line="56"/> + <source>Step:</source> + <translation>Wartość końcowa:</translation> + </message> +</context> +<context> + <name>PopulateWorker</name> + <message> + <location filename="../populateworker.cpp" line="23"/> + <source>Could not start transaction in order to perform table populating. Error details: %1</source> + <translation>Nie udało się rozpocząć transakcji w celu zaludnienia tabeli. Szczegóły błędu: %1</translation> + </message> + <message> + <location filename="../populateworker.cpp" line="56"/> + <source>Error while populating table: %1</source> + <translation>Błąd podczas zaludniania tabeli: %2</translation> + </message> + <message> + <location filename="../populateworker.cpp" line="65"/> + <source>Could not commit transaction after table populating. Error details: %1</source> + <translation>Nie udało się zatwierdzić transakcji po zaludnieniu tabeli. Szczegóły błędy: %1</translation> + </message> +</context> +<context> + <name>QObject</name> + <message> + <location filename="../dbversionconverter.cpp" line="137"/> + <location filename="../dbversionconverter.cpp" line="142"/> + <location filename="../dbversionconverter.cpp" line="195"/> + <location filename="../dbversionconverter.cpp" line="240"/> + <location filename="../dbversionconverter.cpp" line="245"/> + <location filename="../dbversionconverter.cpp" line="253"/> + <location filename="../dbversionconverter.cpp" line="331"/> + <source>SQLite %1 does not support '%2' statement.</source> + <translation>SQLite %1 nie obsługuje zapytania '%2'.</translation> + </message> + <message> + <location filename="../dbversionconverter.cpp" line="201"/> + <source>SQLite %1 does not support '%2' statement, but the regular table can be created instead if you proceed.</source> + <translation>SQLite %1 nie obsługuje zapytania '%2', ale stworzona zostanie zwykła tabela, jeśli będziesz kontynuować.</translation> + </message> + <message> + <location filename="../dbversionconverter.cpp" line="424"/> + <source>Could not parse statement: %1 +Error details: %2</source> + <translation>Nie udało się przeanalizować zapytania: %1 +Szczegóły błędu: %2</translation> + </message> + <message> + <location filename="../dbversionconverter.cpp" line="435"/> + <location filename="../dbversionconverter.cpp" line="461"/> + <location filename="../dbversionconverter.cpp" line="482"/> + <location filename="../dbversionconverter.cpp" line="515"/> + <source>SQLite %1 does not support the '%2' clause. Cannot convert '%3' statement with that clause.</source> + <translation>SQLite %1 nie obsługuje klauzuli '%2'. Nie można przekonwertować zapytania '%3' z tą klauzulą.</translation> + </message> + <message> + <location filename="../dbversionconverter.cpp" line="488"/> + <source>SQLite %1 does not support the '%2' clause in the '%3' statement.</source> + <translation>SQLite %1 nie obsługuje klauzuli '%2' w zapytaniu '%3'.</translation> + </message> + <message> + <source>SQLite %1 does not support the '%2' clause. Cannot convert '%1' statement with that clause.</source> + <translation type="obsolete">SQLite %1 nie obsługuje klauzuli '%2'. Nie można przekonwertować zapytania '%3' z tą klauzulą. {1 ?} {2'?} {1'?}</translation> + </message> + <message> + <location filename="../dbversionconverter.cpp" line="756"/> + <source>SQLite %1 does not support current date or time clauses in expressions.</source> + <translation>SQLite %1 nie obsługuje aktualnej daty lub klauzul czasowu w wyrażeniach.</translation> + </message> + <message> + <location filename="../dbversionconverter.cpp" line="767"/> + <location filename="../dbversionconverter.cpp" line="770"/> + <location filename="../dbversionconverter.cpp" line="781"/> + <source>SQLite %1 does not support '%2' clause in expressions.</source> + <translation>SQLite %1 nie obsługuje klauzuli '%2' w wyrażeniach.</translation> + </message> + <message> + <location filename="../impl/dbattacherimpl.cpp" line="109"/> + <source>Could not attach database %1: %2</source> + <translation>Nie udało się dołączyć bazy danych %1: %2</translation> + </message> + <message> + <location filename="../parser/parsercontext.cpp" line="108"/> + <location filename="../parser/parsercontext.cpp" line="110"/> + <source>Incomplete query.</source> + <translation>Niekompletne zapytanie.</translation> + </message> + <message> + <location filename="../parser/sqlite2_parse.cpp" line="1905"/> + <location filename="../parser/sqlite3_parse.cpp" line="2171"/> + <source>Parser stack overflow</source> + <translation>Przeciążenie stosu analizatora.</translation> + </message> + <message> + <location filename="../parser/sqlite2_parse.cpp" line="4471"/> + <location filename="../parser/sqlite3_parse.cpp" line="5086"/> + <source>Syntax error</source> + <translation>Błąd składni</translation> + </message> + <message> + <location filename="../plugins/populatedictionary.cpp" line="30"/> + <source>Could not open dictionary file %1 for reading.</source> + <translation>Nie udało się otworzyć pliku słownika %1 do odczytu.</translation> + </message> + <message> + <location filename="../plugins/populatedictionary.cpp" line="91"/> + <source>Dictionary file must exist and be readable.</source> + <translation>Plik słownika musi istnieć i musisz mieć prawa do jego odczytu.</translation> + </message> + <message> + <location filename="../plugins/populaterandom.cpp" line="53"/> + <source>Maximum value cannot be less than minimum value.</source> + <translation>Wartość maksymalna nie może być mniejsza niż wartość minimalna.</translation> + </message> + <message> + <location filename="../plugins/populaterandomtext.cpp" line="77"/> + <source>Maximum length cannot be less than minimum length.</source> + <translation>Długość maksymalna nie może być mniejsza niż długość minimalna.</translation> + </message> + <message> + <location filename="../plugins/populaterandomtext.cpp" line="88"/> + <source>Custom character set cannot be empty.</source> + <translation>Zestaw własnych znaków nie może być pusty.</translation> + </message> + <message> + <location filename="../plugins/populatescript.cpp" line="40"/> + <source>Could not find plugin to support scripting language: %1</source> + <translation>Nie udało się znaleźć wtyczki obsługującej język skryptowy: %1</translation> + </message> + <message> + <location filename="../plugins/populatescript.cpp" line="58"/> + <source>Error while executing populating initial code: %1</source> + <translation>Błąd podczas wykonywania kodu inicjalizującego zaludnianie: %1</translation> + </message> + <message> + <location filename="../plugins/populatescript.cpp" line="80"/> + <source>Error while executing populating code: %1</source> + <translation>Błąd podczas wykonywania kodu zaludniania: %1</translation> + </message> + <message> + <location filename="../plugins/populatescript.cpp" line="112"/> + <source>Select implementation language.</source> + <translation>Wybierz język implementacji.</translation> + </message> + <message> + <location filename="../plugins/populatescript.cpp" line="113"/> + <source>Implementation code cannot be empty.</source> + <translation>Kod implementacji nie może być pusty.</translation> + </message> + <message> + <location filename="../selectresolver.cpp" line="307"/> + <source>Could not resolve data source for column: %1</source> + <translation>Nie znaleziono źródła danych dla kolumny: %1</translation> + </message> + <message> + <location filename="../services/impl/configimpl.cpp" line="590"/> + <source>Could not initialize configuration file. Any configuration changes and queries history will be lost after application restart. Tried to initialize the file at following localizations: %1.</source> + <translation>Nie udało się zainicjalizować pliku konfiguracyjnego. Jakiekolwiek zmiany w konfiguracji i historia zapytań będą utracone po zrestartowaniu aplikacji. Próbowano zainicjalizować plik konfiguracyjny w następujących lokalizacjach: %1.</translation> + </message> + <message> + <location filename="../sqlitestudio.cpp" line="288"/> + <source>General purpose</source> + <comment>plugin category name</comment> + <translation>Ogólne</translation> + </message> + <message> + <location filename="../sqlitestudio.cpp" line="289"/> + <source>Database support</source> + <comment>plugin category name</comment> + <translation>Wsparcie baz danych</translation> + </message> + <message> + <location filename="../sqlitestudio.cpp" line="290"/> + <source>Code formatter</source> + <comment>plugin category name</comment> + <translation>Formatowanie kodu</translation> + </message> + <message> + <location filename="../sqlitestudio.cpp" line="291"/> + <source>Scripting languages</source> + <comment>plugin category name</comment> + <translation>Języki skryptowe</translation> + </message> + <message> + <location filename="../sqlitestudio.cpp" line="292"/> + <source>Exporting</source> + <comment>plugin category name</comment> + <translation>Eksportowanie</translation> + </message> + <message> + <location filename="../sqlitestudio.cpp" line="293"/> + <source>Importing</source> + <comment>plugin category name</comment> + <translation>Importowanie</translation> + </message> + <message> + <location filename="../sqlitestudio.cpp" line="294"/> + <source>Table populating</source> + <comment>plugin category name</comment> + <translation>Zaludnianie tabel</translation> + </message> + <message> + <location filename="../tablemodifier.cpp" line="106"/> + <source>Table %1 is referencing table %2, but the foreign key definition will not be updated for new table definition due to problems while parsing DDL of the table %3.</source> + <translation>Tabela %1 odwołuje się do tabeli %2, ale definicja klucza obcego nie zostanie zaktualizowane dla definicji nowej tabeli w związku z problemami przy analizowaniu DDL tabeli %3.</translation> + </message> + <message> + <location filename="../tablemodifier.cpp" line="373"/> + <source>All columns indexed by the index %1 are gone. The index will not be recreated after table modification.</source> + <translation>Wszystkie kolumny indeksowane przez indeks %1 już nie istnieją. Indeks ten nie będzie odtworzony po modyfikacji tabeli.</translation> + </message> + <message> + <location filename="../tablemodifier.cpp" line="402"/> + <source>Cannot not update trigger %1 according to table %2 modification.</source> + <translation>Nie można zaktualizować wyzwalacza %1 zgodnie z modyfikacjami tabeli %2.</translation> + </message> + <message> + <location filename="../tablemodifier.cpp" line="408"/> + <source>All columns covered by the trigger %1 are gone. The trigger will not be recreated after table modification.</source> + <translation>Wszystkie kolumny obsługiwane przez wyzwalacz %1 już nie istnieją. Wyzwalacz ten nie będzie odtworzony po modyfikacji tabeli.</translation> + </message> + <message> + <location filename="../tablemodifier.cpp" line="431"/> + <source>Cannot not update view %1 according to table %2 modifications. +The view will remain as it is.</source> + <translation>Nie można zaktualizować widoku %1 w związku z modyfikacjami tabeli %2. +Widok pozostanie nienaruszony.</translation> + </message> + <message> + <location filename="../tablemodifier.cpp" line="528"/> + <location filename="../tablemodifier.cpp" line="549"/> + <location filename="../tablemodifier.cpp" line="567"/> + <source>There is a problem with updating an %1 statement within %2 trigger. One of the SELECT substatements which might be referring to table %3 cannot be properly modified. Manual update of the trigger may be necessary.</source> + <translation>Jest problem ze zaktualizowaniem zapytania %1 w wyzwalaczu %2. Jedeno z podzapytań SELECT, które może odwoływać się do tabeli %2 nie może być poprawnie zmodyfikowane. Ręczna aktualizacja tego wyzwalacza może być niezbędna.</translation> + </message> + <message> + <location filename="../viewmodifier.cpp" line="25"/> + <source>Could not parse DDL of the view to be created. Details: %1</source> + <translation>Nie udało się przeanalizować DDL widoku do stworzenia. Szczegóły: %1</translation> + </message> + <message> + <location filename="../viewmodifier.cpp" line="34"/> + <source>Parsed query is not CREATE VIEW. It's: %1</source> + <translation>Przeanalizowane zapytanie to nie CREATE VIEW, ale: %1</translation> + </message> + <message> + <location filename="../viewmodifier.cpp" line="82"/> + <source>SQLiteStudio was unable to resolve columns returned by the new view, therefore it won't be able to tell which triggers might fail during the recreation process.</source> + <translation>SQLiteStudio nie było w stanie określić kolumn zwracanych przez nowy widok, w związku z czym nie może określić które wyzwalacze mogą się nie powieść podczas procesu odtwarzania.</translation> + </message> + <message> + <location filename="../db/abstractdb2.h" line="198"/> + <location filename="../db/abstractdb3.h" line="355"/> + <source>Could not open database: %1</source> + <translation>Nie udało się otworzyć bazy danych: %1</translation> + </message> + <message> + <location filename="../db/abstractdb3.h" line="375"/> + <source>Could not close database: %1</source> + <translation>Nie udało się zamknąć bazy danych: %1</translation> + </message> + <message> + <location filename="../db/abstractdb2.h" line="791"/> + <location filename="../db/abstractdb3.h" line="1078"/> + <source>Result set expired or no row available.</source> + <translation>Wyniki zapytania są nieaktualne, lub nie ma dostępnych wierszy.</translation> + </message> +</context> +<context> + <name>Query</name> + <message> + <source>Result set expired or no row available.</source> + <translation type="obsolete">Wyniki zapytania są nieaktualne, lub nie ma dostępnych wierszy.</translation> + </message> +</context> +<context> + <name>QueryExecutor</name> + <message> + <location filename="../db/queryexecutor.cpp" line="130"/> + <source>Execution interrupted.</source> + <translation>Wykonywanie przerwane.</translation> + </message> + <message> + <location filename="../db/queryexecutor.cpp" line="172"/> + <source>Database is not open.</source> + <translation>Baza danych nie jest otwarta.</translation> + </message> + <message> + <location filename="../db/queryexecutor.cpp" line="180"/> + <source>Only one query can be executed simultaneously.</source> + <translation>Tylko jedno zapytanie może być wykonywane w danym momencie.</translation> + </message> + <message> + <location filename="../db/queryexecutor.cpp" line="262"/> + <location filename="../db/queryexecutor.cpp" line="535"/> + <source>An error occured while executing the count(*) query, thus data paging will be disabled. Error details from the database: %1</source> + <translation>Wystąpił błąd podczas wykonywania zapytania count(*), przez co stronicowanie danych będzie wyłączone. Szczegóły błędy z bazy danych: %1</translation> + </message> + <message> + <location filename="../db/queryexecutor.cpp" line="446"/> + <source>SQLiteStudio was unable to extract metadata from the query. Results won't be editable.</source> + <translation>SQLiteStudio nie mogło uzyskać metadanych z zapytania. Nie będzie można edytować wyników zapytania.</translation> + </message> +</context> +<context> + <name>ScriptingQtDbProxy</name> + <message> + <location filename="../plugins/scriptingqtdbproxy.cpp" line="48"/> + <source>No database available in current context, while called QtScript's %1 command.</source> + <translation>Brak dostępnej bazy danych w bieżącym kontekście, podczas wywoływania komendy QtScript: %1.</translation> + </message> + <message> + <location filename="../plugins/scriptingqtdbproxy.cpp" line="65"/> + <source>Error from %1: %2</source> + <translation>Błąd z %1: %2</translation> + </message> +</context> +<context> + <name>SqlHistoryModel</name> + <message> + <location filename="../sqlhistorymodel.cpp" line="30"/> + <source>Database</source> + <comment>sql history header</comment> + <translation>Baza danych</translation> + </message> + <message> + <location filename="../sqlhistorymodel.cpp" line="32"/> + <source>Execution date</source> + <comment>sql history header</comment> + <translation>Data wykonania</translation> + </message> + <message> + <location filename="../sqlhistorymodel.cpp" line="34"/> + <source>Time spent</source> + <comment>sql history header</comment> + <translation>Czas trwania</translation> + </message> + <message> + <location filename="../sqlhistorymodel.cpp" line="36"/> + <source>Rows affected</source> + <comment>sql history header</comment> + <translation>Liczba wierszy</translation> + </message> + <message> + <location filename="../sqlhistorymodel.cpp" line="38"/> + <source>SQL</source> + <comment>sql history header</comment> + <translation>SQL</translation> + </message> +</context> +<context> + <name>UpdateManager</name> + <message> + <location filename="../services/updatemanager.cpp" line="129"/> + <source>An error occurred while checking for updates: %1.</source> + <translation>Wystąpił błąd podczas sprawdzania aktualizacji: %1</translation> + </message> + <message> + <location filename="../services/updatemanager.cpp" line="142"/> + <source>Could not check available updates, because server responded with invalid message format. It is safe to ignore this warning.</source> + <translation>Nie udało się sprawdzić aktualizacji, ponieważ serwer odpowiedział wiadomością w niepoprawnym formacie. Możesz spokojnie zignorować tą informację.</translation> + </message> + <message> + <location filename="../services/updatemanager.cpp" line="173"/> + <source>An error occurred while reading updates metadata: %1.</source> + <translation>Wystąpił błąd podczas odczytu metadanych aktualizacji: %1</translation> + </message> + <message> + <location filename="../services/updatemanager.cpp" line="186"/> + <source>Could not download updates, because server responded with invalid message format. You can try again later or download and install updates manually. See <a href="%1">User Manual</a> for details.</source> + <translation>Nie udało się ściągnąć aktualizacji, ponieważ serwer odpowiedział wiadomością w niepoprawnym formacie. Możesz spróbować jeszcze raz później, lub ściągnąć i stainstalować aktualizację ręcznie. Szczegóły: <a href="%1">Podręcznik użytkownika</a>.</translation> + </message> + <message> + <location filename="../services/updatemanager.cpp" line="193"/> + <source>Could not create temporary directory for downloading the update. Updating aborted.</source> + <translation>Nie udało się stworzyć katalogu tymczasowego w celu pobrania aktualizacji. Aktualizacja została przerwana.</translation> + </message> + <message> + <location filename="../services/updatemanager.cpp" line="204"/> + <source>There was no updates to download. Updating aborted.</source> + <translation>Nie znaleziono aktualizacji do pobrania. Aktualizacja przerwana.</translation> + </message> + <message> + <location filename="../services/updatemanager.cpp" line="239"/> + <source>Downloading: %1</source> + <translation>Pobieranie: %1</translation> + </message> + <message> + <location filename="../services/updatemanager.cpp" line="245"/> + <source>Could not determinate file name from update URL: %1. Updating aborted.</source> + <translation>Nie udało się określić nazwy pliku z URL aktualizacji: %1. Aktualizacja przerwana.</translation> + </message> + <message> + <location filename="../services/updatemanager.cpp" line="253"/> + <source>Failed to open file '%1' for writting: %2. Updating aborted.</source> + <translation>Nie udało się otworzyć pliku '%1' do zapisu: %2. Aktualizacja przerwana.</translation> + </message> + <message> + <location filename="../services/updatemanager.cpp" line="274"/> + <source>Installing updates.</source> + <translation>Instalowanie aktualizacji.</translation> + </message> + <message> + <location filename="../services/updatemanager.cpp" line="285"/> + <source>Could not copy current application directory into %1 directory.</source> + <translation>Nie udało się skopiować bieżącego katalogu aplikacji do katalogu %1.</translation> + </message> + <message> + <location filename="../services/updatemanager.cpp" line="338"/> + <source>Could not create directory %1.</source> + <translation>Nie udało się stworzyć katalogu %1.</translation> + </message> + <message> + <location filename="../services/updatemanager.cpp" line="346"/> + <source>Could not rename directory %1 to %2. +Details: %3</source> + <translation>Nie udało się zmienić nazwy katalogu %1 na %2. +Szczegóły: %3</translation> + </message> + <message> + <location filename="../services/updatemanager.cpp" line="350"/> + <source>Cannot not rename directory %1 to %2. +Details: %3</source> + <translation>Nie można zmienić nazwy katalogu %1 na %2. +Szczegóły: %3</translation> + </message> + <message> + <location filename="../services/updatemanager.cpp" line="358"/> + <source>Could not move directory %1 to %2 and also failed to restore original directory, so the original SQLiteStudio directory is now located at: %3</source> + <translation>Nie udało się przenieść katalogu %1 do %2, oraz nie udało się przywrócić originalnego katalog, więc originalny katalog SQLiteStudio jest mieści się teraz w: %3</translation> + </message> + <message> + <location filename="../services/updatemanager.cpp" line="363"/> + <source>Could not rename directory %1 to %2. Rolled back to the original SQLiteStudio version.</source> + <translation>Nie udało się zmienić nazwy katalogu %1 na %2. Przywrócono originalną wersję SQLiteStudio.</translation> + </message> + <message> + <location filename="../services/updatemanager.cpp" line="442"/> + <source>Could not unpack component %1 into %2 directory.</source> + <translation>Nie udało się rozpakować komponentu %1 do katalogu %2.</translation> + </message> + <message> + <location filename="../services/updatemanager.cpp" line="553"/> + <source>Could not find permissions elevator application to run update as a root. Looked for: %1</source> + <translation>Nie udało się znaleźć narzędzia do podnoszenia uprawnień aplikacji, aby uruchomić aktualizację jako administrator. Szukano następujących: %1</translation> + </message> + <message> + <location filename="../services/updatemanager.cpp" line="560"/> + <source>Could not execute final updating steps as root: %1</source> + <translation>Nie udało się wykonać ostatnich kroków jako administrator: %1</translation> + </message> + <message> + <location filename="../services/updatemanager.cpp" line="589"/> + <location filename="../services/updatemanager.cpp" line="598"/> + <location filename="../services/updatemanager.cpp" line="611"/> + <location filename="../services/updatemanager.cpp" line="621"/> + <source>Could not execute final updating steps as admin: %1</source> + <translation>Nie udało się wykonać ostatnich kroków jako administrator: %1</translation> + </message> + <message> + <location filename="../services/updatemanager.cpp" line="589"/> + <source>Cannot create temporary directory for updater.</source> + <translation>Nie można stworzyć tymczasowego katalogu dla aktualizacji.</translation> + </message> + <message> + <location filename="../services/updatemanager.cpp" line="598"/> + <source>Cannot create updater script file.</source> + <translation>Nie można utworzyć skryptu aktualizacji.</translation> + </message> + <message> + <location filename="../services/updatemanager.cpp" line="631"/> + <source>Updating canceled.</source> + <translation>Aktualizacja wycofana.</translation> + </message> + <message> + <location filename="../services/updatemanager.cpp" line="659"/> + <source>Could not execute final updating steps as administrator.</source> + <translation>Nie udało się wykonać ostatich kroków aktualizacji jako administrator.</translation> + </message> + <message> + <location filename="../services/updatemanager.cpp" line="671"/> + <source>Could not execute final updating steps as administrator. Updater startup timed out.</source> + <translation>Nie udało się wykonać ostatich kroków aktualizacji jako administrator. Przekroczono limit czasu oczekiwania.</translation> + </message> + <message> + <location filename="../services/updatemanager.cpp" line="677"/> + <source>Could not execute final updating steps as administrator. Updater operation timed out.</source> + <translation>Nie udało się wykonać ostatich kroków aktualizacji jako administrator. Przekroczono limit czasu oczekiwania.</translation> + </message> + <message> + <location filename="../services/updatemanager.cpp" line="694"/> + <source>Could not clean up temporary directory %1. You can delete it manually at any time.</source> + <translation>Nie udało się wyczyścić katalogu tymczasowego %1. Możesz go usunąć ręcznie w dowolnym momencie.</translation> + </message> + <message> + <location filename="../services/updatemanager.cpp" line="730"/> + <source>Could not run new version for continuing update.</source> + <translation>Nie udało się uruchomić nowej wersji w celu kontynuowania aktualizacji.</translation> + </message> + <message> + <location filename="../services/updatemanager.cpp" line="815"/> + <source>Package not in tar.gz format, cannot install: %1</source> + <translation>Paczka nie jest w formacie tar.gz, nie można zainstalować: %1</translation> + </message> + <message> + <location filename="../services/updatemanager.cpp" line="822"/> + <source>Package %1 cannot be installed, because cannot move it to directory: %2</source> + <translation>Paczka %1 nie może być zainstalowana, ponieważ nie można przenieść jej do katalogu: %2</translation> + </message> + <message> + <location filename="../services/updatemanager.cpp" line="831"/> + <source>Package %1 cannot be installed, because cannot unpack it: %2</source> + <translation>Paczka %1 nie może być zainstalowana, ponieważ nie można jej rozpakować: %2</translation> + </message> + <message> + <location filename="../services/updatemanager.cpp" line="850"/> + <source>Package not in zip format, cannot install: %1</source> + <translation>Paczka nie jest w formacie zip, nie można zainstalować: %1</translation> + </message> + <message> + <location filename="../services/updatemanager.cpp" line="857"/> + <source>Package %1 cannot be installed, because cannot unzip it to directory %2: %3</source> + <translation>Paczka %1 nie może być zainstalowana, ponieważ nie można jej rozpakować do katalogu %2: %3</translation> + </message> + <message> + <location filename="../services/updatemanager.cpp" line="871"/> + <source>Package %1 cannot be installed, because cannot unzip it to directory: %2</source> + <translation>Paczka %1 nie może być zainstalowana, ponieważ nie można jej rozpakować do katalogu %2</translation> + </message> + <message> + <location filename="../services/updatemanager.cpp" line="921"/> + <location filename="../services/updatemanager.cpp" line="930"/> + <source>Could not rename directory %1 to %2.</source> + <translation>Nie udało się zmienić nazwy katalogu %1 na %2.</translation> + </message> + <message> + <location filename="../services/updatemanager.cpp" line="943"/> + <source>Could not delete directory %1.</source> + <translation>Nie udało się skasować katalogu %1.</translation> + </message> + <message> + <location filename="../services/updatemanager.cpp" line="959"/> + <source>Error executing update command: %1 +Error message: %2</source> + <translation>Błąd podczas wykonywania polecenia aktualizacji: %1 +Treść błędu: %2</translation> + </message> + <message> + <location filename="../services/updatemanager.cpp" line="1026"/> + <source>An error occurred while downloading updates: %1. Updating aborted.</source> + <translation>Wystąpił błąd podczas pobierania aktualizacji: %1. Aktualizacja przerwana.</translation> + </message> +</context> +</TS> |
