From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 0CBE0273FA for ; Tue, 31 Jul 2018 09:22:28 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SmkH2L5Lj2QG for ; Tue, 31 Jul 2018 09:22:27 -0400 (EDT) Received: from smtp38.i.mail.ru (smtp38.i.mail.ru [94.100.177.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id B5870270F6 for ; Tue, 31 Jul 2018 09:22:27 -0400 (EDT) Date: Tue, 31 Jul 2018 16:20:53 +0300 From: Kirill Yukhin Subject: [tarantool-patches] Re: [PATCH] sql: remove pragma schema_version Message-ID: <20180731132053.56u6bhsvtwx3xgoe@tarantool.org> References: <836ab78c9ea4741455b7c8c226bd7919f635af6f.1533034378.git.kyukhin@tarantool.org> <30890100-791e-7207-2c58-dea85099da4f@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <30890100-791e-7207-2c58-dea85099da4f@tarantool.org> Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: Vladislav Shpilevoy Cc: tarantool-patches@freelists.org Hello Vlad, On 31 июл 15:33, Vladislav Shpilevoy wrote: > Hi! Thanks for the patch! I've pushed my fixes as a separate > commit on the branch. Thanks, I've squashed your changes. Also, I've squashed into main patch this extra: diff --git a/src/box/sql/alter.c b/src/box/sql/alter.c index d846fbd..91b6515 100644 --- a/src/box/sql/alter.c +++ b/src/box/sql/alter.c @@ -111,10 +111,7 @@ sqlite3AlterRenameTable(Parse * pParse, /* Parser context. */ pTab->def->name); goto exit_rename_table; } - /* Begin a transaction for database. - * Then modify the schema cookie (since the ALTER TABLE modifies the - * schema). - */ + /* Begin a transaction for database. */ v = sqlite3GetVdbe(pParse); if (v == 0) { goto exit_rename_table; @@ -304,7 +301,7 @@ sqlite3AlterBeginAddColumn(Parse * pParse, SrcList * pSrc) pNew->addColOffset = pTab->addColOffset; pNew->nTabRef = 1; - /* Begin a transaction and increment the schema cookie. */ + /* Begin a transaction. */ sql_set_multi_write(pParse, false); v = sqlite3GetVdbe(pParse); if (!v) diff --git a/src/box/sql/build.c b/src/box/sql/build.c index dcbeeb0..d812eb9 100644 --- a/src/box/sql/build.c +++ b/src/box/sql/build.c @@ -179,10 +179,8 @@ sqlite3LocateTable(Parse * pParse, /* context in which to report errors */ if (p == NULL) { const char *zMsg = flags & LOCATE_VIEW ? "no such view" : "no such table"; - if ((flags & LOCATE_NOERR) == 0) { + if ((flags & LOCATE_NOERR) == 0) sqlite3ErrorMsg(pParse, "%s: %s", zMsg, zName); - pParse->checkSchema = 1; - } } return p; diff --git a/src/box/sql/insert.c b/src/box/sql/insert.c index 432e003..edd0c31 100644 --- a/src/box/sql/insert.c +++ b/src/box/sql/insert.c @@ -469,7 +469,6 @@ sqlite3Insert(Parse * pParse, /* Parser context */ sqlite3ErrorMsg(pParse, "table %S has no column named %s", pTabList, 0, pColumn->a[i].zName); - pParse->checkSchema = 1; goto insert_cleanup; } if (bit_test(used_columns, j)) { diff --git a/src/box/sql/resolve.c b/src/box/sql/resolve.c index a4767f2..280ecd9 100644 --- a/src/box/sql/resolve.c +++ b/src/box/sql/resolve.c @@ -434,7 +434,6 @@ lookupName(Parse * pParse, /* The parsing context */ } else { sqlite3ErrorMsg(pParse, "%s: %s", zErr, zCol); } - pParse->checkSchema = 1; pTopNC->nErr++; } diff --git a/src/box/sql/select.c b/src/box/sql/select.c index d060a46..d824b8b 100644 --- a/src/box/sql/select.c +++ b/src/box/sql/select.c @@ -4385,7 +4385,6 @@ sqlite3IndexedByLookup(Parse * pParse, struct SrcList_item *pFrom) if (!pIdx) { sqlite3ErrorMsg(pParse, "no such index: %s", zIndexedBy, 0); - pParse->checkSchema = 1; return SQLITE_ERROR; } pFrom->pIBIndex = pIdx; diff --git a/src/box/sql/sqliteInt.h b/src/box/sql/sqliteInt.h index 8b0b4b7..468b6c6 100644 --- a/src/box/sql/sqliteInt.h +++ b/src/box/sql/sqliteInt.h @@ -2824,7 +2824,6 @@ struct Parse { Vdbe *pVdbe; /* An engine for executing database bytecode */ int rc; /* Return code from execution */ u8 colNamesSet; /* TRUE after OP_ColumnName has been issued to pVdbe */ - u8 checkSchema; /* Causes schema cookie check after an error */ u8 nTempReg; /* Number of temporary registers in aTempReg[] */ u8 isMultiWrite; /* True if statement may modify/insert multiple rows */ u8 mayAbort; /* True if statement may throw an ABORT exception */ diff --git a/src/box/sql/update.c b/src/box/sql/update.c index 489a456..a2f6c73 100644 --- a/src/box/sql/update.c +++ b/src/box/sql/update.c @@ -217,7 +217,6 @@ sqlite3Update(Parse * pParse, /* The parser context */ if (j >= (int)def->field_count) { sqlite3ErrorMsg(pParse, "no such column: %s", pChanges->a[i].zName); - pParse->checkSchema = 1; goto update_cleanup; } } -- Regards, Kirill Yukhin