[tarantool-patches] Re: [PATCH v2 1/1] sql: parameter binding for box.execute()
Konstantin Osipov
kostja at tarantool.org
Tue Apr 2 11:30:10 MSK 2019
* Vladislav Shpilevoy <v.shpilevoy at 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
More information about the Tarantool-patches
mailing list