From: Kirill Yukhin <kyukhin@tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Cc: tarantool-patches@freelists.org
Subject: [tarantool-patches] Re: [PATCH] sql: remove pragma schema_version
Date: Tue, 31 Jul 2018 16:20:53 +0300 [thread overview]
Message-ID: <20180731132053.56u6bhsvtwx3xgoe@tarantool.org> (raw)
In-Reply-To: <30890100-791e-7207-2c58-dea85099da4f@tarantool.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
next prev parent reply other threads:[~2018-07-31 13:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-31 10:54 [tarantool-patches] " Kirill Yukhin
2018-07-31 10:56 ` [tarantool-patches] " Kirill Yukhin
2018-07-31 12:33 ` Vladislav Shpilevoy
2018-07-31 13:20 ` Kirill Yukhin [this message]
2018-08-01 11:30 ` Kirill Yukhin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180731132053.56u6bhsvtwx3xgoe@tarantool.org \
--to=kyukhin@tarantool.org \
--cc=tarantool-patches@freelists.org \
--cc=v.shpilevoy@tarantool.org \
--subject='[tarantool-patches] Re: [PATCH] sql: remove pragma schema_version' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox