[Tarantool-patches] [PATCH v3 1/2] sql: use unify pattern for column names

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Fri Jun 26 00:25:27 MSK 2020


Hi! Thanks for the fixes!

> diff --git a/test/sql-tap/colname.test.lua b/test/sql-tap/colname.test.lua
> index caa61a07a..b5f04a2d7 100755
> --- a/test/sql-tap/colname.test.lua
> +++ b/test/sql-tap/colname.test.lua
> @@ -635,4 +635,143 @@ test:do_catchsql_test(
> +-- <ORDER BY> use the first column with name "COLUMN_1" from
> +-- column list.
> +test:do_execsql2_test(
> +    "colname-12.16",
> +    [[
> +        SELECT column_1, column_1 COLLATE "unicode_ci" FROM j_1 ORDER BY column_1;
> +    ]], {
> +        "COLUMN_1",1,"COLUMN_1",1

When there is just one row, all the sorting looks the same. So even if
it will work not by first 'column_1', you won't notice. What makes the
test not so useful. Please, make it so it would be clearly visible, that
the sorting really used 'the first column'.

Also it looks innatural that you apply "COLLATE "unicode_ci"" to numbers.
Please, use an expression, which would result into something applicable to
a number and not looking exactly the same.

For example, 'column_1 + 1' or '-column_1'. The latter option would be
especially useful to check how sorting changes, when you select

    SELECT column_1, -column_1 FROM j_1 ORDER BY column_1;

Or

    SELECT -column_1, column_1 FROM j_1 ORDER BY column_1;

If really the first matched column name is used, then the results
should be different.


More information about the Tarantool-patches mailing list