[Tarantool-patches] [PATCH v1 1/3] sql: fix truncation of DECIMAL in implicit cast

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Wed Oct 6 00:56:08 MSK 2021


Hi! Thanks for the patchset!

> diff --git a/test/sql-tap/gh-6485-bugs-in-decimal.test.lua b/test/sql-tap/gh-6485-bugs-in-decimal.test.lua
> new file mode 100755
> index 000000000..3f63f2b76
> --- /dev/null
> +++ b/test/sql-tap/gh-6485-bugs-in-decimal.test.lua
> @@ -0,0 +1,16 @@
> +#!/usr/bin/env tarantool
> +local test = require("sqltester")
> +test:plan(1)
> +
> +-- Make sure DECIMAL is not truncated when used in an index.
> +test:do_execsql_test(
> +    "gh-6485-1",
> +    [[
> +        CREATE TABLE t(i INTEGER PRIMARY KEY);
> +        INSERT INTO t VALUES(1), (2);
> +        SELECT i FROM t WHERE i IN (CAST(1.1 AS DECIMAL), CAST(2.2 AS DECIMAL));
> +        DROP TABLE t;
> +    ]], {

Could you make the same select without creating a table? The same
for the tests in the second commit.

Also you might want to make the test run only once. Now it is run
twice with 2 engines.


More information about the Tarantool-patches mailing list