From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org> To: Nikita Pettik <korablev@tarantool.org> Cc: tarantool-patches@dev.tarantool.org Subject: Re: [Tarantool-patches] [PATCH v2 3/6] sql: extend result set with collation Date: Tue, 24 Dec 2019 16:30:00 +0100 [thread overview] Message-ID: <495acabb-26b5-ae5d-bc9b-d12b3e475c32@tarantool.org> (raw) In-Reply-To: <20191224002602.GA98237@tarantool.org> Hi! Thanks for the patch! I've pushed my review fixes on top of this commit. See it below and on the branch. > diff --git a/src/box/sql/vdbeapi.c b/src/box/sql/vdbeapi.c > index 48db0bf43..e57a80334 100644 > --- a/src/box/sql/vdbeapi.c > +++ b/src/box/sql/vdbeapi.c > @@ -745,6 +745,15 @@ sql_column_datatype(sql_stmt *stmt, int n) > return p->metadata[n].type; > } > > +const char * > +sql_column_coll(sql_stmt *stmt, int n) > +{ > + struct Vdbe *p = (struct Vdbe *) stmt; > + assert(n < sql_column_count(stmt) && n >= 0); > + return p->metadata[n].collation; > +} > + > + 1. Double empty line. > /******************************* sql_bind_ ************************** > * > * Routines used to attach values to wildcards in a compiled SQL statement. > diff --git a/test/sql/full_metadata.test.lua b/test/sql/full_metadata.test.lua > new file mode 100644 > index 000000000..4aa2492a1 > --- /dev/null > +++ b/test/sql/full_metadata.test.lua 2. Seems like you use tabs in that test file. According to our code style, we use 4-space blocks in Lua files instead of tabs. ================================================================================ commit 635cd1999708d0d731e46ddda64a97e4da55d082 Author: Vladislav Shpilevoy <v.shpilevoy@tarantool.org> Date: Tue Dec 24 15:46:28 2019 +0100 Review fix 3/6 diff --git a/src/box/sql/vdbeapi.c b/src/box/sql/vdbeapi.c index e57a80334..61b98e0c5 100644 --- a/src/box/sql/vdbeapi.c +++ b/src/box/sql/vdbeapi.c @@ -753,7 +753,6 @@ sql_column_coll(sql_stmt *stmt, int n) return p->metadata[n].collation; } - /******************************* sql_bind_ ************************** * * Routines used to attach values to wildcards in a compiled SQL statement. diff --git a/test/sql/full_metadata.result b/test/sql/full_metadata.result index aebb938fe..76d6107a1 100644 --- a/test/sql/full_metadata.result +++ b/test/sql/full_metadata.result @@ -26,18 +26,18 @@ test_run:cmd("setopt delimiter ';'") | - true | ... if remote then - box.schema.user.grant('guest','read, write, execute', 'universe') - box.schema.user.grant('guest', 'create', 'space') - cn = netbox.connect(box.cfg.listen) - execute = function(...) return cn:execute(...) end + box.schema.user.grant('guest','read, write, execute', 'universe') + box.schema.user.grant('guest', 'create', 'space') + cn = netbox.connect(box.cfg.listen) + execute = function(...) return cn:execute(...) end else - execute = function(...) - local res, err = box.execute(...) - if err ~= nil then - error(err) - end - return res - end + execute = function(...) + local res, err = box.execute(...) + if err ~= nil then + error(err) + end + return res + end end; | --- | ... @@ -90,9 +90,9 @@ test_run:cmd("setopt delimiter ';'") | - true | ... if remote then - cn:close() - box.schema.user.revoke('guest', 'read, write, execute', 'universe') - box.schema.user.revoke('guest', 'create', 'space') + cn:close() + box.schema.user.revoke('guest', 'read, write, execute', 'universe') + box.schema.user.revoke('guest', 'create', 'space') end; | --- | ... diff --git a/test/sql/full_metadata.test.lua b/test/sql/full_metadata.test.lua index 4aa2492a1..7b4637b1e 100644 --- a/test/sql/full_metadata.test.lua +++ b/test/sql/full_metadata.test.lua @@ -8,18 +8,18 @@ remote = test_run:get_cfg('remote') == 'true' execute = nil test_run:cmd("setopt delimiter ';'") if remote then - box.schema.user.grant('guest','read, write, execute', 'universe') - box.schema.user.grant('guest', 'create', 'space') - cn = netbox.connect(box.cfg.listen) - execute = function(...) return cn:execute(...) end + box.schema.user.grant('guest','read, write, execute', 'universe') + box.schema.user.grant('guest', 'create', 'space') + cn = netbox.connect(box.cfg.listen) + execute = function(...) return cn:execute(...) end else - execute = function(...) - local res, err = box.execute(...) - if err ~= nil then - error(err) - end - return res - end + execute = function(...) + local res, err = box.execute(...) + if err ~= nil then + error(err) + end + return res + end end; test_run:cmd("setopt delimiter ''"); @@ -34,9 +34,9 @@ execute("PRAGMA full_metadata = false;") test_run:cmd("setopt delimiter ';'") if remote then - cn:close() - box.schema.user.revoke('guest', 'read, write, execute', 'universe') - box.schema.user.revoke('guest', 'create', 'space') + cn:close() + box.schema.user.revoke('guest', 'read, write, execute', 'universe') + box.schema.user.revoke('guest', 'create', 'space') end; test_run:cmd("setopt delimiter ''");
next prev parent reply other threads:[~2019-12-24 15:30 UTC|newest] Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-12-11 13:44 [Tarantool-patches] [PATCH v2 0/6] sql: extended metadata Nikita Pettik [not found] ` <cover.1576071711.git.korablev@tarantool.org> 2019-12-11 13:44 ` [Tarantool-patches] [PATCH v2 1/6] sql: refactor resulting set metadata Nikita Pettik 2019-12-11 13:44 ` [Tarantool-patches] [PATCH v2 2/6] sql: fix possible null dereference in sql_expr_coll() Nikita Pettik 2019-12-11 13:44 ` [Tarantool-patches] [PATCH v2 3/6] sql: extend result set with collation Nikita Pettik 2019-12-18 0:29 ` Vladislav Shpilevoy 2019-12-24 0:26 ` Nikita Pettik 2019-12-24 15:30 ` Vladislav Shpilevoy [this message] 2019-12-11 13:44 ` [Tarantool-patches] [PATCH v2 4/6] sql: extend result set with nullability Nikita Pettik 2019-12-18 0:29 ` Vladislav Shpilevoy 2019-12-24 0:26 ` Nikita Pettik 2019-12-11 13:44 ` [Tarantool-patches] [PATCH v2 5/6] sql: extend result set with autoincrement Nikita Pettik 2019-12-18 0:29 ` Vladislav Shpilevoy 2019-12-24 0:26 ` Nikita Pettik 2019-12-24 15:30 ` Vladislav Shpilevoy 2019-12-25 12:17 ` Nikita Pettik 2019-12-25 15:40 ` Vladislav Shpilevoy 2019-12-25 23:18 ` Nikita Pettik 2019-12-11 13:44 ` [Tarantool-patches] [PATCH v2 6/6] sql: extend result set with alias Nikita Pettik 2019-12-18 0:29 ` Vladislav Shpilevoy 2019-12-24 0:26 ` Nikita Pettik 2019-12-24 15:34 ` Vladislav Shpilevoy 2019-12-26 11:24 ` Nikita Pettik 2019-12-27 11:53 ` Vladislav Shpilevoy 2019-12-27 23:44 ` Nikita Pettik 2019-12-28 9:29 ` Vladislav Shpilevoy
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=495acabb-26b5-ae5d-bc9b-d12b3e475c32@tarantool.org \ --to=v.shpilevoy@tarantool.org \ --cc=korablev@tarantool.org \ --cc=tarantool-patches@dev.tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH v2 3/6] sql: extend result set with collation' \ /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