From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Kirill Shcherbatov <kshcherbatov@tarantool.org>,
tarantool-patches@freelists.org
Subject: [tarantool-patches] Re: [PATCH v2 07/11] sql: move sqlite3DeleteTrigger to sql.h
Date: Wed, 13 Jun 2018 21:53:51 +0300 [thread overview]
Message-ID: <36043cc5-accb-51b3-5794-11bdf4361758@tarantool.org> (raw)
In-Reply-To: <8e81edd81ecfcb8b90330fde614c95488df15dfc.1528535873.git.kshcherbatov@tarantool.org>
Thanks for the patch!
Please, rationalize the patch in the commit message.
I know why the patch is needed, but Nikita, for example,
does not. Anyone else either.
On 09/06/2018 12:32, Kirill Shcherbatov wrote:
> Part of #3273.
> ---
> src/box/sql.h | 9 +++++++++
> src/box/sql/callback.c | 2 +-
> src/box/sql/sqliteInt.h | 3 +--
> src/box/sql/status.c | 6 +++---
> src/box/sql/tokenize.c | 2 +-
> src/box/sql/trigger.c | 25 +++++++++++--------------
> 6 files changed, 26 insertions(+), 21 deletions(-)
>
Please, apply this:
diff --git a/src/box/sql/callback.c b/src/box/sql/callback.c
index e3f36e301..bd8db9994 100644
--- a/src/box/sql/callback.c
+++ b/src/box/sql/callback.c
@@ -290,10 +290,9 @@ sqlite3SchemaClear(sqlite3 * db)
temp1 = pSchema->tblHash;
temp2 = pSchema->trigHash;
sqlite3HashInit(&pSchema->trigHash);
- for (pElem = sqliteHashFirst(&temp2); pElem;
- pElem = sqliteHashNext(pElem)) {
- sql_trigger_delete(0, (Trigger *) sqliteHashData(pElem));
- }
+ for (pElem = sqliteHashFirst(&temp2); pElem != NULL;
+ pElem = sqliteHashNext(pElem))
+ sql_trigger_delete(NULL, (Trigger *) sqliteHashData(pElem));
sqlite3HashClear(&temp2);
sqlite3HashInit(&pSchema->tblHash);
for (pElem = sqliteHashFirst(&temp1); pElem;
diff --git a/src/box/sql/trigger.c b/src/box/sql/trigger.c
index 053dadbd9..5e21cfca6 100644
--- a/src/box/sql/trigger.c
+++ b/src/box/sql/trigger.c
@@ -185,11 +185,10 @@ sqlite3BeginTrigger(Parse * pParse, /* The parse context of the CREATE TRIGGER s
sqlite3SrcListDelete(db, pTableName);
sqlite3IdListDelete(db, pColumns);
sql_expr_delete(db, pWhen, false);
- if (!pParse->pNewTrigger) {
+ if (pParse->pNewTrigger == NULL)
sql_trigger_delete(db, pTrigger);
- } else {
+ else
assert(pParse->pNewTrigger == pTrigger);
- }
}
/*
next prev parent reply other threads:[~2018-06-13 18:53 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-09 9:58 [tarantool-patches] [PATCH v2 00/11] sql: remove Triggers to server Kirill Shcherbatov
2018-06-09 9:32 ` [tarantool-patches] [PATCH v2 10/11] sql: move " Kirill Shcherbatov
2018-06-13 18:53 ` [tarantool-patches] " Vladislav Shpilevoy
2018-06-14 16:12 ` Kirill Shcherbatov
2018-06-28 7:18 ` Konstantin Osipov
2018-06-28 7:33 ` Kirill Shcherbatov
2018-06-09 9:32 ` [tarantool-patches] [PATCH v2 11/11] sql: VDBE tests for trigger existence Kirill Shcherbatov
2018-06-13 18:53 ` [tarantool-patches] " Vladislav Shpilevoy
2018-06-14 16:12 ` Kirill Shcherbatov
2018-06-09 9:32 ` [tarantool-patches] [PATCH v2 02/11] box: move db->pShchema init to sql_init Kirill Shcherbatov
2018-06-09 9:32 ` [tarantool-patches] [PATCH v2 04/11] sql: fix sql len in tarantoolSqlite3RenameTrigger Kirill Shcherbatov
2018-06-09 9:32 ` [tarantool-patches] [PATCH v2 06/11] sql: refactor sql_expr_compile to return AST Kirill Shcherbatov
2018-06-13 18:53 ` [tarantool-patches] " Vladislav Shpilevoy
2018-06-14 16:12 ` Kirill Shcherbatov
2018-06-09 9:32 ` [tarantool-patches] [PATCH v2 07/11] sql: move sqlite3DeleteTrigger to sql.h Kirill Shcherbatov
2018-06-13 18:53 ` Vladislav Shpilevoy [this message]
2018-06-14 16:12 ` [tarantool-patches] " Kirill Shcherbatov
2018-06-09 9:32 ` [tarantool-patches] [PATCH v2 08/11] box: sort error codes in misc.test Kirill Shcherbatov
2018-06-09 9:32 ` [tarantool-patches] [PATCH v2 09/11] sql: new _trigger space format with space_id Kirill Shcherbatov
2018-06-13 18:53 ` [tarantool-patches] " Vladislav Shpilevoy
2018-06-14 16:12 ` Kirill Shcherbatov
2018-06-09 9:58 ` [tarantool-patches] [PATCH v2 01/11] box: remove migration from alpha 1.8.2 and 1.8.4 Kirill Shcherbatov
2018-06-09 9:58 ` [tarantool-patches] [PATCH v2 03/11] sql: fix leak on CREATE TABLE and resolve self ref Kirill Shcherbatov
2018-06-13 18:53 ` [tarantool-patches] " Vladislav Shpilevoy
2018-06-14 16:12 ` Kirill Shcherbatov
2018-06-09 9:58 ` [tarantool-patches] [PATCH v2 05/11] box: port schema_find_id to C Kirill Shcherbatov
2018-06-13 18:53 ` [tarantool-patches] " Vladislav Shpilevoy
2018-06-14 16:12 ` Kirill Shcherbatov
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=36043cc5-accb-51b3-5794-11bdf4361758@tarantool.org \
--to=v.shpilevoy@tarantool.org \
--cc=kshcherbatov@tarantool.org \
--cc=tarantool-patches@freelists.org \
--subject='[tarantool-patches] Re: [PATCH v2 07/11] sql: move sqlite3DeleteTrigger to sql.h' \
/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