Tarantool development patches archive
 help / color / mirror / Atom feed
From: Kirill Shcherbatov <kshcherbatov@tarantool.org>
To: tarantool-patches@freelists.org
Cc: "n.pettik@corp.mail.ru" <n.pettik@corp.mail.ru>
Subject: [tarantool-patches] Re: [PATCH v4 6/6] sql: VDBE tests for trigger existence
Date: Mon, 25 Jun 2018 18:27:54 +0300	[thread overview]
Message-ID: <a9c518e7-8925-8eca-c768-8b5d3bb5d9cf@tarantool.org> (raw)
In-Reply-To: <0CD65924-D11C-401F-A9D5-4EC06F5310A8@tarantool.org>

> Why? If you didn’t check it, you simply would get ‘duplicate key error’.
> So, you did it to display more informative error..?
> 
>> tested on each VDBE
>> execution attempt, not on Parser iteration.
> 
> And? After this sentence you should explain changes which you patch provides.
 Trigger presence in system should be tested on each VDBE
    execution attempt, not on Parser iteration as system state
    could be changed between opcode run.
    With this patch, such checks are the part of VDBE program
    looking to the _trigger space and raise error message if
    tuple with specified key already exists.


> I would call it vdbe_emit_halt_if_exists().
> Or vdbe_emit_halt_on_duplication()...
+vdbe_emit_halt_if_exists(struct Parse *parser, int space_id, int index_id,


> In previous patch, you used sqlite3DbMalloc() function without using diag_set(),
> since in case of fail it would call sqlite3OomFault(db);
> Lets handle all usages of sqlite3DbMalloc() in the same way.
Ok.

> The same is here.
Ok.

> Why do you set ON_CONFLICT_ACTION_FAIL? You can just skip this arg with 0.
Ok.

> Why this func is under SQLITE_OMIT_CTE guard?
Moved.

> Why have you duplicated this assert? It occurs 2 lines above.
Fixed.

> Rephrase last sentence - I can’t parse it..
+ * The function allocates error and name resources for VDBE itself.

> How can index id contain ’string primary key’?
> Name of object to test on existence.
> Error message to display on VDBE halt.
Ok.

> Looks like redundant diff. If you wanted to make comments fit into 66 chars,
> you would better do it for the whole comment.
Refactored while comment.


> Why did you provide this diff? AFAIK in this particular case these two calls
> are *almost* equivalent.
No, you set SQL_TARANTOOL_ERROR here that require diag error been set with my patch.

  reply	other threads:[~2018-06-25 15:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-20 10:46 [tarantool-patches] [PATCH v4 0/6] sql: remove Triggers to server Kirill Shcherbatov
2018-06-20 10:46 ` [tarantool-patches] [PATCH v4 1/6] sql: refactor sql_expr_compile to return AST Kirill Shcherbatov
2018-06-20 10:46 ` [tarantool-patches] [PATCH v4 2/6] sql: move sqlite3DeleteTrigger to sql.h Kirill Shcherbatov
2018-06-20 10:46 ` [tarantool-patches] [PATCH v4 3/6] box: sort error codes in misc.test Kirill Shcherbatov
2018-06-20 10:46 ` [tarantool-patches] [PATCH v4 4/6] sql: new _trigger space format with space_id Kirill Shcherbatov
2018-06-20 10:46 ` [tarantool-patches] [PATCH v4 5/6] sql: move Triggers to server Kirill Shcherbatov
2018-06-24 15:24   ` [tarantool-patches] " n.pettik
2018-06-24 20:41     ` Vladislav Shpilevoy
2018-06-25 15:27     ` Kirill Shcherbatov
2018-06-26 14:05       ` n.pettik
2018-06-26 16:13         ` Kirill Shcherbatov
2018-06-20 10:46 ` [tarantool-patches] [PATCH v4 6/6] sql: VDBE tests for trigger existence Kirill Shcherbatov
2018-06-24 15:25   ` [tarantool-patches] " n.pettik
2018-06-25 15:27     ` Kirill Shcherbatov [this message]
2018-06-26 14:49       ` n.pettik

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=a9c518e7-8925-8eca-c768-8b5d3bb5d9cf@tarantool.org \
    --to=kshcherbatov@tarantool.org \
    --cc=n.pettik@corp.mail.ru \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH v4 6/6] sql: VDBE tests for trigger existence' \
    /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