[Tarantool-patches] [PATCH v1 1/1] sql: remove OP_Realify

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Mon Jul 26 23:58:05 MSK 2021


Thanks for the patch!

See 2 comments below.

>  src/box/sql/expr.c                            | 13 -------
>  src/box/sql/vdbe.c                            | 17 --------
>  .../gh-5335-wrong-int-to-double-cast.test.lua | 39 +++++++++++++++++++

1. Please, add a changelog file.

> diff --git a/test/sql-tap/gh-5335-wrong-int-to-double-cast.test.lua b/test/sql-tap/gh-5335-wrong-int-to-double-cast.test.lua
> new file mode 100755
> index 000000000..efcae911c
> --- /dev/null
> +++ b/test/sql-tap/gh-5335-wrong-int-to-double-cast.test.lua
> @@ -0,0 +1,39 @@
> +#!/usr/bin/env tarantool
> +local test = require("sqltester")
> +test:plan(2)
> +
> +test:execsql([[
> +    CREATE TABLE t1 (i NUMBER PRIMARY KEY, n NUMBER);
> +    CREATE TABLE t2 (i NUMBER PRIMARY KEY, n NUMBER);
> +    CREATE TRIGGER r AFTER INSERT ON t1 FOR EACH ROW BEGIN UPDATE t1 SET n = new.n; END;
> +    INSERT INTO t1 VALUES (1, 1);
> +    INSERT INTO t2 VALUES (1, 1);
> +]])
> +
> +--
> +-- Make sure that implicit cast from string to integer works correctly in
> +-- arithmetic operations.

2. From string to integer? Where are the strings?

> +--
> +test:do_execsql_test(
> +    "gh-5335-1",
> +    [[
> +        SELECT i / 2, n / 2 FROM t1;
> +    ]], {
> +        0, 0
> +    })
> +
> +test:do_execsql_test(
> +    "gh-5335-2",
> +    [[
> +        SELECT i / 2, n / 2 FROM t2 GROUP BY n;
> +    ]], {
> +        0, 0
> +    })
> +
> +test:execsql([[
> +    DROP TRIGGER r;
> +    DROP TABLE t1;
> +    DROP TABLE t2;
> +]])
> +
> +test:finish_test()
> 


More information about the Tarantool-patches mailing list