From: Konstantin Osipov <kostja@tarantool.org>
To: tarantool-patches@freelists.org
Cc: kyukhin@tarantool.org, imeevma@tarantool.org,
Mergen Imeev <imeevma@gmail.com>
Subject: [tarantool-patches] Re: [PATCH v2 1/1] sql: parameter binding for box.execute()
Date: Tue, 2 Apr 2019 11:30:10 +0300 [thread overview]
Message-ID: <20190402083010.GN25072@chai> (raw)
In-Reply-To: <01d0c735518c8de3b48050395d9f83cf4dc77d7e.1554148852.git.v.shpilevoy@tarantool.org>
* Vladislav Shpilevoy <v.shpilevoy@tarantool.org> [19/04/01 23:03]:
> + /* Check that the table is one-row sized. */
Check that the table has only one row.
> + /*
> + * Name should be saved in allocated memory as it
> + * will be poped from Lua stack.
> + */
popped
> + case MP_STR:
> + /*
> + * Data should be saved in allocated memory as it
> + * will be poped from Lua stack.
> + */
popped
> + case MP_BOOL:
> + /* SQLite doesn't support boolean. Use int instead. */
SQL
The patch itself is LGTM.
Mergen, please create a test case for sql bind parameters in lua
such as:
- it uses a simple SQL select: SELECT ?
- it uses an extensible list of bind values as test subjects
- for each bind value in the list, it verifies that what goes into
the bind, is returned back by SQL intact or SQL produces an
error.
- for each Lua data type such as double, integer, cdata integer,
cdata unsigned, string, lua table, lua array, userdata, append
the following values to the list of test subjects:
- minimal value of the data type
- maximal value of the data type (if present)
- zero value of the data type ("" for strings, null pointer for
userdata)
- nil
We need a similar test for each host language (C, Java, Python,
PHP, etc), but it's a separate subject matter.
--
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.io - www.twitter.com/kostja_osipov
next prev parent reply other threads:[~2019-04-02 8:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-01 20:02 [tarantool-patches] " Vladislav Shpilevoy
2019-04-01 20:03 ` [tarantool-patches] " Vladislav Shpilevoy
2019-04-02 8:30 ` Konstantin Osipov [this message]
2019-04-03 7:56 ` 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=20190402083010.GN25072@chai \
--to=kostja@tarantool.org \
--cc=imeevma@gmail.com \
--cc=imeevma@tarantool.org \
--cc=kyukhin@tarantool.org \
--cc=tarantool-patches@freelists.org \
--subject='[tarantool-patches] Re: [PATCH v2 1/1] sql: parameter binding for box.execute()' \
/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