Tarantool development patches archive
 help / color / mirror / Atom feed
* [Tarantool-patches] [PATCH v3 0/2] Use-unify-pattern-for-column-names
@ 2020-06-11 15:18 Roman Khabibov
  2020-06-11 15:18 ` [Tarantool-patches] [PATCH v3 1/2] sql: use unify pattern for column names Roman Khabibov
  2020-06-11 15:18 ` [Tarantool-patches] [PATCH v3 2/2] sql: print span more properly Roman Khabibov
  0 siblings, 2 replies; 20+ messages in thread
From: Roman Khabibov @ 2020-06-11 15:18 UTC (permalink / raw)
  To: tarantool-patches; +Cc: v.shpilevoy

I decided to drop a patch to remove the append to the names "_N".
The problem was much deeper than I thought. I have not yet been
able to write a sane patch for distinguishing columns with the
same name from different tables in a certain kind of queries. I'll
do it in a separate branch later.

Branch: https://github.com/tarantool/tarantool/tree/romanhabibov/gh-3962-column
Issue: https://github.com/tarantool/tarantool/issues/3962

@ChangeLog
- Name all automatically generated column with the pattern "COLUMN_N".
- Fix a little bug with span display.

Roman Khabibov (2):
  sql: use unify pattern for column names
  sql: print span more properly

 src/box/sql/select.c                         |  52 +--
 src/box/sql/sqlInt.h                         |  15 +
 test/box/function1.result                    |  12 +-
 test/sql-tap/colname.test.lua                | 106 +++++-
 test/sql-tap/select1.test.lua                |  21 +-
 test/sql-tap/select6.test.lua                |  22 +-
 test/sql-tap/view.test.lua                   |   4 +-
 test/sql/bind.result                         |  42 +--
 test/sql/boolean.result                      | 354 +++++++++----------
 test/sql/collation.result                    |  14 +-
 test/sql/errinj.result                       |   2 +-
 test/sql/foreign-keys.result                 |   4 +-
 test/sql/full_metadata.result                |  18 +-
 test/sql/func-recreate.result                |   2 +-
 test/sql/gh-3199-no-mem-leaks.result         |  24 +-
 test/sql/gh-3888-values-blob-assert.result   |   8 +-
 test/sql/gh-4697-scalar-bool-sort-cmp.result |   4 +-
 test/sql/icu-upper-lower.result              |  82 ++---
 test/sql/integer-overflow.result             |  14 +-
 test/sql/iproto.result                       |  18 +-
 test/sql/max-on-index.result                 |   6 +-
 test/sql/misc.result                         |  12 +-
 test/sql/persistency.result                  |  66 ++--
 test/sql/prepared.result                     |  36 +-
 test/sql/row-count.result                    |  40 +--
 test/sql/transition.result                   |  66 ++--
 test/sql/types.result                        | 224 ++++++------
 27 files changed, 688 insertions(+), 580 deletions(-)

-- 
2.21.0 (Apple Git-122)

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Tarantool-patches] [PATCH v3 1/2] sql: use unify pattern for column names
  2020-06-11 15:18 [Tarantool-patches] [PATCH v3 0/2] Use-unify-pattern-for-column-names Roman Khabibov
@ 2020-06-11 15:18 ` Roman Khabibov
  2020-06-15 21:59   ` Vladislav Shpilevoy
  2020-06-11 15:18 ` [Tarantool-patches] [PATCH v3 2/2] sql: print span more properly Roman Khabibov
  1 sibling, 1 reply; 20+ messages in thread
From: Roman Khabibov @ 2020-06-11 15:18 UTC (permalink / raw)
  To: tarantool-patches; +Cc: v.shpilevoy

Name resulting columns generated by an expression or <VALUES>
construction by the "COLUMN_N" pattern.

Closes #3962

@TarantoolBot document
Title: Column naming in SQL

Now, every auto generated column is named by the "COLUMN_N"
pattern, where N is the number of column in a query (starting)
from 1). Auto generated column is a column in a query result
generated by an expression or a column from <VALUES>
construction.

Examples:
box.execute("VALUES(1, 2, 3);")
---
- metadata:
  - name: COLUMN_1
    type: integer
  - name: COLUMN_2
    type: integer
  - name: COLUMN_3
    type: integer
  rows:
  - [1, 2, 3]
...
box.execute("SELECT * FROM (VALUES (1+1, 1+1));")
---
- metadata:
  - name: COLUMN_1
    type: integer
  - name: COLUMN_2
    type: integer
  rows:
  - [2, 2]
...
box.execute("SELECT 1+1, 1+1;")
---
- metadata:
  - name: COLUMN_1
    type: integer
  - name: COLUMN_2
    type: integer
  rows:
  - [2, 2]
...
---
 src/box/sql/select.c                         |  50 ++-
 src/box/sql/sqlInt.h                         |  15 +
 test/box/function1.result                    |  12 +-
 test/sql-tap/colname.test.lua                | 106 +++++-
 test/sql-tap/select1.test.lua                |  21 +-
 test/sql-tap/select6.test.lua                |  22 +-
 test/sql-tap/view.test.lua                   |   4 +-
 test/sql/bind.result                         |  42 +--
 test/sql/boolean.result                      | 354 +++++++++----------
 test/sql/collation.result                    |  14 +-
 test/sql/errinj.result                       |   2 +-
 test/sql/foreign-keys.result                 |   4 +-
 test/sql/full_metadata.result                |  10 +-
 test/sql/func-recreate.result                |   2 +-
 test/sql/gh-3199-no-mem-leaks.result         |  24 +-
 test/sql/gh-3888-values-blob-assert.result   |   8 +-
 test/sql/gh-4697-scalar-bool-sort-cmp.result |   4 +-
 test/sql/icu-upper-lower.result              |  82 ++---
 test/sql/integer-overflow.result             |  14 +-
 test/sql/iproto.result                       |  18 +-
 test/sql/max-on-index.result                 |   6 +-
 test/sql/misc.result                         |  12 +-
 test/sql/persistency.result                  |  66 ++--
 test/sql/prepared.result                     |  36 +-
 test/sql/row-count.result                    |  40 +--
 test/sql/transition.result                   |  66 ++--
 test/sql/types.result                        | 224 ++++++------
 27 files changed, 683 insertions(+), 575 deletions(-)

diff --git a/src/box/sql/select.c b/src/box/sql/select.c
index 0b7358af4..b06240ca4 100644
--- a/src/box/sql/select.c
+++ b/src/box/sql/select.c
@@ -1853,14 +1853,14 @@ generate_column_metadata(struct Parse *pParse, struct SrcList *pTabList,
 			}
 		} else {
 			const char *z = NULL;
-			if (colname != NULL)
+			if (colname != NULL) {
 				z = colname;
-			else if (span != NULL)
-				z = span;
-			else
-				z = tt_sprintf("column%d", i + 1);
+			} else {
+				uint32_t idx = ++pParse->autoname_i;
+				z = sql_generate_column_name(idx);
+			}
 			vdbe_metadata_set_col_name(v, i, z);
-			if (is_full_meta && colname != NULL)
+			if (is_full_meta)
 				vdbe_metadata_set_col_span(v, i, span);
 		}
 	}
@@ -1896,7 +1896,6 @@ sqlColumnsFromExprList(Parse * parse, ExprList * expr_list,
 	/* Database connection */
 	sql *db = parse->db;
 	u32 cnt;		/* Index added to make the name unique */
-	Expr *p;		/* Expression for a single result column */
 	char *zName;		/* Column name */
 	int nName;		/* Size of name in zName[] */
 	Hash ht;		/* Hash table of column names */
@@ -1928,13 +1927,12 @@ sqlColumnsFromExprList(Parse * parse, ExprList * expr_list,
 	space_def->field_count = column_count;
 
 	for (uint32_t i = 0; i < column_count; i++) {
-		/* Get an appropriate name for the column
+		/*
+		 * Check if the column contains an "AS <name>"
+		 * phrase.
 		 */
-		p = sqlExprSkipCollate(expr_list->a[i].pExpr);
-		if ((zName = expr_list->a[i].zName) != 0) {
-			/* If the column contains an "AS <name>" phrase, use <name> as the name */
-		} else {
-			Expr *pColExpr = p;	/* The expression that is the result column name */
+		if ((zName = expr_list->a[i].zName) == 0) {
+			struct Expr *pColExpr = expr_list->a[i].pExpr;
 			struct space_def *space_def = NULL;
 			while (pColExpr->op == TK_DOT) {
 				pColExpr = pColExpr->pRight;
@@ -1950,14 +1948,14 @@ sqlColumnsFromExprList(Parse * parse, ExprList * expr_list,
 			} else if (pColExpr->op == TK_ID) {
 				assert(!ExprHasProperty(pColExpr, EP_IntValue));
 				zName = pColExpr->u.zToken;
-			} else {
-				/* Use the original text of the column expression as its name */
-				zName = expr_list->a[i].zSpan;
 			}
 		}
-		if (zName == NULL)
-			zName = "_auto_field_";
-		zName = sqlMPrintf(db, "%s", zName);
+		if (zName == NULL) {
+			uint32_t idx = ++parse->autoname_i;
+			zName = sqlDbStrDup(db, sql_generate_column_name(idx));
+		} else {
+			zName = sqlDbStrDup(db, zName);
+		}
 
 		/* Make sure the column name is unique.  If the name is not unique,
 		 * append an integer to the name so that it becomes unique.
@@ -1988,6 +1986,8 @@ sqlColumnsFromExprList(Parse * parse, ExprList * expr_list,
 			memcpy(space_def->fields[i].name, zName, name_len);
 			space_def->fields[i].name[name_len] = '\0';
 		}
+		sqlDbFree(db, expr_list->a[i].zName);
+		expr_list->a[i].zName = zName;
 	}
 cleanup:
 	sqlHashClear(&ht);
@@ -4951,6 +4951,18 @@ selectExpander(Walker * pWalker, Select * p)
 		       || (pE->pLeft != 0 && pE->pLeft->op == TK_ID));
 		if (pE->op == TK_DOT && pE->pRight->op == TK_ASTERISK)
 			break;
+		/*
+		 * It is necessary to generate auto names for
+		 * expressions before clauses such as ORDER BY,
+		 * GROUP BY will be resolved. These names can be
+		 * found inside these clauses during resolving.
+		 */
+		if (pEList->a[k].zName == NULL && pE->op != TK_DOT &&
+		    ((pE->flags & EP_Leaf) == 0 || pE->op != TK_ID)) {
+			uint32_t idx = ++pParse->autoname_i;
+			pEList->a[k].zName =
+				sqlDbStrDup(db, sql_generate_column_name(idx));
+		}
 	}
 	if (k < pEList->nExpr) {
 		/*
diff --git a/src/box/sql/sqlInt.h b/src/box/sql/sqlInt.h
index 37283e506..adf90d824 100644
--- a/src/box/sql/sqlInt.h
+++ b/src/box/sql/sqlInt.h
@@ -2227,6 +2227,8 @@ struct Parse {
 	TriggerPrg *pTriggerPrg;	/* Linked list of coded triggers */
 	With *pWith;		/* Current WITH clause, or NULL */
 	With *pWithToFree;	/* Free this WITH object at the end of the parse */
+	/** Index of previous auto generated name. */
+	uint32_t autoname_i;
 	/** Space triggers are being coded for. */
 	struct space *triggered_space;
 	/**
@@ -4530,4 +4532,17 @@ void
 sql_setting_set(struct Parse *parse_context, struct Token *name,
 		struct Expr *value);
 
+/**
+ * Return a string of the form "COLUMN_N", where N is @a number.
+ *
+ * We decided to name every auto generated column in output by
+ * this pattern (like PostgreSQL), because it is more convenient
+ * than "_auto_name_" and naming with span like MariaDB do.
+ */
+static inline const char *
+sql_generate_column_name(uint32_t number)
+{
+	return tt_sprintf("COLUMN_%d", number);
+}
+
 #endif				/* sqlINT_H */
diff --git a/test/box/function1.result b/test/box/function1.result
index 905a4cdab..928cd5758 100644
--- a/test/box/function1.result
+++ b/test/box/function1.result
@@ -449,7 +449,7 @@ box.execute('SELECT "function1.divide"(6, 3, 3)')
 box.execute('SELECT "function1.divide"(6, 3)')
 ---
 - metadata:
-  - name: '"function1.divide"(6, 3)'
+  - name: COLUMN_1
     type: number
   rows:
   - [2]
@@ -457,7 +457,7 @@ box.execute('SELECT "function1.divide"(6, 3)')
 box.execute('SELECT "function1.divide"(5, 2)')
 ---
 - metadata:
-  - name: '"function1.divide"(5, 2)'
+  - name: COLUMN_1
     type: number
   rows:
   - [2.5]
@@ -482,7 +482,7 @@ test_run:cmd("setopt delimiter ''");
 box.execute('SELECT summarize(1, 2)')
 ---
 - metadata:
-  - name: summarize(1, 2)
+  - name: COLUMN_1
     type: number
   rows:
   - [3]
@@ -505,7 +505,7 @@ test_run:cmd("setopt delimiter ''");
 box.execute('SELECT summarize(1, 2)')
 ---
 - metadata:
-  - name: summarize(1, 2)
+  - name: COLUMN_1
     type: number
   rows:
   - [3]
@@ -519,7 +519,7 @@ box.func.SUMMARIZE:drop()
 box.execute('SELECT lua(\'return 1 + 1\')')
 ---
 - metadata:
-  - name: lua('return 1 + 1')
+  - name: COLUMN_1
     type: any
   rows:
   - [2]
@@ -537,7 +537,7 @@ box.execute('SELECT lua(\'return box.cfg()\')')
 box.execute('SELECT lua(\'return box.cfg.memtx_memory\')')
 ---
 - metadata:
-  - name: lua('return box.cfg.memtx_memory')
+  - name: COLUMN_1
     type: any
   rows:
   - [107374182]
diff --git a/test/sql-tap/colname.test.lua b/test/sql-tap/colname.test.lua
index caa61a07a..3762a247d 100755
--- a/test/sql-tap/colname.test.lua
+++ b/test/sql-tap/colname.test.lua
@@ -1,6 +1,6 @@
 #!/usr/bin/env tarantool
 test = require("sqltester")
-test:plan(62)
+test:plan(73)
 
 --!./tcltestrunner.lua
 -- 2008 July 15
@@ -94,7 +94,7 @@ test:do_execsql2_test(
         SELECT +tabc.a, -tabc.b, tabc.c, * FROM tabc
     ]], {
         -- <colname-2.3>
-        "+tabc.a",1,"-tabc.b",-2,"C",3,"A",1,"B",2,"C",3
+        "COLUMN_1",1,"COLUMN_2",-2,"C",3,"A",1,"B",2,"C",3
         -- </colname-2.3>
     })
 
@@ -194,7 +194,7 @@ test:do_execsql2_test(
         SELECT +tabc.a, -tabc.b, tabc.c FROM tabc
     ]], {
         -- <colname-3.3>
-        "+tabc.a", 1, "-tabc.b", -2, "C", 3
+        "COLUMN_1",1,"COLUMN_2",-2,"C",3
         -- </colname-3.3>
     })
 
@@ -314,7 +314,7 @@ test:do_execsql2_test(
         SELECT +tabc.a, -tabc.b, tabc.c FROM tabc
     ]], {
         -- <colname-4.3>
-        "+tabc.a", 1, "-tabc.b", -2, "TABC.C", 3
+        "COLUMN_1",1,"COLUMN_2",-2,"TABC.C",3
         -- </colname-4.3>
     })
 
@@ -635,4 +635,102 @@ test:do_catchsql_test(
     [[ CREATE INDEX t1c ON table1('c'); ]],
     {1, "/Tarantool does not support functional indexes/"})
 
+--
+-- gh-3962: Check auto generated names in different selects.
+--
+test:do_execsql2_test(
+    "colname-12.1",
+    [[
+        VALUES(1, 2, 'aaa');
+    ]], {
+        "COLUMN_1",1,"COLUMN_2",2,"COLUMN_3","aaa"
+    })
+
+test:do_execsql2_test(
+    "colname-12.2",
+    [[
+        SELECT * FROM (VALUES (1+1, 1+1, 'aaa'));
+    ]], {
+        "COLUMN_1",2,"COLUMN_2",2,"COLUMN_3","aaa"
+    })
+
+test:do_execsql2_test(
+    "colname-12.3",
+    [[
+        SELECT 1+1, 1+1, 'aaa';
+    ]], {
+        "COLUMN_1",2,"COLUMN_2",2,"COLUMN_3","aaa"
+    })
+
+test:do_execsql2_test(
+    "colname-12.4",
+    [[
+        SELECT * FROM (SELECT * FROM (VALUES(1, 2, 'aaa'))),
+                      (SELECT * FROM (VALUES(1, 2, 'aaa')))
+    ]], {
+        "COLUMN_1",1,"COLUMN_2",2,"COLUMN_3","aaa","COLUMN_4",1,"COLUMN_5",2,
+        "COLUMN_6","aaa"
+    })
+
+test:do_execsql2_test(
+    "colname-12.5",
+    [[
+        CREATE TABLE j (s1 SCALAR PRIMARY KEY);
+        INSERT INTO j VALUES(1);
+    ]], {})
+
+--
+-- Column named as 'COLUMN_1', because of <COLLATE>.
+--
+test:do_execsql2_test(
+    "colname-12.6",
+    [[
+        SELECT s1 COLLATE "unicode_ci" FROM j;
+    ]], {
+        "COLUMN_1",1
+    })
+
+test:do_execsql2_test(
+    "colname-12.7",
+    [[
+        SELECT s1 COLLATE "unicode_ci" FROM j ORDER BY column_1;
+    ]], {
+        "COLUMN_1",1
+    })
+
+test:do_execsql2_test(
+    "colname-12.8",
+    [[
+        SELECT * FROM (SELECT s1 COLLATE "unicode_ci" FROM j
+                       ORDER BY column_1) ORDER BY column_1;
+    ]], {
+        "COLUMN_1",1
+    })
+
+test:do_execsql2_test(
+    "colname-12.9",
+    [[
+        SELECT s1 COLLATE "unicode_ci" FROM j GROUP BY column_1;
+    ]], {
+        "COLUMN_1",1
+    })
+
+test:do_execsql2_test(
+    "colname-12.10",
+    [[
+        SELECT * FROM (SELECT s1 COLLATE "unicode_ci" FROM j
+                       ORDER BY column_1) GROUP BY column_1;
+    ]], {
+        "COLUMN_1",1
+    })
+
+test:do_execsql2_test(
+    "colname-12.10",
+    [[
+        SELECT * FROM (SELECT s1 COLLATE "unicode_ci" FROM j
+                       ORDER BY column_1) WHERE column_1 = 1;
+    ]], {
+        "COLUMN_1",1
+    })
+
 test:finish_test()
diff --git a/test/sql-tap/select1.test.lua b/test/sql-tap/select1.test.lua
index fbebfab37..80e94b019 100755
--- a/test/sql-tap/select1.test.lua
+++ b/test/sql-tap/select1.test.lua
@@ -1032,7 +1032,7 @@ test:do_catchsql2_test(
         SELECT f1+F2 FROM test1 ORDER BY f2
     ]], {
         -- <select1-6.4a>
-        0, {"f1+F2", 33, "f1+F2", 77}
+        0, {"COLUMN_1",33,"COLUMN_1",77}
         -- </select1-6.4a>
     })
 
@@ -1042,7 +1042,7 @@ test:do_catchsql2_test(
         SELECT test1.f1+F2 FROM test1 ORDER BY f2
     ]], {
         -- <select1-6.5>
-        0, {"test1.f1+F2", 33, "test1.f1+F2", 77}
+        0, {"COLUMN_1",33,"COLUMN_1",77}
         -- </select1-6.5>
     })
 
@@ -1059,7 +1059,7 @@ test:do_test(
         return table.insert(v,msg) or v
     end, {
         -- <select1-6.5.1>
-        0, {'test1.f1+F2', 33, 'test1.f1+F2', 77}
+        0, {"COLUMN_1",33,"COLUMN_1",77}
         -- </select1-6.5.1>
     })
 
@@ -1068,7 +1068,7 @@ test:do_catchsql2_test(
     [[SELECT test1.f1+F2, t1 FROM test1, test2 
          ORDER BY f2]], {
         -- <select1-6.6>
-        0, {"test1.f1+F2", 33, "T1", "abc", "test1.f1+F2", 77, "T1", "abc"}
+        0, {"COLUMN_1",33,"T1","abc","COLUMN_1",77,"T1","abc"}
         -- </select1-6.6>
     })
 
@@ -1161,7 +1161,7 @@ test:do_test(
         ]]
     end, {
         -- <select1-6.9.5>
-        "123.45", 123.45
+        "COLUMN_1",123.45
         -- </select1-6.9.5>
     })
 
@@ -1189,7 +1189,8 @@ test:do_test(
         return x
     end, {
         -- <select1-6.9.7>
-        "A.F1", 11, "A.F2", 22, "sql_subquery.5", 5, "sql_subquery.6", 6
+        "A.F1", 11, "A.F2", 22, "sql_subquery.COLUMN_1", 5,
+        "sql_subquery.COLUMN_2", 6
         -- </select1-6.9.7>
     })
 
@@ -1816,7 +1817,7 @@ test:do_execsql2_test(
             SELECT * FROM t3, (SELECT max(a), max(b) FROM t4) as "tx"
         ]], {
             -- <select1-11.14>
-            "ID", 0, "A", "1", "B", "2", "max(a)", 3, "max(b)", "4"
+            "ID", 0, "A", "1", "B", "2", "COLUMN_1", 3, "COLUMN_2", "4"
             -- </select1-11.14>
         })
 
@@ -1826,7 +1827,7 @@ test:do_execsql2_test(
             SELECT y.*, t3.* FROM t3, (SELECT max(a), max(b) FROM t4) AS y
         ]], {
             -- <select1-11.15>
-            "max(a)", 3, "max(b)", "4", "ID", 0, "A", "1", "B", "2"
+            "COLUMN_1", 3, "COLUMN_2", "4", "ID", 0, "A", "1", "B", "2"
             -- </select1-11.15>
         })
 
@@ -1850,7 +1851,7 @@ test:do_execsql2_test(
         SELECT 1+2+3
     ]], {
         -- <select1-12.1>
-        "1+2+3", 6
+        "COLUMN_1",6
         -- </select1-12.1>
     })
 
@@ -1860,7 +1861,7 @@ test:do_execsql2_test(
         SELECT 1,'hello',2
     ]], {
         -- <select1-12.2>
-        '1', 1, "'hello'", "hello", '2', 2
+        "COLUMN_1",1,"COLUMN_2","hello","COLUMN_3",2
         -- </select1-12.2>
     })
 
diff --git a/test/sql-tap/select6.test.lua b/test/sql-tap/select6.test.lua
index c9960dc29..380fd67c1 100755
--- a/test/sql-tap/select6.test.lua
+++ b/test/sql-tap/select6.test.lua
@@ -128,9 +128,9 @@ test:do_execsql_test(
 test:do_execsql_test(
     "select6-1.7",
     [=[
-        SELECT a.y, a."count(*)", "max(x)", "count(*)"
-        FROM (SELECT count(*),y FROM t1 GROUP BY y) AS a,
-             (SELECT max(x),y FROM t1 GROUP BY y) as b
+        SELECT a.y, a.COLUMN_1, COLUMN_2, COLUMN_1
+        FROM (SELECT count(*), y FROM t1 GROUP BY y) AS a,
+             (SELECT max(x), y FROM t1 GROUP BY y) as b
         WHERE a.y=b.y ORDER BY a.y
     ]=], {
         -- <select6-1.7>
@@ -154,9 +154,9 @@ test:do_execsql_test(
 test:do_execsql_test(
     "select6-1.9",
     [=[
-        SELECT q, p, r, b."min(x)+y"
+        SELECT q, p, r, min
         FROM (SELECT count(*) as p , y as q FROM t1 GROUP BY y) AS a,
-             (SELECT max(x) as r, y as s, min(x)+y FROM t1 GROUP BY y) as b
+             (SELECT max(x) as r, y as s, min(x)+y AS min FROM t1 GROUP BY y) as b
         WHERE q=s ORDER BY s
     ]=], {
         -- <select6-1.9>
@@ -247,9 +247,9 @@ test:do_execsql_test(
 test:do_execsql_test(
     "select6-2.7",
     [=[
-        SELECT a.b, a."count(*)", "max(a)", "count(*)"
-        FROM (SELECT count(*),b FROM t2 GROUP BY b) AS a,
-             (SELECT max(a),b FROM t2 GROUP BY b) as b
+        SELECT a.b, a.count, max, count
+        FROM (SELECT count(*) AS count, b FROM t2 GROUP BY b) AS a,
+             (SELECT max(a) AS max, b FROM t2 GROUP BY b) as b
         WHERE a.b=b.b ORDER BY a.b
     ]=], {
         -- <select6-2.7>
@@ -432,8 +432,8 @@ test:do_execsql_test(
 test:do_execsql_test(
     "select6-3.14",
     [=[
-        SELECT "count(*)",y FROM (SELECT count(*), y FROM t1 GROUP BY y)
-        ORDER BY "count(*)"
+        SELECT count, y FROM (SELECT count(*) AS count, y FROM t1 GROUP BY y)
+        ORDER BY count
     ]=], {
         -- <select6-3.14>
         1, 1, 2, 2, 4, 3, 5, 5, 8, 4
@@ -443,7 +443,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "select6-3.15",
     [=[
-        SELECT "count(*)",y FROM (SELECT count(*), y FROM t1 GROUP BY y)
+        SELECT count, y FROM (SELECT count(*) AS count, y FROM t1 GROUP BY y)
         ORDER BY y
     ]=], {
         -- <select6-3.15>
diff --git a/test/sql-tap/view.test.lua b/test/sql-tap/view.test.lua
index e553b91c7..66374e374 100755
--- a/test/sql-tap/view.test.lua
+++ b/test/sql-tap/view.test.lua
@@ -265,7 +265,7 @@ test:do_execsql2_test(
         SELECT * FROM v1 LIMIT 1
     ]], {
         -- <view-3.3.1>
-        "XYZ", 2, "PQR", 7, "c-b", 1
+        "XYZ", 2, "PQR", 7, "COLUMN_1", 1
         -- </view-3.3.1>
     })
 
@@ -276,7 +276,7 @@ test:do_execsql2_test(
         SELECT * FROM v1b LIMIT 1
     ]], {
         -- <view-3.3.2>
-        "A", 2, "b+c", 7, "C", 4
+        "A", 2, "COLUMN_1", 7, "C", 4
         -- </view-3.3.2>
     })
 
diff --git a/test/sql/bind.result b/test/sql/bind.result
index b24094052..cb0302885 100644
--- a/test/sql/bind.result
+++ b/test/sql/bind.result
@@ -77,11 +77,11 @@ execute('SELECT * FROM test WHERE id = :value', parameters)
 execute('SELECT ?, ?, ?', {1, 2, 3})
 ---
 - metadata:
-  - name: '?'
+  - name: COLUMN_1
     type: integer
-  - name: '?'
+  - name: COLUMN_2
     type: integer
-  - name: '?'
+  - name: COLUMN_3
     type: integer
   rows:
   - [1, 2, 3]
@@ -107,11 +107,11 @@ parameters[3][':value1'] = 11
 execute('SELECT ?, :value1, @value2', parameters)
 ---
 - metadata:
-  - name: '?'
+  - name: COLUMN_1
     type: integer
-  - name: :value1
+  - name: COLUMN_2
     type: integer
-  - name: '@value2'
+  - name: COLUMN_3
     type: integer
   rows:
   - [10, 11, 12]
@@ -149,22 +149,22 @@ parameters[6]['@value2'] = 6
 execute('SELECT :value3, ?, :value1, ?, ?, @value2, ?, :value3', parameters)
 ---
 - metadata:
-  - name: :value3
+  - name: COLUMN_1
     type: integer
-  - name: '?'
+  - name: COLUMN_2
     type: integer
-  - name: :value1
+  - name: COLUMN_3
     type: integer
-  - name: '?'
+  - name: COLUMN_4
     type: integer
-  - name: '?'
+  - name: COLUMN_5
     type: integer
-  - name: '@value2'
+  - name: COLUMN_6
     type: integer
-  - name: '?'
+  - name: COLUMN_7
+    type: boolean
+  - name: COLUMN_8
     type: boolean
-  - name: :value3
-    type: integer
   rows:
   - [1, 2, 3, 4, 5, 6, null, 1]
 ...
@@ -175,15 +175,15 @@ msgpack = require('msgpack')
 execute('SELECT ?, ?, ?, ?, ?', {'abc', -123.456, msgpack.NULL, true, false})
 ---
 - metadata:
-  - name: '?'
+  - name: COLUMN_1
     type: text
-  - name: '?'
+  - name: COLUMN_2
     type: numeric
-  - name: '?'
+  - name: COLUMN_3
     type: boolean
-  - name: '?'
+  - name: COLUMN_4
     type: boolean
-  - name: '?'
+  - name: COLUMN_5
     type: boolean
   rows:
   - ['abc', -123.456, null, true, false]
@@ -290,7 +290,7 @@ execute('SELECT :value', parameters)
 execute('SELECT ? ', {18446744073709551615ULL})
 ---
 - metadata:
-  - name: '?'
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551615]
diff --git a/test/sql/boolean.result b/test/sql/boolean.result
index 112e41a12..51ec5820b 100644
--- a/test/sql/boolean.result
+++ b/test/sql/boolean.result
@@ -241,7 +241,7 @@ i > 0
 SELECT return_type(a) FROM t;
  | ---
  | - metadata:
- |   - name: return_type(a)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['boolean']
@@ -250,7 +250,7 @@ SELECT return_type(a) FROM t;
 SELECT return_type('false');
  | ---
  | - metadata:
- |   - name: return_type('false')
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['string']
@@ -258,7 +258,7 @@ SELECT return_type('false');
 SELECT is_boolean(a) FROM t LIMIT 1;
  | ---
  | - metadata:
- |   - name: is_boolean(a)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -266,7 +266,7 @@ SELECT is_boolean(a) FROM t LIMIT 1;
 SELECT is_boolean('true');
  | ---
  | - metadata:
- |   - name: is_boolean('true')
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -281,7 +281,7 @@ SELECT abs(a) FROM t0;
 SELECT lower(a) FROM t0;
  | ---
  | - metadata:
- |   - name: lower(a)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['false']
@@ -292,7 +292,7 @@ SELECT lower(a) FROM t0;
 SELECT upper(a) FROM t0;
  | ---
  | - metadata:
- |   - name: upper(a)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['FALSE']
@@ -303,7 +303,7 @@ SELECT upper(a) FROM t0;
 SELECT quote(a) FROM t0;
  | ---
  | - metadata:
- |   - name: quote(a)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['FALSE']
@@ -315,7 +315,7 @@ SELECT quote(a) FROM t0;
 SELECT length(a) FROM t0;
  | ---
  | - metadata:
- |   - name: length(a)
+ |   - name: COLUMN_1
  |     type: integer
  |   rows:
  |   - [5]
@@ -326,7 +326,7 @@ SELECT length(a) FROM t0;
 SELECT typeof(a) FROM t0;
  | ---
  | - metadata:
- |   - name: typeof(a)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['boolean']
@@ -344,7 +344,7 @@ SELECT AVG(a) FROM t0;
 SELECT MIN(a) FROM t0;
  | ---
  | - metadata:
- |   - name: MIN(a)
+ |   - name: COLUMN_1
  |     type: scalar
  |   rows:
  |   - [false]
@@ -352,7 +352,7 @@ SELECT MIN(a) FROM t0;
 SELECT MAX(a) FROM t0;
  | ---
  | - metadata:
- |   - name: MAX(a)
+ |   - name: COLUMN_1
  |     type: scalar
  |   rows:
  |   - [true]
@@ -365,7 +365,7 @@ SELECT SUM(a) FROM t0;
 SELECT COUNT(a) FROM t0;
  | ---
  | - metadata:
- |   - name: COUNT(a)
+ |   - name: COLUMN_1
  |     type: integer
  |   rows:
  |   - [2]
@@ -378,7 +378,7 @@ SELECT TOTAL(a) FROM t0;
 SELECT GROUP_CONCAT(a, ' +++ ') FROM t0;
  | ---
  | - metadata:
- |   - name: GROUP_CONCAT(a, ' +++ ')
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['FALSE +++ TRUE']
@@ -392,13 +392,13 @@ SELECT GROUP_CONCAT(a, ' +++ ') FROM t0;
 box.execute('SELECT ?, ?, return_type($1), typeof($2);', {true, false})
  | ---
  | - metadata:
- |   - name: '?'
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: '?'
+ |   - name: COLUMN_2
  |     type: boolean
- |   - name: return_type($1)
+ |   - name: COLUMN_3
  |     type: string
- |   - name: typeof($2)
+ |   - name: COLUMN_4
  |     type: string
  |   rows:
  |   - [true, false, 'boolean', 'boolean']
@@ -422,9 +422,9 @@ parameters[2][':value1'] = false
 box.execute('SELECT :value1, @value2;', parameters)
  | ---
  | - metadata:
- |   - name: :value1
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: '@value2'
+ |   - name: COLUMN_2
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -501,9 +501,9 @@ INSERT INTO t3 VALUES (4, false)
 SELECT cast(true AS INTEGER), cast(false AS INTEGER);
  | ---
  | - metadata:
- |   - name: cast(true AS INTEGER)
+ |   - name: COLUMN_1
  |     type: integer
- |   - name: cast(false AS INTEGER)
+ |   - name: COLUMN_2
  |     type: integer
  |   rows:
  |   - [1, 0]
@@ -511,9 +511,9 @@ SELECT cast(true AS INTEGER), cast(false AS INTEGER);
 SELECT cast(true AS NUMBER), cast(false AS NUMBER);
  | ---
  | - metadata:
- |   - name: cast(true AS NUMBER)
+ |   - name: COLUMN_1
  |     type: number
- |   - name: cast(false AS NUMBER)
+ |   - name: COLUMN_2
  |     type: number
  |   rows:
  |   - [1, 0]
@@ -522,9 +522,9 @@ SELECT cast(true AS NUMBER), cast(false AS NUMBER);
 SELECT cast(true AS TEXT), cast(false AS TEXT);
  | ---
  | - metadata:
- |   - name: cast(true AS TEXT)
+ |   - name: COLUMN_1
  |     type: string
- |   - name: cast(false AS TEXT)
+ |   - name: COLUMN_2
  |     type: string
  |   rows:
  |   - ['TRUE', 'FALSE']
@@ -532,9 +532,9 @@ SELECT cast(true AS TEXT), cast(false AS TEXT);
 SELECT cast(true AS BOOLEAN), cast(false AS BOOLEAN);
  | ---
  | - metadata:
- |   - name: cast(true AS BOOLEAN)
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: cast(false AS BOOLEAN)
+ |   - name: COLUMN_2
  |     type: boolean
  |   rows:
  |   - [true, false]
@@ -544,11 +544,11 @@ SELECT cast(true AS BOOLEAN), cast(false AS BOOLEAN);
 SELECT cast(100 AS BOOLEAN), cast(1 AS BOOLEAN), cast(0 AS BOOLEAN);
  | ---
  | - metadata:
- |   - name: cast(100 AS BOOLEAN)
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: cast(1 AS BOOLEAN)
+ |   - name: COLUMN_2
  |     type: boolean
- |   - name: cast(0 AS BOOLEAN)
+ |   - name: COLUMN_3
  |     type: boolean
  |   rows:
  |   - [true, true, false]
@@ -556,9 +556,9 @@ SELECT cast(100 AS BOOLEAN), cast(1 AS BOOLEAN), cast(0 AS BOOLEAN);
 SELECT cast(0.123 AS BOOLEAN), cast(0.0 AS BOOLEAN);
  | ---
  | - metadata:
- |   - name: cast(0.123 AS BOOLEAN)
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: cast(0.0 AS BOOLEAN)
+ |   - name: COLUMN_2
  |     type: boolean
  |   rows:
  |   - [true, false]
@@ -566,9 +566,9 @@ SELECT cast(0.123 AS BOOLEAN), cast(0.0 AS BOOLEAN);
 SELECT cast('true' AS BOOLEAN), cast('false' AS BOOLEAN);
  | ---
  | - metadata:
- |   - name: cast('true' AS BOOLEAN)
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: cast('false' AS BOOLEAN)
+ |   - name: COLUMN_2
  |     type: boolean
  |   rows:
  |   - [true, false]
@@ -576,9 +576,9 @@ SELECT cast('true' AS BOOLEAN), cast('false' AS BOOLEAN);
 SELECT cast('TRUE' AS BOOLEAN), cast('FALSE' AS BOOLEAN);
  | ---
  | - metadata:
- |   - name: cast('TRUE' AS BOOLEAN)
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: cast('FALSE' AS BOOLEAN)
+ |   - name: COLUMN_2
  |     type: boolean
  |   rows:
  |   - [true, false]
@@ -887,7 +887,7 @@ SELECT a, COUNT(*) FROM (SELECT * FROM t4 UNION SELECT * FROM t5) GROUP BY a;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: COUNT(*)
+ |   - name: COLUMN_1
  |     type: integer
  |   rows:
  |   - [false, 3]
@@ -907,7 +907,7 @@ INSERT INTO t6 VALUES (true, false), (false, true);
 SELECT NOT true;
  | ---
  | - metadata:
- |   - name: NOT true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -915,7 +915,7 @@ SELECT NOT true;
 SELECT NOT false;
  | ---
  | - metadata:
- |   - name: NOT false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -925,7 +925,7 @@ SELECT a, NOT a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: NOT a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -935,7 +935,7 @@ SELECT a, NOT a FROM t;
 SELECT true AND true;
  | ---
  | - metadata:
- |   - name: true AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -943,7 +943,7 @@ SELECT true AND true;
 SELECT true AND false;
  | ---
  | - metadata:
- |   - name: true AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -951,7 +951,7 @@ SELECT true AND false;
 SELECT false AND true;
  | ---
  | - metadata:
- |   - name: false AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -959,7 +959,7 @@ SELECT false AND true;
 SELECT false AND false;
  | ---
  | - metadata:
- |   - name: false AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -967,7 +967,7 @@ SELECT false AND false;
 SELECT true OR true;
  | ---
  | - metadata:
- |   - name: true OR true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -975,7 +975,7 @@ SELECT true OR true;
 SELECT true OR false;
  | ---
  | - metadata:
- |   - name: true OR false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -983,7 +983,7 @@ SELECT true OR false;
 SELECT false OR true;
  | ---
  | - metadata:
- |   - name: false OR true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -991,7 +991,7 @@ SELECT false OR true;
 SELECT false OR false;
  | ---
  | - metadata:
- |   - name: false OR false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1002,7 +1002,7 @@ SELECT a, true AND a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true AND a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1013,7 +1013,7 @@ SELECT a, false AND a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false AND a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1024,7 +1024,7 @@ SELECT a, true OR a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true OR a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1035,7 +1035,7 @@ SELECT a, false OR a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false OR a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1046,7 +1046,7 @@ SELECT a, a AND true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1057,7 +1057,7 @@ SELECT a, a AND false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1068,7 +1068,7 @@ SELECT a, a OR true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a OR true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1079,7 +1079,7 @@ SELECT a, a OR false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a OR false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1093,7 +1093,7 @@ SELECT a, a1, a AND a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a AND a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, false]
@@ -1108,7 +1108,7 @@ SELECT a, a1, a OR a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a OR a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, false]
@@ -1622,7 +1622,7 @@ SELECT a1, a2, a2 || a2 FROM t6;
 SELECT true > true;
  | ---
  | - metadata:
- |   - name: true > true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1630,7 +1630,7 @@ SELECT true > true;
 SELECT true > false;
  | ---
  | - metadata:
- |   - name: true > false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -1638,7 +1638,7 @@ SELECT true > false;
 SELECT false > true;
  | ---
  | - metadata:
- |   - name: false > true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1646,7 +1646,7 @@ SELECT false > true;
 SELECT false > false;
  | ---
  | - metadata:
- |   - name: false > false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1654,7 +1654,7 @@ SELECT false > false;
 SELECT true < true;
  | ---
  | - metadata:
- |   - name: true < true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1662,7 +1662,7 @@ SELECT true < true;
 SELECT true < false;
  | ---
  | - metadata:
- |   - name: true < false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1670,7 +1670,7 @@ SELECT true < false;
 SELECT false < true;
  | ---
  | - metadata:
- |   - name: false < true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -1678,7 +1678,7 @@ SELECT false < true;
 SELECT false < false;
  | ---
  | - metadata:
- |   - name: false < false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1689,7 +1689,7 @@ SELECT a, true > a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true > a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1700,7 +1700,7 @@ SELECT a, false > a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false > a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1711,7 +1711,7 @@ SELECT a, true < a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true < a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1722,7 +1722,7 @@ SELECT a, false < a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false < a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1733,7 +1733,7 @@ SELECT a, a > true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a > true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1744,7 +1744,7 @@ SELECT a, a > false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a > false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1755,7 +1755,7 @@ SELECT a, a < true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a < true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1766,7 +1766,7 @@ SELECT a, a < false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a < false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1780,7 +1780,7 @@ SELECT a, a1, a > a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a > a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, false]
@@ -1795,7 +1795,7 @@ SELECT a, a1, a < a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a < a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, false]
@@ -1807,7 +1807,7 @@ SELECT a, a1, a < a1 FROM t, t6;
 SELECT true >= true;
  | ---
  | - metadata:
- |   - name: true >= true
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [true]
@@ -1815,7 +1815,7 @@ SELECT true >= true;
 SELECT true >= false;
  | ---
  | - metadata:
- |   - name: true >= false
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [true]
@@ -1823,7 +1823,7 @@ SELECT true >= false;
 SELECT false >= true;
  | ---
  | - metadata:
- |   - name: false >= true
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [false]
@@ -1831,7 +1831,7 @@ SELECT false >= true;
 SELECT false >= false;
  | ---
  | - metadata:
- |   - name: false >= false
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [true]
@@ -1839,7 +1839,7 @@ SELECT false >= false;
 SELECT true <= true;
  | ---
  | - metadata:
- |   - name: true <= true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -1847,7 +1847,7 @@ SELECT true <= true;
 SELECT true <= false;
  | ---
  | - metadata:
- |   - name: true <= false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1855,7 +1855,7 @@ SELECT true <= false;
 SELECT false <= true;
  | ---
  | - metadata:
- |   - name: false <= true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -1863,7 +1863,7 @@ SELECT false <= true;
 SELECT false <= false;
  | ---
  | - metadata:
- |   - name: false <= false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -1874,7 +1874,7 @@ SELECT a, true >= a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true >= a
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [false, true]
@@ -1885,7 +1885,7 @@ SELECT a, false >= a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false >= a
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [false, true]
@@ -1896,7 +1896,7 @@ SELECT a, true <= a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true <= a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1907,7 +1907,7 @@ SELECT a, false <= a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false <= a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1918,7 +1918,7 @@ SELECT a, a >= true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a >= true
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [false, false]
@@ -1929,7 +1929,7 @@ SELECT a, a >= false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a >= false
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [false, true]
@@ -1940,7 +1940,7 @@ SELECT a, a <= true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a <= true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1951,7 +1951,7 @@ SELECT a, a <= false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a <= false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1965,7 +1965,7 @@ SELECT a, a1, a >= a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a >= a1
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [false, false, true]
@@ -1980,7 +1980,7 @@ SELECT a, a1, a <= a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a <= a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, true]
@@ -1992,7 +1992,7 @@ SELECT a, a1, a <= a1 FROM t, t6;
 SELECT true == true;
  | ---
  | - metadata:
- |   - name: true == true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2000,7 +2000,7 @@ SELECT true == true;
 SELECT true == false;
  | ---
  | - metadata:
- |   - name: true == false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2008,7 +2008,7 @@ SELECT true == false;
 SELECT false == true;
  | ---
  | - metadata:
- |   - name: false == true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2016,7 +2016,7 @@ SELECT false == true;
 SELECT false == false;
  | ---
  | - metadata:
- |   - name: false == false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2024,7 +2024,7 @@ SELECT false == false;
 SELECT true != true;
  | ---
  | - metadata:
- |   - name: true != true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2032,7 +2032,7 @@ SELECT true != true;
 SELECT true != false;
  | ---
  | - metadata:
- |   - name: true != false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2040,7 +2040,7 @@ SELECT true != false;
 SELECT false != true;
  | ---
  | - metadata:
- |   - name: false != true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2048,7 +2048,7 @@ SELECT false != true;
 SELECT false != false;
  | ---
  | - metadata:
- |   - name: false != false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2059,7 +2059,7 @@ SELECT a, true == a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true == a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2070,7 +2070,7 @@ SELECT a, false == a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false == a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2081,7 +2081,7 @@ SELECT a, true != a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true != a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2092,7 +2092,7 @@ SELECT a, false != a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false != a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2103,7 +2103,7 @@ SELECT a, a == true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a == true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2114,7 +2114,7 @@ SELECT a, a == false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a == false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2125,7 +2125,7 @@ SELECT a, a != true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a != true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2136,7 +2136,7 @@ SELECT a, a != false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a != false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2150,7 +2150,7 @@ SELECT a, a1, a == a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a == a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, true]
@@ -2165,7 +2165,7 @@ SELECT a, a1, a != a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a != a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, false]
@@ -2177,7 +2177,7 @@ SELECT a, a1, a != a1 FROM t, t6;
 SELECT true IN (true);
  | ---
  | - metadata:
- |   - name: true IN (true)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2185,7 +2185,7 @@ SELECT true IN (true);
 SELECT false IN (true);
  | ---
  | - metadata:
- |   - name: false IN (true)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2193,7 +2193,7 @@ SELECT false IN (true);
 SELECT true IN (false);
  | ---
  | - metadata:
- |   - name: true IN (false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2201,7 +2201,7 @@ SELECT true IN (false);
 SELECT false IN (false);
  | ---
  | - metadata:
- |   - name: false IN (false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2209,7 +2209,7 @@ SELECT false IN (false);
 SELECT true IN (true, false);
  | ---
  | - metadata:
- |   - name: true IN (true, false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2217,7 +2217,7 @@ SELECT true IN (true, false);
 SELECT false IN (true, false);
  | ---
  | - metadata:
- |   - name: false IN (true, false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2225,7 +2225,7 @@ SELECT false IN (true, false);
 SELECT true IN (SELECT a1 FROM t6);
  | ---
  | - metadata:
- |   - name: true IN (SELECT a1 FROM t6)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2233,7 +2233,7 @@ SELECT true IN (SELECT a1 FROM t6);
 SELECT false IN (SELECT a1 FROM t6);
  | ---
  | - metadata:
- |   - name: false IN (SELECT a1 FROM t6)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2241,7 +2241,7 @@ SELECT false IN (SELECT a1 FROM t6);
 SELECT true IN (SELECT a1 FROM t6 LIMIT 1);
  | ---
  | - metadata:
- |   - name: true IN (SELECT a1 FROM t6 LIMIT 1)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2249,7 +2249,7 @@ SELECT true IN (SELECT a1 FROM t6 LIMIT 1);
 SELECT false IN (SELECT a1 FROM t6 LIMIT 1);
  | ---
  | - metadata:
- |   - name: false IN (SELECT a1 FROM t6 LIMIT 1)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2257,7 +2257,7 @@ SELECT false IN (SELECT a1 FROM t6 LIMIT 1);
 SELECT true IN (1, 1.2, 'true', false);
  | ---
  | - metadata:
- |   - name: true IN (1, 1.2, 'true', false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2265,7 +2265,7 @@ SELECT true IN (1, 1.2, 'true', false);
 SELECT false IN (1, 1.2, 'true', false);
  | ---
  | - metadata:
- |   - name: false IN (1, 1.2, 'true', false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2276,7 +2276,7 @@ SELECT a, a IN (true) FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a IN (true)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2287,7 +2287,7 @@ SELECT a, a IN (false) FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a IN (false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2298,7 +2298,7 @@ SELECT a, a IN (true, false) FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a IN (true, false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2309,7 +2309,7 @@ SELECT a, a IN (SELECT a1 FROM t6 LIMIT 1) FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a IN (SELECT a1 FROM t6 LIMIT 1)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2320,7 +2320,7 @@ SELECT a, a IN (SELECT a1 FROM t6) FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a IN (SELECT a1 FROM t6)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2331,7 +2331,7 @@ SELECT a, a IN (1, 1.2, 'true', false) FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a IN (1, 1.2, 'true', false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2341,7 +2341,7 @@ SELECT a, a IN (1, 1.2, 'true', false) FROM t;
 SELECT true BETWEEN true AND true;
  | ---
  | - metadata:
- |   - name: true BETWEEN true AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2349,7 +2349,7 @@ SELECT true BETWEEN true AND true;
 SELECT false BETWEEN true AND true;
  | ---
  | - metadata:
- |   - name: false BETWEEN true AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2357,7 +2357,7 @@ SELECT false BETWEEN true AND true;
 SELECT true BETWEEN false AND false;
  | ---
  | - metadata:
- |   - name: true BETWEEN false AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2365,7 +2365,7 @@ SELECT true BETWEEN false AND false;
 SELECT false BETWEEN false AND false;
  | ---
  | - metadata:
- |   - name: false BETWEEN false AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2373,7 +2373,7 @@ SELECT false BETWEEN false AND false;
 SELECT true BETWEEN true AND false;
  | ---
  | - metadata:
- |   - name: true BETWEEN true AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2381,7 +2381,7 @@ SELECT true BETWEEN true AND false;
 SELECT false BETWEEN true AND false;
  | ---
  | - metadata:
- |   - name: false BETWEEN true AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2389,7 +2389,7 @@ SELECT false BETWEEN true AND false;
 SELECT true BETWEEN false AND true;
  | ---
  | - metadata:
- |   - name: true BETWEEN false AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2397,7 +2397,7 @@ SELECT true BETWEEN false AND true;
 SELECT false BETWEEN false AND true;
  | ---
  | - metadata:
- |   - name: false BETWEEN false AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2408,7 +2408,7 @@ SELECT a, a BETWEEN true AND true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a BETWEEN true AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2419,7 +2419,7 @@ SELECT a, a BETWEEN false AND false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a BETWEEN false AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2430,7 +2430,7 @@ SELECT a, a BETWEEN true AND false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a BETWEEN true AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2441,7 +2441,7 @@ SELECT a, a BETWEEN false AND true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a BETWEEN false AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2466,7 +2466,7 @@ SELECT true AND 2;
 SELECT false AND 2;
  | ---
  | - metadata:
- |   - name: false AND 2
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2489,7 +2489,7 @@ SELECT 2 AND true;
 SELECT 2 AND false;
  | ---
  | - metadata:
- |   - name: 2 AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2556,7 +2556,7 @@ SELECT b, false AND b FROM t7;
  | - metadata:
  |   - name: B
  |     type: integer
- |   - name: false AND b
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [123, false]
@@ -2581,7 +2581,7 @@ SELECT b, b AND false FROM t7;
  | - metadata:
  |   - name: B
  |     type: integer
- |   - name: b AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [123, false]
@@ -3861,7 +3861,7 @@ SELECT a2, b, b != a2 FROM t6, t7;
 SELECT true IN (0, 1, 2, 3);
  | ---
  | - metadata:
- |   - name: true IN (0, 1, 2, 3)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -3869,7 +3869,7 @@ SELECT true IN (0, 1, 2, 3);
 SELECT false IN (0, 1, 2, 3);
  | ---
  | - metadata:
- |   - name: false IN (0, 1, 2, 3)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -3889,7 +3889,7 @@ SELECT a1, a1 IN (0, 1, 2, 3) FROM t6
  | - metadata:
  |   - name: A1
  |     type: boolean
- |   - name: a1 IN (0, 1, 2, 3)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -3935,7 +3935,7 @@ SELECT true AND 2.3;
 SELECT false AND 2.3;
  | ---
  | - metadata:
- |   - name: false AND 2.3
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -3958,7 +3958,7 @@ SELECT 2.3 AND true;
 SELECT 2.3 AND false;
  | ---
  | - metadata:
- |   - name: 2.3 AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -4025,7 +4025,7 @@ SELECT c, false AND c FROM t8;
  | - metadata:
  |   - name: C
  |     type: number
- |   - name: false AND c
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [4.56, false]
@@ -4050,7 +4050,7 @@ SELECT c, c AND false FROM t8;
  | - metadata:
  |   - name: C
  |     type: number
- |   - name: c AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [4.56, false]
@@ -5006,7 +5006,7 @@ SELECT a2, c, c != a2 FROM t6, t8;
 SELECT true IN (0.1, 1.2, 2.3, 3.4);
  | ---
  | - metadata:
- |   - name: true IN (0.1, 1.2, 2.3, 3.4)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5014,7 +5014,7 @@ SELECT true IN (0.1, 1.2, 2.3, 3.4);
 SELECT false IN (0.1, 1.2, 2.3, 3.4);
  | ---
  | - metadata:
- |   - name: false IN (0.1, 1.2, 2.3, 3.4)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5022,7 +5022,7 @@ SELECT false IN (0.1, 1.2, 2.3, 3.4);
 SELECT a1 IN (0.1, 1.2, 2.3, 3.4) FROM t6 LIMIT 1;
  | ---
  | - metadata:
- |   - name: a1 IN (0.1, 1.2, 2.3, 3.4)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5030,7 +5030,7 @@ SELECT a1 IN (0.1, 1.2, 2.3, 3.4) FROM t6 LIMIT 1;
 SELECT a2 IN (0.1, 1.2, 2.3, 3.4) FROM t6 LIMIT 1;
  | ---
  | - metadata:
- |   - name: a2 IN (0.1, 1.2, 2.3, 3.4)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5095,7 +5095,7 @@ SELECT true AND 'abc';
 SELECT false AND 'abc';
  | ---
  | - metadata:
- |   - name: false AND 'abc'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5118,7 +5118,7 @@ SELECT 'abc' AND true;
 SELECT 'abc' AND false;
  | ---
  | - metadata:
- |   - name: '''abc'' AND false'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5185,7 +5185,7 @@ SELECT d, false AND d FROM t9;
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: false AND d
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['AsdF', false]
@@ -5210,7 +5210,7 @@ SELECT d, d AND false FROM t9;
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: d AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['AsdF', false]
@@ -5470,7 +5470,7 @@ SELECT true AND 'TRUE';
 SELECT false AND 'TRUE';
  | ---
  | - metadata:
- |   - name: false AND 'TRUE'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5493,7 +5493,7 @@ SELECT 'TRUE' AND true;
 SELECT 'TRUE' AND false;
  | ---
  | - metadata:
- |   - name: '''TRUE'' AND false'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5560,7 +5560,7 @@ SELECT d, false AND d FROM t9 WHERE d = 'TRUE';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: false AND d
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['TRUE', false]
@@ -5585,7 +5585,7 @@ SELECT d, d AND false FROM t9 WHERE d = 'TRUE';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: d AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['TRUE', false]
@@ -5650,7 +5650,7 @@ SELECT true AND 'true';
 SELECT false AND 'true';
  | ---
  | - metadata:
- |   - name: false AND 'true'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5673,7 +5673,7 @@ SELECT 'true' AND true;
 SELECT 'true' AND false;
  | ---
  | - metadata:
- |   - name: '''true'' AND false'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5740,7 +5740,7 @@ SELECT d, false AND d FROM t9 WHERE d = 'true';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: false AND d
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['true', false]
@@ -5765,7 +5765,7 @@ SELECT d, d AND false FROM t9 WHERE d = 'true';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: d AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['true', false]
@@ -5830,7 +5830,7 @@ SELECT true AND 'FALSE';
 SELECT false AND 'FALSE';
  | ---
  | - metadata:
- |   - name: false AND 'FALSE'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5853,7 +5853,7 @@ SELECT 'FALSE' AND true;
 SELECT 'FALSE' AND false;
  | ---
  | - metadata:
- |   - name: '''FALSE'' AND false'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5920,7 +5920,7 @@ SELECT d, false AND d FROM t9 WHERE d = 'FALSE';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: false AND d
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['FALSE', false]
@@ -5945,7 +5945,7 @@ SELECT d, d AND false FROM t9 WHERE d = 'FALSE';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: d AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['FALSE', false]
@@ -6010,7 +6010,7 @@ SELECT true AND 'false';
 SELECT false AND 'false';
  | ---
  | - metadata:
- |   - name: false AND 'false'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -6033,7 +6033,7 @@ SELECT 'false' AND true;
 SELECT 'false' AND false;
  | ---
  | - metadata:
- |   - name: '''false'' AND false'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -6100,7 +6100,7 @@ SELECT d, false AND d FROM t9 WHERE d = 'false';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: false AND d
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['false', false]
@@ -6125,7 +6125,7 @@ SELECT d, d AND false FROM t9 WHERE d = 'false';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: d AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['false', false]
diff --git a/test/sql/collation.result b/test/sql/collation.result
index 4e4c27ef0..bfc89e1b8 100644
--- a/test/sql/collation.result
+++ b/test/sql/collation.result
@@ -111,7 +111,7 @@ box.execute([[SELECT descriptor, upper(letter), letter FROM tu where UPPER(lette
 - metadata:
   - name: DESCRIPTOR
     type: string
-  - name: upper(letter)
+  - name: COLUMN_1
     type: string
   - name: LETTER
     type: string
@@ -124,7 +124,7 @@ box.execute([[SELECT descriptor, upper(letter COLLATE "GERMAN"), letter FROM tu
 - metadata:
   - name: DESCRIPTOR
     type: string
-  - name: upper(letter COLLATE "GERMAN")
+  - name: COLUMN_1
     type: string
   - name: LETTER
     type: string
@@ -335,14 +335,14 @@ box.execute("SELECT a FROM t UNION SELECT c FROM t;")
 box.execute("SELECT c COLLATE \"binary\" FROM t UNION SELECT a FROM t;")
 ---
 - metadata:
-  - name: c COLLATE "binary"
+  - name: COLUMN_1
     type: string
   rows: []
 ...
 box.execute("SELECT b COLLATE \"unicode\" FROM t UNION SELECT a FROM t;")
 ---
 - metadata:
-  - name: b COLLATE "unicode"
+  - name: COLUMN_1
     type: string
   rows: []
 ...
@@ -1128,7 +1128,7 @@ box.execute("INSERT INTO jj VALUES (1,'A'), (2,'a')")
 box.execute("SELECT DISTINCT trim(s2) FROM jj;")
 ---
 - metadata:
-  - name: trim(s2)
+  - name: COLUMN_1
     type: string
   rows:
   - ['A']
@@ -1140,7 +1140,7 @@ box.execute("INSERT INTO jj VALUES (3, 'aS'), (4, 'AS');")
 box.execute("SELECT DISTINCT replace(s2, 'S', 's') FROM jj;")
 ---
 - metadata:
-  - name: replace(s2, 'S', 's')
+  - name: COLUMN_1
     type: string
   rows:
   - ['A']
@@ -1149,7 +1149,7 @@ box.execute("SELECT DISTINCT replace(s2, 'S', 's') FROM jj;")
 box.execute("SELECT DISTINCT substr(s2, 1, 1) FROM jj;")
 ---
 - metadata:
-  - name: substr(s2, 1, 1)
+  - name: COLUMN_1
     type: string
   rows:
   - ['A']
diff --git a/test/sql/errinj.result b/test/sql/errinj.result
index 68c001f28..f19203bc6 100644
--- a/test/sql/errinj.result
+++ b/test/sql/errinj.result
@@ -120,7 +120,7 @@ insert_res
 select_res
 ---
 - metadata:
-  - name: '1'
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
diff --git a/test/sql/foreign-keys.result b/test/sql/foreign-keys.result
index f1d973443..33689a06e 100644
--- a/test/sql/foreign-keys.result
+++ b/test/sql/foreign-keys.result
@@ -357,7 +357,7 @@ box.execute('ALTER TABLE tc ADD CONSTRAINT fk1 FOREIGN KEY (id) REFERENCES tp(id
 box.execute('SELECT row_count();')
 ---
 - metadata:
-  - name: row_count()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -374,7 +374,7 @@ box.execute('ALTER TABLE tc DROP CONSTRAINT fk1;')
 box.execute('SELECT row_count();')
 ---
 - metadata:
-  - name: row_count()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
diff --git a/test/sql/full_metadata.result b/test/sql/full_metadata.result
index 5a93c41ec..25bac6d86 100644
--- a/test/sql/full_metadata.result
+++ b/test/sql/full_metadata.result
@@ -57,7 +57,7 @@ execute("SELECT 'aSd' COLLATE \"unicode_ci\";")
  | - metadata:
  |   - type: string
  |     span: '''aSd'' COLLATE "unicode_ci"'
- |     name: '''aSd'' COLLATE "unicode_ci"'
+ |     name: COLUMN_1
  |     collation: unicode_ci
  |   rows:
  |   - ['aSd']
@@ -78,7 +78,7 @@ execute("SELECT c COLLATE \"unicode\" FROM t;")
  | - metadata:
  |   - type: string
  |     span: c COLLATE "unicode"
- |     name: c COLLATE "unicode"
+ |     name: COLUMN_1
  |     collation: unicode
  |   rows:
  |   - ['aSd']
@@ -165,7 +165,7 @@ execute("SELECT *, id + 1 AS x, a AS y, c || 'abc' FROM t;")
  |     is_nullable: false
  |   - type: string
  |     span: c || 'abc'
- |     name: c || 'abc'
+ |     name: COLUMN_1
  |   rows:
  |   - [1, 1, 'aSd', 2, 1, 'aSdabc']
  | ...
@@ -185,8 +185,8 @@ execute("SELECT * FROM v;")
  |     name: Y
  |     is_nullable: false
  |   - type: string
- |     span: c || 'abc'
- |     name: c || 'abc'
+ |     span: COLUMN_1
+ |     name: COLUMN_1
  |   rows:
  |   - [2, 1, 'aSdabc']
  | ...
diff --git a/test/sql/func-recreate.result b/test/sql/func-recreate.result
index 3709df787..5fd2b79c0 100644
--- a/test/sql/func-recreate.result
+++ b/test/sql/func-recreate.result
@@ -48,7 +48,7 @@ test_run:cmd("setopt delimiter ''");
 ch:get()
 ---
 - metadata:
-  - name: WAITFOR(0.2)
+  - name: COLUMN_1
     type: number
   rows:
   - [0.2]
diff --git a/test/sql/gh-3199-no-mem-leaks.result b/test/sql/gh-3199-no-mem-leaks.result
index d8590779a..6ce8df436 100644
--- a/test/sql/gh-3199-no-mem-leaks.result
+++ b/test/sql/gh-3199-no-mem-leaks.result
@@ -32,7 +32,7 @@ box.execute('SELECT x, y, x + y FROM test ORDER BY y')
     type: integer
   - name: Y
     type: integer
-  - name: x + y
+  - name: COLUMN_1
     type: integer
   rows:
   - [1, 1, 2]
@@ -49,7 +49,7 @@ box.execute('SELECT x, y, x + y FROM test ORDER BY y')
     type: integer
   - name: Y
     type: integer
-  - name: x + y
+  - name: COLUMN_1
     type: integer
   rows:
   - [1, 1, 2]
@@ -62,7 +62,7 @@ box.execute('SELECT x, y, x + y FROM test ORDER BY y')
     type: integer
   - name: Y
     type: integer
-  - name: x + y
+  - name: COLUMN_1
     type: integer
   rows:
   - [1, 1, 2]
@@ -75,7 +75,7 @@ box.execute('SELECT x, y, x + y FROM test ORDER BY y')
     type: integer
   - name: Y
     type: integer
-  - name: x + y
+  - name: COLUMN_1
     type: integer
   rows:
   - [1, 1, 2]
@@ -88,7 +88,7 @@ box.execute('SELECT x, y, x + y FROM test ORDER BY y')
     type: integer
   - name: Y
     type: integer
-  - name: x + y
+  - name: COLUMN_1
     type: integer
   rows:
   - [1, 1, 2]
@@ -115,7 +115,7 @@ box.execute('SELECT a, id + 2, b FROM test2 WHERE b < id * 2 ORDER BY a ')
 - metadata:
   - name: A
     type: string
-  - name: id + 2
+  - name: COLUMN_1
     type: integer
   - name: B
     type: integer
@@ -134,7 +134,7 @@ box.execute('SELECT a, id + 2 * b, a FROM test2 WHERE b < id * 2 ORDER BY a ')
 - metadata:
   - name: A
     type: string
-  - name: id + 2 * b
+  - name: COLUMN_1
     type: integer
   - name: A
     type: string
@@ -149,7 +149,7 @@ box.execute('SELECT a, id + 2 * b, a FROM test2 WHERE b < id * 2 ORDER BY a ')
 - metadata:
   - name: A
     type: string
-  - name: id + 2 * b
+  - name: COLUMN_1
     type: integer
   - name: A
     type: string
@@ -164,7 +164,7 @@ box.execute('SELECT a, id + 2 * b, a FROM test2 WHERE b < id * 2 ORDER BY a ')
 - metadata:
   - name: A
     type: string
-  - name: id + 2 * b
+  - name: COLUMN_1
     type: integer
   - name: A
     type: string
@@ -183,7 +183,7 @@ box.execute('SELECT x, y + 3 * b, b FROM test2, test WHERE b = x')
 - metadata:
   - name: X
     type: integer
-  - name: y + 3 * b
+  - name: COLUMN_1
     type: integer
   - name: B
     type: integer
@@ -196,7 +196,7 @@ box.execute('SELECT x, y + 3 * b, b FROM test2, test WHERE b = x')
 - metadata:
   - name: X
     type: integer
-  - name: y + 3 * b
+  - name: COLUMN_1
     type: integer
   - name: B
     type: integer
@@ -209,7 +209,7 @@ box.execute('SELECT x, y + 3 * b, b FROM test2, test WHERE b = x')
 - metadata:
   - name: X
     type: integer
-  - name: y + 3 * b
+  - name: COLUMN_1
     type: integer
   - name: B
     type: integer
diff --git a/test/sql/gh-3888-values-blob-assert.result b/test/sql/gh-3888-values-blob-assert.result
index 0a1af28f2..669f2eb2f 100644
--- a/test/sql/gh-3888-values-blob-assert.result
+++ b/test/sql/gh-3888-values-blob-assert.result
@@ -51,7 +51,7 @@ box.execute('SELECT TheColumnName')
 box.execute('VALUES(-0.5e-2)')
 ---
 - metadata:
-  - name: column1
+  - name: COLUMN_1
     type: double
   rows:
   - [-0.005]
@@ -59,7 +59,7 @@ box.execute('VALUES(-0.5e-2)')
 box.execute('SELECT X\'507265766564\'')
 ---
 - metadata:
-  - name: X'507265766564'
+  - name: COLUMN_1
     type: varbinary
   rows:
   - ['Preved']
@@ -68,7 +68,7 @@ box.execute('SELECT X\'507265766564\'')
 box.execute('SELECT 3.14')
 ---
 - metadata:
-  - name: '3.14'
+  - name: COLUMN_1
     type: double
   rows:
   - [3.14]
@@ -76,7 +76,7 @@ box.execute('SELECT 3.14')
 box.execute('SELECT X\'4D6564766564\'')
 ---
 - metadata:
-  - name: X'4D6564766564'
+  - name: COLUMN_1
     type: varbinary
   rows:
   - ['Medved']
diff --git a/test/sql/gh-4697-scalar-bool-sort-cmp.result b/test/sql/gh-4697-scalar-bool-sort-cmp.result
index 2423cd894..6f7fbd62b 100644
--- a/test/sql/gh-4697-scalar-bool-sort-cmp.result
+++ b/test/sql/gh-4697-scalar-bool-sort-cmp.result
@@ -30,7 +30,7 @@ SELECT s2, typeof(s2) FROM test ORDER BY s2;
  | - metadata:
  |   - name: S2
  |     type: scalar
- |   - name: typeof(s2)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - [null, 'boolean']
@@ -43,7 +43,7 @@ SELECT s3, typeof(s3) FROM test ORDER BY s3;
  | - metadata:
  |   - name: S3
  |     type: scalar
- |   - name: typeof(s3)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - [null, 'boolean']
diff --git a/test/sql/icu-upper-lower.result b/test/sql/icu-upper-lower.result
index f7b9dfa38..3ecc07d94 100644
--- a/test/sql/icu-upper-lower.result
+++ b/test/sql/icu-upper-lower.result
@@ -23,11 +23,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Zəfər, jaketini də, papağını da götür, bu axşam hava çox soyuq
-      olacaq. ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Zəfər, jaketini də, papağını da götür, bu axşam hava çox soyuq
-      olacaq. ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     zəfər, jaketini də, papağını da götür, bu axşam hava çox soyuq olacaq. ',
@@ -38,9 +36,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     The quick brown fox jumps over the lazy dog. ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     The quick brown fox jumps over the lazy dog. ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     the quick brown fox jumps over the lazy dog. ', '     THE QUICK BROWN FOX
@@ -52,9 +50,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     The quick brown fox jumps over the lazy dog. ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     The quick brown fox jumps over the lazy dog. ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     the quick brown fox jumps over the lazy dog. ', '     THE QUICK BROWN FOX
@@ -66,11 +64,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Բել դղյակի ձախ ժամն օֆ ազգությանը ցպահանջ չճշտած վնաս էր եւ
-      փառք ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Բել դղյակի ձախ ժամն օֆ ազգությանը ցպահանջ չճշտած վնաս էր եւ
-      փառք ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     բել դղյակի ձախ ժամն օֆ ազգությանը ցպահանջ չճշտած վնաս էր եւ փառք ', '     ԲԵԼ
@@ -82,11 +78,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     У Іўі худы жвавы чорт у зялёнай камізэльцы пабег пад’есці фаршу
-      з юшкай ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     У Іўі худы жвавы чорт у зялёнай камізэльцы пабег пад’есці фаршу
-      з юшкай ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     у іўі худы жвавы чорт у зялёнай камізэльцы пабег пад’есці фаршу з юшкай ',
@@ -98,11 +92,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός
-      ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός
-      ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός ', '     ΤΆΧΙΣΤΗ
@@ -114,11 +106,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Chuaigh bé mhórshách le dlúthspád fíorfhinn trí hata mo dhea-phorcáin
-      bhig ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Chuaigh bé mhórshách le dlúthspád fíorfhinn trí hata mo dhea-phorcáin
-      bhig ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     chuaigh bé mhórshách le dlúthspád fíorfhinn trí hata mo dhea-phorcáin bhig ',
@@ -130,9 +120,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Quiere la boca exhausta vid, kiwi, piña y fugaz jamón ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Quiere la boca exhausta vid, kiwi, piña y fugaz jamón ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     quiere la boca exhausta vid, kiwi, piña y fugaz jamón ', '     QUIERE LA
@@ -144,9 +134,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     키스의 고유조건은 입술끼리 만나야 하고 특별한 기술은 필요치 않다 ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     키스의 고유조건은 입술끼리 만나야 하고 특별한 기술은 필요치 않다 ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     키스의 고유조건은 입술끼리 만나야 하고 특별한 기술은 필요치 않다 ', '     키스의 고유조건은 입술끼리 만나야 하고 특별한
@@ -158,9 +148,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Glāžšķūņa rūķīši dzērumā čiepj Baha koncertflīģeļu vākus ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Glāžšķūņa rūķīši dzērumā čiepj Baha koncertflīģeļu vākus ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     glāžšķūņa rūķīši dzērumā čiepj baha koncertflīģeļu vākus ', '     GLĀŽŠĶŪŅA
@@ -172,11 +162,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Zwölf große Boxkämpfer jagen Viktor quer über den Sylter Deich
-      ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Zwölf große Boxkämpfer jagen Viktor quer über den Sylter Deich
-      ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     zwölf große boxkämpfer jagen viktor quer über den sylter deich ', '     ZWÖLF
@@ -188,9 +176,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Pchnąć w tę łódź jeża lub ośm skrzyń fig. ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Pchnąć w tę łódź jeża lub ośm skrzyń fig. ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     pchnąć w tę łódź jeża lub ośm skrzyń fig. ', '     PCHNĄĆ W TĘ ŁÓDŹ JEŻA
@@ -202,9 +190,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Чуєш їх, доцю, га? Кумедна ж ти, прощайся без ґольфів! ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Чуєш їх, доцю, га? Кумедна ж ти, прощайся без ґольфів! ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     чуєш їх, доцю, га? кумедна ж ти, прощайся без ґольфів! ', '     ЧУЄШ ЇХ,
@@ -216,9 +204,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Příliš žluťoučký kůň úpěl ďábelské ódy ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Příliš žluťoučký kůň úpěl ďábelské ódy ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     příliš žluťoučký kůň úpěl ďábelské ódy ', '     PŘÍLIŠ ŽLUŤOUČKÝ KŮŇ ÚPĚL
@@ -230,11 +218,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Laŭ Ludoviko Zamenhof bongustas freŝa ĉeĥa manĝaĵo kun spicoj
-      ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Laŭ Ludoviko Zamenhof bongustas freŝa ĉeĥa manĝaĵo kun spicoj
-      ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     laŭ ludoviko zamenhof bongustas freŝa ĉeĥa manĝaĵo kun spicoj ', '     LAŬ
@@ -246,9 +232,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     いろはにほへと ちりぬるを わかよたれそ つねならむ うゐのおくやま けふこえて あさきゆめみし ゑひもせす ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     いろはにほへと ちりぬるを わかよたれそ つねならむ うゐのおくやま けふこえて あさきゆめみし ゑひもせす ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     いろはにほへと ちりぬるを わかよたれそ つねならむ うゐのおくやま けふこえて あさきゆめみし ゑひもせす ', '     いろはにほへと
@@ -260,9 +246,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: 'lower(''     Pijamalı hasta yağız şoföre çabucak güvendi. EXTRA: İ '')'
+  - name: COLUMN_1
     type: string
-  - name: 'upper(''     Pijamalı hasta yağız şoföre çabucak güvendi. EXTRA: İ '')'
+  - name: COLUMN_2
     type: string
   rows:
   - ['     pijamalı hasta yağız şoföre çabucak güvendi. extra: i̇ ', '     PIJAMALI
diff --git a/test/sql/integer-overflow.result b/test/sql/integer-overflow.result
index 6269cb547..a56fb2412 100644
--- a/test/sql/integer-overflow.result
+++ b/test/sql/integer-overflow.result
@@ -19,7 +19,7 @@ box.execute('SELECT (2147483647 * 2147483647 * 2147483647);')
 box.execute('SELECT (-9223372036854775808 / -1);')
 ---
 - metadata:
-  - name: (-9223372036854775808 / -1)
+  - name: COLUMN_1
     type: integer
   rows:
   - [9223372036854775808]
@@ -32,7 +32,7 @@ box.execute('SELECT (-9223372036854775808 - 1);')
 box.execute('SELECT (9223372036854775807 + 1);')
 ---
 - metadata:
-  - name: (9223372036854775807 + 1)
+  - name: COLUMN_1
     type: integer
   rows:
   - [9223372036854775808]
@@ -50,7 +50,7 @@ box.execute('SELECT 18446744073709551615 * 2;')
 box.execute('SELECT (-9223372036854775807 * (-2));')
 ---
 - metadata:
-  - name: (-9223372036854775807 * (-2))
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551614]
@@ -60,7 +60,7 @@ box.execute('SELECT (-9223372036854775807 * (-2));')
 box.execute('SELECT 9223372036854775808;')
 ---
 - metadata:
-  - name: '9223372036854775808'
+  - name: COLUMN_1
     type: integer
   rows:
   - [9223372036854775808]
@@ -74,7 +74,7 @@ box.execute('SELECT -9223372036854775809;')
 box.execute('SELECT 9223372036854775808 - 1;')
 ---
 - metadata:
-  - name: 9223372036854775808 - 1
+  - name: COLUMN_1
     type: integer
   rows:
   - [9223372036854775807]
@@ -82,7 +82,7 @@ box.execute('SELECT 9223372036854775808 - 1;')
 box.execute('SELECT 18446744073709551615;')
 ---
 - metadata:
-  - name: '18446744073709551615'
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551615]
@@ -98,7 +98,7 @@ box.execute('SELECT 18446744073709551616;')
 box.execute('SELECT CAST(\'9223372036854775808\' AS INTEGER);')
 ---
 - metadata:
-  - name: CAST('9223372036854775808' AS INTEGER)
+  - name: COLUMN_1
     type: integer
   rows:
   - [9223372036854775808]
diff --git a/test/sql/iproto.result b/test/sql/iproto.result
index 44ba499a0..ee1047fc1 100644
--- a/test/sql/iproto.result
+++ b/test/sql/iproto.result
@@ -372,11 +372,11 @@ parameters[3] = 33
 cn:execute('select $2, $1, $3', parameters)
 ---
 - metadata:
-  - name: $2
+  - name: COLUMN_1
     type: integer
-  - name: $1
+  - name: COLUMN_2
     type: integer
-  - name: $3
+  - name: COLUMN_3
     type: integer
   rows:
   - [22, 11, 33]
@@ -736,7 +736,7 @@ res.metadata
 cn:execute("SELECT zeroblob(1);")
 ---
 - metadata:
-  - name: zeroblob(1)
+  - name: COLUMN_1
     type: varbinary
   rows:
   - ["\0"]
@@ -749,7 +749,7 @@ res = cn:execute("SELECT randomblob(1);")
 ...
 res.metadata
 ---
-- - name: randomblob(1)
+- - name: COLUMN_1
     type: varbinary
 ...
 -- Type set during compilation stage, and since min/max are accept
@@ -759,7 +759,7 @@ res.metadata
 cn:execute("SELECT LEAST(1, 2, 3);")
 ---
 - metadata:
-  - name: LEAST(1, 2, 3)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [1]
@@ -767,7 +767,7 @@ cn:execute("SELECT LEAST(1, 2, 3);")
 cn:execute("SELECT GREATEST(1, 2, 3);")
 ---
 - metadata:
-  - name: GREATEST(1, 2, 3)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [3]
@@ -803,7 +803,7 @@ s = box.prepare([[ SELECT ?; ]])
 s:execute({42})
 ---
 - metadata:
-  - name: '?'
+  - name: COLUMN_1
     type: integer
   rows:
   - [42]
@@ -811,7 +811,7 @@ s:execute({42})
 box.execute('SELECT 1;')
 ---
 - metadata:
-  - name: '1'
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
diff --git a/test/sql/max-on-index.result b/test/sql/max-on-index.result
index 1cd488f85..a90f30993 100644
--- a/test/sql/max-on-index.result
+++ b/test/sql/max-on-index.result
@@ -48,7 +48,7 @@ box.execute("INSERT INTO test2 VALUES(1, 2)");
 box.execute("SELECT MAX(f1) FROM test1")
 ---
 - metadata:
-  - name: MAX(f1)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [4]
@@ -56,7 +56,7 @@ box.execute("SELECT MAX(f1) FROM test1")
 box.execute("SELECT MAX(f2) FROM test1")
 ---
 - metadata:
-  - name: MAX(f2)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [3]
@@ -64,7 +64,7 @@ box.execute("SELECT MAX(f2) FROM test1")
 box.execute("SELECT MAX(f1) FROM test2")
 ---
 - metadata:
-  - name: MAX(f1)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [1]
diff --git a/test/sql/misc.result b/test/sql/misc.result
index 0190a5897..6af11bfba 100644
--- a/test/sql/misc.result
+++ b/test/sql/misc.result
@@ -11,7 +11,7 @@ _ = box.space._session_settings:update('sql_default_engine', {{'=', 2, engine}})
 box.execute('select 1;')
 ---
 - metadata:
-  - name: '1'
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -78,7 +78,7 @@ box.execute('CREATE TABLE test (id INTEGER PRIMARY KEY, b TEXT CONSTRAINT c1 COL
 box.execute('SELECT 1;')
 ---
 - metadata:
-  - name: '1'
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -86,7 +86,7 @@ box.execute('SELECT 1;')
 box.execute('SELECT 1.5;')
 ---
 - metadata:
-  - name: '1.5'
+  - name: COLUMN_1
     type: double
   rows:
   - [1.5]
@@ -94,7 +94,7 @@ box.execute('SELECT 1.5;')
 box.execute('SELECT 1.0;')
 ---
 - metadata:
-  - name: '1.0'
+  - name: COLUMN_1
     type: double
   rows:
   - [1]
@@ -102,7 +102,7 @@ box.execute('SELECT 1.0;')
 box.execute('SELECT \'abc\';')
 ---
 - metadata:
-  - name: '''abc'''
+  - name: COLUMN_1
     type: string
   rows:
   - ['abc']
@@ -110,7 +110,7 @@ box.execute('SELECT \'abc\';')
 box.execute('SELECT X\'4D6564766564\'')
 ---
 - metadata:
-  - name: X'4D6564766564'
+  - name: COLUMN_1
     type: varbinary
   rows:
   - ['Medved']
diff --git a/test/sql/persistency.result b/test/sql/persistency.result
index 6d14d4c4e..95dde5714 100644
--- a/test/sql/persistency.result
+++ b/test/sql/persistency.result
@@ -41,9 +41,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -57,9 +57,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar LIMIT 2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -72,9 +72,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo=2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['bar', 2, 42, 'awesome']
@@ -86,9 +86,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo>2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foobar', 1000, 42, 'awesome']
@@ -100,9 +100,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo>=2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['bar', 2, 42, 'awesome']
@@ -115,9 +115,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo=10000")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows: []
 ...
@@ -128,9 +128,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo>10000")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows: []
 ...
@@ -141,9 +141,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -155,9 +155,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<2.001")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -170,9 +170,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<=2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -185,9 +185,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<100")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -200,9 +200,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE bar='foo'")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -210,7 +210,7 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE bar='foo'")
 box.execute("SELECT count(*) FROM foobar")
 ---
 - metadata:
-  - name: count(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -218,7 +218,7 @@ box.execute("SELECT count(*) FROM foobar")
 box.execute("SELECT count(*) FROM foobar WHERE bar='foo'")
 ---
 - metadata:
-  - name: count(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -230,9 +230,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar ORDER BY bar")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['bar', 2, 42, 'awesome']
@@ -246,9 +246,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar ORDER BY bar DESC")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foobar', 1000, 42, 'awesome']
@@ -263,7 +263,7 @@ box.execute("REPLACE INTO foobar VALUES (1, 'cacodaemon')")
 box.execute("SELECT COUNT(*) FROM foobar WHERE foo=1")
 ---
 - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -271,7 +271,7 @@ box.execute("SELECT COUNT(*) FROM foobar WHERE foo=1")
 box.execute("SELECT COUNT(*) FROM foobar WHERE bar='cacodaemon'")
 ---
 - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -283,7 +283,7 @@ box.execute("DELETE FROM foobar WHERE bar='cacodaemon'")
 box.execute("SELECT COUNT(*) FROM foobar WHERE bar='cacodaemon'")
 ---
 - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
diff --git a/test/sql/prepared.result b/test/sql/prepared.result
index 666f6e1d3..0db2cc03f 100644
--- a/test/sql/prepared.result
+++ b/test/sql/prepared.result
@@ -425,13 +425,13 @@ s = prepare("SELECT count(*), count(a - 3), max(b), abs(id) FROM test WHERE b =
 execute(s.stmt_id)
  | ---
  | - metadata:
- |   - name: count(*)
+ |   - name: COLUMN_1
  |     type: integer
- |   - name: count(a - 3)
+ |   - name: COLUMN_2
  |     type: integer
- |   - name: max(b)
+ |   - name: COLUMN_3
  |     type: scalar
- |   - name: abs(id)
+ |   - name: COLUMN_4
  |     type: number
  |   rows:
  |   - [1, 1, '3', 1]
@@ -439,13 +439,13 @@ execute(s.stmt_id)
 execute(s.stmt_id)
  | ---
  | - metadata:
- |   - name: count(*)
+ |   - name: COLUMN_1
  |     type: integer
- |   - name: count(a - 3)
+ |   - name: COLUMN_2
  |     type: integer
- |   - name: max(b)
+ |   - name: COLUMN_3
  |     type: scalar
- |   - name: abs(id)
+ |   - name: COLUMN_4
  |     type: number
  |   rows:
  |   - [1, 1, '3', 1]
@@ -480,7 +480,7 @@ res = execute(s.stmt_id)
  | ...
 res.metadata
  | ---
- | - - name: group_concat(TRIM(TRAILING FROM t),x'0a')
+ | - - name: COLUMN_13
  |     type: string
  | ...
 unprepare(s.stmt_id)
@@ -838,11 +838,11 @@ s = prepare('SELECT :a, :b, :c');
 execute(s.stmt_id, {{[':a'] = 1}, {[':b'] = 2}, {[':c'] = 3}});
  | ---
  | - metadata:
- |   - name: :a
+ |   - name: COLUMN_1
  |     type: integer
- |   - name: :b
+ |   - name: COLUMN_2
  |     type: integer
- |   - name: :c
+ |   - name: COLUMN_3
  |     type: integer
  |   rows:
  |   - [1, 2, 3]
@@ -850,11 +850,11 @@ execute(s.stmt_id, {{[':a'] = 1}, {[':b'] = 2}, {[':c'] = 3}});
 execute(s.stmt_id, {{[':a'] = 1}, {[':b'] = 2}});
  | ---
  | - metadata:
- |   - name: :a
+ |   - name: COLUMN_1
  |     type: integer
- |   - name: :b
+ |   - name: COLUMN_2
  |     type: integer
- |   - name: :c
+ |   - name: COLUMN_3
  |     type: boolean
  |   rows:
  |   - [1, 2, null]
@@ -862,11 +862,11 @@ execute(s.stmt_id, {{[':a'] = 1}, {[':b'] = 2}});
 execute(s.stmt_id);
  | ---
  | - metadata:
- |   - name: :a
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: :b
+ |   - name: COLUMN_2
  |     type: boolean
- |   - name: :c
+ |   - name: COLUMN_3
  |     type: boolean
  |   rows:
  |   - [null, null, null]
diff --git a/test/sql/row-count.result b/test/sql/row-count.result
index 02acd79b5..7591d1630 100644
--- a/test/sql/row-count.result
+++ b/test/sql/row-count.result
@@ -16,7 +16,7 @@ box.execute("CREATE TABLE t1 (s1 VARCHAR(10) PRIMARY KEY);")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -24,7 +24,7 @@ box.execute("SELECT ROW_COUNT();")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -36,7 +36,7 @@ box.execute("CREATE TABLE t2 (s1 VARCHAR(10) PRIMARY KEY, s2 VARCHAR(10) REFEREN
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -52,7 +52,7 @@ box.execute("INSERT INTO t3 VALUES (0, 0, 0);")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -64,7 +64,7 @@ box.execute("CREATE TRIGGER x AFTER DELETE ON t1 FOR EACH ROW BEGIN UPDATE t3 SE
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -76,7 +76,7 @@ box.execute("INSERT INTO t1 VALUES ('a');")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -88,7 +88,7 @@ box.execute("INSERT INTO t2 VALUES ('a','a');")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -100,7 +100,7 @@ box.execute("INSERT INTO t1 VALUES ('b'), ('c'), ('d');")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -113,7 +113,7 @@ box.execute("REPLACE INTO t2 VALUES('a', 'c');")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [2]
@@ -125,7 +125,7 @@ box.execute("DELETE FROM t1;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [4]
@@ -141,7 +141,7 @@ box.execute("TRUNCATE TABLE t3;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -157,7 +157,7 @@ box.execute("UPDATE t3 SET i2 = 666;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -172,7 +172,7 @@ box.execute("DELETE FROM t3 WHERE 0 = 0;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -188,7 +188,7 @@ box.execute("DELETE FROM t3")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -222,7 +222,7 @@ box.execute("DELETE FROM tt1 WHERE id = 2;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -252,7 +252,7 @@ box.execute("START TRANSACTION;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -264,7 +264,7 @@ box.execute("COMMIT;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -277,7 +277,7 @@ box.execute("COMMIT;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -286,7 +286,7 @@ box.execute("SELECT ROW_COUNT();")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -308,7 +308,7 @@ box.execute("EXPLAIN QUERY PLAN INSERT INTO t1 VALUES ('b'), ('c'), ('d');")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
diff --git a/test/sql/transition.result b/test/sql/transition.result
index c14055b4e..8680e3cec 100644
--- a/test/sql/transition.result
+++ b/test/sql/transition.result
@@ -38,9 +38,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -54,9 +54,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar LIMIT 2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -69,9 +69,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo=2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['bar', 2, 42, 'awesome']
@@ -83,9 +83,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo>2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foobar', 1000, 42, 'awesome']
@@ -97,9 +97,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo>=2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['bar', 2, 42, 'awesome']
@@ -112,9 +112,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo=10000")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows: []
 ...
@@ -125,9 +125,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo>10000")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows: []
 ...
@@ -138,9 +138,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -152,9 +152,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<2.001")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -167,9 +167,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<=2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -182,9 +182,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<100")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -197,9 +197,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE bar='foo'")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -207,7 +207,7 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE bar='foo'")
 box.execute("SELECT count(*) FROM foobar")
 ---
 - metadata:
-  - name: count(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -215,7 +215,7 @@ box.execute("SELECT count(*) FROM foobar")
 box.execute("SELECT count(*) FROM foobar WHERE bar='foo'")
 ---
 - metadata:
-  - name: count(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -227,9 +227,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar ORDER BY bar")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['bar', 2, 42, 'awesome']
@@ -243,9 +243,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar ORDER BY bar DESC")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foobar', 1000, 42, 'awesome']
@@ -260,7 +260,7 @@ box.execute("REPLACE INTO foobar VALUES (1, 'cacodaemon')")
 box.execute("SELECT COUNT(*) FROM foobar WHERE foo=1")
 ---
 - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -268,7 +268,7 @@ box.execute("SELECT COUNT(*) FROM foobar WHERE foo=1")
 box.execute("SELECT COUNT(*) FROM foobar WHERE bar='cacodaemon'")
 ---
 - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -280,7 +280,7 @@ box.execute("DELETE FROM foobar WHERE bar='cacodaemon'")
 box.execute("SELECT COUNT(*) FROM foobar WHERE bar='cacodaemon'")
 ---
 - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
diff --git a/test/sql/types.result b/test/sql/types.result
index 54aff460e..8204b22bd 100644
--- a/test/sql/types.result
+++ b/test/sql/types.result
@@ -54,8 +54,8 @@ box.execute("CREATE VIEW v1 AS SELECT b + a, b - a FROM t1;")
 ...
 box.space.V1:format()
 ---
-- [{'type': 'number', 'nullable_action': 'none', 'name': 'b + a', 'is_nullable': true},
-  {'type': 'number', 'nullable_action': 'none', 'name': 'b - a', 'is_nullable': true}]
+- [{'type': 'number', 'nullable_action': 'none', 'name': 'COLUMN_1', 'is_nullable': true},
+  {'type': 'number', 'nullable_action': 'none', 'name': 'COLUMN_2', 'is_nullable': true}]
 ...
 -- gh-2494: index's part also features correct declared type.
 --
@@ -197,7 +197,7 @@ box.execute("SELECT randomblob(5) || 'x';")
 box.execute("VALUES (TYPEOF(randomblob(5) || zeroblob(5)));")
 ---
 - metadata:
-  - name: column1
+  - name: COLUMN_1
     type: string
   rows:
   - ['varbinary']
@@ -230,7 +230,7 @@ box.execute("SELECT * FROM t1 WHERE 'blob' LIKE x'0000';")
 box.execute("SELECT s LIKE NULL FROM t1;")
 ---
 - metadata:
-  - name: s LIKE NULL
+  - name: COLUMN_1
     type: integer
   rows:
   - [null]
@@ -256,7 +256,7 @@ box.execute("SELECT * FROM t1 WHERE 'int' LIKE 4;")
 box.execute("SELECT NULL LIKE s FROM t1;")
 ---
 - metadata:
-  - name: NULL LIKE s
+  - name: COLUMN_1
     type: integer
   rows:
   - [null]
@@ -295,7 +295,7 @@ box.space.T1:drop()
 box.execute('SELECT 1 + 1;')
 ---
 - metadata:
-  - name: 1 + 1
+  - name: COLUMN_1
     type: integer
   rows:
   - [2]
@@ -303,7 +303,7 @@ box.execute('SELECT 1 + 1;')
 box.execute('SELECT 1 + 1.1;')
 ---
 - metadata:
-  - name: 1 + 1.1
+  - name: COLUMN_1
     type: double
   rows:
   - [2.1]
@@ -311,7 +311,7 @@ box.execute('SELECT 1 + 1.1;')
 box.execute('SELECT \'9223372036854\' + 1;')
 ---
 - metadata:
-  - name: '''9223372036854'' + 1'
+  - name: COLUMN_1
     type: integer
   rows:
   - [9223372036855]
@@ -320,7 +320,7 @@ box.execute('SELECT \'9223372036854\' + 1;')
 box.execute('SELECT ?', {true})
 ---
 - metadata:
-  - name: '?'
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -481,7 +481,7 @@ s:drop()
 box.execute("SELECT 18446744073709551615 > 18446744073709551614;")
 ---
 - metadata:
-  - name: 18446744073709551615 > 18446744073709551614
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -489,7 +489,7 @@ box.execute("SELECT 18446744073709551615 > 18446744073709551614;")
 box.execute("SELECT 18446744073709551615 > -9223372036854775808;")
 ---
 - metadata:
-  - name: 18446744073709551615 > -9223372036854775808
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -497,7 +497,7 @@ box.execute("SELECT 18446744073709551615 > -9223372036854775808;")
 box.execute("SELECT -1 < 18446744073709551615;")
 ---
 - metadata:
-  - name: -1 < 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -505,7 +505,7 @@ box.execute("SELECT -1 < 18446744073709551615;")
 box.execute("SELECT 1.5 < 18446744073709551615")
 ---
 - metadata:
-  - name: 1.5 < 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -513,7 +513,7 @@ box.execute("SELECT 1.5 < 18446744073709551615")
 box.execute("SELECT 1.5 > 18446744073709551615")
 ---
 - metadata:
-  - name: 1.5 > 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [false]
@@ -521,7 +521,7 @@ box.execute("SELECT 1.5 > 18446744073709551615")
 box.execute("SELECT 18446744073709551615 > 1.5")
 ---
 - metadata:
-  - name: 18446744073709551615 > 1.5
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -529,7 +529,7 @@ box.execute("SELECT 18446744073709551615 > 1.5")
 box.execute("SELECT 18446744073709551615 < 1.5")
 ---
 - metadata:
-  - name: 18446744073709551615 < 1.5
+  - name: COLUMN_1
     type: boolean
   rows:
   - [false]
@@ -537,7 +537,7 @@ box.execute("SELECT 18446744073709551615 < 1.5")
 box.execute("SELECT 18446744073709551615 = 18446744073709551615;")
 ---
 - metadata:
-  - name: 18446744073709551615 = 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -545,7 +545,7 @@ box.execute("SELECT 18446744073709551615 = 18446744073709551615;")
 box.execute("SELECT 18446744073709551615 > -9223372036854775808;")
 ---
 - metadata:
-  - name: 18446744073709551615 > -9223372036854775808
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -553,7 +553,7 @@ box.execute("SELECT 18446744073709551615 > -9223372036854775808;")
 box.execute("SELECT 18446744073709551615 < -9223372036854775808;")
 ---
 - metadata:
-  - name: 18446744073709551615 < -9223372036854775808
+  - name: COLUMN_1
     type: boolean
   rows:
   - [false]
@@ -561,7 +561,7 @@ box.execute("SELECT 18446744073709551615 < -9223372036854775808;")
 box.execute("SELECT -1 < 18446744073709551615;")
 ---
 - metadata:
-  - name: -1 < 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -569,7 +569,7 @@ box.execute("SELECT -1 < 18446744073709551615;")
 box.execute("SELECT -1 > 18446744073709551615;")
 ---
 - metadata:
-  - name: -1 > 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [false]
@@ -577,7 +577,7 @@ box.execute("SELECT -1 > 18446744073709551615;")
 box.execute("SELECT 18446744073709551610 - 18446744073709551615;")
 ---
 - metadata:
-  - name: 18446744073709551610 - 18446744073709551615
+  - name: COLUMN_1
     type: integer
   rows:
   - [-5]
@@ -585,7 +585,7 @@ box.execute("SELECT 18446744073709551610 - 18446744073709551615;")
 box.execute("SELECT 18446744073709551615 = null;")
 ---
 - metadata:
-  - name: 18446744073709551615 = null
+  - name: COLUMN_1
     type: boolean
   rows:
   - [null]
@@ -593,7 +593,7 @@ box.execute("SELECT 18446744073709551615 = null;")
 box.execute("SELECT 18446744073709551615 = 18446744073709551615.0;")
 ---
 - metadata:
-  - name: 18446744073709551615 = 18446744073709551615.0
+  - name: COLUMN_1
     type: boolean
   rows:
   - [false]
@@ -601,7 +601,7 @@ box.execute("SELECT 18446744073709551615 = 18446744073709551615.0;")
 box.execute("SELECT 18446744073709551615.0 > 18446744073709551615")
 ---
 - metadata:
-  - name: 18446744073709551615.0 > 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -609,7 +609,7 @@ box.execute("SELECT 18446744073709551615.0 > 18446744073709551615")
 box.execute("SELECT 18446744073709551615 IN ('18446744073709551615', 18446744073709551615.0)")
 ---
 - metadata:
-  - name: 18446744073709551615 IN ('18446744073709551615', 18446744073709551615.0)
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -617,7 +617,7 @@ box.execute("SELECT 18446744073709551615 IN ('18446744073709551615', 18446744073
 box.execute("SELECT 1 LIMIT 18446744073709551615;")
 ---
 - metadata:
-  - name: '1'
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -625,7 +625,7 @@ box.execute("SELECT 1 LIMIT 18446744073709551615;")
 box.execute("SELECT 1 LIMIT 1 OFFSET 18446744073709551614;")
 ---
 - metadata:
-  - name: '1'
+  - name: COLUMN_1
     type: integer
   rows: []
 ...
@@ -637,7 +637,7 @@ box.execute("SELECT CAST('18446744073' || '709551616' AS INTEGER);")
 box.execute("SELECT CAST('18446744073' || '709551615' AS INTEGER);")
 ---
 - metadata:
-  - name: CAST('18446744073' || '709551615' AS INTEGER)
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551615]
@@ -645,7 +645,7 @@ box.execute("SELECT CAST('18446744073' || '709551615' AS INTEGER);")
 box.execute("SELECT 18446744073709551610 + 5;")
 ---
 - metadata:
-  - name: 18446744073709551610 + 5
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551615]
@@ -653,7 +653,7 @@ box.execute("SELECT 18446744073709551610 + 5;")
 box.execute("SELECT 18446744073709551615 * 1;")
 ---
 - metadata:
-  - name: 18446744073709551615 * 1
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551615]
@@ -661,7 +661,7 @@ box.execute("SELECT 18446744073709551615 * 1;")
 box.execute("SELECT 1 / 18446744073709551615;")
 ---
 - metadata:
-  - name: 1 / 18446744073709551615
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -669,7 +669,7 @@ box.execute("SELECT 1 / 18446744073709551615;")
 box.execute("SELECT 18446744073709551615 / 18446744073709551615;")
 ---
 - metadata:
-  - name: 18446744073709551615 / 18446744073709551615
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -677,7 +677,7 @@ box.execute("SELECT 18446744073709551615 / 18446744073709551615;")
 box.execute("SELECT 18446744073709551615 / -9223372036854775808;")
 ---
 - metadata:
-  - name: 18446744073709551615 / -9223372036854775808
+  - name: COLUMN_1
     type: integer
   rows:
   - [-1]
@@ -771,7 +771,7 @@ box.execute("INSERT INTO t VALUES (2, -1);")
 box.execute("SELECT sum(i) FROM t;")
 ---
 - metadata:
-  - name: sum(i)
+  - name: COLUMN_1
     type: number
   rows:
   - [18446744073709551613]
@@ -779,7 +779,7 @@ box.execute("SELECT sum(i) FROM t;")
 box.execute("SELECT avg(i) FROM t;")
 ---
 - metadata:
-  - name: avg(i)
+  - name: COLUMN_1
     type: number
   rows:
   - [6148914691236516864]
@@ -787,7 +787,7 @@ box.execute("SELECT avg(i) FROM t;")
 box.execute("SELECT total(i) FROM t;")
 ---
 - metadata:
-  - name: total(i)
+  - name: COLUMN_1
     type: number
   rows:
   - [1.844674407371e+19]
@@ -795,7 +795,7 @@ box.execute("SELECT total(i) FROM t;")
 box.execute("SELECT min(i) FROM t;")
 ---
 - metadata:
-  - name: min(i)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [-1]
@@ -803,7 +803,7 @@ box.execute("SELECT min(i) FROM t;")
 box.execute("SELECT max(i) FROM t;")
 ---
 - metadata:
-  - name: max(i)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [18446744073709551613]
@@ -811,7 +811,7 @@ box.execute("SELECT max(i) FROM t;")
 box.execute("SELECT count(i) FROM t;")
 ---
 - metadata:
-  - name: count(i)
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -819,7 +819,7 @@ box.execute("SELECT count(i) FROM t;")
 box.execute("SELECT group_concat(i) FROM t;")
 ---
 - metadata:
-  - name: group_concat(i)
+  - name: COLUMN_1
     type: string
   rows:
   - ['1,-1,18446744073709551613']
@@ -831,7 +831,7 @@ box.execute("DELETE FROM t WHERE i < 18446744073709551613;")
 box.execute("SELECT lower(i) FROM t;")
 ---
 - metadata:
-  - name: lower(i)
+  - name: COLUMN_1
     type: string
   rows:
   - ['18446744073709551613']
@@ -839,7 +839,7 @@ box.execute("SELECT lower(i) FROM t;")
 box.execute("SELECT upper(i) FROM t;")
 ---
 - metadata:
-  - name: upper(i)
+  - name: COLUMN_1
     type: string
   rows:
   - ['18446744073709551613']
@@ -847,7 +847,7 @@ box.execute("SELECT upper(i) FROM t;")
 box.execute("SELECT abs(i) FROM t;")
 ---
 - metadata:
-  - name: abs(i)
+  - name: COLUMN_1
     type: number
   rows:
   - [18446744073709551613]
@@ -855,7 +855,7 @@ box.execute("SELECT abs(i) FROM t;")
 box.execute("SELECT typeof(i) FROM t;")
 ---
 - metadata:
-  - name: typeof(i)
+  - name: COLUMN_1
     type: string
   rows:
   - ['integer']
@@ -863,7 +863,7 @@ box.execute("SELECT typeof(i) FROM t;")
 box.execute("SELECT quote(i) FROM t;")
 ---
 - metadata:
-  - name: quote(i)
+  - name: COLUMN_1
     type: string
   rows:
   - [18446744073709551613]
@@ -871,7 +871,7 @@ box.execute("SELECT quote(i) FROM t;")
 box.execute("SELECT LEAST(-1, i) FROM t;")
 ---
 - metadata:
-  - name: LEAST(-1, i)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [-1]
@@ -879,7 +879,7 @@ box.execute("SELECT LEAST(-1, i) FROM t;")
 box.execute("SELECT quote(i) FROM t;")
 ---
 - metadata:
-  - name: quote(i)
+  - name: COLUMN_1
     type: string
   rows:
   - [18446744073709551613]
@@ -1012,7 +1012,7 @@ box.space.T1:drop()
 box.execute("SELECT CAST(18446744073709551615 AS NUMBER);")
 ---
 - metadata:
-  - name: CAST(18446744073709551615 AS NUMBER)
+  - name: COLUMN_1
     type: number
   rows:
   - [18446744073709551615]
@@ -1020,7 +1020,7 @@ box.execute("SELECT CAST(18446744073709551615 AS NUMBER);")
 box.execute("SELECT CAST(18446744073709551615 AS TEXT);")
 ---
 - metadata:
-  - name: CAST(18446744073709551615 AS TEXT)
+  - name: COLUMN_1
     type: string
   rows:
   - ['18446744073709551615']
@@ -1028,7 +1028,7 @@ box.execute("SELECT CAST(18446744073709551615 AS TEXT);")
 box.execute("SELECT CAST(18446744073709551615 AS SCALAR);")
 ---
 - metadata:
-  - name: CAST(18446744073709551615 AS SCALAR)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [18446744073709551615]
@@ -1036,7 +1036,7 @@ box.execute("SELECT CAST(18446744073709551615 AS SCALAR);")
 box.execute("SELECT CAST(18446744073709551615 AS BOOLEAN);")
 ---
 - metadata:
-  - name: CAST(18446744073709551615 AS BOOLEAN)
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -1044,7 +1044,7 @@ box.execute("SELECT CAST(18446744073709551615 AS BOOLEAN);")
 box.execute("SELECT CAST('18446744073709551615' AS INTEGER);")
 ---
 - metadata:
-  - name: CAST('18446744073709551615' AS INTEGER)
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551615]
@@ -1077,7 +1077,7 @@ box.execute("SELECT id FROM t1;")
 box.execute("SELECT CAST(123 AS UNSIGNED);")
 ---
 - metadata:
-  - name: CAST(123 AS UNSIGNED)
+  - name: COLUMN_1
     type: unsigned
   rows:
   - [123]
@@ -1090,7 +1090,7 @@ box.execute("SELECT CAST(-123 AS UNSIGNED);")
 box.execute("SELECT CAST(1.5 AS UNSIGNED);")
 ---
 - metadata:
-  - name: CAST(1.5 AS UNSIGNED)
+  - name: COLUMN_1
     type: unsigned
   rows:
   - [1]
@@ -1098,7 +1098,7 @@ box.execute("SELECT CAST(1.5 AS UNSIGNED);")
 box.execute("SELECT CAST(-1.5 AS UNSIGNED);")
 ---
 - metadata:
-  - name: CAST(-1.5 AS UNSIGNED)
+  - name: COLUMN_1
     type: unsigned
   rows:
   - [-1]
@@ -1106,7 +1106,7 @@ box.execute("SELECT CAST(-1.5 AS UNSIGNED);")
 box.execute("SELECT CAST(true AS UNSIGNED);")
 ---
 - metadata:
-  - name: CAST(true AS UNSIGNED)
+  - name: COLUMN_1
     type: unsigned
   rows:
   - [1]
@@ -1114,7 +1114,7 @@ box.execute("SELECT CAST(true AS UNSIGNED);")
 box.execute("SELECT CAST('123' AS UNSIGNED);")
 ---
 - metadata:
-  - name: CAST('123' AS UNSIGNED)
+  - name: COLUMN_1
     type: unsigned
   rows:
   - [123]
@@ -1146,7 +1146,7 @@ box.space.T:drop()
 box.execute("SELECT CASE 1 WHEN 1 THEN x'0000000000' WHEN 2 THEN 'str' END")
 ---
 - metadata:
-  - name: CASE 1 WHEN 1 THEN x'0000000000' WHEN 2 THEN 'str' END
+  - name: COLUMN_1
     type: scalar
   rows:
   - ["\0\0\0\0\0"]
@@ -1154,7 +1154,7 @@ box.execute("SELECT CASE 1 WHEN 1 THEN x'0000000000' WHEN 2 THEN 'str' END")
 box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 END")
 ---
 - metadata:
-  - name: CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 END
+  - name: COLUMN_1
     type: integer
   rows:
   - [666]
@@ -1162,7 +1162,7 @@ box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 END")
 box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 ELSE 321 END")
 ---
 - metadata:
-  - name: CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 ELSE 321 END
+  - name: COLUMN_1
     type: integer
   rows:
   - [666]
@@ -1170,7 +1170,7 @@ box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 ELSE 321 END")
 box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 ELSE 'asd' END")
 ---
 - metadata:
-  - name: CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 ELSE 'asd' END
+  - name: COLUMN_1
     type: scalar
   rows:
   - [666]
@@ -1178,8 +1178,7 @@ box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 ELSE 'asd' END")
 box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4 WHEN 'e' THEN 5 WHEN 'f' THEN 6 END;")
 ---
 - metadata:
-  - name: CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4
-      WHEN 'e' THEN 5 WHEN 'f' THEN 6 END
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -1187,8 +1186,7 @@ box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHE
 box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4 WHEN 'e' THEN 5 WHEN 'f' THEN 'asd' END;")
 ---
 - metadata:
-  - name: CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4
-      WHEN 'e' THEN 5 WHEN 'f' THEN 'asd' END
+  - name: COLUMN_1
     type: scalar
   rows:
   - [1]
@@ -1196,8 +1194,7 @@ box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHE
 box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4 WHEN 'e' THEN 5 WHEN 'f' THEN 6 ELSE 'asd' END;")
 ---
 - metadata:
-  - name: CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4
-      WHEN 'e' THEN 5 WHEN 'f' THEN 6 ELSE 'asd' END
+  - name: COLUMN_1
     type: scalar
   rows:
   - [1]
@@ -1205,8 +1202,7 @@ box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHE
 box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4 WHEN 'e' THEN 5 WHEN 'f' THEN 6 ELSE 7 END;")
 ---
 - metadata:
-  - name: CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4
-      WHEN 'e' THEN 5 WHEN 'f' THEN 6 ELSE 7 END
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -1284,7 +1280,7 @@ box.execute("SELECT total(v) FROM t;")
 box.execute("SELECT min(v) FROM t;")
 ---
 - metadata:
-  - name: min(v)
+  - name: COLUMN_1
     type: scalar
   rows:
   - ['abc']
@@ -1292,7 +1288,7 @@ box.execute("SELECT min(v) FROM t;")
 box.execute("SELECT max(v) FROM t;")
 ---
 - metadata:
-  - name: max(v)
+  - name: COLUMN_1
     type: scalar
   rows:
   - ['abc']
@@ -1300,7 +1296,7 @@ box.execute("SELECT max(v) FROM t;")
 box.execute("SELECT count(v) FROM t;")
 ---
 - metadata:
-  - name: count(v)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -1308,7 +1304,7 @@ box.execute("SELECT count(v) FROM t;")
 box.execute("SELECT group_concat(v) FROM t;")
 ---
 - metadata:
-  - name: group_concat(v)
+  - name: COLUMN_1
     type: string
   rows:
   - ['abc']
@@ -1331,7 +1327,7 @@ box.execute("SELECT abs(v) FROM t;")
 box.execute("SELECT typeof(v) FROM t;")
 ---
 - metadata:
-  - name: typeof(v)
+  - name: COLUMN_1
     type: string
   rows:
   - ['varbinary']
@@ -1339,7 +1335,7 @@ box.execute("SELECT typeof(v) FROM t;")
 box.execute("SELECT quote(v) FROM t;")
 ---
 - metadata:
-  - name: quote(v)
+  - name: COLUMN_1
     type: string
   rows:
   - ['X''616263''']
@@ -1347,7 +1343,7 @@ box.execute("SELECT quote(v) FROM t;")
 box.execute("SELECT LEAST(v, x'') FROM t;")
 ---
 - metadata:
-  - name: LEAST(v, x'')
+  - name: COLUMN_1
     type: scalar
   rows:
   - ['']
@@ -1467,7 +1463,7 @@ box.execute("SELECT CAST(true AS VARBINARY);")
 box.execute("SELECT CAST('asd' AS VARBINARY);")
 ---
 - metadata:
-  - name: CAST('asd' AS VARBINARY)
+  - name: COLUMN_1
     type: varbinary
   rows:
   - ['asd']
@@ -1475,7 +1471,7 @@ box.execute("SELECT CAST('asd' AS VARBINARY);")
 box.execute("SELECT CAST(x'' AS VARBINARY);")
 ---
 - metadata:
-  - name: CAST(x'' AS VARBINARY)
+  - name: COLUMN_1
     type: varbinary
   rows:
   - ['']
@@ -1494,9 +1490,9 @@ box.execute("INSERT INTO t VALUES (1, 1, 1), (2, NULL, NULL);")
 box.execute("SELECT typeof(a), typeof(s) FROM t;")
 ---
 - metadata:
-  - name: typeof(a)
+  - name: COLUMN_1
     type: string
-  - name: typeof(s)
+  - name: COLUMN_2
     type: string
   rows:
   - ['integer', 'integer']
@@ -1513,7 +1509,7 @@ box.execute('INSERT INTO t1 VALUES (1, NULL, NULL);')
 box.execute('SELECT typeof(a & b) FROM t1;')
 ---
 - metadata:
-  - name: typeof(a & b)
+  - name: COLUMN_1
     type: string
   rows:
   - ['integer']
@@ -1521,11 +1517,11 @@ box.execute('SELECT typeof(a & b) FROM t1;')
 box.execute('SELECT typeof(a), typeof(b), typeof(a & b) FROM t1')
 ---
 - metadata:
-  - name: typeof(a)
+  - name: COLUMN_1
     type: string
-  - name: typeof(b)
+  - name: COLUMN_2
     type: string
-  - name: typeof(a & b)
+  - name: COLUMN_3
     type: string
   rows:
   - ['integer', 'integer', 'integer']
@@ -1533,7 +1529,7 @@ box.execute('SELECT typeof(a), typeof(b), typeof(a & b) FROM t1')
 box.execute("SELECT typeof(CAST(0 AS UNSIGNED));")
 ---
 - metadata:
-  - name: typeof(CAST(0 AS UNSIGNED))
+  - name: COLUMN_1
     type: string
   rows:
   - ['unsigned']
@@ -1693,7 +1689,7 @@ box.execute('DROP TABLE t1;')
 box.execute("SELECT 1.0;")
 ---
 - metadata:
-  - name: '1.0'
+  - name: COLUMN_1
     type: double
   rows:
   - [1]
@@ -1701,7 +1697,7 @@ box.execute("SELECT 1.0;")
 box.execute("SELECT .01;")
 ---
 - metadata:
-  - name: '.01'
+  - name: COLUMN_1
     type: double
   rows:
   - [0.01]
@@ -1709,7 +1705,7 @@ box.execute("SELECT .01;")
 box.execute("SELECT CAST(1 AS DOUBLE);")
 ---
 - metadata:
-  - name: CAST(1 AS DOUBLE)
+  - name: COLUMN_1
     type: double
   rows:
   - [1]
@@ -1717,7 +1713,7 @@ box.execute("SELECT CAST(1 AS DOUBLE);")
 box.execute("SELECT CAST(1.123 AS DOUBLE);")
 ---
 - metadata:
-  - name: CAST(1.123 AS DOUBLE)
+  - name: COLUMN_1
     type: double
   rows:
   - [1.123]
@@ -1735,7 +1731,7 @@ box.execute("SELECT CAST('asd' AS DOUBLE);")
 box.execute("SELECT CAST('1' AS DOUBLE);")
 ---
 - metadata:
-  - name: CAST('1' AS DOUBLE)
+  - name: COLUMN_1
     type: double
   rows:
   - [1]
@@ -1743,7 +1739,7 @@ box.execute("SELECT CAST('1' AS DOUBLE);")
 box.execute("SELECT CAST('1.123' AS DOUBLE);")
 ---
 - metadata:
-  - name: CAST('1.123' AS DOUBLE)
+  - name: COLUMN_1
     type: double
   rows:
   - [1.123]
@@ -1761,7 +1757,7 @@ box.execute("SELECT CAST(x'35' AS DOUBLE);")
 box.execute("SELECT CAST(CAST(x'35' AS STRING) AS DOUBLE);")
 ---
 - metadata:
-  - name: CAST(CAST(x'35' AS STRING) AS DOUBLE)
+  - name: COLUMN_1
     type: double
   rows:
   - [5]
@@ -1795,7 +1791,7 @@ box.execute('SELECT * FROM t;')
 box.execute('SELECT d / 100 FROM t;')
 ---
 - metadata:
-  - name: d / 100
+  - name: COLUMN_1
     type: double
   rows:
   - [0.1]
@@ -1828,7 +1824,7 @@ box.execute('SELECT * from t WHERE d = 3.3;')
 box.execute("SELECT sum(d) FROM t;")
 ---
 - metadata:
-  - name: sum(d)
+  - name: COLUMN_1
     type: number
   rows:
   - [18000000000000000000]
@@ -1836,7 +1832,7 @@ box.execute("SELECT sum(d) FROM t;")
 box.execute("SELECT avg(d) FROM t;")
 ---
 - metadata:
-  - name: avg(d)
+  - name: COLUMN_1
     type: number
   rows:
   - [4500000000000000000]
@@ -1844,7 +1840,7 @@ box.execute("SELECT avg(d) FROM t;")
 box.execute("SELECT total(d) FROM t;")
 ---
 - metadata:
-  - name: total(d)
+  - name: COLUMN_1
     type: number
   rows:
   - [18000000000000000000]
@@ -1852,7 +1848,7 @@ box.execute("SELECT total(d) FROM t;")
 box.execute("SELECT min(d) FROM t;")
 ---
 - metadata:
-  - name: min(d)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [-2]
@@ -1860,7 +1856,7 @@ box.execute("SELECT min(d) FROM t;")
 box.execute("SELECT max(d) FROM t;")
 ---
 - metadata:
-  - name: max(d)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [18000000000000000000]
@@ -1868,7 +1864,7 @@ box.execute("SELECT max(d) FROM t;")
 box.execute("SELECT count(d) FROM t;")
 ---
 - metadata:
-  - name: count(d)
+  - name: COLUMN_1
     type: integer
   rows:
   - [4]
@@ -1876,7 +1872,7 @@ box.execute("SELECT count(d) FROM t;")
 box.execute("SELECT group_concat(d) FROM t;")
 ---
 - metadata:
-  - name: group_concat(d)
+  - name: COLUMN_1
     type: string
   rows:
   - ['10.0,-2.0,3.3,1.8e+19']
@@ -1884,7 +1880,7 @@ box.execute("SELECT group_concat(d) FROM t;")
 box.execute("SELECT lower(d) FROM t;")
 ---
 - metadata:
-  - name: lower(d)
+  - name: COLUMN_1
     type: string
   rows:
   - ['10.0']
@@ -1895,7 +1891,7 @@ box.execute("SELECT lower(d) FROM t;")
 box.execute("SELECT upper(d) FROM t;")
 ---
 - metadata:
-  - name: upper(d)
+  - name: COLUMN_1
     type: string
   rows:
   - ['10.0']
@@ -1906,7 +1902,7 @@ box.execute("SELECT upper(d) FROM t;")
 box.execute("SELECT abs(d) FROM t;")
 ---
 - metadata:
-  - name: abs(d)
+  - name: COLUMN_1
     type: number
   rows:
   - [10]
@@ -1917,7 +1913,7 @@ box.execute("SELECT abs(d) FROM t;")
 box.execute("SELECT typeof(d) FROM t;")
 ---
 - metadata:
-  - name: typeof(d)
+  - name: COLUMN_1
     type: string
   rows:
   - ['double']
@@ -1928,7 +1924,7 @@ box.execute("SELECT typeof(d) FROM t;")
 box.execute("SELECT quote(d) FROM t;")
 ---
 - metadata:
-  - name: quote(d)
+  - name: COLUMN_1
     type: string
   rows:
   - ['10.0']
@@ -1939,7 +1935,7 @@ box.execute("SELECT quote(d) FROM t;")
 box.execute("SELECT LEAST(d, 0) FROM t;")
 ---
 - metadata:
-  - name: LEAST(d, 0)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [0]
@@ -2081,9 +2077,9 @@ box.execute("DROP TABLE t4;")
 box.execute("SELECT 1.0, typeof(1.0);")
 ---
 - metadata:
-  - name: '1.0'
+  - name: COLUMN_1
     type: double
-  - name: typeof(1.0)
+  - name: COLUMN_2
     type: string
   rows:
   - [1, 'double']
@@ -2091,9 +2087,9 @@ box.execute("SELECT 1.0, typeof(1.0);")
 box.execute("SELECT CAST(2 AS DOUBLE), typeof(CAST(2 AS DOUBLE));")
 ---
 - metadata:
-  - name: CAST(2 AS DOUBLE)
+  - name: COLUMN_1
     type: double
-  - name: typeof(CAST(2 AS DOUBLE))
+  - name: COLUMN_2
     type: string
   rows:
   - [2, 'double']
@@ -2101,9 +2097,9 @@ box.execute("SELECT CAST(2 AS DOUBLE), typeof(CAST(2 AS DOUBLE));")
 box.execute("SELECT 3e3, typeof(3e3);")
 ---
 - metadata:
-  - name: '3e3'
+  - name: COLUMN_1
     type: double
-  - name: typeof(3e3)
+  - name: COLUMN_2
     type: string
   rows:
   - [3000, 'double']
@@ -2121,7 +2117,7 @@ box.execute("SELECT d, TYPEOF(d) FROM t5;")
 - metadata:
   - name: D
     type: double
-  - name: TYPEOF(d)
+  - name: COLUMN_1
     type: string
   rows:
   - [4, 'double']
-- 
2.21.0 (Apple Git-122)

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Tarantool-patches] [PATCH v3 2/2] sql: print span more properly
  2020-06-11 15:18 [Tarantool-patches] [PATCH v3 0/2] Use-unify-pattern-for-column-names Roman Khabibov
  2020-06-11 15:18 ` [Tarantool-patches] [PATCH v3 1/2] sql: use unify pattern for column names Roman Khabibov
@ 2020-06-11 15:18 ` Roman Khabibov
  2020-06-15 22:18   ` Vladislav Shpilevoy
  1 sibling, 1 reply; 20+ messages in thread
From: Roman Khabibov @ 2020-06-11 15:18 UTC (permalink / raw)
  To: tarantool-patches; +Cc: v.shpilevoy

There were several cases where instead of the correct column
span, the column name was printed. Fix this bug.

Follow up #3962
---
 src/box/sql/select.c          | 2 +-
 test/sql/full_metadata.result | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/box/sql/select.c b/src/box/sql/select.c
index b06240ca4..0a0d9ba14 100644
--- a/src/box/sql/select.c
+++ b/src/box/sql/select.c
@@ -1848,7 +1848,7 @@ generate_column_metadata(struct Parse *pParse, struct SrcList *pTabList,
 				if (space->sequence != NULL &&
 				    space->sequence_fieldno == (uint32_t) iCol)
 					vdbe_metadata_set_col_autoincrement(v, i);
-				if (colname != NULL)
+				if (span != NULL)
 					vdbe_metadata_set_col_span(v, i, span);
 			}
 		} else {
diff --git a/test/sql/full_metadata.result b/test/sql/full_metadata.result
index 25bac6d86..dc1e91115 100644
--- a/test/sql/full_metadata.result
+++ b/test/sql/full_metadata.result
@@ -65,7 +65,7 @@ execute("SELECT 'aSd' COLLATE \"unicode_ci\";")
 execute("SELECT c FROM t;")
  | ---
  | - metadata:
- |   - span: C
+ |   - span: c
  |     type: string
  |     is_nullable: true
  |     name: C
@@ -89,16 +89,16 @@ execute("SELECT c COLLATE \"unicode\" FROM t;")
 execute("SELECT id, a, c FROM t;")
  | ---
  | - metadata:
- |   - span: ID
+ |   - span: id
  |     type: integer
  |     is_autoincrement: true
  |     name: ID
  |     is_nullable: false
  |   - type: integer
- |     span: A
+ |     span: a
  |     name: A
  |     is_nullable: false
- |   - span: C
+ |   - span: c
  |     type: string
  |     is_nullable: true
  |     name: C
-- 
2.21.0 (Apple Git-122)

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Tarantool-patches] [PATCH v3 1/2] sql: use unify pattern for column names
  2020-06-11 15:18 ` [Tarantool-patches] [PATCH v3 1/2] sql: use unify pattern for column names Roman Khabibov
@ 2020-06-15 21:59   ` Vladislav Shpilevoy
  2020-06-22 21:14     ` roman
  0 siblings, 1 reply; 20+ messages in thread
From: Vladislav Shpilevoy @ 2020-06-15 21:59 UTC (permalink / raw)
  To: Roman Khabibov, tarantool-patches

Hi! Thanks for the patch!

See 4 comments below.

On 11/06/2020 17:18, Roman Khabibov wrote:

> sql: use unify pattern for column names

1. 'Unify' is a verb. You don't need 'use' before it.

> Name resulting columns generated by an expression or <VALUES>
> construction by the "COLUMN_N" pattern.
> 
> Closes #3962
> 
> @TarantoolBot document
> Title: Column naming in SQL
> 
> Now, every auto generated column is named by the "COLUMN_N"
> pattern, where N is the number of column in a query (starting)
> from 1). Auto generated column is a column in a query result
> generated by an expression or a column from <VALUES>
> construction.
> 
> Examples:
> box.execute("VALUES(1, 2, 3);")
> ---
> - metadata:
>   - name: COLUMN_1
>     type: integer
>   - name: COLUMN_2
>     type: integer
>   - name: COLUMN_3
>     type: integer
>   rows:
>   - [1, 2, 3]
> ...
> box.execute("SELECT * FROM (VALUES (1+1, 1+1));")
> ---
> - metadata:
>   - name: COLUMN_1
>     type: integer
>   - name: COLUMN_2
>     type: integer
>   rows:
>   - [2, 2]
> ...
> box.execute("SELECT 1+1, 1+1;")
> ---
> - metadata:
>   - name: COLUMN_1
>     type: integer
>   - name: COLUMN_2
>     type: integer
>   rows:
>   - [2, 2]
> ...

2. Please, wrap code into ``` to make the github markdown
more readable.

3. What if I specify first column by myself, and the second
is an expression? Will it be _1 or _2?

> @@ -4951,6 +4951,18 @@ selectExpander(Walker * pWalker, Select * p)
>  		       || (pE->pLeft != 0 && pE->pLeft->op == TK_ID));
>  		if (pE->op == TK_DOT && pE->pRight->op == TK_ASTERISK)
>  			break;
> +		/*
> +		 * It is necessary to generate auto names for
> +		 * expressions before clauses such as ORDER BY,
> +		 * GROUP BY will be resolved. These names can be
> +		 * found inside these clauses during resolving.
> +		 */
> +		if (pEList->a[k].zName == NULL && pE->op != TK_DOT &&
> +		    ((pE->flags & EP_Leaf) == 0 || pE->op != TK_ID)) {
> +			uint32_t idx = ++pParse->autoname_i;
> +			pEList->a[k].zName =
> +				sqlDbStrDup(db, sql_generate_column_name(idx));

4. I don't think I understand what is happening here. Looks too
complicated. Why do you need so many checks, what do these checks
mean, how are they related to ORDER BY/GROUP BY? And how is it
related to select expansion (the function is called selectExpander())?
Why does it work fine when I use normal column names in ORDER BY/GROUP BY,
and does not work here without this crutch?

Also, this looks broken:

tarantool> box.execute('SELECT *, s1 COLLATE "unicode_ci" FROM j ORDER BY column_1;')
---
- null
- Can’t resolve field 'COLUMN_1'
...


tarantool> box.execute('SELECT s1 COLLATE "unicode_ci" FROM j ORDER BY column_1;')
---
- metadata:
  - name: COLUMN_1
    type: scalar
  rows:
  - [1]
...

When I add '*' before the column_1, it stops working.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Tarantool-patches] [PATCH v3 2/2] sql: print span more properly
  2020-06-11 15:18 ` [Tarantool-patches] [PATCH v3 2/2] sql: print span more properly Roman Khabibov
@ 2020-06-15 22:18   ` Vladislav Shpilevoy
  2020-06-22 21:14     ` roman
  0 siblings, 1 reply; 20+ messages in thread
From: Vladislav Shpilevoy @ 2020-06-15 22:18 UTC (permalink / raw)
  To: Roman Khabibov, tarantool-patches

Thanks for the patch!

On 11/06/2020 17:18, Roman Khabibov wrote:
> There were several cases where instead of the correct column
> span, the column name was printed. Fix this bug.
> 
> Follow up #3962

This is rather a follow up for 4407. Because the
bug was introduced here:
https://github.com/tarantool/tarantool/commit/f89d65652c3003dd62c18a88b73a8ebbae50aab0#diff-6b3f29fe63589aaefab6b4beb6cb572e

It is not related to auto columns.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Tarantool-patches] [PATCH v3 1/2] sql: use unify pattern for column names
  2020-06-15 21:59   ` Vladislav Shpilevoy
@ 2020-06-22 21:14     ` roman
  2020-06-23 23:12       ` Vladislav Shpilevoy
  0 siblings, 1 reply; 20+ messages in thread
From: roman @ 2020-06-22 21:14 UTC (permalink / raw)
  To: Vladislav Shpilevoy; +Cc: tarantool-patches

[-- Attachment #1: Type: text/plain, Size: 143150 bytes --]

Hello. Thanks for the review.

On 16.06.2020 00:59, Vladislav Shpilevoy wrote:
> Hi! Thanks for the patch!
>
> See 4 comments below.
>
> On 11/06/2020 17:18, Roman Khabibov wrote:
>
>> sql: use unify pattern for column names
> 1. 'Unify' is a verb. You don't need 'use' before it.
Done.
>> Name resulting columns generated by an expression or <VALUES>
>> construction by the "COLUMN_N" pattern.
>>
>> Closes #3962
>>
>> @TarantoolBot document
>> Title: Column naming in SQL
>>
>> Now, every auto generated column is named by the "COLUMN_N"
>> pattern, where N is the number of column in a query (starting)
>> from 1). Auto generated column is a column in a query result
>> generated by an expression or a column from <VALUES>
>> construction.
>>
>> Examples:
>> box.execute("VALUES(1, 2, 3);")
>> ---
>> - metadata:
>>    - name: COLUMN_1
>>      type: integer
>>    - name: COLUMN_2
>>      type: integer
>>    - name: COLUMN_3
>>      type: integer
>>    rows:
>>    - [1, 2, 3]
>> ...
>> box.execute("SELECT * FROM (VALUES (1+1, 1+1));")
>> ---
>> - metadata:
>>    - name: COLUMN_1
>>      type: integer
>>    - name: COLUMN_2
>>      type: integer
>>    rows:
>>    - [2, 2]
>> ...
>> box.execute("SELECT 1+1, 1+1;")
>> ---
>> - metadata:
>>    - name: COLUMN_1
>>      type: integer
>>    - name: COLUMN_2
>>      type: integer
>>    rows:
>>    - [2, 2]
>> ...
> 2. Please, wrap code into ``` to make the github markdown
> more readable.
Done.
> 3. What if I specify first column by myself, and the second
> is an expression? Will it be _1 or _2?

tarantool>         CREATE TABLE j (column_1 SCALAR PRIMARY KEY);
---
- row_count: 1
...

tarantool>         INSERT INTO j VALUES(1);
---
- row_count: 1
...

tarantool> SELECT column_1, column_1 COLLATE "unicode_ci" FROM j ORDER BY column_1;
---
- metadata:
   - name: COLUMN_1
     type: scalar
   - name: COLUMN_1
     type: scalar
   rows:
   - [1, 1]
...

If we want that the second expression to be named "COLUMN_2". should we use a
hash table in struct Parse. We will push the names of all columns in the request
to it and generate names without collisions. I don't now anymore ways.
I would leave it as it is now.

>> @@ -4951,6 +4951,18 @@ selectExpander(Walker * pWalker, Select * p)
>>   		       || (pE->pLeft != 0 && pE->pLeft->op == TK_ID));
>>   		if (pE->op == TK_DOT && pE->pRight->op == TK_ASTERISK)
>>   			break;
>> +		/*
>> +		 * It is necessary to generate auto names for
>> +		 * expressions before clauses such as ORDER BY,
>> +		 * GROUP BY will be resolved. These names can be
>> +		 * found inside these clauses during resolving.
>> +		 */
>> +		if (pEList->a[k].zName == NULL && pE->op != TK_DOT &&
>> +		    ((pE->flags & EP_Leaf) == 0 || pE->op != TK_ID)) {
>> +			uint32_t idx = ++pParse->autoname_i;
>> +			pEList->a[k].zName =
>> +				sqlDbStrDup(db, sql_generate_column_name(idx));
> 4. I don't think I understand what is happening here. Looks too
> complicated. Why do you need so many checks, what do these checks
> mean, how are they related to ORDER BY/GROUP BY? And how is it
> related to select expansion (the function is called selectExpander())?
> Why does it work fine when I use normal column names in ORDER BY/GROUP BY,
> and does not work here without this crutch?
Here I name all items (generate names) in expression list if it is needed.
I think this operation can be attributed to "expanding". Expanding is before
name resolving. At the resolving all items must be named.

You can use normal column names in ORDER BY, GROUP BY etc, I checked it 
in Postgre
(Postgre names expression the same way). I think it is OK.

+/**
+ * Determine whether to generate a name for @a expr or not.
+ *
+ * Auto generated names is needed for every item in  a <SELECT>
+ * expression list except asterisks, dots and column names (also
+ * if this item hasn't alias).
+ *
+ * @param expr Expression from expression list to analyze.
+ *
+ * @retval true/false If item is/isn't needed needed to name.
+ */
+static bool
+is_needed_to_name(struct Expr *expr) {
+    if (expr->op != TK_ASTERISK && expr->op != TK_DOT &&
+        ((expr->flags & EP_Leaf) == 0 || expr->op != TK_ID))
+        return true;
+    return false;
+}
+
  /*
   * This routine is a Walker callback for "expanding" a SELECT statement.
   * "Expanding" means to do the following:
@@ -4941,19 +4960,27 @@ selectExpander(Walker * pWalker, Select * p)
       * all tables.
       *
       * The first loop just checks to see if there are any "*" operators
-     * that need expanding.
+     * that need expanding and name items of the expression
+     * list if needed.
       */
+    i = pEList->nExpr;
      for (k = 0; k < pEList->nExpr; k++) {
          pE = pEList->a[k].pExpr;
-        if (pE->op == TK_ASTERISK)
-            break;
+        if (pE->op == TK_ASTERISK && i == pEList->nExpr)
+            i = k;
          assert(pE->op != TK_DOT || pE->pRight != 0);
          assert(pE->op != TK_DOT
                 || (pE->pLeft != 0 && pE->pLeft->op == TK_ID));
-        if (pE->op == TK_DOT && pE->pRight->op == TK_ASTERISK)
-            break;
+        if (pE->op == TK_DOT && pE->pRight->op == TK_ASTERISK  &&
+            i == pEList->nExpr)
+            i = k;
+        if (pEList->a[k].zName == NULL && is_needed_to_name(pE)) {
+            uint32_t idx = ++pParse->autoname_i;
+            pEList->a[k].zName =
+                sqlDbStrDup(db, sql_generate_column_name(idx));
+        }
      }
-    if (k < pEList->nExpr) {
+    if (i < pEList->nExpr) {
          /*
           * If we get here it means the result set contains one or more "*"
           * operators that need to be expanded.  Loop through each 
expression
> Also, this looks broken:
>
> tarantool> box.execute('SELECT *, s1 COLLATE "unicode_ci" FROM j ORDER BY column_1;')
> ---
> - null
> - Can’t resolve field 'COLUMN_1'
> ...
Now, it is OK.
> tarantool> box.execute('SELECT s1 COLLATE "unicode_ci" FROM j ORDER BY column_1;')
> ---
> - metadata:
>    - name: COLUMN_1
>      type: scalar
>    rows:
>    - [1]
> ...
>
> When I add '*' before the column_1, it stops working.

commit 718d7e809291b1c48c1b5bc1a0c297906319394d
Author: Roman Khabibov <roman.habibov@tarantool.org>
Date:   Thu Mar 5 12:48:58 2020 +0300

     sql: unify pattern for column names

     Name resulting columns generated by an expression or <VALUES>
     construction by the "COLUMN_N" pattern.

     Closes #3962

     @TarantoolBot document
     Title: Column naming in SQL

     Now, every auto generated column is named by the "COLUMN_N"
     pattern, where N is the number of column in a query (starting)
     from 1). Auto generated column is a column in a query result
     generated by an expression or a column from <VALUES>
     construction.

     Examples:
     ```
     box.execute("VALUES(1, 2, 3);")
     ---
     - metadata:
       - name: COLUMN_1
         type: integer
       - name: COLUMN_2
         type: integer
       - name: COLUMN_3
         type: integer
       rows:
       - [1, 2, 3]
     ...
     box.execute("SELECT * FROM (VALUES (1+1, 1+1));")
     ---
     - metadata:
       - name: COLUMN_1
         type: integer
       - name: COLUMN_2
         type: integer
       rows:
       - [2, 2]
     ...
     box.execute("SELECT 1+1, 1+1;")
     ---
     - metadata:
       - name: COLUMN_1
         type: integer
       - name: COLUMN_2
         type: integer
       rows:
       - [2, 2]
     ...
     ```

diff --git a/src/box/sql/select.c b/src/box/sql/select.c
index 4b069ad..7a56136 100644
--- a/src/box/sql/select.c
+++ b/src/box/sql/select.c
@@ -1854,14 +1854,14 @@ generate_column_metadata(struct Parse *pParse, 
struct SrcList *pTabList,
              }
          } else {
              const char *z = NULL;
-            if (colname != NULL)
+            if (colname != NULL) {
                  z = colname;
-            else if (span != NULL)
-                z = span;
-            else
-                z = tt_sprintf("column%d", i + 1);
+            } else {
+                uint32_t idx = ++pParse->autoname_i;
+                z = sql_generate_column_name(idx);
+            }
              vdbe_metadata_set_col_name(v, i, z);
-            if (is_full_meta && colname != NULL)
+            if (is_full_meta)
                  vdbe_metadata_set_col_span(v, i, span);
          }
      }
@@ -1897,7 +1897,6 @@ sqlColumnsFromExprList(Parse * parse, ExprList * 
expr_list,
      /* Database connection */
      sql *db = parse->db;
      u32 cnt;        /* Index added to make the name unique */
-    Expr *p;        /* Expression for a single result column */
      char *zName;        /* Column name */
      int nName;        /* Size of name in zName[] */
      Hash ht;        /* Hash table of column names */
@@ -1929,13 +1928,12 @@ sqlColumnsFromExprList(Parse * parse, ExprList * 
expr_list,
      space_def->field_count = column_count;

      for (uint32_t i = 0; i < column_count; i++) {
-        /* Get an appropriate name for the column
+        /*
+         * Check if the column contains an "AS <name>"
+         * phrase.
           */
-        p = sqlExprSkipCollate(expr_list->a[i].pExpr);
-        if ((zName = expr_list->a[i].zName) != 0) {
-            /* If the column contains an "AS <name>" phrase, use <name> 
as the name */
-        } else {
-            Expr *pColExpr = p;    /* The expression that is the result 
column name */
+        if ((zName = expr_list->a[i].zName) == 0) {
+            struct Expr *pColExpr = expr_list->a[i].pExpr;
              struct space_def *space_def = NULL;
              while (pColExpr->op == TK_DOT) {
                  pColExpr = pColExpr->pRight;
@@ -1951,14 +1949,14 @@ sqlColumnsFromExprList(Parse * parse, ExprList * 
expr_list,
              } else if (pColExpr->op == TK_ID) {
                  assert(!ExprHasProperty(pColExpr, EP_IntValue));
                  zName = pColExpr->u.zToken;
-            } else {
-                /* Use the original text of the column expression as 
its name */
-                zName = expr_list->a[i].zSpan;
              }
          }
-        if (zName == NULL)
-            zName = "_auto_field_";
-        zName = sqlMPrintf(db, "%s", zName);
+        if (zName == NULL) {
+            uint32_t idx = ++parse->autoname_i;
+            zName = sqlDbStrDup(db, sql_generate_column_name(idx));
+        } else {
+            zName = sqlDbStrDup(db, zName);
+        }

          /* Make sure the column name is unique.  If the name is not 
unique,
           * append an integer to the name so that it becomes unique.
@@ -1989,6 +1987,8 @@ sqlColumnsFromExprList(Parse * parse, ExprList * 
expr_list,
              memcpy(space_def->fields[i].name, zName, name_len);
              space_def->fields[i].name[name_len] = '\0';
          }
+        sqlDbFree(db, expr_list->a[i].zName);
+        expr_list->a[i].zName = zName;
      }
  cleanup:
      sqlHashClear(&ht);
@@ -4792,6 +4792,25 @@ selectPopWith(Walker * pWalker, Select * p)
      }
  }

+/**
+ * Determine whether to generate a name for @a expr or not.
+ *
+ * Auto generated names is needed for every item in  a <SELECT>
+ * expression list except asterisks, dots and column names (also
+ * if this item hasn't alias).
+ *
+ * @param expr Expression from expression list to analyze.
+ *
+ * @retval true/false If item is/isn't needed needed to name.
+ */
+static bool
+is_needed_to_name(struct Expr *expr) {
+    if (expr->op != TK_ASTERISK && expr->op != TK_DOT &&
+        ((expr->flags & EP_Leaf) == 0 || expr->op != TK_ID))
+        return true;
+    return false;
+}
+
  /*
   * This routine is a Walker callback for "expanding" a SELECT statement.
   * "Expanding" means to do the following:
@@ -4941,19 +4960,27 @@ selectExpander(Walker * pWalker, Select * p)
       * all tables.
       *
       * The first loop just checks to see if there are any "*" operators
-     * that need expanding.
+     * that need expanding and name items of the expression
+     * list if needed.
       */
+    i = pEList->nExpr;
      for (k = 0; k < pEList->nExpr; k++) {
          pE = pEList->a[k].pExpr;
-        if (pE->op == TK_ASTERISK)
-            break;
+        if (pE->op == TK_ASTERISK && i == pEList->nExpr)
+            i = k;
          assert(pE->op != TK_DOT || pE->pRight != 0);
          assert(pE->op != TK_DOT
                 || (pE->pLeft != 0 && pE->pLeft->op == TK_ID));
-        if (pE->op == TK_DOT && pE->pRight->op == TK_ASTERISK)
-            break;
+        if (pE->op == TK_DOT && pE->pRight->op == TK_ASTERISK  &&
+            i == pEList->nExpr)
+            i = k;
+        if (pEList->a[k].zName == NULL && is_needed_to_name(pE)) {
+            uint32_t idx = ++pParse->autoname_i;
+            pEList->a[k].zName =
+                sqlDbStrDup(db, sql_generate_column_name(idx));
+        }
      }
-    if (k < pEList->nExpr) {
+    if (i < pEList->nExpr) {
          /*
           * If we get here it means the result set contains one or more "*"
           * operators that need to be expanded.  Loop through each 
expression
diff --git a/src/box/sql/sqlInt.h b/src/box/sql/sqlInt.h
index 37283e5..adf90d8 100644
--- a/src/box/sql/sqlInt.h
+++ b/src/box/sql/sqlInt.h
@@ -2227,6 +2227,8 @@ struct Parse {
      TriggerPrg *pTriggerPrg;    /* Linked list of coded triggers */
      With *pWith;        /* Current WITH clause, or NULL */
      With *pWithToFree;    /* Free this WITH object at the end of the 
parse */
+    /** Index of previous auto generated name. */
+    uint32_t autoname_i;
      /** Space triggers are being coded for. */
      struct space *triggered_space;
      /**
@@ -4530,4 +4532,17 @@ void
  sql_setting_set(struct Parse *parse_context, struct Token *name,
          struct Expr *value);

+/**
+ * Return a string of the form "COLUMN_N", where N is @a number.
+ *
+ * We decided to name every auto generated column in output by
+ * this pattern (like PostgreSQL), because it is more convenient
+ * than "_auto_name_" and naming with span like MariaDB do.
+ */
+static inline const char *
+sql_generate_column_name(uint32_t number)
+{
+    return tt_sprintf("COLUMN_%d", number);
+}
+
  #endif                /* sqlINT_H */
diff --git a/test/box/function1.result b/test/box/function1.result
index 905a4cd..928cd57 100644
--- a/test/box/function1.result
+++ b/test/box/function1.result
@@ -449,7 +449,7 @@ box.execute('SELECT "function1.divide"(6, 3, 3)')
  box.execute('SELECT "function1.divide"(6, 3)')
  ---
  - metadata:
-  - name: '"function1.divide"(6, 3)'
+  - name: COLUMN_1
      type: number
    rows:
    - [2]
@@ -457,7 +457,7 @@ box.execute('SELECT "function1.divide"(6, 3)')
  box.execute('SELECT "function1.divide"(5, 2)')
  ---
  - metadata:
-  - name: '"function1.divide"(5, 2)'
+  - name: COLUMN_1
      type: number
    rows:
    - [2.5]
@@ -482,7 +482,7 @@ test_run:cmd("setopt delimiter ''");
  box.execute('SELECT summarize(1, 2)')
  ---
  - metadata:
-  - name: summarize(1, 2)
+  - name: COLUMN_1
      type: number
    rows:
    - [3]
@@ -505,7 +505,7 @@ test_run:cmd("setopt delimiter ''");
  box.execute('SELECT summarize(1, 2)')
  ---
  - metadata:
-  - name: summarize(1, 2)
+  - name: COLUMN_1
      type: number
    rows:
    - [3]
@@ -519,7 +519,7 @@ box.func.SUMMARIZE:drop()
  box.execute('SELECT lua(\'return 1 + 1\')')
  ---
  - metadata:
-  - name: lua('return 1 + 1')
+  - name: COLUMN_1
      type: any
    rows:
    - [2]
@@ -537,7 +537,7 @@ box.execute('SELECT lua(\'return box.cfg()\')')
  box.execute('SELECT lua(\'return box.cfg.memtx_memory\')')
  ---
  - metadata:
-  - name: lua('return box.cfg.memtx_memory')
+  - name: COLUMN_1
      type: any
    rows:
    - [107374182]
diff --git a/test/sql-tap/colname.test.lua b/test/sql-tap/colname.test.lua
index caa61a0..a9b0c92 100755
--- a/test/sql-tap/colname.test.lua
+++ b/test/sql-tap/colname.test.lua
@@ -1,6 +1,6 @@
  #!/usr/bin/env tarantool
  test = require("sqltester")
-test:plan(62)
+test:plan(75)

  --!./tcltestrunner.lua
  -- 2008 July 15
@@ -94,7 +94,7 @@ test:do_execsql2_test(
          SELECT +tabc.a, -tabc.b, tabc.c, * FROM tabc
      ]], {
          -- <colname-2.3>
-        "+tabc.a",1,"-tabc.b",-2,"C",3,"A",1,"B",2,"C",3
+        "COLUMN_1",1,"COLUMN_2",-2,"C",3,"A",1,"B",2,"C",3
          -- </colname-2.3>
      })

@@ -194,7 +194,7 @@ test:do_execsql2_test(
          SELECT +tabc.a, -tabc.b, tabc.c FROM tabc
      ]], {
          -- <colname-3.3>
-        "+tabc.a", 1, "-tabc.b", -2, "C", 3
+        "COLUMN_1",1,"COLUMN_2",-2,"C",3
          -- </colname-3.3>
      })

@@ -314,7 +314,7 @@ test:do_execsql2_test(
          SELECT +tabc.a, -tabc.b, tabc.c FROM tabc
      ]], {
          -- <colname-4.3>
-        "+tabc.a", 1, "-tabc.b", -2, "TABC.C", 3
+        "COLUMN_1",1,"COLUMN_2",-2,"TABC.C",3
          -- </colname-4.3>
      })

@@ -635,4 +635,118 @@ test:do_catchsql_test(
      [[ CREATE INDEX t1c ON table1('c'); ]],
      {1, "/Tarantool does not support functional indexes/"})

+--
+-- gh-3962: Check auto generated names in different selects.
+--
+test:do_execsql2_test(
+    "colname-12.1",
+    [[
+        VALUES(1, 2, 'aaa');
+    ]], {
+        "COLUMN_1",1,"COLUMN_2",2,"COLUMN_3","aaa"
+    })
+
+test:do_execsql2_test(
+    "colname-12.2",
+    [[
+        SELECT * FROM (VALUES (1+1, 1+1, 'aaa'));
+    ]], {
+        "COLUMN_1",2,"COLUMN_2",2,"COLUMN_3","aaa"
+    })
+
+test:do_execsql2_test(
+    "colname-12.3",
+    [[
+        SELECT 1+1, 1+1, 'aaa';
+    ]], {
+        "COLUMN_1",2,"COLUMN_2",2,"COLUMN_3","aaa"
+    })
+
+test:do_execsql2_test(
+    "colname-12.4",
+    [[
+        SELECT * FROM (SELECT * FROM (VALUES(1, 2, 'aaa'))),
+                      (SELECT * FROM (VALUES(1, 2, 'aaa')))
+    ]], {
+ "COLUMN_1",1,"COLUMN_2",2,"COLUMN_3","aaa","COLUMN_4",1,"COLUMN_5",2,
+        "COLUMN_6","aaa"
+    })
+
+test:do_execsql2_test(
+    "colname-12.5",
+    [[
+        CREATE TABLE j (s1 SCALAR PRIMARY KEY);
+        INSERT INTO j VALUES(1);
+    ]], {})
+
+--
+-- Column named as 'COLUMN_1', because of <COLLATE>.
+--
+test:do_execsql2_test(
+    "colname-12.6",
+    [[
+        SELECT s1 COLLATE "unicode_ci" FROM j;
+    ]], {
+        "COLUMN_1",1
+    })
+
+test:do_execsql2_test(
+    "colname-12.7",
+    [[
+        SELECT s1 COLLATE "unicode_ci" FROM j ORDER BY column_1;
+    ]], {
+        "COLUMN_1",1
+    })
+
+test:do_execsql2_test(
+    "colname-12.8",
+    [[
+        SELECT * FROM (SELECT s1 COLLATE "unicode_ci" FROM j
+                       ORDER BY column_1) ORDER BY column_1;
+    ]], {
+        "COLUMN_1",1
+    })
+
+test:do_execsql2_test(
+    "colname-12.9",
+    [[
+        SELECT s1 COLLATE "unicode_ci" FROM j GROUP BY column_1;
+    ]], {
+        "COLUMN_1",1
+    })
+
+test:do_execsql2_test(
+    "colname-12.10",
+    [[
+        SELECT * FROM (SELECT s1 COLLATE "unicode_ci" FROM j
+                       ORDER BY column_1) GROUP BY column_1;
+    ]], {
+        "COLUMN_1",1
+    })
+
+test:do_execsql2_test(
+    "colname-12.11",
+    [[
+        SELECT * FROM (SELECT s1 COLLATE "unicode_ci" FROM j
+                       ORDER BY column_1) WHERE column_1 = 1;
+    ]], {
+        "COLUMN_1",1
+    })
+
+test:do_execsql2_test(
+    "colname-12.12",
+    [[
+        SELECT *, s1 COLLATE "unicode_ci" FROM j ORDER BY column_1;
+    ]], {
+        "S1",1,"COLUMN_1",1
+    })
+
+test:do_execsql2_test(
+    "colname-12.13",
+    [[
+        SELECT s1 COLLATE "unicode_ci", * FROM j ORDER BY column_1;
+    ]], {
+        "COLUMN_1",1,"S1",1
+    })
+
  test:finish_test()
diff --git a/test/sql-tap/select1.test.lua b/test/sql-tap/select1.test.lua
index fbebfab..80e94b0 100755
--- a/test/sql-tap/select1.test.lua
+++ b/test/sql-tap/select1.test.lua
@@ -1032,7 +1032,7 @@ test:do_catchsql2_test(
          SELECT f1+F2 FROM test1 ORDER BY f2
      ]], {
          -- <select1-6.4a>
-        0, {"f1+F2", 33, "f1+F2", 77}
+        0, {"COLUMN_1",33,"COLUMN_1",77}
          -- </select1-6.4a>
      })

@@ -1042,7 +1042,7 @@ test:do_catchsql2_test(
          SELECT test1.f1+F2 FROM test1 ORDER BY f2
      ]], {
          -- <select1-6.5>
-        0, {"test1.f1+F2", 33, "test1.f1+F2", 77}
+        0, {"COLUMN_1",33,"COLUMN_1",77}
          -- </select1-6.5>
      })

@@ -1059,7 +1059,7 @@ test:do_test(
          return table.insert(v,msg) or v
      end, {
          -- <select1-6.5.1>
-        0, {'test1.f1+F2', 33, 'test1.f1+F2', 77}
+        0, {"COLUMN_1",33,"COLUMN_1",77}
          -- </select1-6.5.1>
      })

@@ -1068,7 +1068,7 @@ test:do_catchsql2_test(
      [[SELECT test1.f1+F2, t1 FROM test1, test2
           ORDER BY f2]], {
          -- <select1-6.6>
-        0, {"test1.f1+F2", 33, "T1", "abc", "test1.f1+F2", 77, "T1", "abc"}
+        0, {"COLUMN_1",33,"T1","abc","COLUMN_1",77,"T1","abc"}
          -- </select1-6.6>
      })

@@ -1161,7 +1161,7 @@ test:do_test(
          ]]
      end, {
          -- <select1-6.9.5>
-        "123.45", 123.45
+        "COLUMN_1",123.45
          -- </select1-6.9.5>
      })

@@ -1189,7 +1189,8 @@ test:do_test(
          return x
      end, {
          -- <select1-6.9.7>
-        "A.F1", 11, "A.F2", 22, "sql_subquery.5", 5, "sql_subquery.6", 6
+        "A.F1", 11, "A.F2", 22, "sql_subquery.COLUMN_1", 5,
+        "sql_subquery.COLUMN_2", 6
          -- </select1-6.9.7>
      })

@@ -1816,7 +1817,7 @@ test:do_execsql2_test(
              SELECT * FROM t3, (SELECT max(a), max(b) FROM t4) as "tx"
          ]], {
              -- <select1-11.14>
-            "ID", 0, "A", "1", "B", "2", "max(a)", 3, "max(b)", "4"
+            "ID", 0, "A", "1", "B", "2", "COLUMN_1", 3, "COLUMN_2", "4"
              -- </select1-11.14>
          })

@@ -1826,7 +1827,7 @@ test:do_execsql2_test(
              SELECT y.*, t3.* FROM t3, (SELECT max(a), max(b) FROM t4) AS y
          ]], {
              -- <select1-11.15>
-            "max(a)", 3, "max(b)", "4", "ID", 0, "A", "1", "B", "2"
+            "COLUMN_1", 3, "COLUMN_2", "4", "ID", 0, "A", "1", "B", "2"
              -- </select1-11.15>
          })

@@ -1850,7 +1851,7 @@ test:do_execsql2_test(
          SELECT 1+2+3
      ]], {
          -- <select1-12.1>
-        "1+2+3", 6
+        "COLUMN_1",6
          -- </select1-12.1>
      })

@@ -1860,7 +1861,7 @@ test:do_execsql2_test(
          SELECT 1,'hello',2
      ]], {
          -- <select1-12.2>
-        '1', 1, "'hello'", "hello", '2', 2
+        "COLUMN_1",1,"COLUMN_2","hello","COLUMN_3",2
          -- </select1-12.2>
      })

diff --git a/test/sql-tap/select6.test.lua b/test/sql-tap/select6.test.lua
index c9960dc..380fd67 100755
--- a/test/sql-tap/select6.test.lua
+++ b/test/sql-tap/select6.test.lua
@@ -128,9 +128,9 @@ test:do_execsql_test(
  test:do_execsql_test(
      "select6-1.7",
      [=[
-        SELECT a.y, a."count(*)", "max(x)", "count(*)"
-        FROM (SELECT count(*),y FROM t1 GROUP BY y) AS a,
-             (SELECT max(x),y FROM t1 GROUP BY y) as b
+        SELECT a.y, a.COLUMN_1, COLUMN_2, COLUMN_1
+        FROM (SELECT count(*), y FROM t1 GROUP BY y) AS a,
+             (SELECT max(x), y FROM t1 GROUP BY y) as b
          WHERE a.y=b.y ORDER BY a.y
      ]=], {
          -- <select6-1.7>
@@ -154,9 +154,9 @@ test:do_execsql_test(
  test:do_execsql_test(
      "select6-1.9",
      [=[
-        SELECT q, p, r, b."min(x)+y"
+        SELECT q, p, r, min
          FROM (SELECT count(*) as p , y as q FROM t1 GROUP BY y) AS a,
-             (SELECT max(x) as r, y as s, min(x)+y FROM t1 GROUP BY y) as b
+             (SELECT max(x) as r, y as s, min(x)+y AS min FROM t1 GROUP 
BY y) as b
          WHERE q=s ORDER BY s
      ]=], {
          -- <select6-1.9>
@@ -247,9 +247,9 @@ test:do_execsql_test(
  test:do_execsql_test(
      "select6-2.7",
      [=[
-        SELECT a.b, a."count(*)", "max(a)", "count(*)"
-        FROM (SELECT count(*),b FROM t2 GROUP BY b) AS a,
-             (SELECT max(a),b FROM t2 GROUP BY b) as b
+        SELECT a.b, a.count, max, count
+        FROM (SELECT count(*) AS count, b FROM t2 GROUP BY b) AS a,
+             (SELECT max(a) AS max, b FROM t2 GROUP BY b) as b
          WHERE a.b=b.b ORDER BY a.b
      ]=], {
          -- <select6-2.7>
@@ -432,8 +432,8 @@ test:do_execsql_test(
  test:do_execsql_test(
      "select6-3.14",
      [=[
-        SELECT "count(*)",y FROM (SELECT count(*), y FROM t1 GROUP BY y)
-        ORDER BY "count(*)"
+        SELECT count, y FROM (SELECT count(*) AS count, y FROM t1 GROUP 
BY y)
+        ORDER BY count
      ]=], {
          -- <select6-3.14>
          1, 1, 2, 2, 4, 3, 5, 5, 8, 4
@@ -443,7 +443,7 @@ test:do_execsql_test(
  test:do_execsql_test(
      "select6-3.15",
      [=[
-        SELECT "count(*)",y FROM (SELECT count(*), y FROM t1 GROUP BY y)
+        SELECT count, y FROM (SELECT count(*) AS count, y FROM t1 GROUP 
BY y)
          ORDER BY y
      ]=], {
          -- <select6-3.15>
diff --git a/test/sql-tap/view.test.lua b/test/sql-tap/view.test.lua
index e553b91..66374e3 100755
--- a/test/sql-tap/view.test.lua
+++ b/test/sql-tap/view.test.lua
@@ -265,7 +265,7 @@ test:do_execsql2_test(
          SELECT * FROM v1 LIMIT 1
      ]], {
          -- <view-3.3.1>
-        "XYZ", 2, "PQR", 7, "c-b", 1
+        "XYZ", 2, "PQR", 7, "COLUMN_1", 1
          -- </view-3.3.1>
      })

@@ -276,7 +276,7 @@ test:do_execsql2_test(
          SELECT * FROM v1b LIMIT 1
      ]], {
          -- <view-3.3.2>
-        "A", 2, "b+c", 7, "C", 4
+        "A", 2, "COLUMN_1", 7, "C", 4
          -- </view-3.3.2>
      })

diff --git a/test/sql/bind.result b/test/sql/bind.result
index b240940..cb03028 100644
--- a/test/sql/bind.result
+++ b/test/sql/bind.result
@@ -77,11 +77,11 @@ execute('SELECT * FROM test WHERE id = :value', 
parameters)
  execute('SELECT ?, ?, ?', {1, 2, 3})
  ---
  - metadata:
-  - name: '?'
+  - name: COLUMN_1
      type: integer
-  - name: '?'
+  - name: COLUMN_2
      type: integer
-  - name: '?'
+  - name: COLUMN_3
      type: integer
    rows:
    - [1, 2, 3]
@@ -107,11 +107,11 @@ parameters[3][':value1'] = 11
  execute('SELECT ?, :value1, @value2', parameters)
  ---
  - metadata:
-  - name: '?'
+  - name: COLUMN_1
      type: integer
-  - name: :value1
+  - name: COLUMN_2
      type: integer
-  - name: '@value2'
+  - name: COLUMN_3
      type: integer
    rows:
    - [10, 11, 12]
@@ -149,22 +149,22 @@ parameters[6]['@value2'] = 6
  execute('SELECT :value3, ?, :value1, ?, ?, @value2, ?, :value3', 
parameters)
  ---
  - metadata:
-  - name: :value3
+  - name: COLUMN_1
      type: integer
-  - name: '?'
+  - name: COLUMN_2
      type: integer
-  - name: :value1
+  - name: COLUMN_3
      type: integer
-  - name: '?'
+  - name: COLUMN_4
      type: integer
-  - name: '?'
+  - name: COLUMN_5
      type: integer
-  - name: '@value2'
+  - name: COLUMN_6
      type: integer
-  - name: '?'
+  - name: COLUMN_7
+    type: boolean
+  - name: COLUMN_8
      type: boolean
-  - name: :value3
-    type: integer
    rows:
    - [1, 2, 3, 4, 5, 6, null, 1]
  ...
@@ -175,15 +175,15 @@ msgpack = require('msgpack')
  execute('SELECT ?, ?, ?, ?, ?', {'abc', -123.456, msgpack.NULL, true, 
false})
  ---
  - metadata:
-  - name: '?'
+  - name: COLUMN_1
      type: text
-  - name: '?'
+  - name: COLUMN_2
      type: numeric
-  - name: '?'
+  - name: COLUMN_3
      type: boolean
-  - name: '?'
+  - name: COLUMN_4
      type: boolean
-  - name: '?'
+  - name: COLUMN_5
      type: boolean
    rows:
    - ['abc', -123.456, null, true, false]
@@ -290,7 +290,7 @@ execute('SELECT :value', parameters)
  execute('SELECT ? ', {18446744073709551615ULL})
  ---
  - metadata:
-  - name: '?'
+  - name: COLUMN_1
      type: integer
    rows:
    - [18446744073709551615]
diff --git a/test/sql/boolean.result b/test/sql/boolean.result
index 112e41a..51ec582 100644
--- a/test/sql/boolean.result
+++ b/test/sql/boolean.result
@@ -241,7 +241,7 @@ i > 0
  SELECT return_type(a) FROM t;
   | ---
   | - metadata:
- |   - name: return_type(a)
+ |   - name: COLUMN_1
   |     type: string
   |   rows:
   |   - ['boolean']
@@ -250,7 +250,7 @@ SELECT return_type(a) FROM t;
  SELECT return_type('false');
   | ---
   | - metadata:
- |   - name: return_type('false')
+ |   - name: COLUMN_1
   |     type: string
   |   rows:
   |   - ['string']
@@ -258,7 +258,7 @@ SELECT return_type('false');
  SELECT is_boolean(a) FROM t LIMIT 1;
   | ---
   | - metadata:
- |   - name: is_boolean(a)
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [true]
@@ -266,7 +266,7 @@ SELECT is_boolean(a) FROM t LIMIT 1;
  SELECT is_boolean('true');
   | ---
   | - metadata:
- |   - name: is_boolean('true')
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -281,7 +281,7 @@ SELECT abs(a) FROM t0;
  SELECT lower(a) FROM t0;
   | ---
   | - metadata:
- |   - name: lower(a)
+ |   - name: COLUMN_1
   |     type: string
   |   rows:
   |   - ['false']
@@ -292,7 +292,7 @@ SELECT lower(a) FROM t0;
  SELECT upper(a) FROM t0;
   | ---
   | - metadata:
- |   - name: upper(a)
+ |   - name: COLUMN_1
   |     type: string
   |   rows:
   |   - ['FALSE']
@@ -303,7 +303,7 @@ SELECT upper(a) FROM t0;
  SELECT quote(a) FROM t0;
   | ---
   | - metadata:
- |   - name: quote(a)
+ |   - name: COLUMN_1
   |     type: string
   |   rows:
   |   - ['FALSE']
@@ -315,7 +315,7 @@ SELECT quote(a) FROM t0;
  SELECT length(a) FROM t0;
   | ---
   | - metadata:
- |   - name: length(a)
+ |   - name: COLUMN_1
   |     type: integer
   |   rows:
   |   - [5]
@@ -326,7 +326,7 @@ SELECT length(a) FROM t0;
  SELECT typeof(a) FROM t0;
   | ---
   | - metadata:
- |   - name: typeof(a)
+ |   - name: COLUMN_1
   |     type: string
   |   rows:
   |   - ['boolean']
@@ -344,7 +344,7 @@ SELECT AVG(a) FROM t0;
  SELECT MIN(a) FROM t0;
   | ---
   | - metadata:
- |   - name: MIN(a)
+ |   - name: COLUMN_1
   |     type: scalar
   |   rows:
   |   - [false]
@@ -352,7 +352,7 @@ SELECT MIN(a) FROM t0;
  SELECT MAX(a) FROM t0;
   | ---
   | - metadata:
- |   - name: MAX(a)
+ |   - name: COLUMN_1
   |     type: scalar
   |   rows:
   |   - [true]
@@ -365,7 +365,7 @@ SELECT SUM(a) FROM t0;
  SELECT COUNT(a) FROM t0;
   | ---
   | - metadata:
- |   - name: COUNT(a)
+ |   - name: COLUMN_1
   |     type: integer
   |   rows:
   |   - [2]
@@ -378,7 +378,7 @@ SELECT TOTAL(a) FROM t0;
  SELECT GROUP_CONCAT(a, ' +++ ') FROM t0;
   | ---
   | - metadata:
- |   - name: GROUP_CONCAT(a, ' +++ ')
+ |   - name: COLUMN_1
   |     type: string
   |   rows:
   |   - ['FALSE +++ TRUE']
@@ -392,13 +392,13 @@ SELECT GROUP_CONCAT(a, ' +++ ') FROM t0;
  box.execute('SELECT ?, ?, return_type($1), typeof($2);', {true, false})
   | ---
   | - metadata:
- |   - name: '?'
+ |   - name: COLUMN_1
   |     type: boolean
- |   - name: '?'
+ |   - name: COLUMN_2
   |     type: boolean
- |   - name: return_type($1)
+ |   - name: COLUMN_3
   |     type: string
- |   - name: typeof($2)
+ |   - name: COLUMN_4
   |     type: string
   |   rows:
   |   - [true, false, 'boolean', 'boolean']
@@ -422,9 +422,9 @@ parameters[2][':value1'] = false
  box.execute('SELECT :value1, @value2;', parameters)
   | ---
   | - metadata:
- |   - name: :value1
+ |   - name: COLUMN_1
   |     type: boolean
- |   - name: '@value2'
+ |   - name: COLUMN_2
   |     type: boolean
   |   rows:
   |   - [false, true]
@@ -501,9 +501,9 @@ INSERT INTO t3 VALUES (4, false)
  SELECT cast(true AS INTEGER), cast(false AS INTEGER);
   | ---
   | - metadata:
- |   - name: cast(true AS INTEGER)
+ |   - name: COLUMN_1
   |     type: integer
- |   - name: cast(false AS INTEGER)
+ |   - name: COLUMN_2
   |     type: integer
   |   rows:
   |   - [1, 0]
@@ -511,9 +511,9 @@ SELECT cast(true AS INTEGER), cast(false AS INTEGER);
  SELECT cast(true AS NUMBER), cast(false AS NUMBER);
   | ---
   | - metadata:
- |   - name: cast(true AS NUMBER)
+ |   - name: COLUMN_1
   |     type: number
- |   - name: cast(false AS NUMBER)
+ |   - name: COLUMN_2
   |     type: number
   |   rows:
   |   - [1, 0]
@@ -522,9 +522,9 @@ SELECT cast(true AS NUMBER), cast(false AS NUMBER);
  SELECT cast(true AS TEXT), cast(false AS TEXT);
   | ---
   | - metadata:
- |   - name: cast(true AS TEXT)
+ |   - name: COLUMN_1
   |     type: string
- |   - name: cast(false AS TEXT)
+ |   - name: COLUMN_2
   |     type: string
   |   rows:
   |   - ['TRUE', 'FALSE']
@@ -532,9 +532,9 @@ SELECT cast(true AS TEXT), cast(false AS TEXT);
  SELECT cast(true AS BOOLEAN), cast(false AS BOOLEAN);
   | ---
   | - metadata:
- |   - name: cast(true AS BOOLEAN)
+ |   - name: COLUMN_1
   |     type: boolean
- |   - name: cast(false AS BOOLEAN)
+ |   - name: COLUMN_2
   |     type: boolean
   |   rows:
   |   - [true, false]
@@ -544,11 +544,11 @@ SELECT cast(true AS BOOLEAN), cast(false AS BOOLEAN);
  SELECT cast(100 AS BOOLEAN), cast(1 AS BOOLEAN), cast(0 AS BOOLEAN);
   | ---
   | - metadata:
- |   - name: cast(100 AS BOOLEAN)
+ |   - name: COLUMN_1
   |     type: boolean
- |   - name: cast(1 AS BOOLEAN)
+ |   - name: COLUMN_2
   |     type: boolean
- |   - name: cast(0 AS BOOLEAN)
+ |   - name: COLUMN_3
   |     type: boolean
   |   rows:
   |   - [true, true, false]
@@ -556,9 +556,9 @@ SELECT cast(100 AS BOOLEAN), cast(1 AS BOOLEAN), 
cast(0 AS BOOLEAN);
  SELECT cast(0.123 AS BOOLEAN), cast(0.0 AS BOOLEAN);
   | ---
   | - metadata:
- |   - name: cast(0.123 AS BOOLEAN)
+ |   - name: COLUMN_1
   |     type: boolean
- |   - name: cast(0.0 AS BOOLEAN)
+ |   - name: COLUMN_2
   |     type: boolean
   |   rows:
   |   - [true, false]
@@ -566,9 +566,9 @@ SELECT cast(0.123 AS BOOLEAN), cast(0.0 AS BOOLEAN);
  SELECT cast('true' AS BOOLEAN), cast('false' AS BOOLEAN);
   | ---
   | - metadata:
- |   - name: cast('true' AS BOOLEAN)
+ |   - name: COLUMN_1
   |     type: boolean
- |   - name: cast('false' AS BOOLEAN)
+ |   - name: COLUMN_2
   |     type: boolean
   |   rows:
   |   - [true, false]
@@ -576,9 +576,9 @@ SELECT cast('true' AS BOOLEAN), cast('false' AS 
BOOLEAN);
  SELECT cast('TRUE' AS BOOLEAN), cast('FALSE' AS BOOLEAN);
   | ---
   | - metadata:
- |   - name: cast('TRUE' AS BOOLEAN)
+ |   - name: COLUMN_1
   |     type: boolean
- |   - name: cast('FALSE' AS BOOLEAN)
+ |   - name: COLUMN_2
   |     type: boolean
   |   rows:
   |   - [true, false]
@@ -887,7 +887,7 @@ SELECT a, COUNT(*) FROM (SELECT * FROM t4 UNION 
SELECT * FROM t5) GROUP BY a;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: COUNT(*)
+ |   - name: COLUMN_1
   |     type: integer
   |   rows:
   |   - [false, 3]
@@ -907,7 +907,7 @@ INSERT INTO t6 VALUES (true, false), (false, true);
  SELECT NOT true;
   | ---
   | - metadata:
- |   - name: NOT true
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -915,7 +915,7 @@ SELECT NOT true;
  SELECT NOT false;
   | ---
   | - metadata:
- |   - name: NOT false
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [true]
@@ -925,7 +925,7 @@ SELECT a, NOT a FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: NOT a
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, true]
@@ -935,7 +935,7 @@ SELECT a, NOT a FROM t;
  SELECT true AND true;
   | ---
   | - metadata:
- |   - name: true AND true
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [true]
@@ -943,7 +943,7 @@ SELECT true AND true;
  SELECT true AND false;
   | ---
   | - metadata:
- |   - name: true AND false
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -951,7 +951,7 @@ SELECT true AND false;
  SELECT false AND true;
   | ---
   | - metadata:
- |   - name: false AND true
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -959,7 +959,7 @@ SELECT false AND true;
  SELECT false AND false;
   | ---
   | - metadata:
- |   - name: false AND false
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -967,7 +967,7 @@ SELECT false AND false;
  SELECT true OR true;
   | ---
   | - metadata:
- |   - name: true OR true
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [true]
@@ -975,7 +975,7 @@ SELECT true OR true;
  SELECT true OR false;
   | ---
   | - metadata:
- |   - name: true OR false
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [true]
@@ -983,7 +983,7 @@ SELECT true OR false;
  SELECT false OR true;
   | ---
   | - metadata:
- |   - name: false OR true
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [true]
@@ -991,7 +991,7 @@ SELECT false OR true;
  SELECT false OR false;
   | ---
   | - metadata:
- |   - name: false OR false
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -1002,7 +1002,7 @@ SELECT a, true AND a FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: true AND a
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, false]
@@ -1013,7 +1013,7 @@ SELECT a, false AND a FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: false AND a
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, false]
@@ -1024,7 +1024,7 @@ SELECT a, true OR a FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: true OR a
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, true]
@@ -1035,7 +1035,7 @@ SELECT a, false OR a FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: false OR a
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, false]
@@ -1046,7 +1046,7 @@ SELECT a, a AND true FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: a AND true
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, false]
@@ -1057,7 +1057,7 @@ SELECT a, a AND false FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: a AND false
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, false]
@@ -1068,7 +1068,7 @@ SELECT a, a OR true FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: a OR true
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, true]
@@ -1079,7 +1079,7 @@ SELECT a, a OR false FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: a OR false
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, false]
@@ -1093,7 +1093,7 @@ SELECT a, a1, a AND a1 FROM t, t6;
   |     type: boolean
   |   - name: A1
   |     type: boolean
- |   - name: a AND a1
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, false, false]
@@ -1108,7 +1108,7 @@ SELECT a, a1, a OR a1 FROM t, t6;
   |     type: boolean
   |   - name: A1
   |     type: boolean
- |   - name: a OR a1
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, false, false]
@@ -1622,7 +1622,7 @@ SELECT a1, a2, a2 || a2 FROM t6;
  SELECT true > true;
   | ---
   | - metadata:
- |   - name: true > true
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -1630,7 +1630,7 @@ SELECT true > true;
  SELECT true > false;
   | ---
   | - metadata:
- |   - name: true > false
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [true]
@@ -1638,7 +1638,7 @@ SELECT true > false;
  SELECT false > true;
   | ---
   | - metadata:
- |   - name: false > true
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -1646,7 +1646,7 @@ SELECT false > true;
  SELECT false > false;
   | ---
   | - metadata:
- |   - name: false > false
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -1654,7 +1654,7 @@ SELECT false > false;
  SELECT true < true;
   | ---
   | - metadata:
- |   - name: true < true
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -1662,7 +1662,7 @@ SELECT true < true;
  SELECT true < false;
   | ---
   | - metadata:
- |   - name: true < false
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -1670,7 +1670,7 @@ SELECT true < false;
  SELECT false < true;
   | ---
   | - metadata:
- |   - name: false < true
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [true]
@@ -1678,7 +1678,7 @@ SELECT false < true;
  SELECT false < false;
   | ---
   | - metadata:
- |   - name: false < false
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -1689,7 +1689,7 @@ SELECT a, true > a FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: true > a
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, true]
@@ -1700,7 +1700,7 @@ SELECT a, false > a FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: false > a
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, false]
@@ -1711,7 +1711,7 @@ SELECT a, true < a FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: true < a
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, false]
@@ -1722,7 +1722,7 @@ SELECT a, false < a FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: false < a
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, false]
@@ -1733,7 +1733,7 @@ SELECT a, a > true FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: a > true
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, false]
@@ -1744,7 +1744,7 @@ SELECT a, a > false FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: a > false
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, false]
@@ -1755,7 +1755,7 @@ SELECT a, a < true FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: a < true
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, true]
@@ -1766,7 +1766,7 @@ SELECT a, a < false FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: a < false
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, false]
@@ -1780,7 +1780,7 @@ SELECT a, a1, a > a1 FROM t, t6;
   |     type: boolean
   |   - name: A1
   |     type: boolean
- |   - name: a > a1
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, false, false]
@@ -1795,7 +1795,7 @@ SELECT a, a1, a < a1 FROM t, t6;
   |     type: boolean
   |   - name: A1
   |     type: boolean
- |   - name: a < a1
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, false, false]
@@ -1807,7 +1807,7 @@ SELECT a, a1, a < a1 FROM t, t6;
  SELECT true >= true;
   | ---
   | - metadata:
- |   - name: true >= true
+ |   - name: COLUMN_1
   |     type: any
   |   rows:
   |   - [true]
@@ -1815,7 +1815,7 @@ SELECT true >= true;
  SELECT true >= false;
   | ---
   | - metadata:
- |   - name: true >= false
+ |   - name: COLUMN_1
   |     type: any
   |   rows:
   |   - [true]
@@ -1823,7 +1823,7 @@ SELECT true >= false;
  SELECT false >= true;
   | ---
   | - metadata:
- |   - name: false >= true
+ |   - name: COLUMN_1
   |     type: any
   |   rows:
   |   - [false]
@@ -1831,7 +1831,7 @@ SELECT false >= true;
  SELECT false >= false;
   | ---
   | - metadata:
- |   - name: false >= false
+ |   - name: COLUMN_1
   |     type: any
   |   rows:
   |   - [true]
@@ -1839,7 +1839,7 @@ SELECT false >= false;
  SELECT true <= true;
   | ---
   | - metadata:
- |   - name: true <= true
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [true]
@@ -1847,7 +1847,7 @@ SELECT true <= true;
  SELECT true <= false;
   | ---
   | - metadata:
- |   - name: true <= false
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -1855,7 +1855,7 @@ SELECT true <= false;
  SELECT false <= true;
   | ---
   | - metadata:
- |   - name: false <= true
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [true]
@@ -1863,7 +1863,7 @@ SELECT false <= true;
  SELECT false <= false;
   | ---
   | - metadata:
- |   - name: false <= false
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [true]
@@ -1874,7 +1874,7 @@ SELECT a, true >= a FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: true >= a
+ |   - name: COLUMN_1
   |     type: any
   |   rows:
   |   - [false, true]
@@ -1885,7 +1885,7 @@ SELECT a, false >= a FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: false >= a
+ |   - name: COLUMN_1
   |     type: any
   |   rows:
   |   - [false, true]
@@ -1896,7 +1896,7 @@ SELECT a, true <= a FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: true <= a
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, false]
@@ -1907,7 +1907,7 @@ SELECT a, false <= a FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: false <= a
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, true]
@@ -1918,7 +1918,7 @@ SELECT a, a >= true FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: a >= true
+ |   - name: COLUMN_1
   |     type: any
   |   rows:
   |   - [false, false]
@@ -1929,7 +1929,7 @@ SELECT a, a >= false FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: a >= false
+ |   - name: COLUMN_1
   |     type: any
   |   rows:
   |   - [false, true]
@@ -1940,7 +1940,7 @@ SELECT a, a <= true FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: a <= true
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, true]
@@ -1951,7 +1951,7 @@ SELECT a, a <= false FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: a <= false
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, true]
@@ -1965,7 +1965,7 @@ SELECT a, a1, a >= a1 FROM t, t6;
   |     type: boolean
   |   - name: A1
   |     type: boolean
- |   - name: a >= a1
+ |   - name: COLUMN_1
   |     type: any
   |   rows:
   |   - [false, false, true]
@@ -1980,7 +1980,7 @@ SELECT a, a1, a <= a1 FROM t, t6;
   |     type: boolean
   |   - name: A1
   |     type: boolean
- |   - name: a <= a1
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, false, true]
@@ -1992,7 +1992,7 @@ SELECT a, a1, a <= a1 FROM t, t6;
  SELECT true == true;
   | ---
   | - metadata:
- |   - name: true == true
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [true]
@@ -2000,7 +2000,7 @@ SELECT true == true;
  SELECT true == false;
   | ---
   | - metadata:
- |   - name: true == false
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -2008,7 +2008,7 @@ SELECT true == false;
  SELECT false == true;
   | ---
   | - metadata:
- |   - name: false == true
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -2016,7 +2016,7 @@ SELECT false == true;
  SELECT false == false;
   | ---
   | - metadata:
- |   - name: false == false
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [true]
@@ -2024,7 +2024,7 @@ SELECT false == false;
  SELECT true != true;
   | ---
   | - metadata:
- |   - name: true != true
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -2032,7 +2032,7 @@ SELECT true != true;
  SELECT true != false;
   | ---
   | - metadata:
- |   - name: true != false
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [true]
@@ -2040,7 +2040,7 @@ SELECT true != false;
  SELECT false != true;
   | ---
   | - metadata:
- |   - name: false != true
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [true]
@@ -2048,7 +2048,7 @@ SELECT false != true;
  SELECT false != false;
   | ---
   | - metadata:
- |   - name: false != false
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -2059,7 +2059,7 @@ SELECT a, true == a FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: true == a
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, false]
@@ -2070,7 +2070,7 @@ SELECT a, false == a FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: false == a
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, true]
@@ -2081,7 +2081,7 @@ SELECT a, true != a FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: true != a
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, true]
@@ -2092,7 +2092,7 @@ SELECT a, false != a FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: false != a
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, false]
@@ -2103,7 +2103,7 @@ SELECT a, a == true FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: a == true
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, false]
@@ -2114,7 +2114,7 @@ SELECT a, a == false FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: a == false
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, true]
@@ -2125,7 +2125,7 @@ SELECT a, a != true FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: a != true
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, true]
@@ -2136,7 +2136,7 @@ SELECT a, a != false FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: a != false
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, false]
@@ -2150,7 +2150,7 @@ SELECT a, a1, a == a1 FROM t, t6;
   |     type: boolean
   |   - name: A1
   |     type: boolean
- |   - name: a == a1
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, false, true]
@@ -2165,7 +2165,7 @@ SELECT a, a1, a != a1 FROM t, t6;
   |     type: boolean
   |   - name: A1
   |     type: boolean
- |   - name: a != a1
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, false, false]
@@ -2177,7 +2177,7 @@ SELECT a, a1, a != a1 FROM t, t6;
  SELECT true IN (true);
   | ---
   | - metadata:
- |   - name: true IN (true)
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [true]
@@ -2185,7 +2185,7 @@ SELECT true IN (true);
  SELECT false IN (true);
   | ---
   | - metadata:
- |   - name: false IN (true)
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -2193,7 +2193,7 @@ SELECT false IN (true);
  SELECT true IN (false);
   | ---
   | - metadata:
- |   - name: true IN (false)
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -2201,7 +2201,7 @@ SELECT true IN (false);
  SELECT false IN (false);
   | ---
   | - metadata:
- |   - name: false IN (false)
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [true]
@@ -2209,7 +2209,7 @@ SELECT false IN (false);
  SELECT true IN (true, false);
   | ---
   | - metadata:
- |   - name: true IN (true, false)
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [true]
@@ -2217,7 +2217,7 @@ SELECT true IN (true, false);
  SELECT false IN (true, false);
   | ---
   | - metadata:
- |   - name: false IN (true, false)
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [true]
@@ -2225,7 +2225,7 @@ SELECT false IN (true, false);
  SELECT true IN (SELECT a1 FROM t6);
   | ---
   | - metadata:
- |   - name: true IN (SELECT a1 FROM t6)
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [true]
@@ -2233,7 +2233,7 @@ SELECT true IN (SELECT a1 FROM t6);
  SELECT false IN (SELECT a1 FROM t6);
   | ---
   | - metadata:
- |   - name: false IN (SELECT a1 FROM t6)
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [true]
@@ -2241,7 +2241,7 @@ SELECT false IN (SELECT a1 FROM t6);
  SELECT true IN (SELECT a1 FROM t6 LIMIT 1);
   | ---
   | - metadata:
- |   - name: true IN (SELECT a1 FROM t6 LIMIT 1)
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -2249,7 +2249,7 @@ SELECT true IN (SELECT a1 FROM t6 LIMIT 1);
  SELECT false IN (SELECT a1 FROM t6 LIMIT 1);
   | ---
   | - metadata:
- |   - name: false IN (SELECT a1 FROM t6 LIMIT 1)
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [true]
@@ -2257,7 +2257,7 @@ SELECT false IN (SELECT a1 FROM t6 LIMIT 1);
  SELECT true IN (1, 1.2, 'true', false);
   | ---
   | - metadata:
- |   - name: true IN (1, 1.2, 'true', false)
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -2265,7 +2265,7 @@ SELECT true IN (1, 1.2, 'true', false);
  SELECT false IN (1, 1.2, 'true', false);
   | ---
   | - metadata:
- |   - name: false IN (1, 1.2, 'true', false)
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [true]
@@ -2276,7 +2276,7 @@ SELECT a, a IN (true) FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: a IN (true)
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, false]
@@ -2287,7 +2287,7 @@ SELECT a, a IN (false) FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: a IN (false)
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, true]
@@ -2298,7 +2298,7 @@ SELECT a, a IN (true, false) FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: a IN (true, false)
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, true]
@@ -2309,7 +2309,7 @@ SELECT a, a IN (SELECT a1 FROM t6 LIMIT 1) FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: a IN (SELECT a1 FROM t6 LIMIT 1)
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, true]
@@ -2320,7 +2320,7 @@ SELECT a, a IN (SELECT a1 FROM t6) FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: a IN (SELECT a1 FROM t6)
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, true]
@@ -2331,7 +2331,7 @@ SELECT a, a IN (1, 1.2, 'true', false) FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: a IN (1, 1.2, 'true', false)
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, true]
@@ -2341,7 +2341,7 @@ SELECT a, a IN (1, 1.2, 'true', false) FROM t;
  SELECT true BETWEEN true AND true;
   | ---
   | - metadata:
- |   - name: true BETWEEN true AND true
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [true]
@@ -2349,7 +2349,7 @@ SELECT true BETWEEN true AND true;
  SELECT false BETWEEN true AND true;
   | ---
   | - metadata:
- |   - name: false BETWEEN true AND true
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -2357,7 +2357,7 @@ SELECT false BETWEEN true AND true;
  SELECT true BETWEEN false AND false;
   | ---
   | - metadata:
- |   - name: true BETWEEN false AND false
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -2365,7 +2365,7 @@ SELECT true BETWEEN false AND false;
  SELECT false BETWEEN false AND false;
   | ---
   | - metadata:
- |   - name: false BETWEEN false AND false
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [true]
@@ -2373,7 +2373,7 @@ SELECT false BETWEEN false AND false;
  SELECT true BETWEEN true AND false;
   | ---
   | - metadata:
- |   - name: true BETWEEN true AND false
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -2381,7 +2381,7 @@ SELECT true BETWEEN true AND false;
  SELECT false BETWEEN true AND false;
   | ---
   | - metadata:
- |   - name: false BETWEEN true AND false
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -2389,7 +2389,7 @@ SELECT false BETWEEN true AND false;
  SELECT true BETWEEN false AND true;
   | ---
   | - metadata:
- |   - name: true BETWEEN false AND true
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [true]
@@ -2397,7 +2397,7 @@ SELECT true BETWEEN false AND true;
  SELECT false BETWEEN false AND true;
   | ---
   | - metadata:
- |   - name: false BETWEEN false AND true
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [true]
@@ -2408,7 +2408,7 @@ SELECT a, a BETWEEN true AND true FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: a BETWEEN true AND true
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, false]
@@ -2419,7 +2419,7 @@ SELECT a, a BETWEEN false AND false FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: a BETWEEN false AND false
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, true]
@@ -2430,7 +2430,7 @@ SELECT a, a BETWEEN true AND false FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: a BETWEEN true AND false
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, false]
@@ -2441,7 +2441,7 @@ SELECT a, a BETWEEN false AND true FROM t;
   | - metadata:
   |   - name: A
   |     type: boolean
- |   - name: a BETWEEN false AND true
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, true]
@@ -2466,7 +2466,7 @@ SELECT true AND 2;
  SELECT false AND 2;
   | ---
   | - metadata:
- |   - name: false AND 2
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -2489,7 +2489,7 @@ SELECT 2 AND true;
  SELECT 2 AND false;
   | ---
   | - metadata:
- |   - name: 2 AND false
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -2556,7 +2556,7 @@ SELECT b, false AND b FROM t7;
   | - metadata:
   |   - name: B
   |     type: integer
- |   - name: false AND b
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [123, false]
@@ -2581,7 +2581,7 @@ SELECT b, b AND false FROM t7;
   | - metadata:
   |   - name: B
   |     type: integer
- |   - name: b AND false
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [123, false]
@@ -3861,7 +3861,7 @@ SELECT a2, b, b != a2 FROM t6, t7;
  SELECT true IN (0, 1, 2, 3);
   | ---
   | - metadata:
- |   - name: true IN (0, 1, 2, 3)
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -3869,7 +3869,7 @@ SELECT true IN (0, 1, 2, 3);
  SELECT false IN (0, 1, 2, 3);
   | ---
   | - metadata:
- |   - name: false IN (0, 1, 2, 3)
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -3889,7 +3889,7 @@ SELECT a1, a1 IN (0, 1, 2, 3) FROM t6
   | - metadata:
   |   - name: A1
   |     type: boolean
- |   - name: a1 IN (0, 1, 2, 3)
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false, false]
@@ -3935,7 +3935,7 @@ SELECT true AND 2.3;
  SELECT false AND 2.3;
   | ---
   | - metadata:
- |   - name: false AND 2.3
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -3958,7 +3958,7 @@ SELECT 2.3 AND true;
  SELECT 2.3 AND false;
   | ---
   | - metadata:
- |   - name: 2.3 AND false
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -4025,7 +4025,7 @@ SELECT c, false AND c FROM t8;
   | - metadata:
   |   - name: C
   |     type: number
- |   - name: false AND c
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [4.56, false]
@@ -4050,7 +4050,7 @@ SELECT c, c AND false FROM t8;
   | - metadata:
   |   - name: C
   |     type: number
- |   - name: c AND false
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [4.56, false]
@@ -5006,7 +5006,7 @@ SELECT a2, c, c != a2 FROM t6, t8;
  SELECT true IN (0.1, 1.2, 2.3, 3.4);
   | ---
   | - metadata:
- |   - name: true IN (0.1, 1.2, 2.3, 3.4)
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -5014,7 +5014,7 @@ SELECT true IN (0.1, 1.2, 2.3, 3.4);
  SELECT false IN (0.1, 1.2, 2.3, 3.4);
   | ---
   | - metadata:
- |   - name: false IN (0.1, 1.2, 2.3, 3.4)
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -5022,7 +5022,7 @@ SELECT false IN (0.1, 1.2, 2.3, 3.4);
  SELECT a1 IN (0.1, 1.2, 2.3, 3.4) FROM t6 LIMIT 1;
   | ---
   | - metadata:
- |   - name: a1 IN (0.1, 1.2, 2.3, 3.4)
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -5030,7 +5030,7 @@ SELECT a1 IN (0.1, 1.2, 2.3, 3.4) FROM t6 LIMIT 1;
  SELECT a2 IN (0.1, 1.2, 2.3, 3.4) FROM t6 LIMIT 1;
   | ---
   | - metadata:
- |   - name: a2 IN (0.1, 1.2, 2.3, 3.4)
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -5095,7 +5095,7 @@ SELECT true AND 'abc';
  SELECT false AND 'abc';
   | ---
   | - metadata:
- |   - name: false AND 'abc'
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -5118,7 +5118,7 @@ SELECT 'abc' AND true;
  SELECT 'abc' AND false;
   | ---
   | - metadata:
- |   - name: '''abc'' AND false'
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -5185,7 +5185,7 @@ SELECT d, false AND d FROM t9;
   | - metadata:
   |   - name: D
   |     type: string
- |   - name: false AND d
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - ['AsdF', false]
@@ -5210,7 +5210,7 @@ SELECT d, d AND false FROM t9;
   | - metadata:
   |   - name: D
   |     type: string
- |   - name: d AND false
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - ['AsdF', false]
@@ -5470,7 +5470,7 @@ SELECT true AND 'TRUE';
  SELECT false AND 'TRUE';
   | ---
   | - metadata:
- |   - name: false AND 'TRUE'
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -5493,7 +5493,7 @@ SELECT 'TRUE' AND true;
  SELECT 'TRUE' AND false;
   | ---
   | - metadata:
- |   - name: '''TRUE'' AND false'
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -5560,7 +5560,7 @@ SELECT d, false AND d FROM t9 WHERE d = 'TRUE';
   | - metadata:
   |   - name: D
   |     type: string
- |   - name: false AND d
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - ['TRUE', false]
@@ -5585,7 +5585,7 @@ SELECT d, d AND false FROM t9 WHERE d = 'TRUE';
   | - metadata:
   |   - name: D
   |     type: string
- |   - name: d AND false
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - ['TRUE', false]
@@ -5650,7 +5650,7 @@ SELECT true AND 'true';
  SELECT false AND 'true';
   | ---
   | - metadata:
- |   - name: false AND 'true'
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -5673,7 +5673,7 @@ SELECT 'true' AND true;
  SELECT 'true' AND false;
   | ---
   | - metadata:
- |   - name: '''true'' AND false'
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -5740,7 +5740,7 @@ SELECT d, false AND d FROM t9 WHERE d = 'true';
   | - metadata:
   |   - name: D
   |     type: string
- |   - name: false AND d
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - ['true', false]
@@ -5765,7 +5765,7 @@ SELECT d, d AND false FROM t9 WHERE d = 'true';
   | - metadata:
   |   - name: D
   |     type: string
- |   - name: d AND false
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - ['true', false]
@@ -5830,7 +5830,7 @@ SELECT true AND 'FALSE';
  SELECT false AND 'FALSE';
   | ---
   | - metadata:
- |   - name: false AND 'FALSE'
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -5853,7 +5853,7 @@ SELECT 'FALSE' AND true;
  SELECT 'FALSE' AND false;
   | ---
   | - metadata:
- |   - name: '''FALSE'' AND false'
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -5920,7 +5920,7 @@ SELECT d, false AND d FROM t9 WHERE d = 'FALSE';
   | - metadata:
   |   - name: D
   |     type: string
- |   - name: false AND d
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - ['FALSE', false]
@@ -5945,7 +5945,7 @@ SELECT d, d AND false FROM t9 WHERE d = 'FALSE';
   | - metadata:
   |   - name: D
   |     type: string
- |   - name: d AND false
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - ['FALSE', false]
@@ -6010,7 +6010,7 @@ SELECT true AND 'false';
  SELECT false AND 'false';
   | ---
   | - metadata:
- |   - name: false AND 'false'
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -6033,7 +6033,7 @@ SELECT 'false' AND true;
  SELECT 'false' AND false;
   | ---
   | - metadata:
- |   - name: '''false'' AND false'
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - [false]
@@ -6100,7 +6100,7 @@ SELECT d, false AND d FROM t9 WHERE d = 'false';
   | - metadata:
   |   - name: D
   |     type: string
- |   - name: false AND d
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - ['false', false]
@@ -6125,7 +6125,7 @@ SELECT d, d AND false FROM t9 WHERE d = 'false';
   | - metadata:
   |   - name: D
   |     type: string
- |   - name: d AND false
+ |   - name: COLUMN_1
   |     type: boolean
   |   rows:
   |   - ['false', false]
diff --git a/test/sql/collation.result b/test/sql/collation.result
index 4e4c27e..bfc89e1 100644
--- a/test/sql/collation.result
+++ b/test/sql/collation.result
@@ -111,7 +111,7 @@ box.execute([[SELECT descriptor, upper(letter), 
letter FROM tu where UPPER(lette
  - metadata:
    - name: DESCRIPTOR
      type: string
-  - name: upper(letter)
+  - name: COLUMN_1
      type: string
    - name: LETTER
      type: string
@@ -124,7 +124,7 @@ box.execute([[SELECT descriptor, upper(letter 
COLLATE "GERMAN"), letter FROM tu
  - metadata:
    - name: DESCRIPTOR
      type: string
-  - name: upper(letter COLLATE "GERMAN")
+  - name: COLUMN_1
      type: string
    - name: LETTER
      type: string
@@ -335,14 +335,14 @@ box.execute("SELECT a FROM t UNION SELECT c FROM t;")
  box.execute("SELECT c COLLATE \"binary\" FROM t UNION SELECT a FROM t;")
  ---
  - metadata:
-  - name: c COLLATE "binary"
+  - name: COLUMN_1
      type: string
    rows: []
  ...
  box.execute("SELECT b COLLATE \"unicode\" FROM t UNION SELECT a FROM t;")
  ---
  - metadata:
-  - name: b COLLATE "unicode"
+  - name: COLUMN_1
      type: string
    rows: []
  ...
@@ -1128,7 +1128,7 @@ box.execute("INSERT INTO jj VALUES (1,'A'), (2,'a')")
  box.execute("SELECT DISTINCT trim(s2) FROM jj;")
  ---
  - metadata:
-  - name: trim(s2)
+  - name: COLUMN_1
      type: string
    rows:
    - ['A']
@@ -1140,7 +1140,7 @@ box.execute("INSERT INTO jj VALUES (3, 'aS'), (4, 
'AS');")
  box.execute("SELECT DISTINCT replace(s2, 'S', 's') FROM jj;")
  ---
  - metadata:
-  - name: replace(s2, 'S', 's')
+  - name: COLUMN_1
      type: string
    rows:
    - ['A']
@@ -1149,7 +1149,7 @@ box.execute("SELECT DISTINCT replace(s2, 'S', 's') 
FROM jj;")
  box.execute("SELECT DISTINCT substr(s2, 1, 1) FROM jj;")
  ---
  - metadata:
-  - name: substr(s2, 1, 1)
+  - name: COLUMN_1
      type: string
    rows:
    - ['A']
diff --git a/test/sql/errinj.result b/test/sql/errinj.result
index 68c001f..f19203b 100644
--- a/test/sql/errinj.result
+++ b/test/sql/errinj.result
@@ -120,7 +120,7 @@ insert_res
  select_res
  ---
  - metadata:
-  - name: '1'
+  - name: COLUMN_1
      type: integer
    rows:
    - [1]
diff --git a/test/sql/foreign-keys.result b/test/sql/foreign-keys.result
index f1d9734..33689a0 100644
--- a/test/sql/foreign-keys.result
+++ b/test/sql/foreign-keys.result
@@ -357,7 +357,7 @@ box.execute('ALTER TABLE tc ADD CONSTRAINT fk1 
FOREIGN KEY (id) REFERENCES tp(id
  box.execute('SELECT row_count();')
  ---
  - metadata:
-  - name: row_count()
+  - name: COLUMN_1
      type: integer
    rows:
    - [1]
@@ -374,7 +374,7 @@ box.execute('ALTER TABLE tc DROP CONSTRAINT fk1;')
  box.execute('SELECT row_count();')
  ---
  - metadata:
-  - name: row_count()
+  - name: COLUMN_1
      type: integer
    rows:
    - [1]
diff --git a/test/sql/full_metadata.result b/test/sql/full_metadata.result
index 5a93c41..25bac6d 100644
--- a/test/sql/full_metadata.result
+++ b/test/sql/full_metadata.result
@@ -57,7 +57,7 @@ execute("SELECT 'aSd' COLLATE \"unicode_ci\";")
   | - metadata:
   |   - type: string
   |     span: '''aSd'' COLLATE "unicode_ci"'
- |     name: '''aSd'' COLLATE "unicode_ci"'
+ |     name: COLUMN_1
   |     collation: unicode_ci
   |   rows:
   |   - ['aSd']
@@ -78,7 +78,7 @@ execute("SELECT c COLLATE \"unicode\" FROM t;")
   | - metadata:
   |   - type: string
   |     span: c COLLATE "unicode"
- |     name: c COLLATE "unicode"
+ |     name: COLUMN_1
   |     collation: unicode
   |   rows:
   |   - ['aSd']
@@ -165,7 +165,7 @@ execute("SELECT *, id + 1 AS x, a AS y, c || 'abc' 
FROM t;")
   |     is_nullable: false
   |   - type: string
   |     span: c || 'abc'
- |     name: c || 'abc'
+ |     name: COLUMN_1
   |   rows:
   |   - [1, 1, 'aSd', 2, 1, 'aSdabc']
   | ...
@@ -185,8 +185,8 @@ execute("SELECT * FROM v;")
   |     name: Y
   |     is_nullable: false
   |   - type: string
- |     span: c || 'abc'
- |     name: c || 'abc'
+ |     span: COLUMN_1
+ |     name: COLUMN_1
   |   rows:
   |   - [2, 1, 'aSdabc']
   | ...
diff --git a/test/sql/func-recreate.result b/test/sql/func-recreate.result
index 3709df7..5fd2b79 100644
--- a/test/sql/func-recreate.result
+++ b/test/sql/func-recreate.result
@@ -48,7 +48,7 @@ test_run:cmd("setopt delimiter ''");
  ch:get()
  ---
  - metadata:
-  - name: WAITFOR(0.2)
+  - name: COLUMN_1
      type: number
    rows:
    - [0.2]
diff --git a/test/sql/gh-3199-no-mem-leaks.result 
b/test/sql/gh-3199-no-mem-leaks.result
index d859077..6ce8df4 100644
--- a/test/sql/gh-3199-no-mem-leaks.result
+++ b/test/sql/gh-3199-no-mem-leaks.result
@@ -32,7 +32,7 @@ box.execute('SELECT x, y, x + y FROM test ORDER BY y')
      type: integer
    - name: Y
      type: integer
-  - name: x + y
+  - name: COLUMN_1
      type: integer
    rows:
    - [1, 1, 2]
@@ -49,7 +49,7 @@ box.execute('SELECT x, y, x + y FROM test ORDER BY y')
      type: integer
    - name: Y
      type: integer
-  - name: x + y
+  - name: COLUMN_1
      type: integer
    rows:
    - [1, 1, 2]
@@ -62,7 +62,7 @@ box.execute('SELECT x, y, x + y FROM test ORDER BY y')
      type: integer
    - name: Y
      type: integer
-  - name: x + y
+  - name: COLUMN_1
      type: integer
    rows:
    - [1, 1, 2]
@@ -75,7 +75,7 @@ box.execute('SELECT x, y, x + y FROM test ORDER BY y')
      type: integer
    - name: Y
      type: integer
-  - name: x + y
+  - name: COLUMN_1
      type: integer
    rows:
    - [1, 1, 2]
@@ -88,7 +88,7 @@ box.execute('SELECT x, y, x + y FROM test ORDER BY y')
      type: integer
    - name: Y
      type: integer
-  - name: x + y
+  - name: COLUMN_1
      type: integer
    rows:
    - [1, 1, 2]
@@ -115,7 +115,7 @@ box.execute('SELECT a, id + 2, b FROM test2 WHERE b 
< id * 2 ORDER BY a ')
  - metadata:
    - name: A
      type: string
-  - name: id + 2
+  - name: COLUMN_1
      type: integer
    - name: B
      type: integer
@@ -134,7 +134,7 @@ box.execute('SELECT a, id + 2 * b, a FROM test2 
WHERE b < id * 2 ORDER BY a ')
  - metadata:
    - name: A
      type: string
-  - name: id + 2 * b
+  - name: COLUMN_1
      type: integer
    - name: A
      type: string
@@ -149,7 +149,7 @@ box.execute('SELECT a, id + 2 * b, a FROM test2 
WHERE b < id * 2 ORDER BY a ')
  - metadata:
    - name: A
      type: string
-  - name: id + 2 * b
+  - name: COLUMN_1
      type: integer
    - name: A
      type: string
@@ -164,7 +164,7 @@ box.execute('SELECT a, id + 2 * b, a FROM test2 
WHERE b < id * 2 ORDER BY a ')
  - metadata:
    - name: A
      type: string
-  - name: id + 2 * b
+  - name: COLUMN_1
      type: integer
    - name: A
      type: string
@@ -183,7 +183,7 @@ box.execute('SELECT x, y + 3 * b, b FROM test2, test 
WHERE b = x')
  - metadata:
    - name: X
      type: integer
-  - name: y + 3 * b
+  - name: COLUMN_1
      type: integer
    - name: B
      type: integer
@@ -196,7 +196,7 @@ box.execute('SELECT x, y + 3 * b, b FROM test2, test 
WHERE b = x')
  - metadata:
    - name: X
      type: integer
-  - name: y + 3 * b
+  - name: COLUMN_1
      type: integer
    - name: B
      type: integer
@@ -209,7 +209,7 @@ box.execute('SELECT x, y + 3 * b, b FROM test2, test 
WHERE b = x')
  - metadata:
    - name: X
      type: integer
-  - name: y + 3 * b
+  - name: COLUMN_1
      type: integer
    - name: B
      type: integer
diff --git a/test/sql/gh-3888-values-blob-assert.result 
b/test/sql/gh-3888-values-blob-assert.result
index 0a1af28..669f2eb 100644
--- a/test/sql/gh-3888-values-blob-assert.result
+++ b/test/sql/gh-3888-values-blob-assert.result
@@ -51,7 +51,7 @@ box.execute('SELECT TheColumnName')
  box.execute('VALUES(-0.5e-2)')
  ---
  - metadata:
-  - name: column1
+  - name: COLUMN_1
      type: double
    rows:
    - [-0.005]
@@ -59,7 +59,7 @@ box.execute('VALUES(-0.5e-2)')
  box.execute('SELECT X\'507265766564\'')
  ---
  - metadata:
-  - name: X'507265766564'
+  - name: COLUMN_1
      type: varbinary
    rows:
    - ['Preved']
@@ -68,7 +68,7 @@ box.execute('SELECT X\'507265766564\'')
  box.execute('SELECT 3.14')
  ---
  - metadata:
-  - name: '3.14'
+  - name: COLUMN_1
      type: double
    rows:
    - [3.14]
@@ -76,7 +76,7 @@ box.execute('SELECT 3.14')
  box.execute('SELECT X\'4D6564766564\'')
  ---
  - metadata:
-  - name: X'4D6564766564'
+  - name: COLUMN_1
      type: varbinary
    rows:
    - ['Medved']
diff --git a/test/sql/gh-4697-scalar-bool-sort-cmp.result 
b/test/sql/gh-4697-scalar-bool-sort-cmp.result
index 2423cd8..6f7fbd6 100644
--- a/test/sql/gh-4697-scalar-bool-sort-cmp.result
+++ b/test/sql/gh-4697-scalar-bool-sort-cmp.result
@@ -30,7 +30,7 @@ SELECT s2, typeof(s2) FROM test ORDER BY s2;
   | - metadata:
   |   - name: S2
   |     type: scalar
- |   - name: typeof(s2)
+ |   - name: COLUMN_1
   |     type: string
   |   rows:
   |   - [null, 'boolean']
@@ -43,7 +43,7 @@ SELECT s3, typeof(s3) FROM test ORDER BY s3;
   | - metadata:
   |   - name: S3
   |     type: scalar
- |   - name: typeof(s3)
+ |   - name: COLUMN_1
   |     type: string
   |   rows:
   |   - [null, 'boolean']
diff --git a/test/sql/icu-upper-lower.result 
b/test/sql/icu-upper-lower.result
index f7b9dfa..3ecc07d 100644
--- a/test/sql/icu-upper-lower.result
+++ b/test/sql/icu-upper-lower.result
@@ -23,11 +23,9 @@ upper_lower_test([[
  ]]);
  ---
  - metadata:
-  - name: lower('     Zəfər, jaketini də, papağını da götür, bu axşam 
hava çox soyuq
-      olacaq. ')
+  - name: COLUMN_1
      type: string
-  - name: upper('     Zəfər, jaketini də, papağını da götür, bu axşam 
hava çox soyuq
-      olacaq. ')
+  - name: COLUMN_2
      type: string
    rows:
    - ['     zəfər, jaketini də, papağını da götür, bu axşam hava çox 
soyuq olacaq. ',
@@ -38,9 +36,9 @@ upper_lower_test([[
  ]]);
  ---
  - metadata:
-  - name: lower('     The quick brown fox jumps over the lazy dog. ')
+  - name: COLUMN_1
      type: string
-  - name: upper('     The quick brown fox jumps over the lazy dog. ')
+  - name: COLUMN_2
      type: string
    rows:
    - ['     the quick brown fox jumps over the lazy dog. ', '     THE 
QUICK BROWN FOX
@@ -52,9 +50,9 @@ upper_lower_test([[
  ]]);
  ---
  - metadata:
-  - name: lower('     The quick brown fox jumps over the lazy dog. ')
+  - name: COLUMN_1
      type: string
-  - name: upper('     The quick brown fox jumps over the lazy dog. ')
+  - name: COLUMN_2
      type: string
    rows:
    - ['     the quick brown fox jumps over the lazy dog. ', '     THE 
QUICK BROWN FOX
@@ -66,11 +64,9 @@ upper_lower_test([[
  ]]);
  ---
  - metadata:
-  - name: lower('     Բել դղյակի ձախ ժամն օֆ ազգությանը ցպահանջ չճշտած 
վնաս էր եւ
-      փառք ')
+  - name: COLUMN_1
      type: string
-  - name: upper('     Բել դղյակի ձախ ժամն օֆ ազգությանը ցպահանջ չճշտած 
վնաս էր եւ
-      փառք ')
+  - name: COLUMN_2
      type: string
    rows:
    - ['     բել դղյակի ձախ ժամն օֆ ազգությանը ցպահանջ չճշտած վնաս էր եւ 
փառք ', '     ԲԵԼ
@@ -82,11 +78,9 @@ upper_lower_test([[
  ]]);
  ---
  - metadata:
-  - name: lower('     У Іўі худы жвавы чорт у зялёнай камізэльцы пабег 
пад’есці фаршу
-      з юшкай ')
+  - name: COLUMN_1
      type: string
-  - name: upper('     У Іўі худы жвавы чорт у зялёнай камізэльцы пабег 
пад’есці фаршу
-      з юшкай ')
+  - name: COLUMN_2
      type: string
    rows:
    - ['     у іўі худы жвавы чорт у зялёнай камізэльцы пабег пад’есці 
фаршу з юшкай ',
@@ -98,11 +92,9 @@ upper_lower_test([[
  ]]);
  ---
  - metadata:
-  - name: lower('     Τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ 
νωθρού κυνός
-      ')
+  - name: COLUMN_1
      type: string
-  - name: upper('     Τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ 
νωθρού κυνός
-      ')
+  - name: COLUMN_2
      type: string
    rows:
    - ['     τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού 
κυνός ', '     ΤΆΧΙΣΤΗ
@@ -114,11 +106,9 @@ upper_lower_test([[
  ]]);
  ---
  - metadata:
-  - name: lower('     Chuaigh bé mhórshách le dlúthspád fíorfhinn trí 
hata mo dhea-phorcáin
-      bhig ')
+  - name: COLUMN_1
      type: string
-  - name: upper('     Chuaigh bé mhórshách le dlúthspád fíorfhinn trí 
hata mo dhea-phorcáin
-      bhig ')
+  - name: COLUMN_2
      type: string
    rows:
    - ['     chuaigh bé mhórshách le dlúthspád fíorfhinn trí hata mo 
dhea-phorcáin bhig ',
@@ -130,9 +120,9 @@ upper_lower_test([[
  ]]);
  ---
  - metadata:
-  - name: lower('     Quiere la boca exhausta vid, kiwi, piña y fugaz 
jamón ')
+  - name: COLUMN_1
      type: string
-  - name: upper('     Quiere la boca exhausta vid, kiwi, piña y fugaz 
jamón ')
+  - name: COLUMN_2
      type: string
    rows:
    - ['     quiere la boca exhausta vid, kiwi, piña y fugaz jamón ', 
'     QUIERE LA
@@ -144,9 +134,9 @@ upper_lower_test([[
  ]]);
  ---
  - metadata:
-  - name: lower('     키스의 고유조건은 입술끼리 만나야 하고 특별한 기술은 
필요치 않다 ')
+  - name: COLUMN_1
      type: string
-  - name: upper('     키스의 고유조건은 입술끼리 만나야 하고 특별한 기술은 
필요치 않다 ')
+  - name: COLUMN_2
      type: string
    rows:
    - ['     키스의 고유조건은 입술끼리 만나야 하고 특별한 기술은 필요치 
않다 ', '     키스의 고유조건은 입술끼리 만나야 하고 특별한
@@ -158,9 +148,9 @@ upper_lower_test([[
  ]]);
  ---
  - metadata:
-  - name: lower('     Glāžšķūņa rūķīši dzērumā čiepj Baha 
koncertflīģeļu vākus ')
+  - name: COLUMN_1
      type: string
-  - name: upper('     Glāžšķūņa rūķīši dzērumā čiepj Baha 
koncertflīģeļu vākus ')
+  - name: COLUMN_2
      type: string
    rows:
    - ['     glāžšķūņa rūķīši dzērumā čiepj baha koncertflīģeļu vākus ', 
'     GLĀŽŠĶŪŅA
@@ -172,11 +162,9 @@ upper_lower_test([[
  ]]);
  ---
  - metadata:
-  - name: lower('     Zwölf große Boxkämpfer jagen Viktor quer über den 
Sylter Deich
-      ')
+  - name: COLUMN_1
      type: string
-  - name: upper('     Zwölf große Boxkämpfer jagen Viktor quer über den 
Sylter Deich
-      ')
+  - name: COLUMN_2
      type: string
    rows:
    - ['     zwölf große boxkämpfer jagen viktor quer über den sylter 
deich ', '     ZWÖLF
@@ -188,9 +176,9 @@ upper_lower_test([[
  ]]);
  ---
  - metadata:
-  - name: lower('     Pchnąć w tę łódź jeża lub ośm skrzyń fig. ')
+  - name: COLUMN_1
      type: string
-  - name: upper('     Pchnąć w tę łódź jeża lub ośm skrzyń fig. ')
+  - name: COLUMN_2
      type: string
    rows:
    - ['     pchnąć w tę łódź jeża lub ośm skrzyń fig. ', ' PCHNĄĆ W TĘ 
ŁÓDŹ JEŻA
@@ -202,9 +190,9 @@ upper_lower_test([[
  ]]);
  ---
  - metadata:
-  - name: lower('     Чуєш їх, доцю, га? Кумедна ж ти, прощайся без 
ґольфів! ')
+  - name: COLUMN_1
      type: string
-  - name: upper('     Чуєш їх, доцю, га? Кумедна ж ти, прощайся без 
ґольфів! ')
+  - name: COLUMN_2
      type: string
    rows:
    - ['     чуєш їх, доцю, га? кумедна ж ти, прощайся без ґольфів! ', 
'     ЧУЄШ ЇХ,
@@ -216,9 +204,9 @@ upper_lower_test([[
  ]]);
  ---
  - metadata:
-  - name: lower('     Příliš žluťoučký kůň úpěl ďábelské ódy ')
+  - name: COLUMN_1
      type: string
-  - name: upper('     Příliš žluťoučký kůň úpěl ďábelské ódy ')
+  - name: COLUMN_2
      type: string
    rows:
    - ['     příliš žluťoučký kůň úpěl ďábelské ódy ', ' PŘÍLIŠ 
ŽLUŤOUČKÝ KŮŇ ÚPĚL
@@ -230,11 +218,9 @@ upper_lower_test([[
  ]]);
  ---
  - metadata:
-  - name: lower('     Laŭ Ludoviko Zamenhof bongustas freŝa ĉeĥa 
manĝaĵo kun spicoj
-      ')
+  - name: COLUMN_1
      type: string
-  - name: upper('     Laŭ Ludoviko Zamenhof bongustas freŝa ĉeĥa 
manĝaĵo kun spicoj
-      ')
+  - name: COLUMN_2
      type: string
    rows:
    - ['     laŭ ludoviko zamenhof bongustas freŝa ĉeĥa manĝaĵo kun 
spicoj ', '     LAŬ
@@ -246,9 +232,9 @@ upper_lower_test([[
  ]]);
  ---
  - metadata:
-  - name: lower('     いろはにほへと ちりぬるを わかよたれそ つねならむ 
うゐのおくやま けふこえて あさきゆめみし ゑひもせす ')
+  - name: COLUMN_1
      type: string
-  - name: upper('     いろはにほへと ちりぬるを わかよたれそ つねならむ 
うゐのおくやま けふこえて あさきゆめみし ゑひもせす ')
+  - name: COLUMN_2
      type: string
    rows:
    - ['     いろはにほへと ちりぬるを わかよたれそ つねならむ 
うゐのおくやま けふこえて あさきゆめみし ゑひもせす ', '     いろはにほへと
@@ -260,9 +246,9 @@ upper_lower_test([[
  ]]);
  ---
  - metadata:
-  - name: 'lower(''     Pijamalı hasta yağız şoföre çabucak güvendi. 
EXTRA: İ '')'
+  - name: COLUMN_1
      type: string
-  - name: 'upper(''     Pijamalı hasta yağız şoföre çabucak güvendi. 
EXTRA: İ '')'
+  - name: COLUMN_2
      type: string
    rows:
    - ['     pijamalı hasta yağız şoföre çabucak güvendi. extra: i̇ ', 
'     PIJAMALI
diff --git a/test/sql/integer-overflow.result 
b/test/sql/integer-overflow.result
index 6269cb5..a56fb24 100644
--- a/test/sql/integer-overflow.result
+++ b/test/sql/integer-overflow.result
@@ -19,7 +19,7 @@ box.execute('SELECT (2147483647 * 2147483647 * 
2147483647);')
  box.execute('SELECT (-9223372036854775808 / -1);')
  ---
  - metadata:
-  - name: (-9223372036854775808 / -1)
+  - name: COLUMN_1
      type: integer
    rows:
    - [9223372036854775808]
@@ -32,7 +32,7 @@ box.execute('SELECT (-9223372036854775808 - 1);')
  box.execute('SELECT (9223372036854775807 + 1);')
  ---
  - metadata:
-  - name: (9223372036854775807 + 1)
+  - name: COLUMN_1
      type: integer
    rows:
    - [9223372036854775808]
@@ -50,7 +50,7 @@ box.execute('SELECT 18446744073709551615 * 2;')
  box.execute('SELECT (-9223372036854775807 * (-2));')
  ---
  - metadata:
-  - name: (-9223372036854775807 * (-2))
+  - name: COLUMN_1
      type: integer
    rows:
    - [18446744073709551614]
@@ -60,7 +60,7 @@ box.execute('SELECT (-9223372036854775807 * (-2));')
  box.execute('SELECT 9223372036854775808;')
  ---
  - metadata:
-  - name: '9223372036854775808'
+  - name: COLUMN_1
      type: integer
    rows:
    - [9223372036854775808]
@@ -74,7 +74,7 @@ box.execute('SELECT -9223372036854775809;')
  box.execute('SELECT 9223372036854775808 - 1;')
  ---
  - metadata:
-  - name: 9223372036854775808 - 1
+  - name: COLUMN_1
      type: integer
    rows:
    - [9223372036854775807]
@@ -82,7 +82,7 @@ box.execute('SELECT 9223372036854775808 - 1;')
  box.execute('SELECT 18446744073709551615;')
  ---
  - metadata:
-  - name: '18446744073709551615'
+  - name: COLUMN_1
      type: integer
    rows:
    - [18446744073709551615]
@@ -98,7 +98,7 @@ box.execute('SELECT 18446744073709551616;')
  box.execute('SELECT CAST(\'9223372036854775808\' AS INTEGER);')
  ---
  - metadata:
-  - name: CAST('9223372036854775808' AS INTEGER)
+  - name: COLUMN_1
      type: integer
    rows:
    - [9223372036854775808]
diff --git a/test/sql/iproto.result b/test/sql/iproto.result
index 44ba499..ee1047f 100644
--- a/test/sql/iproto.result
+++ b/test/sql/iproto.result
@@ -372,11 +372,11 @@ parameters[3] = 33
  cn:execute('select $2, $1, $3', parameters)
  ---
  - metadata:
-  - name: $2
+  - name: COLUMN_1
      type: integer
-  - name: $1
+  - name: COLUMN_2
      type: integer
-  - name: $3
+  - name: COLUMN_3
      type: integer
    rows:
    - [22, 11, 33]
@@ -736,7 +736,7 @@ res.metadata
  cn:execute("SELECT zeroblob(1);")
  ---
  - metadata:
-  - name: zeroblob(1)
+  - name: COLUMN_1
      type: varbinary
    rows:
    - ["\0"]
@@ -749,7 +749,7 @@ res = cn:execute("SELECT randomblob(1);")
  ...
  res.metadata
  ---
-- - name: randomblob(1)
+- - name: COLUMN_1
      type: varbinary
  ...
  -- Type set during compilation stage, and since min/max are accept
@@ -759,7 +759,7 @@ res.metadata
  cn:execute("SELECT LEAST(1, 2, 3);")
  ---
  - metadata:
-  - name: LEAST(1, 2, 3)
+  - name: COLUMN_1
      type: scalar
    rows:
    - [1]
@@ -767,7 +767,7 @@ cn:execute("SELECT LEAST(1, 2, 3);")
  cn:execute("SELECT GREATEST(1, 2, 3);")
  ---
  - metadata:
-  - name: GREATEST(1, 2, 3)
+  - name: COLUMN_1
      type: scalar
    rows:
    - [3]
@@ -803,7 +803,7 @@ s = box.prepare([[ SELECT ?; ]])
  s:execute({42})
  ---
  - metadata:
-  - name: '?'
+  - name: COLUMN_1
      type: integer
    rows:
    - [42]
@@ -811,7 +811,7 @@ s:execute({42})
  box.execute('SELECT 1;')
  ---
  - metadata:
-  - name: '1'
+  - name: COLUMN_1
      type: integer
    rows:
    - [1]
diff --git a/test/sql/max-on-index.result b/test/sql/max-on-index.result
index 1cd488f..a90f309 100644
--- a/test/sql/max-on-index.result
+++ b/test/sql/max-on-index.result
@@ -48,7 +48,7 @@ box.execute("INSERT INTO test2 VALUES(1, 2)");
  box.execute("SELECT MAX(f1) FROM test1")
  ---
  - metadata:
-  - name: MAX(f1)
+  - name: COLUMN_1
      type: scalar
    rows:
    - [4]
@@ -56,7 +56,7 @@ box.execute("SELECT MAX(f1) FROM test1")
  box.execute("SELECT MAX(f2) FROM test1")
  ---
  - metadata:
-  - name: MAX(f2)
+  - name: COLUMN_1
      type: scalar
    rows:
    - [3]
@@ -64,7 +64,7 @@ box.execute("SELECT MAX(f2) FROM test1")
  box.execute("SELECT MAX(f1) FROM test2")
  ---
  - metadata:
-  - name: MAX(f1)
+  - name: COLUMN_1
      type: scalar
    rows:
    - [1]
diff --git a/test/sql/misc.result b/test/sql/misc.result
index 0190a58..6af11bf 100644
--- a/test/sql/misc.result
+++ b/test/sql/misc.result
@@ -11,7 +11,7 @@ _ = 
box.space._session_settings:update('sql_default_engine', {{'=', 2, engine}})
  box.execute('select 1;')
  ---
  - metadata:
-  - name: '1'
+  - name: COLUMN_1
      type: integer
    rows:
    - [1]
@@ -78,7 +78,7 @@ box.execute('CREATE TABLE test (id INTEGER PRIMARY 
KEY, b TEXT CONSTRAINT c1 COL
  box.execute('SELECT 1;')
  ---
  - metadata:
-  - name: '1'
+  - name: COLUMN_1
      type: integer
    rows:
    - [1]
@@ -86,7 +86,7 @@ box.execute('SELECT 1;')
  box.execute('SELECT 1.5;')
  ---
  - metadata:
-  - name: '1.5'
+  - name: COLUMN_1
      type: double
    rows:
    - [1.5]
@@ -94,7 +94,7 @@ box.execute('SELECT 1.5;')
  box.execute('SELECT 1.0;')
  ---
  - metadata:
-  - name: '1.0'
+  - name: COLUMN_1
      type: double
    rows:
    - [1]
@@ -102,7 +102,7 @@ box.execute('SELECT 1.0;')
  box.execute('SELECT \'abc\';')
  ---
  - metadata:
-  - name: '''abc'''
+  - name: COLUMN_1
      type: string
    rows:
    - ['abc']
@@ -110,7 +110,7 @@ box.execute('SELECT \'abc\';')
  box.execute('SELECT X\'4D6564766564\'')
  ---
  - metadata:
-  - name: X'4D6564766564'
+  - name: COLUMN_1
      type: varbinary
    rows:
    - ['Medved']
diff --git a/test/sql/persistency.result b/test/sql/persistency.result
index 6d14d4c..95dde57 100644
--- a/test/sql/persistency.result
+++ b/test/sql/persistency.result
@@ -41,9 +41,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar")
      type: string
    - name: FOO
      type: integer
-  - name: '42'
+  - name: COLUMN_1
      type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
      type: string
    rows:
    - ['foo', 1, 42, 'awesome']
@@ -57,9 +57,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM 
foobar LIMIT 2")
      type: string
    - name: FOO
      type: integer
-  - name: '42'
+  - name: COLUMN_1
      type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
      type: string
    rows:
    - ['foo', 1, 42, 'awesome']
@@ -72,9 +72,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM 
foobar WHERE foo=2")
      type: string
    - name: FOO
      type: integer
-  - name: '42'
+  - name: COLUMN_1
      type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
      type: string
    rows:
    - ['bar', 2, 42, 'awesome']
@@ -86,9 +86,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM 
foobar WHERE foo>2")
      type: string
    - name: FOO
      type: integer
-  - name: '42'
+  - name: COLUMN_1
      type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
      type: string
    rows:
    - ['foobar', 1000, 42, 'awesome']
@@ -100,9 +100,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM 
foobar WHERE foo>=2")
      type: string
    - name: FOO
      type: integer
-  - name: '42'
+  - name: COLUMN_1
      type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
      type: string
    rows:
    - ['bar', 2, 42, 'awesome']
@@ -115,9 +115,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM 
foobar WHERE foo=10000")
      type: string
    - name: FOO
      type: integer
-  - name: '42'
+  - name: COLUMN_1
      type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
      type: string
    rows: []
  ...
@@ -128,9 +128,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM 
foobar WHERE foo>10000")
      type: string
    - name: FOO
      type: integer
-  - name: '42'
+  - name: COLUMN_1
      type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
      type: string
    rows: []
  ...
@@ -141,9 +141,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM 
foobar WHERE foo<2")
      type: string
    - name: FOO
      type: integer
-  - name: '42'
+  - name: COLUMN_1
      type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
      type: string
    rows:
    - ['foo', 1, 42, 'awesome']
@@ -155,9 +155,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM 
foobar WHERE foo<2.001")
      type: string
    - name: FOO
      type: integer
-  - name: '42'
+  - name: COLUMN_1
      type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
      type: string
    rows:
    - ['foo', 1, 42, 'awesome']
@@ -170,9 +170,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM 
foobar WHERE foo<=2")
      type: string
    - name: FOO
      type: integer
-  - name: '42'
+  - name: COLUMN_1
      type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
      type: string
    rows:
    - ['foo', 1, 42, 'awesome']
@@ -185,9 +185,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM 
foobar WHERE foo<100")
      type: string
    - name: FOO
      type: integer
-  - name: '42'
+  - name: COLUMN_1
      type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
      type: string
    rows:
    - ['foo', 1, 42, 'awesome']
@@ -200,9 +200,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM 
foobar WHERE bar='foo'")
      type: string
    - name: FOO
      type: integer
-  - name: '42'
+  - name: COLUMN_1
      type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
      type: string
    rows:
    - ['foo', 1, 42, 'awesome']
@@ -210,7 +210,7 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM 
foobar WHERE bar='foo'")
  box.execute("SELECT count(*) FROM foobar")
  ---
  - metadata:
-  - name: count(*)
+  - name: COLUMN_1
      type: integer
    rows:
    - [3]
@@ -218,7 +218,7 @@ box.execute("SELECT count(*) FROM foobar")
  box.execute("SELECT count(*) FROM foobar WHERE bar='foo'")
  ---
  - metadata:
-  - name: count(*)
+  - name: COLUMN_1
      type: integer
    rows:
    - [1]
@@ -230,9 +230,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM 
foobar ORDER BY bar")
      type: string
    - name: FOO
      type: integer
-  - name: '42'
+  - name: COLUMN_1
      type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
      type: string
    rows:
    - ['bar', 2, 42, 'awesome']
@@ -246,9 +246,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM 
foobar ORDER BY bar DESC")
      type: string
    - name: FOO
      type: integer
-  - name: '42'
+  - name: COLUMN_1
      type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
      type: string
    rows:
    - ['foobar', 1000, 42, 'awesome']
@@ -263,7 +263,7 @@ box.execute("REPLACE INTO foobar VALUES (1, 
'cacodaemon')")
  box.execute("SELECT COUNT(*) FROM foobar WHERE foo=1")
  ---
  - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
      type: integer
    rows:
    - [1]
@@ -271,7 +271,7 @@ box.execute("SELECT COUNT(*) FROM foobar WHERE foo=1")
  box.execute("SELECT COUNT(*) FROM foobar WHERE bar='cacodaemon'")
  ---
  - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
      type: integer
    rows:
    - [1]
@@ -283,7 +283,7 @@ box.execute("DELETE FROM foobar WHERE bar='cacodaemon'")
  box.execute("SELECT COUNT(*) FROM foobar WHERE bar='cacodaemon'")
  ---
  - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
      type: integer
    rows:
    - [0]
diff --git a/test/sql/prepared.result b/test/sql/prepared.result
index 666f6e1..0db2cc0 100644
--- a/test/sql/prepared.result
+++ b/test/sql/prepared.result
@@ -425,13 +425,13 @@ s = prepare("SELECT count(*), count(a - 3), 
max(b), abs(id) FROM test WHERE b =
  execute(s.stmt_id)
   | ---
   | - metadata:
- |   - name: count(*)
+ |   - name: COLUMN_1
   |     type: integer
- |   - name: count(a - 3)
+ |   - name: COLUMN_2
   |     type: integer
- |   - name: max(b)
+ |   - name: COLUMN_3
   |     type: scalar
- |   - name: abs(id)
+ |   - name: COLUMN_4
   |     type: number
   |   rows:
   |   - [1, 1, '3', 1]
@@ -439,13 +439,13 @@ execute(s.stmt_id)
  execute(s.stmt_id)
   | ---
   | - metadata:
- |   - name: count(*)
+ |   - name: COLUMN_1
   |     type: integer
- |   - name: count(a - 3)
+ |   - name: COLUMN_2
   |     type: integer
- |   - name: max(b)
+ |   - name: COLUMN_3
   |     type: scalar
- |   - name: abs(id)
+ |   - name: COLUMN_4
   |     type: number
   |   rows:
   |   - [1, 1, '3', 1]
@@ -480,7 +480,7 @@ res = execute(s.stmt_id)
   | ...
  res.metadata
   | ---
- | - - name: group_concat(TRIM(TRAILING FROM t),x'0a')
+ | - - name: COLUMN_13
   |     type: string
   | ...
  unprepare(s.stmt_id)
@@ -838,11 +838,11 @@ s = prepare('SELECT :a, :b, :c');
  execute(s.stmt_id, {{[':a'] = 1}, {[':b'] = 2}, {[':c'] = 3}});
   | ---
   | - metadata:
- |   - name: :a
+ |   - name: COLUMN_1
   |     type: integer
- |   - name: :b
+ |   - name: COLUMN_2
   |     type: integer
- |   - name: :c
+ |   - name: COLUMN_3
   |     type: integer
   |   rows:
   |   - [1, 2, 3]
@@ -850,11 +850,11 @@ execute(s.stmt_id, {{[':a'] = 1}, {[':b'] = 2}, 
{[':c'] = 3}});
  execute(s.stmt_id, {{[':a'] = 1}, {[':b'] = 2}});
   | ---
   | - metadata:
- |   - name: :a
+ |   - name: COLUMN_1
   |     type: integer
- |   - name: :b
+ |   - name: COLUMN_2
   |     type: integer
- |   - name: :c
+ |   - name: COLUMN_3
   |     type: boolean
   |   rows:
   |   - [1, 2, null]
@@ -862,11 +862,11 @@ execute(s.stmt_id, {{[':a'] = 1}, {[':b'] = 2}});
  execute(s.stmt_id);
   | ---
   | - metadata:
- |   - name: :a
+ |   - name: COLUMN_1
   |     type: boolean
- |   - name: :b
+ |   - name: COLUMN_2
   |     type: boolean
- |   - name: :c
+ |   - name: COLUMN_3
   |     type: boolean
   |   rows:
   |   - [null, null, null]
diff --git a/test/sql/row-count.result b/test/sql/row-count.result
index 02acd79..7591d16 100644
--- a/test/sql/row-count.result
+++ b/test/sql/row-count.result
@@ -16,7 +16,7 @@ box.execute("CREATE TABLE t1 (s1 VARCHAR(10) PRIMARY 
KEY);")
  box.execute("SELECT ROW_COUNT();")
  ---
  - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
      type: integer
    rows:
    - [1]
@@ -24,7 +24,7 @@ box.execute("SELECT ROW_COUNT();")
  box.execute("SELECT ROW_COUNT();")
  ---
  - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
      type: integer
    rows:
    - [0]
@@ -36,7 +36,7 @@ box.execute("CREATE TABLE t2 (s1 VARCHAR(10) PRIMARY 
KEY, s2 VARCHAR(10) REFEREN
  box.execute("SELECT ROW_COUNT();")
  ---
  - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
      type: integer
    rows:
    - [1]
@@ -52,7 +52,7 @@ box.execute("INSERT INTO t3 VALUES (0, 0, 0);")
  box.execute("SELECT ROW_COUNT();")
  ---
  - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
      type: integer
    rows:
    - [1]
@@ -64,7 +64,7 @@ box.execute("CREATE TRIGGER x AFTER DELETE ON t1 FOR 
EACH ROW BEGIN UPDATE t3 SE
  box.execute("SELECT ROW_COUNT();")
  ---
  - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
      type: integer
    rows:
    - [1]
@@ -76,7 +76,7 @@ box.execute("INSERT INTO t1 VALUES ('a');")
  box.execute("SELECT ROW_COUNT();")
  ---
  - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
      type: integer
    rows:
    - [1]
@@ -88,7 +88,7 @@ box.execute("INSERT INTO t2 VALUES ('a','a');")
  box.execute("SELECT ROW_COUNT();")
  ---
  - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
      type: integer
    rows:
    - [1]
@@ -100,7 +100,7 @@ box.execute("INSERT INTO t1 VALUES ('b'), ('c'), 
('d');")
  box.execute("SELECT ROW_COUNT();")
  ---
  - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
      type: integer
    rows:
    - [3]
@@ -113,7 +113,7 @@ box.execute("REPLACE INTO t2 VALUES('a', 'c');")
  box.execute("SELECT ROW_COUNT();")
  ---
  - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
      type: integer
    rows:
    - [2]
@@ -125,7 +125,7 @@ box.execute("DELETE FROM t1;")
  box.execute("SELECT ROW_COUNT();")
  ---
  - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
      type: integer
    rows:
    - [4]
@@ -141,7 +141,7 @@ box.execute("TRUNCATE TABLE t3;")
  box.execute("SELECT ROW_COUNT();")
  ---
  - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
      type: integer
    rows:
    - [0]
@@ -157,7 +157,7 @@ box.execute("UPDATE t3 SET i2 = 666;")
  box.execute("SELECT ROW_COUNT();")
  ---
  - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
      type: integer
    rows:
    - [3]
@@ -172,7 +172,7 @@ box.execute("DELETE FROM t3 WHERE 0 = 0;")
  box.execute("SELECT ROW_COUNT();")
  ---
  - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
      type: integer
    rows:
    - [3]
@@ -188,7 +188,7 @@ box.execute("DELETE FROM t3")
  box.execute("SELECT ROW_COUNT();")
  ---
  - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
      type: integer
    rows:
    - [3]
@@ -222,7 +222,7 @@ box.execute("DELETE FROM tt1 WHERE id = 2;")
  box.execute("SELECT ROW_COUNT();")
  ---
  - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
      type: integer
    rows:
    - [1]
@@ -252,7 +252,7 @@ box.execute("START TRANSACTION;")
  box.execute("SELECT ROW_COUNT();")
  ---
  - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
      type: integer
    rows:
    - [0]
@@ -264,7 +264,7 @@ box.execute("COMMIT;")
  box.execute("SELECT ROW_COUNT();")
  ---
  - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
      type: integer
    rows:
    - [0]
@@ -277,7 +277,7 @@ box.execute("COMMIT;")
  box.execute("SELECT ROW_COUNT();")
  ---
  - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
      type: integer
    rows:
    - [0]
@@ -286,7 +286,7 @@ box.execute("SELECT ROW_COUNT();")
  box.execute("SELECT ROW_COUNT();")
  ---
  - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
      type: integer
    rows:
    - [0]
@@ -308,7 +308,7 @@ box.execute("EXPLAIN QUERY PLAN INSERT INTO t1 
VALUES ('b'), ('c'), ('d');")
  box.execute("SELECT ROW_COUNT();")
  ---
  - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
      type: integer
    rows:
    - [0]
diff --git a/test/sql/transition.result b/test/sql/transition.result
index c14055b..8680e3c 100644
--- a/test/sql/transition.result
+++ b/test/sql/transition.result
@@ -38,9 +38,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar")
      type: string
    - name: FOO
      type: integer
-  - name: '42'
+  - name: COLUMN_1
      type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
      type: string
    rows:
    - ['foo', 1, 42, 'awesome']
@@ -54,9 +54,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM 
foobar LIMIT 2")
      type: string
    - name: FOO
      type: integer
-  - name: '42'
+  - name: COLUMN_1
      type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
      type: string
    rows:
    - ['foo', 1, 42, 'awesome']
@@ -69,9 +69,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM 
foobar WHERE foo=2")
      type: string
    - name: FOO
      type: integer
-  - name: '42'
+  - name: COLUMN_1
      type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
      type: string
    rows:
    - ['bar', 2, 42, 'awesome']
@@ -83,9 +83,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM 
foobar WHERE foo>2")
      type: string
    - name: FOO
      type: integer
-  - name: '42'
+  - name: COLUMN_1
      type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
      type: string
    rows:
    - ['foobar', 1000, 42, 'awesome']
@@ -97,9 +97,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM 
foobar WHERE foo>=2")
      type: string
    - name: FOO
      type: integer
-  - name: '42'
+  - name: COLUMN_1
      type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
      type: string
    rows:
    - ['bar', 2, 42, 'awesome']
@@ -112,9 +112,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM 
foobar WHERE foo=10000")
      type: string
    - name: FOO
      type: integer
-  - name: '42'
+  - name: COLUMN_1
      type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
      type: string
    rows: []
  ...
@@ -125,9 +125,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM 
foobar WHERE foo>10000")
      type: string
    - name: FOO
      type: integer
-  - name: '42'
+  - name: COLUMN_1
      type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
      type: string
    rows: []
  ...
@@ -138,9 +138,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM 
foobar WHERE foo<2")
      type: string
    - name: FOO
      type: integer
-  - name: '42'
+  - name: COLUMN_1
      type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
      type: string
    rows:
    - ['foo', 1, 42, 'awesome']
@@ -152,9 +152,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM 
foobar WHERE foo<2.001")
      type: string
    - name: FOO
      type: integer
-  - name: '42'
+  - name: COLUMN_1
      type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
      type: string
    rows:
    - ['foo', 1, 42, 'awesome']
@@ -167,9 +167,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM 
foobar WHERE foo<=2")
      type: string
    - name: FOO
      type: integer
-  - name: '42'
+  - name: COLUMN_1
      type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
      type: string
    rows:
    - ['foo', 1, 42, 'awesome']
@@ -182,9 +182,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM 
foobar WHERE foo<100")
      type: string
    - name: FOO
      type: integer
-  - name: '42'
+  - name: COLUMN_1
      type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
      type: string
    rows:
    - ['foo', 1, 42, 'awesome']
@@ -197,9 +197,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM 
foobar WHERE bar='foo'")
      type: string
    - name: FOO
      type: integer
-  - name: '42'
+  - name: COLUMN_1
      type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
      type: string
    rows:
    - ['foo', 1, 42, 'awesome']
@@ -207,7 +207,7 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM 
foobar WHERE bar='foo'")
  box.execute("SELECT count(*) FROM foobar")
  ---
  - metadata:
-  - name: count(*)
+  - name: COLUMN_1
      type: integer
    rows:
    - [3]
@@ -215,7 +215,7 @@ box.execute("SELECT count(*) FROM foobar")
  box.execute("SELECT count(*) FROM foobar WHERE bar='foo'")
  ---
  - metadata:
-  - name: count(*)
+  - name: COLUMN_1
      type: integer
    rows:
    - [1]
@@ -227,9 +227,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM 
foobar ORDER BY bar")
      type: string
    - name: FOO
      type: integer
-  - name: '42'
+  - name: COLUMN_1
      type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
      type: string
    rows:
    - ['bar', 2, 42, 'awesome']
@@ -243,9 +243,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM 
foobar ORDER BY bar DESC")
      type: string
    - name: FOO
      type: integer
-  - name: '42'
+  - name: COLUMN_1
      type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
      type: string
    rows:
    - ['foobar', 1000, 42, 'awesome']
@@ -260,7 +260,7 @@ box.execute("REPLACE INTO foobar VALUES (1, 
'cacodaemon')")
  box.execute("SELECT COUNT(*) FROM foobar WHERE foo=1")
  ---
  - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
      type: integer
    rows:
    - [1]
@@ -268,7 +268,7 @@ box.execute("SELECT COUNT(*) FROM foobar WHERE foo=1")
  box.execute("SELECT COUNT(*) FROM foobar WHERE bar='cacodaemon'")
  ---
  - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
      type: integer
    rows:
    - [1]
@@ -280,7 +280,7 @@ box.execute("DELETE FROM foobar WHERE bar='cacodaemon'")
  box.execute("SELECT COUNT(*) FROM foobar WHERE bar='cacodaemon'")
  ---
  - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
      type: integer
    rows:
    - [0]
diff --git a/test/sql/types.result b/test/sql/types.result
index 54aff46..8204b22 100644
--- a/test/sql/types.result
+++ b/test/sql/types.result
@@ -54,8 +54,8 @@ box.execute("CREATE VIEW v1 AS SELECT b + a, b - a 
FROM t1;")
  ...
  box.space.V1:format()
  ---
-- [{'type': 'number', 'nullable_action': 'none', 'name': 'b + a', 
'is_nullable': true},
-  {'type': 'number', 'nullable_action': 'none', 'name': 'b - a', 
'is_nullable': true}]
+- [{'type': 'number', 'nullable_action': 'none', 'name': 'COLUMN_1', 
'is_nullable': true},
+  {'type': 'number', 'nullable_action': 'none', 'name': 'COLUMN_2', 
'is_nullable': true}]
  ...
  -- gh-2494: index's part also features correct declared type.
  --
@@ -197,7 +197,7 @@ box.execute("SELECT randomblob(5) || 'x';")
  box.execute("VALUES (TYPEOF(randomblob(5) || zeroblob(5)));")
  ---
  - metadata:
-  - name: column1
+  - name: COLUMN_1
      type: string
    rows:
    - ['varbinary']
@@ -230,7 +230,7 @@ box.execute("SELECT * FROM t1 WHERE 'blob' LIKE 
x'0000';")
  box.execute("SELECT s LIKE NULL FROM t1;")
  ---
  - metadata:
-  - name: s LIKE NULL
+  - name: COLUMN_1
      type: integer
    rows:
    - [null]
@@ -256,7 +256,7 @@ box.execute("SELECT * FROM t1 WHERE 'int' LIKE 4;")
  box.execute("SELECT NULL LIKE s FROM t1;")
  ---
  - metadata:
-  - name: NULL LIKE s
+  - name: COLUMN_1
      type: integer
    rows:
    - [null]
@@ -295,7 +295,7 @@ box.space.T1:drop()
  box.execute('SELECT 1 + 1;')
  ---
  - metadata:
-  - name: 1 + 1
+  - name: COLUMN_1
      type: integer
    rows:
    - [2]
@@ -303,7 +303,7 @@ box.execute('SELECT 1 + 1;')
  box.execute('SELECT 1 + 1.1;')
  ---
  - metadata:
-  - name: 1 + 1.1
+  - name: COLUMN_1
      type: double
    rows:
    - [2.1]
@@ -311,7 +311,7 @@ box.execute('SELECT 1 + 1.1;')
  box.execute('SELECT \'9223372036854\' + 1;')
  ---
  - metadata:
-  - name: '''9223372036854'' + 1'
+  - name: COLUMN_1
      type: integer
    rows:
    - [9223372036855]
@@ -320,7 +320,7 @@ box.execute('SELECT \'9223372036854\' + 1;')
  box.execute('SELECT ?', {true})
  ---
  - metadata:
-  - name: '?'
+  - name: COLUMN_1
      type: boolean
    rows:
    - [true]
@@ -481,7 +481,7 @@ s:drop()
  box.execute("SELECT 18446744073709551615 > 18446744073709551614;")
  ---
  - metadata:
-  - name: 18446744073709551615 > 18446744073709551614
+  - name: COLUMN_1
      type: boolean
    rows:
    - [true]
@@ -489,7 +489,7 @@ box.execute("SELECT 18446744073709551615 > 
18446744073709551614;")
  box.execute("SELECT 18446744073709551615 > -9223372036854775808;")
  ---
  - metadata:
-  - name: 18446744073709551615 > -9223372036854775808
+  - name: COLUMN_1
      type: boolean
    rows:
    - [true]
@@ -497,7 +497,7 @@ box.execute("SELECT 18446744073709551615 > 
-9223372036854775808;")
  box.execute("SELECT -1 < 18446744073709551615;")
  ---
  - metadata:
-  - name: -1 < 18446744073709551615
+  - name: COLUMN_1
      type: boolean
    rows:
    - [true]
@@ -505,7 +505,7 @@ box.execute("SELECT -1 < 18446744073709551615;")
  box.execute("SELECT 1.5 < 18446744073709551615")
  ---
  - metadata:
-  - name: 1.5 < 18446744073709551615
+  - name: COLUMN_1
      type: boolean
    rows:
    - [true]
@@ -513,7 +513,7 @@ box.execute("SELECT 1.5 < 18446744073709551615")
  box.execute("SELECT 1.5 > 18446744073709551615")
  ---
  - metadata:
-  - name: 1.5 > 18446744073709551615
+  - name: COLUMN_1
      type: boolean
    rows:
    - [false]
@@ -521,7 +521,7 @@ box.execute("SELECT 1.5 > 18446744073709551615")
  box.execute("SELECT 18446744073709551615 > 1.5")
  ---
  - metadata:
-  - name: 18446744073709551615 > 1.5
+  - name: COLUMN_1
      type: boolean
    rows:
    - [true]
@@ -529,7 +529,7 @@ box.execute("SELECT 18446744073709551615 > 1.5")
  box.execute("SELECT 18446744073709551615 < 1.5")
  ---
  - metadata:
-  - name: 18446744073709551615 < 1.5
+  - name: COLUMN_1
      type: boolean
    rows:
    - [false]
@@ -537,7 +537,7 @@ box.execute("SELECT 18446744073709551615 < 1.5")
  box.execute("SELECT 18446744073709551615 = 18446744073709551615;")
  ---
  - metadata:
-  - name: 18446744073709551615 = 18446744073709551615
+  - name: COLUMN_1
      type: boolean
    rows:
    - [true]
@@ -545,7 +545,7 @@ box.execute("SELECT 18446744073709551615 = 
18446744073709551615;")
  box.execute("SELECT 18446744073709551615 > -9223372036854775808;")
  ---
  - metadata:
-  - name: 18446744073709551615 > -9223372036854775808
+  - name: COLUMN_1
      type: boolean
    rows:
    - [true]
@@ -553,7 +553,7 @@ box.execute("SELECT 18446744073709551615 > 
-9223372036854775808;")
  box.execute("SELECT 18446744073709551615 < -9223372036854775808;")
  ---
  - metadata:
-  - name: 18446744073709551615 < -9223372036854775808
+  - name: COLUMN_1
      type: boolean
    rows:
    - [false]
@@ -561,7 +561,7 @@ box.execute("SELECT 18446744073709551615 < 
-9223372036854775808;")
  box.execute("SELECT -1 < 18446744073709551615;")
  ---
  - metadata:
-  - name: -1 < 18446744073709551615
+  - name: COLUMN_1
      type: boolean
    rows:
    - [true]
@@ -569,7 +569,7 @@ box.execute("SELECT -1 < 18446744073709551615;")
  box.execute("SELECT -1 > 18446744073709551615;")
  ---
  - metadata:
-  - name: -1 > 18446744073709551615
+  - name: COLUMN_1
      type: boolean
    rows:
    - [false]
@@ -577,7 +577,7 @@ box.execute("SELECT -1 > 18446744073709551615;")
  box.execute("SELECT 18446744073709551610 - 18446744073709551615;")
  ---
  - metadata:
-  - name: 18446744073709551610 - 18446744073709551615
+  - name: COLUMN_1
      type: integer
    rows:
    - [-5]
@@ -585,7 +585,7 @@ box.execute("SELECT 18446744073709551610 - 
18446744073709551615;")
  box.execute("SELECT 18446744073709551615 = null;")
  ---
  - metadata:
-  - name: 18446744073709551615 = null
+  - name: COLUMN_1
      type: boolean
    rows:
    - [null]
@@ -593,7 +593,7 @@ box.execute("SELECT 18446744073709551615 = null;")
  box.execute("SELECT 18446744073709551615 = 18446744073709551615.0;")
  ---
  - metadata:
-  - name: 18446744073709551615 = 18446744073709551615.0
+  - name: COLUMN_1
      type: boolean
    rows:
    - [false]
@@ -601,7 +601,7 @@ box.execute("SELECT 18446744073709551615 = 
18446744073709551615.0;")
  box.execute("SELECT 18446744073709551615.0 > 18446744073709551615")
  ---
  - metadata:
-  - name: 18446744073709551615.0 > 18446744073709551615
+  - name: COLUMN_1
      type: boolean
    rows:
    - [true]
@@ -609,7 +609,7 @@ box.execute("SELECT 18446744073709551615.0 > 
18446744073709551615")
  box.execute("SELECT 18446744073709551615 IN ('18446744073709551615', 
18446744073709551615.0)")
  ---
  - metadata:
-  - name: 18446744073709551615 IN ('18446744073709551615', 
18446744073709551615.0)
+  - name: COLUMN_1
      type: boolean
    rows:
    - [true]
@@ -617,7 +617,7 @@ box.execute("SELECT 18446744073709551615 IN 
('18446744073709551615', 18446744073
  box.execute("SELECT 1 LIMIT 18446744073709551615;")
  ---
  - metadata:
-  - name: '1'
+  - name: COLUMN_1
      type: integer
    rows:
    - [1]
@@ -625,7 +625,7 @@ box.execute("SELECT 1 LIMIT 18446744073709551615;")
  box.execute("SELECT 1 LIMIT 1 OFFSET 18446744073709551614;")
  ---
  - metadata:
-  - name: '1'
+  - name: COLUMN_1
      type: integer
    rows: []
  ...
@@ -637,7 +637,7 @@ box.execute("SELECT CAST('18446744073' || 
'709551616' AS INTEGER);")
  box.execute("SELECT CAST('18446744073' || '709551615' AS INTEGER);")
  ---
  - metadata:
-  - name: CAST('18446744073' || '709551615' AS INTEGER)
+  - name: COLUMN_1
      type: integer
    rows:
    - [18446744073709551615]
@@ -645,7 +645,7 @@ box.execute("SELECT CAST('18446744073' || 
'709551615' AS INTEGER);")
  box.execute("SELECT 18446744073709551610 + 5;")
  ---
  - metadata:
-  - name: 18446744073709551610 + 5
+  - name: COLUMN_1
      type: integer
    rows:
    - [18446744073709551615]
@@ -653,7 +653,7 @@ box.execute("SELECT 18446744073709551610 + 5;")
  box.execute("SELECT 18446744073709551615 * 1;")
  ---
  - metadata:
-  - name: 18446744073709551615 * 1
+  - name: COLUMN_1
      type: integer
    rows:
    - [18446744073709551615]
@@ -661,7 +661,7 @@ box.execute("SELECT 18446744073709551615 * 1;")
  box.execute("SELECT 1 / 18446744073709551615;")
  ---
  - metadata:
-  - name: 1 / 18446744073709551615
+  - name: COLUMN_1
      type: integer
    rows:
    - [0]
@@ -669,7 +669,7 @@ box.execute("SELECT 1 / 18446744073709551615;")
  box.execute("SELECT 18446744073709551615 / 18446744073709551615;")
  ---
  - metadata:
-  - name: 18446744073709551615 / 18446744073709551615
+  - name: COLUMN_1
      type: integer
    rows:
    - [1]
@@ -677,7 +677,7 @@ box.execute("SELECT 18446744073709551615 / 
18446744073709551615;")
  box.execute("SELECT 18446744073709551615 / -9223372036854775808;")
  ---
  - metadata:
-  - name: 18446744073709551615 / -9223372036854775808
+  - name: COLUMN_1
      type: integer
    rows:
    - [-1]
@@ -771,7 +771,7 @@ box.execute("INSERT INTO t VALUES (2, -1);")
  box.execute("SELECT sum(i) FROM t;")
  ---
  - metadata:
-  - name: sum(i)
+  - name: COLUMN_1
      type: number
    rows:
    - [18446744073709551613]
@@ -779,7 +779,7 @@ box.execute("SELECT sum(i) FROM t;")
  box.execute("SELECT avg(i) FROM t;")
  ---
  - metadata:
-  - name: avg(i)
+  - name: COLUMN_1
      type: number
    rows:
    - [6148914691236516864]
@@ -787,7 +787,7 @@ box.execute("SELECT avg(i) FROM t;")
  box.execute("SELECT total(i) FROM t;")
  ---
  - metadata:
-  - name: total(i)
+  - name: COLUMN_1
      type: number
    rows:
    - [1.844674407371e+19]
@@ -795,7 +795,7 @@ box.execute("SELECT total(i) FROM t;")
  box.execute("SELECT min(i) FROM t;")
  ---
  - metadata:
-  - name: min(i)
+  - name: COLUMN_1
      type: scalar
    rows:
    - [-1]
@@ -803,7 +803,7 @@ box.execute("SELECT min(i) FROM t;")
  box.execute("SELECT max(i) FROM t;")
  ---
  - metadata:
-  - name: max(i)
+  - name: COLUMN_1
      type: scalar
    rows:
    - [18446744073709551613]
@@ -811,7 +811,7 @@ box.execute("SELECT max(i) FROM t;")
  box.execute("SELECT count(i) FROM t;")
  ---
  - metadata:
-  - name: count(i)
+  - name: COLUMN_1
      type: integer
    rows:
    - [3]
@@ -819,7 +819,7 @@ box.execute("SELECT count(i) FROM t;")
  box.execute("SELECT group_concat(i) FROM t;")
  ---
  - metadata:
-  - name: group_concat(i)
+  - name: COLUMN_1
      type: string
    rows:
    - ['1,-1,18446744073709551613']
@@ -831,7 +831,7 @@ box.execute("DELETE FROM t WHERE i < 
18446744073709551613;")
  box.execute("SELECT lower(i) FROM t;")
  ---
  - metadata:
-  - name: lower(i)
+  - name: COLUMN_1
      type: string
    rows:
    - ['18446744073709551613']
@@ -839,7 +839,7 @@ box.execute("SELECT lower(i) FROM t;")
  box.execute("SELECT upper(i) FROM t;")
  ---
  - metadata:
-  - name: upper(i)
+  - name: COLUMN_1
      type: string
    rows:
    - ['18446744073709551613']
@@ -847,7 +847,7 @@ box.execute("SELECT upper(i) FROM t;")
  box.execute("SELECT abs(i) FROM t;")
  ---
  - metadata:
-  - name: abs(i)
+  - name: COLUMN_1
      type: number
    rows:
    - [18446744073709551613]
@@ -855,7 +855,7 @@ box.execute("SELECT abs(i) FROM t;")
  box.execute("SELECT typeof(i) FROM t;")
  ---
  - metadata:
-  - name: typeof(i)
+  - name: COLUMN_1
      type: string
    rows:
    - ['integer']
@@ -863,7 +863,7 @@ box.execute("SELECT typeof(i) FROM t;")
  box.execute("SELECT quote(i) FROM t;")
  ---
  - metadata:
-  - name: quote(i)
+  - name: COLUMN_1
      type: string
    rows:
    - [18446744073709551613]
@@ -871,7 +871,7 @@ box.execute("SELECT quote(i) FROM t;")
  box.execute("SELECT LEAST(-1, i) FROM t;")
  ---
  - metadata:
-  - name: LEAST(-1, i)
+  - name: COLUMN_1
      type: scalar
    rows:
    - [-1]
@@ -879,7 +879,7 @@ box.execute("SELECT LEAST(-1, i) FROM t;")
  box.execute("SELECT quote(i) FROM t;")
  ---
  - metadata:
-  - name: quote(i)
+  - name: COLUMN_1
      type: string
    rows:
    - [18446744073709551613]
@@ -1012,7 +1012,7 @@ box.space.T1:drop()
  box.execute("SELECT CAST(18446744073709551615 AS NUMBER);")
  ---
  - metadata:
-  - name: CAST(18446744073709551615 AS NUMBER)
+  - name: COLUMN_1
      type: number
    rows:
    - [18446744073709551615]
@@ -1020,7 +1020,7 @@ box.execute("SELECT CAST(18446744073709551615 AS 
NUMBER);")
  box.execute("SELECT CAST(18446744073709551615 AS TEXT);")
  ---
  - metadata:
-  - name: CAST(18446744073709551615 AS TEXT)
+  - name: COLUMN_1
      type: string
    rows:
    - ['18446744073709551615']
@@ -1028,7 +1028,7 @@ box.execute("SELECT CAST(18446744073709551615 AS 
TEXT);")
  box.execute("SELECT CAST(18446744073709551615 AS SCALAR);")
  ---
  - metadata:
-  - name: CAST(18446744073709551615 AS SCALAR)
+  - name: COLUMN_1
      type: scalar
    rows:
    - [18446744073709551615]
@@ -1036,7 +1036,7 @@ box.execute("SELECT CAST(18446744073709551615 AS 
SCALAR);")
  box.execute("SELECT CAST(18446744073709551615 AS BOOLEAN);")
  ---
  - metadata:
-  - name: CAST(18446744073709551615 AS BOOLEAN)
+  - name: COLUMN_1
      type: boolean
    rows:
    - [true]
@@ -1044,7 +1044,7 @@ box.execute("SELECT CAST(18446744073709551615 AS 
BOOLEAN);")
  box.execute("SELECT CAST('18446744073709551615' AS INTEGER);")
  ---
  - metadata:
-  - name: CAST('18446744073709551615' AS INTEGER)
+  - name: COLUMN_1
      type: integer
    rows:
    - [18446744073709551615]
@@ -1077,7 +1077,7 @@ box.execute("SELECT id FROM t1;")
  box.execute("SELECT CAST(123 AS UNSIGNED);")
  ---
  - metadata:
-  - name: CAST(123 AS UNSIGNED)
+  - name: COLUMN_1
      type: unsigned
    rows:
    - [123]
@@ -1090,7 +1090,7 @@ box.execute("SELECT CAST(-123 AS UNSIGNED);")
  box.execute("SELECT CAST(1.5 AS UNSIGNED);")
  ---
  - metadata:
-  - name: CAST(1.5 AS UNSIGNED)
+  - name: COLUMN_1
      type: unsigned
    rows:
    - [1]
@@ -1098,7 +1098,7 @@ box.execute("SELECT CAST(1.5 AS UNSIGNED);")
  box.execute("SELECT CAST(-1.5 AS UNSIGNED);")
  ---
  - metadata:
-  - name: CAST(-1.5 AS UNSIGNED)
+  - name: COLUMN_1
      type: unsigned
    rows:
    - [-1]
@@ -1106,7 +1106,7 @@ box.execute("SELECT CAST(-1.5 AS UNSIGNED);")
  box.execute("SELECT CAST(true AS UNSIGNED);")
  ---
  - metadata:
-  - name: CAST(true AS UNSIGNED)
+  - name: COLUMN_1
      type: unsigned
    rows:
    - [1]
@@ -1114,7 +1114,7 @@ box.execute("SELECT CAST(true AS UNSIGNED);")
  box.execute("SELECT CAST('123' AS UNSIGNED);")
  ---
  - metadata:
-  - name: CAST('123' AS UNSIGNED)
+  - name: COLUMN_1
      type: unsigned
    rows:
    - [123]
@@ -1146,7 +1146,7 @@ box.space.T:drop()
  box.execute("SELECT CASE 1 WHEN 1 THEN x'0000000000' WHEN 2 THEN 'str' 
END")
  ---
  - metadata:
-  - name: CASE 1 WHEN 1 THEN x'0000000000' WHEN 2 THEN 'str' END
+  - name: COLUMN_1
      type: scalar
    rows:
    - ["\0\0\0\0\0"]
@@ -1154,7 +1154,7 @@ box.execute("SELECT CASE 1 WHEN 1 THEN 
x'0000000000' WHEN 2 THEN 'str' END")
  box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 END")
  ---
  - metadata:
-  - name: CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 END
+  - name: COLUMN_1
      type: integer
    rows:
    - [666]
@@ -1162,7 +1162,7 @@ box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 
THEN 123 END")
  box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 ELSE 321 END")
  ---
  - metadata:
-  - name: CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 ELSE 321 END
+  - name: COLUMN_1
      type: integer
    rows:
    - [666]
@@ -1170,7 +1170,7 @@ box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 
THEN 123 ELSE 321 END")
  box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 ELSE 'asd' 
END")
  ---
  - metadata:
-  - name: CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 ELSE 'asd' END
+  - name: COLUMN_1
      type: scalar
    rows:
    - [666]
@@ -1178,8 +1178,7 @@ box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 
THEN 123 ELSE 'asd' END")
  box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' 
THEN 3 WHEN 'd' THEN 4 WHEN 'e' THEN 5 WHEN 'f' THEN 6 END;")
  ---
  - metadata:
-  - name: CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 
'd' THEN 4
-      WHEN 'e' THEN 5 WHEN 'f' THEN 6 END
+  - name: COLUMN_1
      type: integer
    rows:
    - [1]
@@ -1187,8 +1186,7 @@ box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 
'b' THEN 2 WHEN 'c' THEN 3 WHE
  box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' 
THEN 3 WHEN 'd' THEN 4 WHEN 'e' THEN 5 WHEN 'f' THEN 'asd' END;")
  ---
  - metadata:
-  - name: CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 
'd' THEN 4
-      WHEN 'e' THEN 5 WHEN 'f' THEN 'asd' END
+  - name: COLUMN_1
      type: scalar
    rows:
    - [1]
@@ -1196,8 +1194,7 @@ box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 
'b' THEN 2 WHEN 'c' THEN 3 WHE
  box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' 
THEN 3 WHEN 'd' THEN 4 WHEN 'e' THEN 5 WHEN 'f' THEN 6 ELSE 'asd' END;")
  ---
  - metadata:
-  - name: CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 
'd' THEN 4
-      WHEN 'e' THEN 5 WHEN 'f' THEN 6 ELSE 'asd' END
+  - name: COLUMN_1
      type: scalar
    rows:
    - [1]
@@ -1205,8 +1202,7 @@ box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 
'b' THEN 2 WHEN 'c' THEN 3 WHE
  box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' 
THEN 3 WHEN 'd' THEN 4 WHEN 'e' THEN 5 WHEN 'f' THEN 6 ELSE 7 END;")
  ---
  - metadata:
-  - name: CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 
'd' THEN 4
-      WHEN 'e' THEN 5 WHEN 'f' THEN 6 ELSE 7 END
+  - name: COLUMN_1
      type: integer
    rows:
    - [1]
@@ -1284,7 +1280,7 @@ box.execute("SELECT total(v) FROM t;")
  box.execute("SELECT min(v) FROM t;")
  ---
  - metadata:
-  - name: min(v)
+  - name: COLUMN_1
      type: scalar
    rows:
    - ['abc']
@@ -1292,7 +1288,7 @@ box.execute("SELECT min(v) FROM t;")
  box.execute("SELECT max(v) FROM t;")
  ---
  - metadata:
-  - name: max(v)
+  - name: COLUMN_1
      type: scalar
    rows:
    - ['abc']
@@ -1300,7 +1296,7 @@ box.execute("SELECT max(v) FROM t;")
  box.execute("SELECT count(v) FROM t;")
  ---
  - metadata:
-  - name: count(v)
+  - name: COLUMN_1
      type: integer
    rows:
    - [1]
@@ -1308,7 +1304,7 @@ box.execute("SELECT count(v) FROM t;")
  box.execute("SELECT group_concat(v) FROM t;")
  ---
  - metadata:
-  - name: group_concat(v)
+  - name: COLUMN_1
      type: string
    rows:
    - ['abc']
@@ -1331,7 +1327,7 @@ box.execute("SELECT abs(v) FROM t;")
  box.execute("SELECT typeof(v) FROM t;")
  ---
  - metadata:
-  - name: typeof(v)
+  - name: COLUMN_1
      type: string
    rows:
    - ['varbinary']
@@ -1339,7 +1335,7 @@ box.execute("SELECT typeof(v) FROM t;")
  box.execute("SELECT quote(v) FROM t;")
  ---
  - metadata:
-  - name: quote(v)
+  - name: COLUMN_1
      type: string
    rows:
    - ['X''616263''']
@@ -1347,7 +1343,7 @@ box.execute("SELECT quote(v) FROM t;")
  box.execute("SELECT LEAST(v, x'') FROM t;")
  ---
  - metadata:
-  - name: LEAST(v, x'')
+  - name: COLUMN_1
      type: scalar
    rows:
    - ['']
@@ -1467,7 +1463,7 @@ box.execute("SELECT CAST(true AS VARBINARY);")
  box.execute("SELECT CAST('asd' AS VARBINARY);")
  ---
  - metadata:
-  - name: CAST('asd' AS VARBINARY)
+  - name: COLUMN_1
      type: varbinary
    rows:
    - ['asd']
@@ -1475,7 +1471,7 @@ box.execute("SELECT CAST('asd' AS VARBINARY);")
  box.execute("SELECT CAST(x'' AS VARBINARY);")
  ---
  - metadata:
-  - name: CAST(x'' AS VARBINARY)
+  - name: COLUMN_1
      type: varbinary
    rows:
    - ['']
@@ -1494,9 +1490,9 @@ box.execute("INSERT INTO t VALUES (1, 1, 1), (2, 
NULL, NULL);")
  box.execute("SELECT typeof(a), typeof(s) FROM t;")
  ---
  - metadata:
-  - name: typeof(a)
+  - name: COLUMN_1
      type: string
-  - name: typeof(s)
+  - name: COLUMN_2
      type: string
    rows:
    - ['integer', 'integer']
@@ -1513,7 +1509,7 @@ box.execute('INSERT INTO t1 VALUES (1, NULL, NULL);')
  box.execute('SELECT typeof(a & b) FROM t1;')
  ---
  - metadata:
-  - name: typeof(a & b)
+  - name: COLUMN_1
      type: string
    rows:
    - ['integer']
@@ -1521,11 +1517,11 @@ box.execute('SELECT typeof(a & b) FROM t1;')
  box.execute('SELECT typeof(a), typeof(b), typeof(a & b) FROM t1')
  ---
  - metadata:
-  - name: typeof(a)
+  - name: COLUMN_1
      type: string
-  - name: typeof(b)
+  - name: COLUMN_2
      type: string
-  - name: typeof(a & b)
+  - name: COLUMN_3
      type: string
    rows:
    - ['integer', 'integer', 'integer']
@@ -1533,7 +1529,7 @@ box.execute('SELECT typeof(a), typeof(b), typeof(a 
& b) FROM t1')
  box.execute("SELECT typeof(CAST(0 AS UNSIGNED));")
  ---
  - metadata:
-  - name: typeof(CAST(0 AS UNSIGNED))
+  - name: COLUMN_1
      type: string
    rows:
    - ['unsigned']
@@ -1693,7 +1689,7 @@ box.execute('DROP TABLE t1;')
  box.execute("SELECT 1.0;")
  ---
  - metadata:
-  - name: '1.0'
+  - name: COLUMN_1
      type: double
    rows:
    - [1]
@@ -1701,7 +1697,7 @@ box.execute("SELECT 1.0;")
  box.execute("SELECT .01;")
  ---
  - metadata:
-  - name: '.01'
+  - name: COLUMN_1
      type: double
    rows:
    - [0.01]
@@ -1709,7 +1705,7 @@ box.execute("SELECT .01;")
  box.execute("SELECT CAST(1 AS DOUBLE);")
  ---
  - metadata:
-  - name: CAST(1 AS DOUBLE)
+  - name: COLUMN_1
      type: double
    rows:
    - [1]
@@ -1717,7 +1713,7 @@ box.execute("SELECT CAST(1 AS DOUBLE);")
  box.execute("SELECT CAST(1.123 AS DOUBLE);")
  ---
  - metadata:
-  - name: CAST(1.123 AS DOUBLE)
+  - name: COLUMN_1
      type: double
    rows:
    - [1.123]
@@ -1735,7 +1731,7 @@ box.execute("SELECT CAST('asd' AS DOUBLE);")
  box.execute("SELECT CAST('1' AS DOUBLE);")
  ---
  - metadata:
-  - name: CAST('1' AS DOUBLE)
+  - name: COLUMN_1
      type: double
    rows:
    - [1]
@@ -1743,7 +1739,7 @@ box.execute("SELECT CAST('1' AS DOUBLE);")
  box.execute("SELECT CAST('1.123' AS DOUBLE);")
  ---
  - metadata:
-  - name: CAST('1.123' AS DOUBLE)
+  - name: COLUMN_1
      type: double
    rows:
    - [1.123]
@@ -1761,7 +1757,7 @@ box.execute("SELECT CAST(x'35' AS DOUBLE);")
  box.execute("SELECT CAST(CAST(x'35' AS STRING) AS DOUBLE);")
  ---
  - metadata:
-  - name: CAST(CAST(x'35' AS STRING) AS DOUBLE)
+  - name: COLUMN_1
      type: double
    rows:
    - [5]
@@ -1795,7 +1791,7 @@ box.execute('SELECT * FROM t;')
  box.execute('SELECT d / 100 FROM t;')
  ---
  - metadata:
-  - name: d / 100
+  - name: COLUMN_1
      type: double
    rows:
    - [0.1]
@@ -1828,7 +1824,7 @@ box.execute('SELECT * from t WHERE d = 3.3;')
  box.execute("SELECT sum(d) FROM t;")
  ---
  - metadata:
-  - name: sum(d)
+  - name: COLUMN_1
      type: number
    rows:
    - [18000000000000000000]
@@ -1836,7 +1832,7 @@ box.execute("SELECT sum(d) FROM t;")
  box.execute("SELECT avg(d) FROM t;")
  ---
  - metadata:
-  - name: avg(d)
+  - name: COLUMN_1
      type: number
    rows:
    - [4500000000000000000]
@@ -1844,7 +1840,7 @@ box.execute("SELECT avg(d) FROM t;")
  box.execute("SELECT total(d) FROM t;")
  ---
  - metadata:
-  - name: total(d)
+  - name: COLUMN_1
      type: number
    rows:
    - [18000000000000000000]
@@ -1852,7 +1848,7 @@ box.execute("SELECT total(d) FROM t;")
  box.execute("SELECT min(d) FROM t;")
  ---
  - metadata:
-  - name: min(d)
+  - name: COLUMN_1
      type: scalar
    rows:
    - [-2]
@@ -1860,7 +1856,7 @@ box.execute("SELECT min(d) FROM t;")
  box.execute("SELECT max(d) FROM t;")
  ---
  - metadata:
-  - name: max(d)
+  - name: COLUMN_1
      type: scalar
    rows:
    - [18000000000000000000]
@@ -1868,7 +1864,7 @@ box.execute("SELECT max(d) FROM t;")
  box.execute("SELECT count(d) FROM t;")
  ---
  - metadata:
-  - name: count(d)
+  - name: COLUMN_1
      type: integer
    rows:
    - [4]
@@ -1876,7 +1872,7 @@ box.execute("SELECT count(d) FROM t;")
  box.execute("SELECT group_concat(d) FROM t;")
  ---
  - metadata:
-  - name: group_concat(d)
+  - name: COLUMN_1
      type: string
    rows:
    - ['10.0,-2.0,3.3,1.8e+19']
@@ -1884,7 +1880,7 @@ box.execute("SELECT group_concat(d) FROM t;")
  box.execute("SELECT lower(d) FROM t;")
  ---
  - metadata:
-  - name: lower(d)
+  - name: COLUMN_1
      type: string
    rows:
    - ['10.0']
@@ -1895,7 +1891,7 @@ box.execute("SELECT lower(d) FROM t;")
  box.execute("SELECT upper(d) FROM t;")
  ---
  - metadata:
-  - name: upper(d)
+  - name: COLUMN_1
      type: string
    rows:
    - ['10.0']
@@ -1906,7 +1902,7 @@ box.execute("SELECT upper(d) FROM t;")
  box.execute("SELECT abs(d) FROM t;")
  ---
  - metadata:
-  - name: abs(d)
+  - name: COLUMN_1
      type: number
    rows:
    - [10]
@@ -1917,7 +1913,7 @@ box.execute("SELECT abs(d) FROM t;")
  box.execute("SELECT typeof(d) FROM t;")
  ---
  - metadata:
-  - name: typeof(d)
+  - name: COLUMN_1
      type: string
    rows:
    - ['double']
@@ -1928,7 +1924,7 @@ box.execute("SELECT typeof(d) FROM t;")
  box.execute("SELECT quote(d) FROM t;")
  ---
  - metadata:
-  - name: quote(d)
+  - name: COLUMN_1
      type: string
    rows:
    - ['10.0']
@@ -1939,7 +1935,7 @@ box.execute("SELECT quote(d) FROM t;")
  box.execute("SELECT LEAST(d, 0) FROM t;")
  ---
  - metadata:
-  - name: LEAST(d, 0)
+  - name: COLUMN_1
      type: scalar
    rows:
    - [0]
@@ -2081,9 +2077,9 @@ box.execute("DROP TABLE t4;")
  box.execute("SELECT 1.0, typeof(1.0);")
  ---
  - metadata:
-  - name: '1.0'
+  - name: COLUMN_1
      type: double
-  - name: typeof(1.0)
+  - name: COLUMN_2
      type: string
    rows:
    - [1, 'double']
@@ -2091,9 +2087,9 @@ box.execute("SELECT 1.0, typeof(1.0);")
  box.execute("SELECT CAST(2 AS DOUBLE), typeof(CAST(2 AS DOUBLE));")
  ---
  - metadata:
-  - name: CAST(2 AS DOUBLE)
+  - name: COLUMN_1
      type: double
-  - name: typeof(CAST(2 AS DOUBLE))
+  - name: COLUMN_2
      type: string
    rows:
    - [2, 'double']
@@ -2101,9 +2097,9 @@ box.execute("SELECT CAST(2 AS DOUBLE), 
typeof(CAST(2 AS DOUBLE));")
  box.execute("SELECT 3e3, typeof(3e3);")
  ---
  - metadata:
-  - name: '3e3'
+  - name: COLUMN_1
      type: double
-  - name: typeof(3e3)
+  - name: COLUMN_2
      type: string
    rows:
    - [3000, 'double']
@@ -2121,7 +2117,7 @@ box.execute("SELECT d, TYPEOF(d) FROM t5;")
  - metadata:
    - name: D
      type: double
-  - name: TYPEOF(d)
+  - name: COLUMN_1
      type: string
    rows:
    - [4, 'double']


[-- Attachment #2: Type: text/html, Size: 202984 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Tarantool-patches] [PATCH v3 2/2] sql: print span more properly
  2020-06-15 22:18   ` Vladislav Shpilevoy
@ 2020-06-22 21:14     ` roman
  2020-06-23 23:12       ` Vladislav Shpilevoy
  0 siblings, 1 reply; 20+ messages in thread
From: roman @ 2020-06-22 21:14 UTC (permalink / raw)
  To: Vladislav Shpilevoy; +Cc: tarantool-patches

Hi. Thanks for the review.

On 16.06.2020 01:18, Vladislav Shpilevoy wrote:
> Thanks for the patch!
>
> On 11/06/2020 17:18, Roman Khabibov wrote:
>> There were several cases where instead of the correct column
>> span, the column name was printed. Fix this bug.
>>
>> Follow up #3962
> This is rather a follow up for 4407. Because the
> bug was introduced here:
> https://github.com/tarantool/tarantool/commit/f89d65652c3003dd62c18a88b73a8ebbae50aab0#diff-6b3f29fe63589aaefab6b4beb6cb572e
>
> It is not related to auto columns.

commit 623e0ebb8ac53dd1a0c17f45315b15b720cf71ba
Author: Roman Khabibov <roman.habibov@tarantool.org>
Date:   Wed Jun 10 15:03:45 2020 +0300

     sql: print span more properly

     There were several cases where instead of the correct column
     span, the column name was printed. Fix this bug.

     Follow up #4407

diff --git a/src/box/sql/select.c b/src/box/sql/select.c
index 7a56136..2955753 100644
--- a/src/box/sql/select.c
+++ b/src/box/sql/select.c
@@ -1849,7 +1849,7 @@ generate_column_metadata(struct Parse *pParse, 
struct SrcList *pTabList,
                  if (space->sequence != NULL &&
                      space->sequence_fieldno == (uint32_t) iCol)
                      vdbe_metadata_set_col_autoincrement(v, i);
-                if (colname != NULL)
+                if (span != NULL)
                      vdbe_metadata_set_col_span(v, i, span);
              }
          } else {
diff --git a/test/sql/full_metadata.result b/test/sql/full_metadata.result
index 25bac6d..dc1e911 100644
--- a/test/sql/full_metadata.result
+++ b/test/sql/full_metadata.result
@@ -65,7 +65,7 @@ execute("SELECT 'aSd' COLLATE \"unicode_ci\";")
  execute("SELECT c FROM t;")
   | ---
   | - metadata:
- |   - span: C
+ |   - span: c
   |     type: string
   |     is_nullable: true
   |     name: C
@@ -89,16 +89,16 @@ execute("SELECT c COLLATE \"unicode\" FROM t;")
  execute("SELECT id, a, c FROM t;")
   | ---
   | - metadata:
- |   - span: ID
+ |   - span: id
   |     type: integer
   |     is_autoincrement: true
   |     name: ID
   |     is_nullable: false
   |   - type: integer
- |     span: A
+ |     span: a
   |     name: A
   |     is_nullable: false
- |   - span: C
+ |   - span: c
   |     type: string
   |     is_nullable: true
   |     name: C

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Tarantool-patches] [PATCH v3 1/2] sql: use unify pattern for column names
  2020-06-22 21:14     ` roman
@ 2020-06-23 23:12       ` Vladislav Shpilevoy
  2020-06-25 14:35         ` Roman Khabibov
  0 siblings, 1 reply; 20+ messages in thread
From: Vladislav Shpilevoy @ 2020-06-23 23:12 UTC (permalink / raw)
  To: roman; +Cc: tarantool-patches

Hi! Thanks for the patch!

>> 3. What if I specify first column by myself, and the second
>> is an expression? Will it be _1 or _2?
> 
> tarantool>         CREATE TABLE j (column_1 SCALAR PRIMARY KEY);
> ---
> - row_count: 1
> ...
> 
> tarantool>         INSERT INTO j VALUES(1);
> ---
> - row_count: 1
> ...
> 
> tarantool> SELECT column_1, column_1 COLLATE "unicode_ci" FROM j ORDER BY column_1;
> ---
> - metadata:
>   - name: COLUMN_1
>     type: scalar
>   - name: COLUMN_1
>     type: scalar
>   rows:
>   - [1, 1]
> ...
> 
> If we want that the second expression to be named "COLUMN_2". should we use a
> hash table in struct Parse. We will push the names of all columns in the request
> to it and generate names without collisions. I don't now anymore ways.
> I would leave it as it is now.

I didn't say anything about behaviour change. I just asked a simple
question, and I don't see an answer here. I will repeat it: what if
my query contains 2 columns - one normal column name and the second
is an expression. Will the expression be visible as COLUMN_1 or as
COLUMN_2 in the result set?

    SELECT mycol, mycol + 1 FROM test;

Will 'mycol + 1' be stored as COLUMN_1 or COLUMN_2? It is a simple
question to clarify in the documentation request. Because it will be
asked if you don't explicitly say what will happen.

>>> @@ -4951,6 +4951,18 @@ selectExpander(Walker * pWalker, Select * p)
>>>  		       || (pE->pLeft != 0 && pE->pLeft->op == TK_ID));
>>>  		if (pE->op == TK_DOT && pE->pRight->op == TK_ASTERISK)
>>>  			break;
>>> +		/*
>>> +		 * It is necessary to generate auto names for
>>> +		 * expressions before clauses such as ORDER BY,
>>> +		 * GROUP BY will be resolved. These names can be
>>> +		 * found inside these clauses during resolving.
>>> +		 */
>>> +		if (pEList->a[k].zName == NULL && pE->op != TK_DOT &&
>>> +		    ((pE->flags & EP_Leaf) == 0 || pE->op != TK_ID)) {
>>> +			uint32_t idx = ++pParse->autoname_i;
>>> +			pEList->a[k].zName =
>>> +				sqlDbStrDup(db, sql_generate_column_name(idx));
>> 4. I don't think I understand what is happening here. Looks too
>> complicated. Why do you need so many checks, what do these checks
>> mean, how are they related to ORDER BY/GROUP BY? And how is it
>> related to select expansion (the function is called selectExpander())?
>> Why does it work fine when I use normal column names in ORDER BY/GROUP BY,
>> and does not work here without this crutch?
> Here I name all items (generate names) in expression list if it is needed.
> I think this operation can be attributed to "expanding". Expanding is before
> name resolving. At the resolving all items must be named.
> 
> You can use normal column names in ORDER BY, GROUP BY etc, I checked it in Postgre
> (Postgre names expression the same way). I think it is OK.

Can you use auto names in PostgreSQL too? Inside the query. Are they a
full featured column name, or just sugar for result set metadata?

See 5 comments below.

> diff --git a/src/box/sql/select.c b/src/box/sql/select.c
> index 4b069ad..7a56136 100644
> --- a/src/box/sql/select.c
> +++ b/src/box/sql/select.c
> @@ -1989,6 +1987,8 @@ sqlColumnsFromExprList(Parse * parse, ExprList * expr_list,
>              memcpy(space_def->fields[i].name, zName, name_len);
>              space_def->fields[i].name[name_len] = '\0';
>          }
> +        sqlDbFree(db, expr_list->a[i].zName);
> +        expr_list->a[i].zName = zName;

1. I deleted this hunk and nothing changed in the tests. Why do you need it?

>      }
>  cleanup:
>      sqlHashClear(&ht);
> @@ -4792,6 +4792,25 @@ selectPopWith(Walker * pWalker, Select * p)
>      }
>  }
>  
> +/**
> + * Determine whether to generate a name for @a expr or not.
> + *
> + * Auto generated names is needed for every item in  a <SELECT>
> + * expression list except asterisks, dots and column names (also
> + * if this item hasn't alias).
> + *
> + * @param expr Expression from expression list to analyze.
> + *
> + * @retval true/false If item is/isn't needed needed to name.
> + */
> +static bool
> +is_needed_to_name(struct Expr *expr) {

2. We put { on separate line.

> +    if (expr->op != TK_ASTERISK && expr->op != TK_DOT &&
> +        ((expr->flags & EP_Leaf) == 0 || expr->op != TK_ID))
> +        return true;
> +    return false;

3. You could simply return the condition itself. It is a boolean
anyway.

What I don't understand is what is 'leaf'. For example, there is an
expression '1 + 2'. Are 1 and 2 leafs? Is '1 + 2' a leaf? What is a
definition of the leaf here?

> +}
> +
>  /*
>   * This routine is a Walker callback for "expanding" a SELECT statement.
>   * "Expanding" means to do the following:
> @@ -4941,19 +4960,27 @@ selectExpander(Walker * pWalker, Select * p)
>       * all tables.
>       *
>       * The first loop just checks to see if there are any "*" operators
> -     * that need expanding.
> +     * that need expanding and name items of the expression
> +     * list if needed.
>       */
> +    i = pEList->nExpr;
>      for (k = 0; k < pEList->nExpr; k++) {

4. Why do you have 2 iterators now?

>          pE = pEList->a[k].pExpr;
> -        if (pE->op == TK_ASTERISK)
> -            break;
> +        if (pE->op == TK_ASTERISK && i == pEList->nExpr)
> +            i = k;
>          assert(pE->op != TK_DOT || pE->pRight != 0);
>          assert(pE->op != TK_DOT
>                 || (pE->pLeft != 0 && pE->pLeft->op == TK_ID));
> -        if (pE->op == TK_DOT && pE->pRight->op == TK_ASTERISK)
> -            break;
> +        if (pE->op == TK_DOT && pE->pRight->op == TK_ASTERISK  &&
> +            i == pEList->nExpr)
> +            i = k;
> +        if (pEList->a[k].zName == NULL && is_needed_to_name(pE)) {
> +            uint32_t idx = ++pParse->autoname_i;
> +            pEList->a[k].zName =
> +                sqlDbStrDup(db, sql_generate_column_name(idx));
> +        }
>      }
> -    if (k < pEList->nExpr) {
> +    if (i < pEList->nExpr) {
>          /*
>           * If we get here it means the result set contains one or more "*"
>           * operators that need to be expanded.  Loop through each expression

5. I don't see any test for the case when a table contains COLUMN_1, COLUMN_2, etc
columns. As real columns. What will happen with the expression names then? This
should be investigated how is it done in other DBs, and documented in the docbot
request for us. Also probably you may need to ask Peter about it, if the other DBs'
cases don't offer anything good enough to blindly copy.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Tarantool-patches] [PATCH v3 2/2] sql: print span more properly
  2020-06-22 21:14     ` roman
@ 2020-06-23 23:12       ` Vladislav Shpilevoy
  2020-07-02 15:55         ` Roman Khabibov
  0 siblings, 1 reply; 20+ messages in thread
From: Vladislav Shpilevoy @ 2020-06-23 23:12 UTC (permalink / raw)
  To: roman; +Cc: tarantool-patches

Thanks for the patch!

This commit LGTM and can be pushed out of order. You can send it to
Nikita in a separate branch in a new thread, I think. If you want it
in earlier than this branch.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Tarantool-patches] [PATCH v3 1/2] sql: use unify pattern for column names
  2020-06-23 23:12       ` Vladislav Shpilevoy
@ 2020-06-25 14:35         ` Roman Khabibov
  2020-06-25 21:25           ` Vladislav Shpilevoy
  0 siblings, 1 reply; 20+ messages in thread
From: Roman Khabibov @ 2020-06-25 14:35 UTC (permalink / raw)
  To: Vladislav Shpilevoy; +Cc: tarantool-patches

Hi! Thanks for the review.

> On Jun 24, 2020, at 02:12, Vladislav Shpilevoy <v.shpilevoy@tarantool.org> wrote:
> 
> Hi! Thanks for the patch!
> 
>>> 3. What if I specify first column by myself, and the second
>>> is an expression? Will it be _1 or _2?
>> 
>> tarantool>         CREATE TABLE j (column_1 SCALAR PRIMARY KEY);
>> ---
>> - row_count: 1
>> ...
>> 
>> tarantool>         INSERT INTO j VALUES(1);
>> ---
>> - row_count: 1
>> ...
>> 
>> tarantool> SELECT column_1, column_1 COLLATE "unicode_ci" FROM j ORDER BY column_1;
>> ---
>> - metadata:
>>   - name: COLUMN_1
>>     type: scalar
>>   - name: COLUMN_1
>>     type: scalar
>>   rows:
>>   - [1, 1]
>> ...
>> 
>> If we want that the second expression to be named "COLUMN_2". should we use a
>> hash table in struct Parse. We will push the names of all columns in the request
>> to it and generate names without collisions. I don't now anymore ways.
>> I would leave it as it is now.
> 
> I didn't say anything about behaviour change. I just asked a simple
> question, and I don't see an answer here. I will repeat it: what if
> my query contains 2 columns - one normal column name and the second
> is an expression. Will the expression be visible as COLUMN_1 or as
> COLUMN_2 in the result set?
> 
>    SELECT mycol, mycol + 1 FROM test;
> 
> Will 'mycol + 1' be stored as COLUMN_1 or COLUMN_2? It is a simple
> question to clarify in the documentation request. Because it will be
> asked if you don't explicitly say what will happen.
Sorry for misunderstanding. Added to the doc request.

Here, the expression "mycol + 1" generates a new column, so that
it is the first auto generated resulting column will be named as
"COLUMN_1".
```
tarantool> CREATE TABLE test (mycol INT PRIMARY KEY);
---
- row_count: 1
...

tarantool> SELECT mycol, mycol + 1 FROM test;
---
- metadata:
  - name: MYCOL
    type: integer
  - name: COLUMN_1
    type: integer
  rows: []
...
```
Note that you can use generated names already within the query,
e.g. in <ORDER BY> clause.
```
tarantool> SELECT mycol, mycol + 1 FROM test ORDER BY column_1;
---
- metadata:
  - name: MYCOL
    type: integer
  - name: COLUMN_1
    type: integer
  rows: []
...
```

>>>> @@ -4951,6 +4951,18 @@ selectExpander(Walker * pWalker, Select * p)
>>>> 		       || (pE->pLeft != 0 && pE->pLeft->op == TK_ID));
>>>> 		if (pE->op == TK_DOT && pE->pRight->op == TK_ASTERISK)
>>>> 			break;
>>>> +		/*
>>>> +		 * It is necessary to generate auto names for
>>>> +		 * expressions before clauses such as ORDER BY,
>>>> +		 * GROUP BY will be resolved. These names can be
>>>> +		 * found inside these clauses during resolving.
>>>> +		 */
>>>> +		if (pEList->a[k].zName == NULL && pE->op != TK_DOT &&
>>>> +		    ((pE->flags & EP_Leaf) == 0 || pE->op != TK_ID)) {
>>>> +			uint32_t idx = ++pParse->autoname_i;
>>>> +			pEList->a[k].zName =
>>>> +				sqlDbStrDup(db, sql_generate_column_name(idx));
>>> 4. I don't think I understand what is happening here. Looks too
>>> complicated. Why do you need so many checks, what do these checks
>>> mean, how are they related to ORDER BY/GROUP BY? And how is it
>>> related to select expansion (the function is called selectExpander())?
>>> Why does it work fine when I use normal column names in ORDER BY/GROUP BY,
>>> and does not work here without this crutch?
>> Here I name all items (generate names) in expression list if it is needed.
>> I think this operation can be attributed to "expanding". Expanding is before
>> name resolving. At the resolving all items must be named.
>> 
>> You can use normal column names in ORDER BY, GROUP BY etc, I checked it in Postgre
>> (Postgre names expression the same way). I think it is OK.
> 
> Can you use auto names in PostgreSQL too? Inside the query. Are they a
> full featured column name, or just sugar for result set metadata?
I was mistaken, Postgre just puts the same name “?column?”. I used
“?column?” in the query, so that full featured.

CREATE TABLE test_12 (mycol INT PRIMARY KEY)\\
INSERT INTO test_12 VALUES (1)\\
SELECT mycol, mycol + 1 FROM test_12 ORDER BY "?column?"\\

Result:
mycol	?column?
1	2

> See 5 comments below.
> 
>> diff --git a/src/box/sql/select.c b/src/box/sql/select.c
>> index 4b069ad..7a56136 100644
>> --- a/src/box/sql/select.c
>> +++ b/src/box/sql/select.c
>> @@ -1989,6 +1987,8 @@ sqlColumnsFromExprList(Parse * parse, ExprList * expr_list,
>>              memcpy(space_def->fields[i].name, zName, name_len);
>>              space_def->fields[i].name[name_len] = '\0';
>>          }
>> +        sqlDbFree(db, expr_list->a[i].zName);
>> +        expr_list->a[i].zName = zName;
> 
> 1. I deleted this hunk and nothing changed in the tests. Why do you need it?
Dropped.

>>      }
>>  cleanup:
>>      sqlHashClear(&ht);
>> @@ -4792,6 +4792,25 @@ selectPopWith(Walker * pWalker, Select * p)
>>      }
>>  }
>>  
>> +/**
>> + * Determine whether to generate a name for @a expr or not.
>> + *
>> + * Auto generated names is needed for every item in  a <SELECT>
>> + * expression list except asterisks, dots and column names (also
>> + * if this item hasn't alias).
>> + *
>> + * @param expr Expression from expression list to analyze.
>> + *
>> + * @retval true/false If item is/isn't needed needed to name.
>> + */
>> +static bool
>> +is_needed_to_name(struct Expr *expr) {
> 
> 2. We put { on separate line.
> 
>> +    if (expr->op != TK_ASTERISK && expr->op != TK_DOT &&
>> +        ((expr->flags & EP_Leaf) == 0 || expr->op != TK_ID))
>> +        return true;
>> +    return false;
> 
> 3. You could simply return the condition itself. It is a boolean
> anyway.
> 
> What I don't understand is what is 'leaf'. For example, there is an
> expression '1 + 2'. Are 1 and 2 leafs? Is '1 + 2' a leaf? What is a
> definition of the leaf here?
The condition with EP_Leaf was excess. Removed.

@@ -4792,6 +4790,24 @@ selectPopWith(Walker * pWalker, Select * p)
 	}
 }
 
+/**
+ * Determine whether to generate a name for @a expr or not.
+ *
+ * Auto generated names is needed for every item in  a <SELECT>
+ * expression list except asterisks, dots and column names (also
+ * if this item hasn't alias).
+ *
+ * @param expr Expression from expression list to analyze.
+ *
+ * @retval true/false If item is/isn't needed needed to name.
+ */
+static bool
+is_needed_to_name(struct Expr *expr)
+{
+	return (expr->op != TK_ASTERISK && expr->op != TK_DOT && expr->op !=
+		TK_ID);
+}
+

>> +}
>> +
>>  /*
>>   * This routine is a Walker callback for "expanding" a SELECT statement.
>>   * "Expanding" means to do the following:
>> @@ -4941,19 +4960,27 @@ selectExpander(Walker * pWalker, Select * p)
>>       * all tables.
>>       *
>>       * The first loop just checks to see if there are any "*" operators
>> -     * that need expanding.
>> +     * that need expanding and name items of the expression
>> +     * list if needed.
>>       */
>> +    i = pEList->nExpr;
>>      for (k = 0; k < pEList->nExpr; k++) {
> 
> 4. Why do you have 2 iterators now?
Fixed.

@@ -4941,19 +4957,26 @@ selectExpander(Walker * pWalker, Select * p)
 	 * all tables.
 	 *
 	 * The first loop just checks to see if there are any "*" operators
-	 * that need expanding.
+	 * that need expanding and names items of the expression
+	 * list if needed.
 	 */
+	bool has_asterisk = false;
 	for (k = 0; k < pEList->nExpr; k++) {
 		pE = pEList->a[k].pExpr;
 		if (pE->op == TK_ASTERISK)
-			break;
+			has_asterisk = true;
 		assert(pE->op != TK_DOT || pE->pRight != 0);
 		assert(pE->op != TK_DOT
 		       || (pE->pLeft != 0 && pE->pLeft->op == TK_ID));
 		if (pE->op == TK_DOT && pE->pRight->op == TK_ASTERISK)
-			break;
+			has_asterisk = true;
+		if (pEList->a[k].zName == NULL && is_needed_to_name(pE)) {
+			uint32_t idx = ++pParse->autoname_i;
+			pEList->a[k].zName =
+				sqlDbStrDup(db, sql_generate_column_name(idx));
+		}
 	}
-	if (k < pEList->nExpr) {
+	if (has_asterisk) {
 		/*
 		 * If we get here it means the result set contains one or more "*"
 		 * operators that need to be expanded.  Loop through each expression

>>          pE = pEList->a[k].pExpr;
>> -        if (pE->op == TK_ASTERISK)
>> -            break;
>> +        if (pE->op == TK_ASTERISK && i == pEList->nExpr)
>> +            i = k;
>>          assert(pE->op != TK_DOT || pE->pRight != 0);
>>          assert(pE->op != TK_DOT
>>                 || (pE->pLeft != 0 && pE->pLeft->op == TK_ID));
>> -        if (pE->op == TK_DOT && pE->pRight->op == TK_ASTERISK)
>> -            break;
>> +        if (pE->op == TK_DOT && pE->pRight->op == TK_ASTERISK  &&
>> +            i == pEList->nExpr)
>> +            i = k;
>> +        if (pEList->a[k].zName == NULL && is_needed_to_name(pE)) {
>> +            uint32_t idx = ++pParse->autoname_i;
>> +            pEList->a[k].zName =
>> +                sqlDbStrDup(db, sql_generate_column_name(idx));
>> +        }
>>      }
>> -    if (k < pEList->nExpr) {
>> +    if (i < pEList->nExpr) {
>>          /*
>>           * If we get here it means the result set contains one or more "*"
>>           * operators that need to be expanded.  Loop through each expression
> 
> 5. I don't see any test for the case when a table contains COLUMN_1, COLUMN_2, etc
> columns. As real columns. What will happen with the expression names then? This
> should be investigated how is it done in other DBs, and documented in the docbot
> request for us.
MariaDB, Oracle, MySQL use span for naming. I know only one and it is Postgre.
> Also probably you may need to ask Peter about it, if the other DBs'
> cases don't offer anything good enough to blindly copy.

I asked Peter in the ticket.

commit 3fea865c78fcfa2e9b2ff14d38697abd97cd1695
Author: Roman Khabibov <roman.habibov@tarantool.org>
Date:   Thu Mar 5 12:48:58 2020 +0300

    sql: unify pattern for column names
    
    Name resulting columns generated by an expression or <VALUES>
    construction by the "COLUMN_N" pattern.
    
    Closes #3962
    
    @TarantoolBot document
    Title: Column naming in SQL
    
    Now, every auto generated column is named by the "COLUMN_N"
    pattern, where N is the number of generated column in a query
    (starting  from 1). Auto generated column is a column in a query
    result generated by an expression or a column from <VALUES>
    construction.
    
    Examples:
    ```
    box.execute("VALUES(1, 2, 3);")
    ---
    - metadata:
      - name: COLUMN_1
        type: integer
      - name: COLUMN_2
        type: integer
      - name: COLUMN_3
        type: integer
      rows:
      - [1, 2, 3]
    ...
    box.execute("SELECT * FROM (VALUES (1+1, 1+1));")
    ---
    - metadata:
      - name: COLUMN_1
        type: integer
      - name: COLUMN_2
        type: integer
      rows:
      - [2, 2]
    ...
    box.execute("SELECT 1+1, 1+1;")
    ---
    - metadata:
      - name: COLUMN_1
        type: integer
      - name: COLUMN_2
        type: integer
      rows:
      - [2, 2]
    ...
    ```
    
    Here, the expression "mycol + 1" generates a new column, so that
    it is the first auto generated resulting column will be named as
    "COLUMN_1".
    ```
    tarantool> CREATE TABLE test (mycol INT PRIMARY KEY);
    ---
    - row_count: 1
    ...
    
    tarantool> SELECT mycol, mycol + 1 FROM test;
    ---
    - metadata:
      - name: MYCOL
        type: integer
      - name: COLUMN_1
        type: integer
      rows: []
    ...
    ```
    Note that you can use generated names already within the query,
    e.g. in <ORDER BY> clause.
    ```
    tarantool> SELECT mycol, mycol + 1 FROM test ORDER BY column_1;
    ---
    - metadata:
      - name: MYCOL
        type: integer
      - name: COLUMN_1
        type: integer
      rows: []
    ...
    ```
    
    It should also be noted that if you use column names similar to
    the "COLUMN_N" pattern, you can get the same names as a result:
    
    ```
    tarantool> CREATE TABLE test (column_1 SCALAR PRIMARY KEY);
    ---
    - row_count: 1
    ...
    
    tarantool> INSERT INTO test VALUES(1);
    ---
    - row_count: 1
    ...
    
    tarantool> SELECT column_1, column_1 COLLATE "unicode_ci" FROM test;
    ---
    - metadata:
      - name: COLUMN_1
        type: scalar
      - name: COLUMN_1
        type: scalar
      rows:
      - [1, 1]
    ...
    ```

diff --git a/src/box/sql/select.c b/src/box/sql/select.c
index 4b069addb..26c735ed7 100644
--- a/src/box/sql/select.c
+++ b/src/box/sql/select.c
@@ -1854,14 +1854,14 @@ generate_column_metadata(struct Parse *pParse, struct SrcList *pTabList,
 			}
 		} else {
 			const char *z = NULL;
-			if (colname != NULL)
+			if (colname != NULL) {
 				z = colname;
-			else if (span != NULL)
-				z = span;
-			else
-				z = tt_sprintf("column%d", i + 1);
+			} else {
+				uint32_t idx = ++pParse->autoname_i;
+				z = sql_generate_column_name(idx);
+			}
 			vdbe_metadata_set_col_name(v, i, z);
-			if (is_full_meta && colname != NULL)
+			if (is_full_meta)
 				vdbe_metadata_set_col_span(v, i, span);
 		}
 	}
@@ -1897,7 +1897,6 @@ sqlColumnsFromExprList(Parse * parse, ExprList * expr_list,
 	/* Database connection */
 	sql *db = parse->db;
 	u32 cnt;		/* Index added to make the name unique */
-	Expr *p;		/* Expression for a single result column */
 	char *zName;		/* Column name */
 	int nName;		/* Size of name in zName[] */
 	Hash ht;		/* Hash table of column names */
@@ -1929,13 +1928,12 @@ sqlColumnsFromExprList(Parse * parse, ExprList * expr_list,
 	space_def->field_count = column_count;
 
 	for (uint32_t i = 0; i < column_count; i++) {
-		/* Get an appropriate name for the column
+		/*
+		 * Check if the column contains an "AS <name>"
+		 * phrase.
 		 */
-		p = sqlExprSkipCollate(expr_list->a[i].pExpr);
-		if ((zName = expr_list->a[i].zName) != 0) {
-			/* If the column contains an "AS <name>" phrase, use <name> as the name */
-		} else {
-			Expr *pColExpr = p;	/* The expression that is the result column name */
+		if ((zName = expr_list->a[i].zName) == 0) {
+			struct Expr *pColExpr = expr_list->a[i].pExpr;
 			struct space_def *space_def = NULL;
 			while (pColExpr->op == TK_DOT) {
 				pColExpr = pColExpr->pRight;
@@ -1951,14 +1949,14 @@ sqlColumnsFromExprList(Parse * parse, ExprList * expr_list,
 			} else if (pColExpr->op == TK_ID) {
 				assert(!ExprHasProperty(pColExpr, EP_IntValue));
 				zName = pColExpr->u.zToken;
-			} else {
-				/* Use the original text of the column expression as its name */
-				zName = expr_list->a[i].zSpan;
 			}
 		}
-		if (zName == NULL)
-			zName = "_auto_field_";
-		zName = sqlMPrintf(db, "%s", zName);
+		if (zName == NULL) {
+			uint32_t idx = ++parse->autoname_i;
+			zName = sqlDbStrDup(db, sql_generate_column_name(idx));
+		} else {
+			zName = sqlDbStrDup(db, zName);
+		}
 
 		/* Make sure the column name is unique.  If the name is not unique,
 		 * append an integer to the name so that it becomes unique.
@@ -4792,6 +4790,24 @@ selectPopWith(Walker * pWalker, Select * p)
 	}
 }
 
+/**
+ * Determine whether to generate a name for @a expr or not.
+ *
+ * Auto generated names is needed for every item in  a <SELECT>
+ * expression list except asterisks, dots and column names (also
+ * if this item hasn't alias).
+ *
+ * @param expr Expression from expression list to analyze.
+ *
+ * @retval true/false If item is/isn't needed needed to name.
+ */
+static bool
+is_needed_to_name(struct Expr *expr)
+{
+	return (expr->op != TK_ASTERISK && expr->op != TK_DOT && expr->op !=
+		TK_ID);
+}
+
 /*
  * This routine is a Walker callback for "expanding" a SELECT statement.
  * "Expanding" means to do the following:
@@ -4941,19 +4957,26 @@ selectExpander(Walker * pWalker, Select * p)
 	 * all tables.
 	 *
 	 * The first loop just checks to see if there are any "*" operators
-	 * that need expanding.
+	 * that need expanding and names items of the expression
+	 * list if needed.
 	 */
+	bool has_asterisk = false;
 	for (k = 0; k < pEList->nExpr; k++) {
 		pE = pEList->a[k].pExpr;
 		if (pE->op == TK_ASTERISK)
-			break;
+			has_asterisk = true;
 		assert(pE->op != TK_DOT || pE->pRight != 0);
 		assert(pE->op != TK_DOT
 		       || (pE->pLeft != 0 && pE->pLeft->op == TK_ID));
 		if (pE->op == TK_DOT && pE->pRight->op == TK_ASTERISK)
-			break;
+			has_asterisk = true;
+		if (pEList->a[k].zName == NULL && is_needed_to_name(pE)) {
+			uint32_t idx = ++pParse->autoname_i;
+			pEList->a[k].zName =
+				sqlDbStrDup(db, sql_generate_column_name(idx));
+		}
 	}
-	if (k < pEList->nExpr) {
+	if (has_asterisk) {
 		/*
 		 * If we get here it means the result set contains one or more "*"
 		 * operators that need to be expanded.  Loop through each expression
diff --git a/src/box/sql/sqlInt.h b/src/box/sql/sqlInt.h
index 37283e506..adf90d824 100644
--- a/src/box/sql/sqlInt.h
+++ b/src/box/sql/sqlInt.h
@@ -2227,6 +2227,8 @@ struct Parse {
 	TriggerPrg *pTriggerPrg;	/* Linked list of coded triggers */
 	With *pWith;		/* Current WITH clause, or NULL */
 	With *pWithToFree;	/* Free this WITH object at the end of the parse */
+	/** Index of previous auto generated name. */
+	uint32_t autoname_i;
 	/** Space triggers are being coded for. */
 	struct space *triggered_space;
 	/**
@@ -4530,4 +4532,17 @@ void
 sql_setting_set(struct Parse *parse_context, struct Token *name,
 		struct Expr *value);
 
+/**
+ * Return a string of the form "COLUMN_N", where N is @a number.
+ *
+ * We decided to name every auto generated column in output by
+ * this pattern (like PostgreSQL), because it is more convenient
+ * than "_auto_name_" and naming with span like MariaDB do.
+ */
+static inline const char *
+sql_generate_column_name(uint32_t number)
+{
+	return tt_sprintf("COLUMN_%d", number);
+}
+
 #endif				/* sqlINT_H */
diff --git a/test/box/function1.result b/test/box/function1.result
index 905a4cdab..928cd5758 100644
--- a/test/box/function1.result
+++ b/test/box/function1.result
@@ -449,7 +449,7 @@ box.execute('SELECT "function1.divide"(6, 3, 3)')
 box.execute('SELECT "function1.divide"(6, 3)')
 ---
 - metadata:
-  - name: '"function1.divide"(6, 3)'
+  - name: COLUMN_1
     type: number
   rows:
   - [2]
@@ -457,7 +457,7 @@ box.execute('SELECT "function1.divide"(6, 3)')
 box.execute('SELECT "function1.divide"(5, 2)')
 ---
 - metadata:
-  - name: '"function1.divide"(5, 2)'
+  - name: COLUMN_1
     type: number
   rows:
   - [2.5]
@@ -482,7 +482,7 @@ test_run:cmd("setopt delimiter ''");
 box.execute('SELECT summarize(1, 2)')
 ---
 - metadata:
-  - name: summarize(1, 2)
+  - name: COLUMN_1
     type: number
   rows:
   - [3]
@@ -505,7 +505,7 @@ test_run:cmd("setopt delimiter ''");
 box.execute('SELECT summarize(1, 2)')
 ---
 - metadata:
-  - name: summarize(1, 2)
+  - name: COLUMN_1
     type: number
   rows:
   - [3]
@@ -519,7 +519,7 @@ box.func.SUMMARIZE:drop()
 box.execute('SELECT lua(\'return 1 + 1\')')
 ---
 - metadata:
-  - name: lua('return 1 + 1')
+  - name: COLUMN_1
     type: any
   rows:
   - [2]
@@ -537,7 +537,7 @@ box.execute('SELECT lua(\'return box.cfg()\')')
 box.execute('SELECT lua(\'return box.cfg.memtx_memory\')')
 ---
 - metadata:
-  - name: lua('return box.cfg.memtx_memory')
+  - name: COLUMN_1
     type: any
   rows:
   - [107374182]
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
@@ -1,6 +1,6 @@
 #!/usr/bin/env tarantool
 test = require("sqltester")
-test:plan(62)
+test:plan(78)
 
 --!./tcltestrunner.lua
 -- 2008 July 15
@@ -94,7 +94,7 @@ test:do_execsql2_test(
         SELECT +tabc.a, -tabc.b, tabc.c, * FROM tabc
     ]], {
         -- <colname-2.3>
-        "+tabc.a",1,"-tabc.b",-2,"C",3,"A",1,"B",2,"C",3
+        "COLUMN_1",1,"COLUMN_2",-2,"C",3,"A",1,"B",2,"C",3
         -- </colname-2.3>
     })
 
@@ -194,7 +194,7 @@ test:do_execsql2_test(
         SELECT +tabc.a, -tabc.b, tabc.c FROM tabc
     ]], {
         -- <colname-3.3>
-        "+tabc.a", 1, "-tabc.b", -2, "C", 3
+        "COLUMN_1",1,"COLUMN_2",-2,"C",3
         -- </colname-3.3>
     })
 
@@ -314,7 +314,7 @@ test:do_execsql2_test(
         SELECT +tabc.a, -tabc.b, tabc.c FROM tabc
     ]], {
         -- <colname-4.3>
-        "+tabc.a", 1, "-tabc.b", -2, "TABC.C", 3
+        "COLUMN_1",1,"COLUMN_2",-2,"TABC.C",3
         -- </colname-4.3>
     })
 
@@ -635,4 +635,143 @@ test:do_catchsql_test(
     [[ CREATE INDEX t1c ON table1('c'); ]],
     {1, "/Tarantool does not support functional indexes/"})
 
+--
+-- gh-3962: Check auto generated names in different selects.
+--
+test:do_execsql2_test(
+    "colname-12.1",
+    [[
+        VALUES(1, 2, 'aaa');
+    ]], {
+        "COLUMN_1",1,"COLUMN_2",2,"COLUMN_3","aaa"
+    })
+
+test:do_execsql2_test(
+    "colname-12.2",
+    [[
+        SELECT * FROM (VALUES (1+1, 1+1, 'aaa'));
+    ]], {
+        "COLUMN_1",2,"COLUMN_2",2,"COLUMN_3","aaa"
+    })
+
+test:do_execsql2_test(
+    "colname-12.3",
+    [[
+        SELECT 1+1, 1+1, 'aaa';
+    ]], {
+        "COLUMN_1",2,"COLUMN_2",2,"COLUMN_3","aaa"
+    })
+
+test:do_execsql2_test(
+    "colname-12.4",
+    [[
+        SELECT * FROM (SELECT * FROM (VALUES(1, 2, 'aaa'))),
+                      (SELECT * FROM (VALUES(1, 2, 'aaa')))
+    ]], {
+        "COLUMN_1",1,"COLUMN_2",2,"COLUMN_3","aaa","COLUMN_4",1,"COLUMN_5",2,
+        "COLUMN_6","aaa"
+    })
+
+test:do_execsql2_test(
+    "colname-12.5",
+    [[
+        CREATE TABLE j (s1 SCALAR PRIMARY KEY);
+        INSERT INTO j VALUES(1);
+    ]], {})
+
+--
+-- Column named as 'COLUMN_1', because of <COLLATE>.
+--
+test:do_execsql2_test(
+    "colname-12.6",
+    [[
+        SELECT s1 COLLATE "unicode_ci" FROM j;
+    ]], {
+        "COLUMN_1",1
+    })
+
+test:do_execsql2_test(
+    "colname-12.7",
+    [[
+        SELECT s1 COLLATE "unicode_ci" FROM j ORDER BY column_1;
+    ]], {
+        "COLUMN_1",1
+    })
+
+test:do_execsql2_test(
+    "colname-12.8",
+    [[
+        SELECT * FROM (SELECT s1 COLLATE "unicode_ci" FROM j
+                       ORDER BY column_1) ORDER BY column_1;
+    ]], {
+        "COLUMN_1",1
+    })
+
+test:do_execsql2_test(
+    "colname-12.9",
+    [[
+        SELECT s1 COLLATE "unicode_ci" FROM j GROUP BY column_1;
+    ]], {
+        "COLUMN_1",1
+    })
+
+test:do_execsql2_test(
+    "colname-12.10",
+    [[
+        SELECT * FROM (SELECT s1 COLLATE "unicode_ci" FROM j
+                       ORDER BY column_1) GROUP BY column_1;
+    ]], {
+        "COLUMN_1",1
+    })
+
+test:do_execsql2_test(
+    "colname-12.11",
+    [[
+        SELECT * FROM (SELECT s1 COLLATE "unicode_ci" FROM j
+                       ORDER BY column_1) WHERE column_1 = 1;
+    ]], {
+        "COLUMN_1",1
+    })
+
+test:do_execsql2_test(
+    "colname-12.12",
+    [[
+        SELECT *, s1 COLLATE "unicode_ci" FROM j ORDER BY column_1;
+    ]], {
+        "S1",1,"COLUMN_1",1
+    })
+
+test:do_execsql2_test(
+    "colname-12.13",
+    [[
+        SELECT s1 COLLATE "unicode_ci", * FROM j ORDER BY column_1;
+    ]], {
+        "COLUMN_1",1,"S1",1
+    })
+
+test:do_execsql2_test(
+    "colname-12.14",
+    [[
+        CREATE TABLE j_1 (column_1 SCALAR PRIMARY KEY, column_2 SCALAR);
+        INSERT INTO j_1 VALUES(1, 1);
+    ]], {})
+
+test:do_execsql2_test(
+    "colname-12.15",
+    [[
+        SELECT column_1, column_1 COLLATE "unicode_ci", column_2, 1 FROM j_1;
+    ]], {
+        "COLUMN_1",1,"COLUMN_1",1,"COLUMN_2",1,"COLUMN_2",1
+    })
+
+-- <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
+    })
+
 test:finish_test()
diff --git a/test/sql-tap/select1.test.lua b/test/sql-tap/select1.test.lua
index fbebfab37..80e94b019 100755
--- a/test/sql-tap/select1.test.lua
+++ b/test/sql-tap/select1.test.lua
@@ -1032,7 +1032,7 @@ test:do_catchsql2_test(
         SELECT f1+F2 FROM test1 ORDER BY f2
     ]], {
         -- <select1-6.4a>
-        0, {"f1+F2", 33, "f1+F2", 77}
+        0, {"COLUMN_1",33,"COLUMN_1",77}
         -- </select1-6.4a>
     })
 
@@ -1042,7 +1042,7 @@ test:do_catchsql2_test(
         SELECT test1.f1+F2 FROM test1 ORDER BY f2
     ]], {
         -- <select1-6.5>
-        0, {"test1.f1+F2", 33, "test1.f1+F2", 77}
+        0, {"COLUMN_1",33,"COLUMN_1",77}
         -- </select1-6.5>
     })
 
@@ -1059,7 +1059,7 @@ test:do_test(
         return table.insert(v,msg) or v
     end, {
         -- <select1-6.5.1>
-        0, {'test1.f1+F2', 33, 'test1.f1+F2', 77}
+        0, {"COLUMN_1",33,"COLUMN_1",77}
         -- </select1-6.5.1>
     })
 
@@ -1068,7 +1068,7 @@ test:do_catchsql2_test(
     [[SELECT test1.f1+F2, t1 FROM test1, test2 
          ORDER BY f2]], {
         -- <select1-6.6>
-        0, {"test1.f1+F2", 33, "T1", "abc", "test1.f1+F2", 77, "T1", "abc"}
+        0, {"COLUMN_1",33,"T1","abc","COLUMN_1",77,"T1","abc"}
         -- </select1-6.6>
     })
 
@@ -1161,7 +1161,7 @@ test:do_test(
         ]]
     end, {
         -- <select1-6.9.5>
-        "123.45", 123.45
+        "COLUMN_1",123.45
         -- </select1-6.9.5>
     })
 
@@ -1189,7 +1189,8 @@ test:do_test(
         return x
     end, {
         -- <select1-6.9.7>
-        "A.F1", 11, "A.F2", 22, "sql_subquery.5", 5, "sql_subquery.6", 6
+        "A.F1", 11, "A.F2", 22, "sql_subquery.COLUMN_1", 5,
+        "sql_subquery.COLUMN_2", 6
         -- </select1-6.9.7>
     })
 
@@ -1816,7 +1817,7 @@ test:do_execsql2_test(
             SELECT * FROM t3, (SELECT max(a), max(b) FROM t4) as "tx"
         ]], {
             -- <select1-11.14>
-            "ID", 0, "A", "1", "B", "2", "max(a)", 3, "max(b)", "4"
+            "ID", 0, "A", "1", "B", "2", "COLUMN_1", 3, "COLUMN_2", "4"
             -- </select1-11.14>
         })
 
@@ -1826,7 +1827,7 @@ test:do_execsql2_test(
             SELECT y.*, t3.* FROM t3, (SELECT max(a), max(b) FROM t4) AS y
         ]], {
             -- <select1-11.15>
-            "max(a)", 3, "max(b)", "4", "ID", 0, "A", "1", "B", "2"
+            "COLUMN_1", 3, "COLUMN_2", "4", "ID", 0, "A", "1", "B", "2"
             -- </select1-11.15>
         })
 
@@ -1850,7 +1851,7 @@ test:do_execsql2_test(
         SELECT 1+2+3
     ]], {
         -- <select1-12.1>
-        "1+2+3", 6
+        "COLUMN_1",6
         -- </select1-12.1>
     })
 
@@ -1860,7 +1861,7 @@ test:do_execsql2_test(
         SELECT 1,'hello',2
     ]], {
         -- <select1-12.2>
-        '1', 1, "'hello'", "hello", '2', 2
+        "COLUMN_1",1,"COLUMN_2","hello","COLUMN_3",2
         -- </select1-12.2>
     })
 
diff --git a/test/sql-tap/select6.test.lua b/test/sql-tap/select6.test.lua
index c9960dc29..380fd67c1 100755
--- a/test/sql-tap/select6.test.lua
+++ b/test/sql-tap/select6.test.lua
@@ -128,9 +128,9 @@ test:do_execsql_test(
 test:do_execsql_test(
     "select6-1.7",
     [=[
-        SELECT a.y, a."count(*)", "max(x)", "count(*)"
-        FROM (SELECT count(*),y FROM t1 GROUP BY y) AS a,
-             (SELECT max(x),y FROM t1 GROUP BY y) as b
+        SELECT a.y, a.COLUMN_1, COLUMN_2, COLUMN_1
+        FROM (SELECT count(*), y FROM t1 GROUP BY y) AS a,
+             (SELECT max(x), y FROM t1 GROUP BY y) as b
         WHERE a.y=b.y ORDER BY a.y
     ]=], {
         -- <select6-1.7>
@@ -154,9 +154,9 @@ test:do_execsql_test(
 test:do_execsql_test(
     "select6-1.9",
     [=[
-        SELECT q, p, r, b."min(x)+y"
+        SELECT q, p, r, min
         FROM (SELECT count(*) as p , y as q FROM t1 GROUP BY y) AS a,
-             (SELECT max(x) as r, y as s, min(x)+y FROM t1 GROUP BY y) as b
+             (SELECT max(x) as r, y as s, min(x)+y AS min FROM t1 GROUP BY y) as b
         WHERE q=s ORDER BY s
     ]=], {
         -- <select6-1.9>
@@ -247,9 +247,9 @@ test:do_execsql_test(
 test:do_execsql_test(
     "select6-2.7",
     [=[
-        SELECT a.b, a."count(*)", "max(a)", "count(*)"
-        FROM (SELECT count(*),b FROM t2 GROUP BY b) AS a,
-             (SELECT max(a),b FROM t2 GROUP BY b) as b
+        SELECT a.b, a.count, max, count
+        FROM (SELECT count(*) AS count, b FROM t2 GROUP BY b) AS a,
+             (SELECT max(a) AS max, b FROM t2 GROUP BY b) as b
         WHERE a.b=b.b ORDER BY a.b
     ]=], {
         -- <select6-2.7>
@@ -432,8 +432,8 @@ test:do_execsql_test(
 test:do_execsql_test(
     "select6-3.14",
     [=[
-        SELECT "count(*)",y FROM (SELECT count(*), y FROM t1 GROUP BY y)
-        ORDER BY "count(*)"
+        SELECT count, y FROM (SELECT count(*) AS count, y FROM t1 GROUP BY y)
+        ORDER BY count
     ]=], {
         -- <select6-3.14>
         1, 1, 2, 2, 4, 3, 5, 5, 8, 4
@@ -443,7 +443,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "select6-3.15",
     [=[
-        SELECT "count(*)",y FROM (SELECT count(*), y FROM t1 GROUP BY y)
+        SELECT count, y FROM (SELECT count(*) AS count, y FROM t1 GROUP BY y)
         ORDER BY y
     ]=], {
         -- <select6-3.15>
diff --git a/test/sql-tap/view.test.lua b/test/sql-tap/view.test.lua
index e553b91c7..66374e374 100755
--- a/test/sql-tap/view.test.lua
+++ b/test/sql-tap/view.test.lua
@@ -265,7 +265,7 @@ test:do_execsql2_test(
         SELECT * FROM v1 LIMIT 1
     ]], {
         -- <view-3.3.1>
-        "XYZ", 2, "PQR", 7, "c-b", 1
+        "XYZ", 2, "PQR", 7, "COLUMN_1", 1
         -- </view-3.3.1>
     })
 
@@ -276,7 +276,7 @@ test:do_execsql2_test(
         SELECT * FROM v1b LIMIT 1
     ]], {
         -- <view-3.3.2>
-        "A", 2, "b+c", 7, "C", 4
+        "A", 2, "COLUMN_1", 7, "C", 4
         -- </view-3.3.2>
     })
 
diff --git a/test/sql/bind.result b/test/sql/bind.result
index b24094052..cb0302885 100644
--- a/test/sql/bind.result
+++ b/test/sql/bind.result
@@ -77,11 +77,11 @@ execute('SELECT * FROM test WHERE id = :value', parameters)
 execute('SELECT ?, ?, ?', {1, 2, 3})
 ---
 - metadata:
-  - name: '?'
+  - name: COLUMN_1
     type: integer
-  - name: '?'
+  - name: COLUMN_2
     type: integer
-  - name: '?'
+  - name: COLUMN_3
     type: integer
   rows:
   - [1, 2, 3]
@@ -107,11 +107,11 @@ parameters[3][':value1'] = 11
 execute('SELECT ?, :value1, @value2', parameters)
 ---
 - metadata:
-  - name: '?'
+  - name: COLUMN_1
     type: integer
-  - name: :value1
+  - name: COLUMN_2
     type: integer
-  - name: '@value2'
+  - name: COLUMN_3
     type: integer
   rows:
   - [10, 11, 12]
@@ -149,22 +149,22 @@ parameters[6]['@value2'] = 6
 execute('SELECT :value3, ?, :value1, ?, ?, @value2, ?, :value3', parameters)
 ---
 - metadata:
-  - name: :value3
+  - name: COLUMN_1
     type: integer
-  - name: '?'
+  - name: COLUMN_2
     type: integer
-  - name: :value1
+  - name: COLUMN_3
     type: integer
-  - name: '?'
+  - name: COLUMN_4
     type: integer
-  - name: '?'
+  - name: COLUMN_5
     type: integer
-  - name: '@value2'
+  - name: COLUMN_6
     type: integer
-  - name: '?'
+  - name: COLUMN_7
+    type: boolean
+  - name: COLUMN_8
     type: boolean
-  - name: :value3
-    type: integer
   rows:
   - [1, 2, 3, 4, 5, 6, null, 1]
 ...
@@ -175,15 +175,15 @@ msgpack = require('msgpack')
 execute('SELECT ?, ?, ?, ?, ?', {'abc', -123.456, msgpack.NULL, true, false})
 ---
 - metadata:
-  - name: '?'
+  - name: COLUMN_1
     type: text
-  - name: '?'
+  - name: COLUMN_2
     type: numeric
-  - name: '?'
+  - name: COLUMN_3
     type: boolean
-  - name: '?'
+  - name: COLUMN_4
     type: boolean
-  - name: '?'
+  - name: COLUMN_5
     type: boolean
   rows:
   - ['abc', -123.456, null, true, false]
@@ -290,7 +290,7 @@ execute('SELECT :value', parameters)
 execute('SELECT ? ', {18446744073709551615ULL})
 ---
 - metadata:
-  - name: '?'
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551615]
diff --git a/test/sql/boolean.result b/test/sql/boolean.result
index 112e41a12..51ec5820b 100644
--- a/test/sql/boolean.result
+++ b/test/sql/boolean.result
@@ -241,7 +241,7 @@ i > 0
 SELECT return_type(a) FROM t;
  | ---
  | - metadata:
- |   - name: return_type(a)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['boolean']
@@ -250,7 +250,7 @@ SELECT return_type(a) FROM t;
 SELECT return_type('false');
  | ---
  | - metadata:
- |   - name: return_type('false')
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['string']
@@ -258,7 +258,7 @@ SELECT return_type('false');
 SELECT is_boolean(a) FROM t LIMIT 1;
  | ---
  | - metadata:
- |   - name: is_boolean(a)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -266,7 +266,7 @@ SELECT is_boolean(a) FROM t LIMIT 1;
 SELECT is_boolean('true');
  | ---
  | - metadata:
- |   - name: is_boolean('true')
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -281,7 +281,7 @@ SELECT abs(a) FROM t0;
 SELECT lower(a) FROM t0;
  | ---
  | - metadata:
- |   - name: lower(a)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['false']
@@ -292,7 +292,7 @@ SELECT lower(a) FROM t0;
 SELECT upper(a) FROM t0;
  | ---
  | - metadata:
- |   - name: upper(a)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['FALSE']
@@ -303,7 +303,7 @@ SELECT upper(a) FROM t0;
 SELECT quote(a) FROM t0;
  | ---
  | - metadata:
- |   - name: quote(a)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['FALSE']
@@ -315,7 +315,7 @@ SELECT quote(a) FROM t0;
 SELECT length(a) FROM t0;
  | ---
  | - metadata:
- |   - name: length(a)
+ |   - name: COLUMN_1
  |     type: integer
  |   rows:
  |   - [5]
@@ -326,7 +326,7 @@ SELECT length(a) FROM t0;
 SELECT typeof(a) FROM t0;
  | ---
  | - metadata:
- |   - name: typeof(a)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['boolean']
@@ -344,7 +344,7 @@ SELECT AVG(a) FROM t0;
 SELECT MIN(a) FROM t0;
  | ---
  | - metadata:
- |   - name: MIN(a)
+ |   - name: COLUMN_1
  |     type: scalar
  |   rows:
  |   - [false]
@@ -352,7 +352,7 @@ SELECT MIN(a) FROM t0;
 SELECT MAX(a) FROM t0;
  | ---
  | - metadata:
- |   - name: MAX(a)
+ |   - name: COLUMN_1
  |     type: scalar
  |   rows:
  |   - [true]
@@ -365,7 +365,7 @@ SELECT SUM(a) FROM t0;
 SELECT COUNT(a) FROM t0;
  | ---
  | - metadata:
- |   - name: COUNT(a)
+ |   - name: COLUMN_1
  |     type: integer
  |   rows:
  |   - [2]
@@ -378,7 +378,7 @@ SELECT TOTAL(a) FROM t0;
 SELECT GROUP_CONCAT(a, ' +++ ') FROM t0;
  | ---
  | - metadata:
- |   - name: GROUP_CONCAT(a, ' +++ ')
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['FALSE +++ TRUE']
@@ -392,13 +392,13 @@ SELECT GROUP_CONCAT(a, ' +++ ') FROM t0;
 box.execute('SELECT ?, ?, return_type($1), typeof($2);', {true, false})
  | ---
  | - metadata:
- |   - name: '?'
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: '?'
+ |   - name: COLUMN_2
  |     type: boolean
- |   - name: return_type($1)
+ |   - name: COLUMN_3
  |     type: string
- |   - name: typeof($2)
+ |   - name: COLUMN_4
  |     type: string
  |   rows:
  |   - [true, false, 'boolean', 'boolean']
@@ -422,9 +422,9 @@ parameters[2][':value1'] = false
 box.execute('SELECT :value1, @value2;', parameters)
  | ---
  | - metadata:
- |   - name: :value1
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: '@value2'
+ |   - name: COLUMN_2
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -501,9 +501,9 @@ INSERT INTO t3 VALUES (4, false)
 SELECT cast(true AS INTEGER), cast(false AS INTEGER);
  | ---
  | - metadata:
- |   - name: cast(true AS INTEGER)
+ |   - name: COLUMN_1
  |     type: integer
- |   - name: cast(false AS INTEGER)
+ |   - name: COLUMN_2
  |     type: integer
  |   rows:
  |   - [1, 0]
@@ -511,9 +511,9 @@ SELECT cast(true AS INTEGER), cast(false AS INTEGER);
 SELECT cast(true AS NUMBER), cast(false AS NUMBER);
  | ---
  | - metadata:
- |   - name: cast(true AS NUMBER)
+ |   - name: COLUMN_1
  |     type: number
- |   - name: cast(false AS NUMBER)
+ |   - name: COLUMN_2
  |     type: number
  |   rows:
  |   - [1, 0]
@@ -522,9 +522,9 @@ SELECT cast(true AS NUMBER), cast(false AS NUMBER);
 SELECT cast(true AS TEXT), cast(false AS TEXT);
  | ---
  | - metadata:
- |   - name: cast(true AS TEXT)
+ |   - name: COLUMN_1
  |     type: string
- |   - name: cast(false AS TEXT)
+ |   - name: COLUMN_2
  |     type: string
  |   rows:
  |   - ['TRUE', 'FALSE']
@@ -532,9 +532,9 @@ SELECT cast(true AS TEXT), cast(false AS TEXT);
 SELECT cast(true AS BOOLEAN), cast(false AS BOOLEAN);
  | ---
  | - metadata:
- |   - name: cast(true AS BOOLEAN)
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: cast(false AS BOOLEAN)
+ |   - name: COLUMN_2
  |     type: boolean
  |   rows:
  |   - [true, false]
@@ -544,11 +544,11 @@ SELECT cast(true AS BOOLEAN), cast(false AS BOOLEAN);
 SELECT cast(100 AS BOOLEAN), cast(1 AS BOOLEAN), cast(0 AS BOOLEAN);
  | ---
  | - metadata:
- |   - name: cast(100 AS BOOLEAN)
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: cast(1 AS BOOLEAN)
+ |   - name: COLUMN_2
  |     type: boolean
- |   - name: cast(0 AS BOOLEAN)
+ |   - name: COLUMN_3
  |     type: boolean
  |   rows:
  |   - [true, true, false]
@@ -556,9 +556,9 @@ SELECT cast(100 AS BOOLEAN), cast(1 AS BOOLEAN), cast(0 AS BOOLEAN);
 SELECT cast(0.123 AS BOOLEAN), cast(0.0 AS BOOLEAN);
  | ---
  | - metadata:
- |   - name: cast(0.123 AS BOOLEAN)
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: cast(0.0 AS BOOLEAN)
+ |   - name: COLUMN_2
  |     type: boolean
  |   rows:
  |   - [true, false]
@@ -566,9 +566,9 @@ SELECT cast(0.123 AS BOOLEAN), cast(0.0 AS BOOLEAN);
 SELECT cast('true' AS BOOLEAN), cast('false' AS BOOLEAN);
  | ---
  | - metadata:
- |   - name: cast('true' AS BOOLEAN)
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: cast('false' AS BOOLEAN)
+ |   - name: COLUMN_2
  |     type: boolean
  |   rows:
  |   - [true, false]
@@ -576,9 +576,9 @@ SELECT cast('true' AS BOOLEAN), cast('false' AS BOOLEAN);
 SELECT cast('TRUE' AS BOOLEAN), cast('FALSE' AS BOOLEAN);
  | ---
  | - metadata:
- |   - name: cast('TRUE' AS BOOLEAN)
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: cast('FALSE' AS BOOLEAN)
+ |   - name: COLUMN_2
  |     type: boolean
  |   rows:
  |   - [true, false]
@@ -887,7 +887,7 @@ SELECT a, COUNT(*) FROM (SELECT * FROM t4 UNION SELECT * FROM t5) GROUP BY a;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: COUNT(*)
+ |   - name: COLUMN_1
  |     type: integer
  |   rows:
  |   - [false, 3]
@@ -907,7 +907,7 @@ INSERT INTO t6 VALUES (true, false), (false, true);
 SELECT NOT true;
  | ---
  | - metadata:
- |   - name: NOT true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -915,7 +915,7 @@ SELECT NOT true;
 SELECT NOT false;
  | ---
  | - metadata:
- |   - name: NOT false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -925,7 +925,7 @@ SELECT a, NOT a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: NOT a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -935,7 +935,7 @@ SELECT a, NOT a FROM t;
 SELECT true AND true;
  | ---
  | - metadata:
- |   - name: true AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -943,7 +943,7 @@ SELECT true AND true;
 SELECT true AND false;
  | ---
  | - metadata:
- |   - name: true AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -951,7 +951,7 @@ SELECT true AND false;
 SELECT false AND true;
  | ---
  | - metadata:
- |   - name: false AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -959,7 +959,7 @@ SELECT false AND true;
 SELECT false AND false;
  | ---
  | - metadata:
- |   - name: false AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -967,7 +967,7 @@ SELECT false AND false;
 SELECT true OR true;
  | ---
  | - metadata:
- |   - name: true OR true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -975,7 +975,7 @@ SELECT true OR true;
 SELECT true OR false;
  | ---
  | - metadata:
- |   - name: true OR false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -983,7 +983,7 @@ SELECT true OR false;
 SELECT false OR true;
  | ---
  | - metadata:
- |   - name: false OR true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -991,7 +991,7 @@ SELECT false OR true;
 SELECT false OR false;
  | ---
  | - metadata:
- |   - name: false OR false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1002,7 +1002,7 @@ SELECT a, true AND a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true AND a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1013,7 +1013,7 @@ SELECT a, false AND a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false AND a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1024,7 +1024,7 @@ SELECT a, true OR a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true OR a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1035,7 +1035,7 @@ SELECT a, false OR a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false OR a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1046,7 +1046,7 @@ SELECT a, a AND true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1057,7 +1057,7 @@ SELECT a, a AND false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1068,7 +1068,7 @@ SELECT a, a OR true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a OR true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1079,7 +1079,7 @@ SELECT a, a OR false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a OR false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1093,7 +1093,7 @@ SELECT a, a1, a AND a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a AND a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, false]
@@ -1108,7 +1108,7 @@ SELECT a, a1, a OR a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a OR a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, false]
@@ -1622,7 +1622,7 @@ SELECT a1, a2, a2 || a2 FROM t6;
 SELECT true > true;
  | ---
  | - metadata:
- |   - name: true > true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1630,7 +1630,7 @@ SELECT true > true;
 SELECT true > false;
  | ---
  | - metadata:
- |   - name: true > false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -1638,7 +1638,7 @@ SELECT true > false;
 SELECT false > true;
  | ---
  | - metadata:
- |   - name: false > true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1646,7 +1646,7 @@ SELECT false > true;
 SELECT false > false;
  | ---
  | - metadata:
- |   - name: false > false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1654,7 +1654,7 @@ SELECT false > false;
 SELECT true < true;
  | ---
  | - metadata:
- |   - name: true < true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1662,7 +1662,7 @@ SELECT true < true;
 SELECT true < false;
  | ---
  | - metadata:
- |   - name: true < false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1670,7 +1670,7 @@ SELECT true < false;
 SELECT false < true;
  | ---
  | - metadata:
- |   - name: false < true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -1678,7 +1678,7 @@ SELECT false < true;
 SELECT false < false;
  | ---
  | - metadata:
- |   - name: false < false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1689,7 +1689,7 @@ SELECT a, true > a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true > a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1700,7 +1700,7 @@ SELECT a, false > a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false > a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1711,7 +1711,7 @@ SELECT a, true < a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true < a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1722,7 +1722,7 @@ SELECT a, false < a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false < a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1733,7 +1733,7 @@ SELECT a, a > true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a > true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1744,7 +1744,7 @@ SELECT a, a > false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a > false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1755,7 +1755,7 @@ SELECT a, a < true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a < true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1766,7 +1766,7 @@ SELECT a, a < false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a < false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1780,7 +1780,7 @@ SELECT a, a1, a > a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a > a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, false]
@@ -1795,7 +1795,7 @@ SELECT a, a1, a < a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a < a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, false]
@@ -1807,7 +1807,7 @@ SELECT a, a1, a < a1 FROM t, t6;
 SELECT true >= true;
  | ---
  | - metadata:
- |   - name: true >= true
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [true]
@@ -1815,7 +1815,7 @@ SELECT true >= true;
 SELECT true >= false;
  | ---
  | - metadata:
- |   - name: true >= false
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [true]
@@ -1823,7 +1823,7 @@ SELECT true >= false;
 SELECT false >= true;
  | ---
  | - metadata:
- |   - name: false >= true
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [false]
@@ -1831,7 +1831,7 @@ SELECT false >= true;
 SELECT false >= false;
  | ---
  | - metadata:
- |   - name: false >= false
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [true]
@@ -1839,7 +1839,7 @@ SELECT false >= false;
 SELECT true <= true;
  | ---
  | - metadata:
- |   - name: true <= true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -1847,7 +1847,7 @@ SELECT true <= true;
 SELECT true <= false;
  | ---
  | - metadata:
- |   - name: true <= false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1855,7 +1855,7 @@ SELECT true <= false;
 SELECT false <= true;
  | ---
  | - metadata:
- |   - name: false <= true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -1863,7 +1863,7 @@ SELECT false <= true;
 SELECT false <= false;
  | ---
  | - metadata:
- |   - name: false <= false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -1874,7 +1874,7 @@ SELECT a, true >= a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true >= a
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [false, true]
@@ -1885,7 +1885,7 @@ SELECT a, false >= a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false >= a
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [false, true]
@@ -1896,7 +1896,7 @@ SELECT a, true <= a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true <= a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1907,7 +1907,7 @@ SELECT a, false <= a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false <= a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1918,7 +1918,7 @@ SELECT a, a >= true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a >= true
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [false, false]
@@ -1929,7 +1929,7 @@ SELECT a, a >= false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a >= false
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [false, true]
@@ -1940,7 +1940,7 @@ SELECT a, a <= true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a <= true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1951,7 +1951,7 @@ SELECT a, a <= false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a <= false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1965,7 +1965,7 @@ SELECT a, a1, a >= a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a >= a1
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [false, false, true]
@@ -1980,7 +1980,7 @@ SELECT a, a1, a <= a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a <= a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, true]
@@ -1992,7 +1992,7 @@ SELECT a, a1, a <= a1 FROM t, t6;
 SELECT true == true;
  | ---
  | - metadata:
- |   - name: true == true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2000,7 +2000,7 @@ SELECT true == true;
 SELECT true == false;
  | ---
  | - metadata:
- |   - name: true == false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2008,7 +2008,7 @@ SELECT true == false;
 SELECT false == true;
  | ---
  | - metadata:
- |   - name: false == true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2016,7 +2016,7 @@ SELECT false == true;
 SELECT false == false;
  | ---
  | - metadata:
- |   - name: false == false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2024,7 +2024,7 @@ SELECT false == false;
 SELECT true != true;
  | ---
  | - metadata:
- |   - name: true != true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2032,7 +2032,7 @@ SELECT true != true;
 SELECT true != false;
  | ---
  | - metadata:
- |   - name: true != false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2040,7 +2040,7 @@ SELECT true != false;
 SELECT false != true;
  | ---
  | - metadata:
- |   - name: false != true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2048,7 +2048,7 @@ SELECT false != true;
 SELECT false != false;
  | ---
  | - metadata:
- |   - name: false != false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2059,7 +2059,7 @@ SELECT a, true == a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true == a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2070,7 +2070,7 @@ SELECT a, false == a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false == a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2081,7 +2081,7 @@ SELECT a, true != a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true != a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2092,7 +2092,7 @@ SELECT a, false != a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false != a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2103,7 +2103,7 @@ SELECT a, a == true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a == true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2114,7 +2114,7 @@ SELECT a, a == false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a == false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2125,7 +2125,7 @@ SELECT a, a != true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a != true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2136,7 +2136,7 @@ SELECT a, a != false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a != false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2150,7 +2150,7 @@ SELECT a, a1, a == a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a == a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, true]
@@ -2165,7 +2165,7 @@ SELECT a, a1, a != a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a != a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, false]
@@ -2177,7 +2177,7 @@ SELECT a, a1, a != a1 FROM t, t6;
 SELECT true IN (true);
  | ---
  | - metadata:
- |   - name: true IN (true)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2185,7 +2185,7 @@ SELECT true IN (true);
 SELECT false IN (true);
  | ---
  | - metadata:
- |   - name: false IN (true)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2193,7 +2193,7 @@ SELECT false IN (true);
 SELECT true IN (false);
  | ---
  | - metadata:
- |   - name: true IN (false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2201,7 +2201,7 @@ SELECT true IN (false);
 SELECT false IN (false);
  | ---
  | - metadata:
- |   - name: false IN (false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2209,7 +2209,7 @@ SELECT false IN (false);
 SELECT true IN (true, false);
  | ---
  | - metadata:
- |   - name: true IN (true, false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2217,7 +2217,7 @@ SELECT true IN (true, false);
 SELECT false IN (true, false);
  | ---
  | - metadata:
- |   - name: false IN (true, false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2225,7 +2225,7 @@ SELECT false IN (true, false);
 SELECT true IN (SELECT a1 FROM t6);
  | ---
  | - metadata:
- |   - name: true IN (SELECT a1 FROM t6)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2233,7 +2233,7 @@ SELECT true IN (SELECT a1 FROM t6);
 SELECT false IN (SELECT a1 FROM t6);
  | ---
  | - metadata:
- |   - name: false IN (SELECT a1 FROM t6)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2241,7 +2241,7 @@ SELECT false IN (SELECT a1 FROM t6);
 SELECT true IN (SELECT a1 FROM t6 LIMIT 1);
  | ---
  | - metadata:
- |   - name: true IN (SELECT a1 FROM t6 LIMIT 1)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2249,7 +2249,7 @@ SELECT true IN (SELECT a1 FROM t6 LIMIT 1);
 SELECT false IN (SELECT a1 FROM t6 LIMIT 1);
  | ---
  | - metadata:
- |   - name: false IN (SELECT a1 FROM t6 LIMIT 1)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2257,7 +2257,7 @@ SELECT false IN (SELECT a1 FROM t6 LIMIT 1);
 SELECT true IN (1, 1.2, 'true', false);
  | ---
  | - metadata:
- |   - name: true IN (1, 1.2, 'true', false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2265,7 +2265,7 @@ SELECT true IN (1, 1.2, 'true', false);
 SELECT false IN (1, 1.2, 'true', false);
  | ---
  | - metadata:
- |   - name: false IN (1, 1.2, 'true', false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2276,7 +2276,7 @@ SELECT a, a IN (true) FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a IN (true)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2287,7 +2287,7 @@ SELECT a, a IN (false) FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a IN (false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2298,7 +2298,7 @@ SELECT a, a IN (true, false) FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a IN (true, false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2309,7 +2309,7 @@ SELECT a, a IN (SELECT a1 FROM t6 LIMIT 1) FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a IN (SELECT a1 FROM t6 LIMIT 1)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2320,7 +2320,7 @@ SELECT a, a IN (SELECT a1 FROM t6) FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a IN (SELECT a1 FROM t6)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2331,7 +2331,7 @@ SELECT a, a IN (1, 1.2, 'true', false) FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a IN (1, 1.2, 'true', false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2341,7 +2341,7 @@ SELECT a, a IN (1, 1.2, 'true', false) FROM t;
 SELECT true BETWEEN true AND true;
  | ---
  | - metadata:
- |   - name: true BETWEEN true AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2349,7 +2349,7 @@ SELECT true BETWEEN true AND true;
 SELECT false BETWEEN true AND true;
  | ---
  | - metadata:
- |   - name: false BETWEEN true AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2357,7 +2357,7 @@ SELECT false BETWEEN true AND true;
 SELECT true BETWEEN false AND false;
  | ---
  | - metadata:
- |   - name: true BETWEEN false AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2365,7 +2365,7 @@ SELECT true BETWEEN false AND false;
 SELECT false BETWEEN false AND false;
  | ---
  | - metadata:
- |   - name: false BETWEEN false AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2373,7 +2373,7 @@ SELECT false BETWEEN false AND false;
 SELECT true BETWEEN true AND false;
  | ---
  | - metadata:
- |   - name: true BETWEEN true AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2381,7 +2381,7 @@ SELECT true BETWEEN true AND false;
 SELECT false BETWEEN true AND false;
  | ---
  | - metadata:
- |   - name: false BETWEEN true AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2389,7 +2389,7 @@ SELECT false BETWEEN true AND false;
 SELECT true BETWEEN false AND true;
  | ---
  | - metadata:
- |   - name: true BETWEEN false AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2397,7 +2397,7 @@ SELECT true BETWEEN false AND true;
 SELECT false BETWEEN false AND true;
  | ---
  | - metadata:
- |   - name: false BETWEEN false AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2408,7 +2408,7 @@ SELECT a, a BETWEEN true AND true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a BETWEEN true AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2419,7 +2419,7 @@ SELECT a, a BETWEEN false AND false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a BETWEEN false AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2430,7 +2430,7 @@ SELECT a, a BETWEEN true AND false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a BETWEEN true AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2441,7 +2441,7 @@ SELECT a, a BETWEEN false AND true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a BETWEEN false AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2466,7 +2466,7 @@ SELECT true AND 2;
 SELECT false AND 2;
  | ---
  | - metadata:
- |   - name: false AND 2
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2489,7 +2489,7 @@ SELECT 2 AND true;
 SELECT 2 AND false;
  | ---
  | - metadata:
- |   - name: 2 AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2556,7 +2556,7 @@ SELECT b, false AND b FROM t7;
  | - metadata:
  |   - name: B
  |     type: integer
- |   - name: false AND b
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [123, false]
@@ -2581,7 +2581,7 @@ SELECT b, b AND false FROM t7;
  | - metadata:
  |   - name: B
  |     type: integer
- |   - name: b AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [123, false]
@@ -3861,7 +3861,7 @@ SELECT a2, b, b != a2 FROM t6, t7;
 SELECT true IN (0, 1, 2, 3);
  | ---
  | - metadata:
- |   - name: true IN (0, 1, 2, 3)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -3869,7 +3869,7 @@ SELECT true IN (0, 1, 2, 3);
 SELECT false IN (0, 1, 2, 3);
  | ---
  | - metadata:
- |   - name: false IN (0, 1, 2, 3)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -3889,7 +3889,7 @@ SELECT a1, a1 IN (0, 1, 2, 3) FROM t6
  | - metadata:
  |   - name: A1
  |     type: boolean
- |   - name: a1 IN (0, 1, 2, 3)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -3935,7 +3935,7 @@ SELECT true AND 2.3;
 SELECT false AND 2.3;
  | ---
  | - metadata:
- |   - name: false AND 2.3
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -3958,7 +3958,7 @@ SELECT 2.3 AND true;
 SELECT 2.3 AND false;
  | ---
  | - metadata:
- |   - name: 2.3 AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -4025,7 +4025,7 @@ SELECT c, false AND c FROM t8;
  | - metadata:
  |   - name: C
  |     type: number
- |   - name: false AND c
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [4.56, false]
@@ -4050,7 +4050,7 @@ SELECT c, c AND false FROM t8;
  | - metadata:
  |   - name: C
  |     type: number
- |   - name: c AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [4.56, false]
@@ -5006,7 +5006,7 @@ SELECT a2, c, c != a2 FROM t6, t8;
 SELECT true IN (0.1, 1.2, 2.3, 3.4);
  | ---
  | - metadata:
- |   - name: true IN (0.1, 1.2, 2.3, 3.4)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5014,7 +5014,7 @@ SELECT true IN (0.1, 1.2, 2.3, 3.4);
 SELECT false IN (0.1, 1.2, 2.3, 3.4);
  | ---
  | - metadata:
- |   - name: false IN (0.1, 1.2, 2.3, 3.4)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5022,7 +5022,7 @@ SELECT false IN (0.1, 1.2, 2.3, 3.4);
 SELECT a1 IN (0.1, 1.2, 2.3, 3.4) FROM t6 LIMIT 1;
  | ---
  | - metadata:
- |   - name: a1 IN (0.1, 1.2, 2.3, 3.4)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5030,7 +5030,7 @@ SELECT a1 IN (0.1, 1.2, 2.3, 3.4) FROM t6 LIMIT 1;
 SELECT a2 IN (0.1, 1.2, 2.3, 3.4) FROM t6 LIMIT 1;
  | ---
  | - metadata:
- |   - name: a2 IN (0.1, 1.2, 2.3, 3.4)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5095,7 +5095,7 @@ SELECT true AND 'abc';
 SELECT false AND 'abc';
  | ---
  | - metadata:
- |   - name: false AND 'abc'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5118,7 +5118,7 @@ SELECT 'abc' AND true;
 SELECT 'abc' AND false;
  | ---
  | - metadata:
- |   - name: '''abc'' AND false'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5185,7 +5185,7 @@ SELECT d, false AND d FROM t9;
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: false AND d
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['AsdF', false]
@@ -5210,7 +5210,7 @@ SELECT d, d AND false FROM t9;
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: d AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['AsdF', false]
@@ -5470,7 +5470,7 @@ SELECT true AND 'TRUE';
 SELECT false AND 'TRUE';
  | ---
  | - metadata:
- |   - name: false AND 'TRUE'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5493,7 +5493,7 @@ SELECT 'TRUE' AND true;
 SELECT 'TRUE' AND false;
  | ---
  | - metadata:
- |   - name: '''TRUE'' AND false'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5560,7 +5560,7 @@ SELECT d, false AND d FROM t9 WHERE d = 'TRUE';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: false AND d
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['TRUE', false]
@@ -5585,7 +5585,7 @@ SELECT d, d AND false FROM t9 WHERE d = 'TRUE';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: d AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['TRUE', false]
@@ -5650,7 +5650,7 @@ SELECT true AND 'true';
 SELECT false AND 'true';
  | ---
  | - metadata:
- |   - name: false AND 'true'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5673,7 +5673,7 @@ SELECT 'true' AND true;
 SELECT 'true' AND false;
  | ---
  | - metadata:
- |   - name: '''true'' AND false'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5740,7 +5740,7 @@ SELECT d, false AND d FROM t9 WHERE d = 'true';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: false AND d
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['true', false]
@@ -5765,7 +5765,7 @@ SELECT d, d AND false FROM t9 WHERE d = 'true';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: d AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['true', false]
@@ -5830,7 +5830,7 @@ SELECT true AND 'FALSE';
 SELECT false AND 'FALSE';
  | ---
  | - metadata:
- |   - name: false AND 'FALSE'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5853,7 +5853,7 @@ SELECT 'FALSE' AND true;
 SELECT 'FALSE' AND false;
  | ---
  | - metadata:
- |   - name: '''FALSE'' AND false'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5920,7 +5920,7 @@ SELECT d, false AND d FROM t9 WHERE d = 'FALSE';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: false AND d
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['FALSE', false]
@@ -5945,7 +5945,7 @@ SELECT d, d AND false FROM t9 WHERE d = 'FALSE';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: d AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['FALSE', false]
@@ -6010,7 +6010,7 @@ SELECT true AND 'false';
 SELECT false AND 'false';
  | ---
  | - metadata:
- |   - name: false AND 'false'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -6033,7 +6033,7 @@ SELECT 'false' AND true;
 SELECT 'false' AND false;
  | ---
  | - metadata:
- |   - name: '''false'' AND false'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -6100,7 +6100,7 @@ SELECT d, false AND d FROM t9 WHERE d = 'false';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: false AND d
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['false', false]
@@ -6125,7 +6125,7 @@ SELECT d, d AND false FROM t9 WHERE d = 'false';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: d AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['false', false]
diff --git a/test/sql/collation.result b/test/sql/collation.result
index 4e4c27ef0..bfc89e1b8 100644
--- a/test/sql/collation.result
+++ b/test/sql/collation.result
@@ -111,7 +111,7 @@ box.execute([[SELECT descriptor, upper(letter), letter FROM tu where UPPER(lette
 - metadata:
   - name: DESCRIPTOR
     type: string
-  - name: upper(letter)
+  - name: COLUMN_1
     type: string
   - name: LETTER
     type: string
@@ -124,7 +124,7 @@ box.execute([[SELECT descriptor, upper(letter COLLATE "GERMAN"), letter FROM tu
 - metadata:
   - name: DESCRIPTOR
     type: string
-  - name: upper(letter COLLATE "GERMAN")
+  - name: COLUMN_1
     type: string
   - name: LETTER
     type: string
@@ -335,14 +335,14 @@ box.execute("SELECT a FROM t UNION SELECT c FROM t;")
 box.execute("SELECT c COLLATE \"binary\" FROM t UNION SELECT a FROM t;")
 ---
 - metadata:
-  - name: c COLLATE "binary"
+  - name: COLUMN_1
     type: string
   rows: []
 ...
 box.execute("SELECT b COLLATE \"unicode\" FROM t UNION SELECT a FROM t;")
 ---
 - metadata:
-  - name: b COLLATE "unicode"
+  - name: COLUMN_1
     type: string
   rows: []
 ...
@@ -1128,7 +1128,7 @@ box.execute("INSERT INTO jj VALUES (1,'A'), (2,'a')")
 box.execute("SELECT DISTINCT trim(s2) FROM jj;")
 ---
 - metadata:
-  - name: trim(s2)
+  - name: COLUMN_1
     type: string
   rows:
   - ['A']
@@ -1140,7 +1140,7 @@ box.execute("INSERT INTO jj VALUES (3, 'aS'), (4, 'AS');")
 box.execute("SELECT DISTINCT replace(s2, 'S', 's') FROM jj;")
 ---
 - metadata:
-  - name: replace(s2, 'S', 's')
+  - name: COLUMN_1
     type: string
   rows:
   - ['A']
@@ -1149,7 +1149,7 @@ box.execute("SELECT DISTINCT replace(s2, 'S', 's') FROM jj;")
 box.execute("SELECT DISTINCT substr(s2, 1, 1) FROM jj;")
 ---
 - metadata:
-  - name: substr(s2, 1, 1)
+  - name: COLUMN_1
     type: string
   rows:
   - ['A']
diff --git a/test/sql/errinj.result b/test/sql/errinj.result
index 68c001f28..f19203bc6 100644
--- a/test/sql/errinj.result
+++ b/test/sql/errinj.result
@@ -120,7 +120,7 @@ insert_res
 select_res
 ---
 - metadata:
-  - name: '1'
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
diff --git a/test/sql/foreign-keys.result b/test/sql/foreign-keys.result
index f1d973443..33689a06e 100644
--- a/test/sql/foreign-keys.result
+++ b/test/sql/foreign-keys.result
@@ -357,7 +357,7 @@ box.execute('ALTER TABLE tc ADD CONSTRAINT fk1 FOREIGN KEY (id) REFERENCES tp(id
 box.execute('SELECT row_count();')
 ---
 - metadata:
-  - name: row_count()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -374,7 +374,7 @@ box.execute('ALTER TABLE tc DROP CONSTRAINT fk1;')
 box.execute('SELECT row_count();')
 ---
 - metadata:
-  - name: row_count()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
diff --git a/test/sql/full_metadata.result b/test/sql/full_metadata.result
index 5a93c41ec..25bac6d86 100644
--- a/test/sql/full_metadata.result
+++ b/test/sql/full_metadata.result
@@ -57,7 +57,7 @@ execute("SELECT 'aSd' COLLATE \"unicode_ci\";")
  | - metadata:
  |   - type: string
  |     span: '''aSd'' COLLATE "unicode_ci"'
- |     name: '''aSd'' COLLATE "unicode_ci"'
+ |     name: COLUMN_1
  |     collation: unicode_ci
  |   rows:
  |   - ['aSd']
@@ -78,7 +78,7 @@ execute("SELECT c COLLATE \"unicode\" FROM t;")
  | - metadata:
  |   - type: string
  |     span: c COLLATE "unicode"
- |     name: c COLLATE "unicode"
+ |     name: COLUMN_1
  |     collation: unicode
  |   rows:
  |   - ['aSd']
@@ -165,7 +165,7 @@ execute("SELECT *, id + 1 AS x, a AS y, c || 'abc' FROM t;")
  |     is_nullable: false
  |   - type: string
  |     span: c || 'abc'
- |     name: c || 'abc'
+ |     name: COLUMN_1
  |   rows:
  |   - [1, 1, 'aSd', 2, 1, 'aSdabc']
  | ...
@@ -185,8 +185,8 @@ execute("SELECT * FROM v;")
  |     name: Y
  |     is_nullable: false
  |   - type: string
- |     span: c || 'abc'
- |     name: c || 'abc'
+ |     span: COLUMN_1
+ |     name: COLUMN_1
  |   rows:
  |   - [2, 1, 'aSdabc']
  | ...
diff --git a/test/sql/func-recreate.result b/test/sql/func-recreate.result
index 3709df787..5fd2b79c0 100644
--- a/test/sql/func-recreate.result
+++ b/test/sql/func-recreate.result
@@ -48,7 +48,7 @@ test_run:cmd("setopt delimiter ''");
 ch:get()
 ---
 - metadata:
-  - name: WAITFOR(0.2)
+  - name: COLUMN_1
     type: number
   rows:
   - [0.2]
diff --git a/test/sql/gh-3199-no-mem-leaks.result b/test/sql/gh-3199-no-mem-leaks.result
index d8590779a..6ce8df436 100644
--- a/test/sql/gh-3199-no-mem-leaks.result
+++ b/test/sql/gh-3199-no-mem-leaks.result
@@ -32,7 +32,7 @@ box.execute('SELECT x, y, x + y FROM test ORDER BY y')
     type: integer
   - name: Y
     type: integer
-  - name: x + y
+  - name: COLUMN_1
     type: integer
   rows:
   - [1, 1, 2]
@@ -49,7 +49,7 @@ box.execute('SELECT x, y, x + y FROM test ORDER BY y')
     type: integer
   - name: Y
     type: integer
-  - name: x + y
+  - name: COLUMN_1
     type: integer
   rows:
   - [1, 1, 2]
@@ -62,7 +62,7 @@ box.execute('SELECT x, y, x + y FROM test ORDER BY y')
     type: integer
   - name: Y
     type: integer
-  - name: x + y
+  - name: COLUMN_1
     type: integer
   rows:
   - [1, 1, 2]
@@ -75,7 +75,7 @@ box.execute('SELECT x, y, x + y FROM test ORDER BY y')
     type: integer
   - name: Y
     type: integer
-  - name: x + y
+  - name: COLUMN_1
     type: integer
   rows:
   - [1, 1, 2]
@@ -88,7 +88,7 @@ box.execute('SELECT x, y, x + y FROM test ORDER BY y')
     type: integer
   - name: Y
     type: integer
-  - name: x + y
+  - name: COLUMN_1
     type: integer
   rows:
   - [1, 1, 2]
@@ -115,7 +115,7 @@ box.execute('SELECT a, id + 2, b FROM test2 WHERE b < id * 2 ORDER BY a ')
 - metadata:
   - name: A
     type: string
-  - name: id + 2
+  - name: COLUMN_1
     type: integer
   - name: B
     type: integer
@@ -134,7 +134,7 @@ box.execute('SELECT a, id + 2 * b, a FROM test2 WHERE b < id * 2 ORDER BY a ')
 - metadata:
   - name: A
     type: string
-  - name: id + 2 * b
+  - name: COLUMN_1
     type: integer
   - name: A
     type: string
@@ -149,7 +149,7 @@ box.execute('SELECT a, id + 2 * b, a FROM test2 WHERE b < id * 2 ORDER BY a ')
 - metadata:
   - name: A
     type: string
-  - name: id + 2 * b
+  - name: COLUMN_1
     type: integer
   - name: A
     type: string
@@ -164,7 +164,7 @@ box.execute('SELECT a, id + 2 * b, a FROM test2 WHERE b < id * 2 ORDER BY a ')
 - metadata:
   - name: A
     type: string
-  - name: id + 2 * b
+  - name: COLUMN_1
     type: integer
   - name: A
     type: string
@@ -183,7 +183,7 @@ box.execute('SELECT x, y + 3 * b, b FROM test2, test WHERE b = x')
 - metadata:
   - name: X
     type: integer
-  - name: y + 3 * b
+  - name: COLUMN_1
     type: integer
   - name: B
     type: integer
@@ -196,7 +196,7 @@ box.execute('SELECT x, y + 3 * b, b FROM test2, test WHERE b = x')
 - metadata:
   - name: X
     type: integer
-  - name: y + 3 * b
+  - name: COLUMN_1
     type: integer
   - name: B
     type: integer
@@ -209,7 +209,7 @@ box.execute('SELECT x, y + 3 * b, b FROM test2, test WHERE b = x')
 - metadata:
   - name: X
     type: integer
-  - name: y + 3 * b
+  - name: COLUMN_1
     type: integer
   - name: B
     type: integer
diff --git a/test/sql/gh-3888-values-blob-assert.result b/test/sql/gh-3888-values-blob-assert.result
index 0a1af28f2..669f2eb2f 100644
--- a/test/sql/gh-3888-values-blob-assert.result
+++ b/test/sql/gh-3888-values-blob-assert.result
@@ -51,7 +51,7 @@ box.execute('SELECT TheColumnName')
 box.execute('VALUES(-0.5e-2)')
 ---
 - metadata:
-  - name: column1
+  - name: COLUMN_1
     type: double
   rows:
   - [-0.005]
@@ -59,7 +59,7 @@ box.execute('VALUES(-0.5e-2)')
 box.execute('SELECT X\'507265766564\'')
 ---
 - metadata:
-  - name: X'507265766564'
+  - name: COLUMN_1
     type: varbinary
   rows:
   - ['Preved']
@@ -68,7 +68,7 @@ box.execute('SELECT X\'507265766564\'')
 box.execute('SELECT 3.14')
 ---
 - metadata:
-  - name: '3.14'
+  - name: COLUMN_1
     type: double
   rows:
   - [3.14]
@@ -76,7 +76,7 @@ box.execute('SELECT 3.14')
 box.execute('SELECT X\'4D6564766564\'')
 ---
 - metadata:
-  - name: X'4D6564766564'
+  - name: COLUMN_1
     type: varbinary
   rows:
   - ['Medved']
diff --git a/test/sql/gh-4697-scalar-bool-sort-cmp.result b/test/sql/gh-4697-scalar-bool-sort-cmp.result
index 2423cd894..6f7fbd62b 100644
--- a/test/sql/gh-4697-scalar-bool-sort-cmp.result
+++ b/test/sql/gh-4697-scalar-bool-sort-cmp.result
@@ -30,7 +30,7 @@ SELECT s2, typeof(s2) FROM test ORDER BY s2;
  | - metadata:
  |   - name: S2
  |     type: scalar
- |   - name: typeof(s2)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - [null, 'boolean']
@@ -43,7 +43,7 @@ SELECT s3, typeof(s3) FROM test ORDER BY s3;
  | - metadata:
  |   - name: S3
  |     type: scalar
- |   - name: typeof(s3)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - [null, 'boolean']
diff --git a/test/sql/icu-upper-lower.result b/test/sql/icu-upper-lower.result
index f7b9dfa38..3ecc07d94 100644
--- a/test/sql/icu-upper-lower.result
+++ b/test/sql/icu-upper-lower.result
@@ -23,11 +23,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Zəfər, jaketini də, papağını da götür, bu axşam hava çox soyuq
-      olacaq. ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Zəfər, jaketini də, papağını da götür, bu axşam hava çox soyuq
-      olacaq. ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     zəfər, jaketini də, papağını da götür, bu axşam hava çox soyuq olacaq. ',
@@ -38,9 +36,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     The quick brown fox jumps over the lazy dog. ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     The quick brown fox jumps over the lazy dog. ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     the quick brown fox jumps over the lazy dog. ', '     THE QUICK BROWN FOX
@@ -52,9 +50,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     The quick brown fox jumps over the lazy dog. ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     The quick brown fox jumps over the lazy dog. ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     the quick brown fox jumps over the lazy dog. ', '     THE QUICK BROWN FOX
@@ -66,11 +64,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Բել դղյակի ձախ ժամն օֆ ազգությանը ցպահանջ չճշտած վնաս էր եւ
-      փառք ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Բել դղյակի ձախ ժամն օֆ ազգությանը ցպահանջ չճշտած վնաս էր եւ
-      փառք ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     բել դղյակի ձախ ժամն օֆ ազգությանը ցպահանջ չճշտած վնաս էր եւ փառք ', '     ԲԵԼ
@@ -82,11 +78,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     У Іўі худы жвавы чорт у зялёнай камізэльцы пабег пад’есці фаршу
-      з юшкай ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     У Іўі худы жвавы чорт у зялёнай камізэльцы пабег пад’есці фаршу
-      з юшкай ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     у іўі худы жвавы чорт у зялёнай камізэльцы пабег пад’есці фаршу з юшкай ',
@@ -98,11 +92,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός
-      ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός
-      ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός ', '     ΤΆΧΙΣΤΗ
@@ -114,11 +106,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Chuaigh bé mhórshách le dlúthspád fíorfhinn trí hata mo dhea-phorcáin
-      bhig ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Chuaigh bé mhórshách le dlúthspád fíorfhinn trí hata mo dhea-phorcáin
-      bhig ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     chuaigh bé mhórshách le dlúthspád fíorfhinn trí hata mo dhea-phorcáin bhig ',
@@ -130,9 +120,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Quiere la boca exhausta vid, kiwi, piña y fugaz jamón ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Quiere la boca exhausta vid, kiwi, piña y fugaz jamón ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     quiere la boca exhausta vid, kiwi, piña y fugaz jamón ', '     QUIERE LA
@@ -144,9 +134,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     키스의 고유조건은 입술끼리 만나야 하고 특별한 기술은 필요치 않다 ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     키스의 고유조건은 입술끼리 만나야 하고 특별한 기술은 필요치 않다 ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     키스의 고유조건은 입술끼리 만나야 하고 특별한 기술은 필요치 않다 ', '     키스의 고유조건은 입술끼리 만나야 하고 특별한
@@ -158,9 +148,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Glāžšķūņa rūķīši dzērumā čiepj Baha koncertflīģeļu vākus ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Glāžšķūņa rūķīši dzērumā čiepj Baha koncertflīģeļu vākus ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     glāžšķūņa rūķīši dzērumā čiepj baha koncertflīģeļu vākus ', '     GLĀŽŠĶŪŅA
@@ -172,11 +162,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Zwölf große Boxkämpfer jagen Viktor quer über den Sylter Deich
-      ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Zwölf große Boxkämpfer jagen Viktor quer über den Sylter Deich
-      ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     zwölf große boxkämpfer jagen viktor quer über den sylter deich ', '     ZWÖLF
@@ -188,9 +176,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Pchnąć w tę łódź jeża lub ośm skrzyń fig. ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Pchnąć w tę łódź jeża lub ośm skrzyń fig. ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     pchnąć w tę łódź jeża lub ośm skrzyń fig. ', '     PCHNĄĆ W TĘ ŁÓDŹ JEŻA
@@ -202,9 +190,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Чуєш їх, доцю, га? Кумедна ж ти, прощайся без ґольфів! ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Чуєш їх, доцю, га? Кумедна ж ти, прощайся без ґольфів! ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     чуєш їх, доцю, га? кумедна ж ти, прощайся без ґольфів! ', '     ЧУЄШ ЇХ,
@@ -216,9 +204,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Příliš žluťoučký kůň úpěl ďábelské ódy ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Příliš žluťoučký kůň úpěl ďábelské ódy ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     příliš žluťoučký kůň úpěl ďábelské ódy ', '     PŘÍLIŠ ŽLUŤOUČKÝ KŮŇ ÚPĚL
@@ -230,11 +218,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Laŭ Ludoviko Zamenhof bongustas freŝa ĉeĥa manĝaĵo kun spicoj
-      ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Laŭ Ludoviko Zamenhof bongustas freŝa ĉeĥa manĝaĵo kun spicoj
-      ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     laŭ ludoviko zamenhof bongustas freŝa ĉeĥa manĝaĵo kun spicoj ', '     LAŬ
@@ -246,9 +232,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     いろはにほへと ちりぬるを わかよたれそ つねならむ うゐのおくやま けふこえて あさきゆめみし ゑひもせす ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     いろはにほへと ちりぬるを わかよたれそ つねならむ うゐのおくやま けふこえて あさきゆめみし ゑひもせす ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     いろはにほへと ちりぬるを わかよたれそ つねならむ うゐのおくやま けふこえて あさきゆめみし ゑひもせす ', '     いろはにほへと
@@ -260,9 +246,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: 'lower(''     Pijamalı hasta yağız şoföre çabucak güvendi. EXTRA: İ '')'
+  - name: COLUMN_1
     type: string
-  - name: 'upper(''     Pijamalı hasta yağız şoföre çabucak güvendi. EXTRA: İ '')'
+  - name: COLUMN_2
     type: string
   rows:
   - ['     pijamalı hasta yağız şoföre çabucak güvendi. extra: i̇ ', '     PIJAMALI
diff --git a/test/sql/integer-overflow.result b/test/sql/integer-overflow.result
index 6269cb547..a56fb2412 100644
--- a/test/sql/integer-overflow.result
+++ b/test/sql/integer-overflow.result
@@ -19,7 +19,7 @@ box.execute('SELECT (2147483647 * 2147483647 * 2147483647);')
 box.execute('SELECT (-9223372036854775808 / -1);')
 ---
 - metadata:
-  - name: (-9223372036854775808 / -1)
+  - name: COLUMN_1
     type: integer
   rows:
   - [9223372036854775808]
@@ -32,7 +32,7 @@ box.execute('SELECT (-9223372036854775808 - 1);')
 box.execute('SELECT (9223372036854775807 + 1);')
 ---
 - metadata:
-  - name: (9223372036854775807 + 1)
+  - name: COLUMN_1
     type: integer
   rows:
   - [9223372036854775808]
@@ -50,7 +50,7 @@ box.execute('SELECT 18446744073709551615 * 2;')
 box.execute('SELECT (-9223372036854775807 * (-2));')
 ---
 - metadata:
-  - name: (-9223372036854775807 * (-2))
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551614]
@@ -60,7 +60,7 @@ box.execute('SELECT (-9223372036854775807 * (-2));')
 box.execute('SELECT 9223372036854775808;')
 ---
 - metadata:
-  - name: '9223372036854775808'
+  - name: COLUMN_1
     type: integer
   rows:
   - [9223372036854775808]
@@ -74,7 +74,7 @@ box.execute('SELECT -9223372036854775809;')
 box.execute('SELECT 9223372036854775808 - 1;')
 ---
 - metadata:
-  - name: 9223372036854775808 - 1
+  - name: COLUMN_1
     type: integer
   rows:
   - [9223372036854775807]
@@ -82,7 +82,7 @@ box.execute('SELECT 9223372036854775808 - 1;')
 box.execute('SELECT 18446744073709551615;')
 ---
 - metadata:
-  - name: '18446744073709551615'
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551615]
@@ -98,7 +98,7 @@ box.execute('SELECT 18446744073709551616;')
 box.execute('SELECT CAST(\'9223372036854775808\' AS INTEGER);')
 ---
 - metadata:
-  - name: CAST('9223372036854775808' AS INTEGER)
+  - name: COLUMN_1
     type: integer
   rows:
   - [9223372036854775808]
diff --git a/test/sql/iproto.result b/test/sql/iproto.result
index 44ba499a0..ee1047fc1 100644
--- a/test/sql/iproto.result
+++ b/test/sql/iproto.result
@@ -372,11 +372,11 @@ parameters[3] = 33
 cn:execute('select $2, $1, $3', parameters)
 ---
 - metadata:
-  - name: $2
+  - name: COLUMN_1
     type: integer
-  - name: $1
+  - name: COLUMN_2
     type: integer
-  - name: $3
+  - name: COLUMN_3
     type: integer
   rows:
   - [22, 11, 33]
@@ -736,7 +736,7 @@ res.metadata
 cn:execute("SELECT zeroblob(1);")
 ---
 - metadata:
-  - name: zeroblob(1)
+  - name: COLUMN_1
     type: varbinary
   rows:
   - ["\0"]
@@ -749,7 +749,7 @@ res = cn:execute("SELECT randomblob(1);")
 ...
 res.metadata
 ---
-- - name: randomblob(1)
+- - name: COLUMN_1
     type: varbinary
 ...
 -- Type set during compilation stage, and since min/max are accept
@@ -759,7 +759,7 @@ res.metadata
 cn:execute("SELECT LEAST(1, 2, 3);")
 ---
 - metadata:
-  - name: LEAST(1, 2, 3)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [1]
@@ -767,7 +767,7 @@ cn:execute("SELECT LEAST(1, 2, 3);")
 cn:execute("SELECT GREATEST(1, 2, 3);")
 ---
 - metadata:
-  - name: GREATEST(1, 2, 3)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [3]
@@ -803,7 +803,7 @@ s = box.prepare([[ SELECT ?; ]])
 s:execute({42})
 ---
 - metadata:
-  - name: '?'
+  - name: COLUMN_1
     type: integer
   rows:
   - [42]
@@ -811,7 +811,7 @@ s:execute({42})
 box.execute('SELECT 1;')
 ---
 - metadata:
-  - name: '1'
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
diff --git a/test/sql/max-on-index.result b/test/sql/max-on-index.result
index 1cd488f85..a90f30993 100644
--- a/test/sql/max-on-index.result
+++ b/test/sql/max-on-index.result
@@ -48,7 +48,7 @@ box.execute("INSERT INTO test2 VALUES(1, 2)");
 box.execute("SELECT MAX(f1) FROM test1")
 ---
 - metadata:
-  - name: MAX(f1)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [4]
@@ -56,7 +56,7 @@ box.execute("SELECT MAX(f1) FROM test1")
 box.execute("SELECT MAX(f2) FROM test1")
 ---
 - metadata:
-  - name: MAX(f2)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [3]
@@ -64,7 +64,7 @@ box.execute("SELECT MAX(f2) FROM test1")
 box.execute("SELECT MAX(f1) FROM test2")
 ---
 - metadata:
-  - name: MAX(f1)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [1]
diff --git a/test/sql/misc.result b/test/sql/misc.result
index 0190a5897..6af11bfba 100644
--- a/test/sql/misc.result
+++ b/test/sql/misc.result
@@ -11,7 +11,7 @@ _ = box.space._session_settings:update('sql_default_engine', {{'=', 2, engine}})
 box.execute('select 1;')
 ---
 - metadata:
-  - name: '1'
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -78,7 +78,7 @@ box.execute('CREATE TABLE test (id INTEGER PRIMARY KEY, b TEXT CONSTRAINT c1 COL
 box.execute('SELECT 1;')
 ---
 - metadata:
-  - name: '1'
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -86,7 +86,7 @@ box.execute('SELECT 1;')
 box.execute('SELECT 1.5;')
 ---
 - metadata:
-  - name: '1.5'
+  - name: COLUMN_1
     type: double
   rows:
   - [1.5]
@@ -94,7 +94,7 @@ box.execute('SELECT 1.5;')
 box.execute('SELECT 1.0;')
 ---
 - metadata:
-  - name: '1.0'
+  - name: COLUMN_1
     type: double
   rows:
   - [1]
@@ -102,7 +102,7 @@ box.execute('SELECT 1.0;')
 box.execute('SELECT \'abc\';')
 ---
 - metadata:
-  - name: '''abc'''
+  - name: COLUMN_1
     type: string
   rows:
   - ['abc']
@@ -110,7 +110,7 @@ box.execute('SELECT \'abc\';')
 box.execute('SELECT X\'4D6564766564\'')
 ---
 - metadata:
-  - name: X'4D6564766564'
+  - name: COLUMN_1
     type: varbinary
   rows:
   - ['Medved']
diff --git a/test/sql/persistency.result b/test/sql/persistency.result
index 6d14d4c4e..95dde5714 100644
--- a/test/sql/persistency.result
+++ b/test/sql/persistency.result
@@ -41,9 +41,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -57,9 +57,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar LIMIT 2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -72,9 +72,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo=2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['bar', 2, 42, 'awesome']
@@ -86,9 +86,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo>2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foobar', 1000, 42, 'awesome']
@@ -100,9 +100,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo>=2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['bar', 2, 42, 'awesome']
@@ -115,9 +115,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo=10000")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows: []
 ...
@@ -128,9 +128,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo>10000")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows: []
 ...
@@ -141,9 +141,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -155,9 +155,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<2.001")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -170,9 +170,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<=2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -185,9 +185,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<100")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -200,9 +200,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE bar='foo'")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -210,7 +210,7 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE bar='foo'")
 box.execute("SELECT count(*) FROM foobar")
 ---
 - metadata:
-  - name: count(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -218,7 +218,7 @@ box.execute("SELECT count(*) FROM foobar")
 box.execute("SELECT count(*) FROM foobar WHERE bar='foo'")
 ---
 - metadata:
-  - name: count(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -230,9 +230,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar ORDER BY bar")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['bar', 2, 42, 'awesome']
@@ -246,9 +246,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar ORDER BY bar DESC")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foobar', 1000, 42, 'awesome']
@@ -263,7 +263,7 @@ box.execute("REPLACE INTO foobar VALUES (1, 'cacodaemon')")
 box.execute("SELECT COUNT(*) FROM foobar WHERE foo=1")
 ---
 - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -271,7 +271,7 @@ box.execute("SELECT COUNT(*) FROM foobar WHERE foo=1")
 box.execute("SELECT COUNT(*) FROM foobar WHERE bar='cacodaemon'")
 ---
 - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -283,7 +283,7 @@ box.execute("DELETE FROM foobar WHERE bar='cacodaemon'")
 box.execute("SELECT COUNT(*) FROM foobar WHERE bar='cacodaemon'")
 ---
 - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
diff --git a/test/sql/prepared.result b/test/sql/prepared.result
index 666f6e1d3..0db2cc03f 100644
--- a/test/sql/prepared.result
+++ b/test/sql/prepared.result
@@ -425,13 +425,13 @@ s = prepare("SELECT count(*), count(a - 3), max(b), abs(id) FROM test WHERE b =
 execute(s.stmt_id)
  | ---
  | - metadata:
- |   - name: count(*)
+ |   - name: COLUMN_1
  |     type: integer
- |   - name: count(a - 3)
+ |   - name: COLUMN_2
  |     type: integer
- |   - name: max(b)
+ |   - name: COLUMN_3
  |     type: scalar
- |   - name: abs(id)
+ |   - name: COLUMN_4
  |     type: number
  |   rows:
  |   - [1, 1, '3', 1]
@@ -439,13 +439,13 @@ execute(s.stmt_id)
 execute(s.stmt_id)
  | ---
  | - metadata:
- |   - name: count(*)
+ |   - name: COLUMN_1
  |     type: integer
- |   - name: count(a - 3)
+ |   - name: COLUMN_2
  |     type: integer
- |   - name: max(b)
+ |   - name: COLUMN_3
  |     type: scalar
- |   - name: abs(id)
+ |   - name: COLUMN_4
  |     type: number
  |   rows:
  |   - [1, 1, '3', 1]
@@ -480,7 +480,7 @@ res = execute(s.stmt_id)
  | ...
 res.metadata
  | ---
- | - - name: group_concat(TRIM(TRAILING FROM t),x'0a')
+ | - - name: COLUMN_13
  |     type: string
  | ...
 unprepare(s.stmt_id)
@@ -838,11 +838,11 @@ s = prepare('SELECT :a, :b, :c');
 execute(s.stmt_id, {{[':a'] = 1}, {[':b'] = 2}, {[':c'] = 3}});
  | ---
  | - metadata:
- |   - name: :a
+ |   - name: COLUMN_1
  |     type: integer
- |   - name: :b
+ |   - name: COLUMN_2
  |     type: integer
- |   - name: :c
+ |   - name: COLUMN_3
  |     type: integer
  |   rows:
  |   - [1, 2, 3]
@@ -850,11 +850,11 @@ execute(s.stmt_id, {{[':a'] = 1}, {[':b'] = 2}, {[':c'] = 3}});
 execute(s.stmt_id, {{[':a'] = 1}, {[':b'] = 2}});
  | ---
  | - metadata:
- |   - name: :a
+ |   - name: COLUMN_1
  |     type: integer
- |   - name: :b
+ |   - name: COLUMN_2
  |     type: integer
- |   - name: :c
+ |   - name: COLUMN_3
  |     type: boolean
  |   rows:
  |   - [1, 2, null]
@@ -862,11 +862,11 @@ execute(s.stmt_id, {{[':a'] = 1}, {[':b'] = 2}});
 execute(s.stmt_id);
  | ---
  | - metadata:
- |   - name: :a
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: :b
+ |   - name: COLUMN_2
  |     type: boolean
- |   - name: :c
+ |   - name: COLUMN_3
  |     type: boolean
  |   rows:
  |   - [null, null, null]
diff --git a/test/sql/row-count.result b/test/sql/row-count.result
index 02acd79b5..7591d1630 100644
--- a/test/sql/row-count.result
+++ b/test/sql/row-count.result
@@ -16,7 +16,7 @@ box.execute("CREATE TABLE t1 (s1 VARCHAR(10) PRIMARY KEY);")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -24,7 +24,7 @@ box.execute("SELECT ROW_COUNT();")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -36,7 +36,7 @@ box.execute("CREATE TABLE t2 (s1 VARCHAR(10) PRIMARY KEY, s2 VARCHAR(10) REFEREN
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -52,7 +52,7 @@ box.execute("INSERT INTO t3 VALUES (0, 0, 0);")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -64,7 +64,7 @@ box.execute("CREATE TRIGGER x AFTER DELETE ON t1 FOR EACH ROW BEGIN UPDATE t3 SE
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -76,7 +76,7 @@ box.execute("INSERT INTO t1 VALUES ('a');")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -88,7 +88,7 @@ box.execute("INSERT INTO t2 VALUES ('a','a');")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -100,7 +100,7 @@ box.execute("INSERT INTO t1 VALUES ('b'), ('c'), ('d');")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -113,7 +113,7 @@ box.execute("REPLACE INTO t2 VALUES('a', 'c');")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [2]
@@ -125,7 +125,7 @@ box.execute("DELETE FROM t1;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [4]
@@ -141,7 +141,7 @@ box.execute("TRUNCATE TABLE t3;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -157,7 +157,7 @@ box.execute("UPDATE t3 SET i2 = 666;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -172,7 +172,7 @@ box.execute("DELETE FROM t3 WHERE 0 = 0;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -188,7 +188,7 @@ box.execute("DELETE FROM t3")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -222,7 +222,7 @@ box.execute("DELETE FROM tt1 WHERE id = 2;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -252,7 +252,7 @@ box.execute("START TRANSACTION;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -264,7 +264,7 @@ box.execute("COMMIT;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -277,7 +277,7 @@ box.execute("COMMIT;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -286,7 +286,7 @@ box.execute("SELECT ROW_COUNT();")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -308,7 +308,7 @@ box.execute("EXPLAIN QUERY PLAN INSERT INTO t1 VALUES ('b'), ('c'), ('d');")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
diff --git a/test/sql/transition.result b/test/sql/transition.result
index c14055b4e..8680e3cec 100644
--- a/test/sql/transition.result
+++ b/test/sql/transition.result
@@ -38,9 +38,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -54,9 +54,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar LIMIT 2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -69,9 +69,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo=2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['bar', 2, 42, 'awesome']
@@ -83,9 +83,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo>2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foobar', 1000, 42, 'awesome']
@@ -97,9 +97,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo>=2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['bar', 2, 42, 'awesome']
@@ -112,9 +112,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo=10000")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows: []
 ...
@@ -125,9 +125,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo>10000")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows: []
 ...
@@ -138,9 +138,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -152,9 +152,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<2.001")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -167,9 +167,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<=2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -182,9 +182,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<100")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -197,9 +197,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE bar='foo'")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -207,7 +207,7 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE bar='foo'")
 box.execute("SELECT count(*) FROM foobar")
 ---
 - metadata:
-  - name: count(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -215,7 +215,7 @@ box.execute("SELECT count(*) FROM foobar")
 box.execute("SELECT count(*) FROM foobar WHERE bar='foo'")
 ---
 - metadata:
-  - name: count(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -227,9 +227,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar ORDER BY bar")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['bar', 2, 42, 'awesome']
@@ -243,9 +243,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar ORDER BY bar DESC")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foobar', 1000, 42, 'awesome']
@@ -260,7 +260,7 @@ box.execute("REPLACE INTO foobar VALUES (1, 'cacodaemon')")
 box.execute("SELECT COUNT(*) FROM foobar WHERE foo=1")
 ---
 - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -268,7 +268,7 @@ box.execute("SELECT COUNT(*) FROM foobar WHERE foo=1")
 box.execute("SELECT COUNT(*) FROM foobar WHERE bar='cacodaemon'")
 ---
 - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -280,7 +280,7 @@ box.execute("DELETE FROM foobar WHERE bar='cacodaemon'")
 box.execute("SELECT COUNT(*) FROM foobar WHERE bar='cacodaemon'")
 ---
 - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
diff --git a/test/sql/types.result b/test/sql/types.result
index 54aff460e..8204b22bd 100644
--- a/test/sql/types.result
+++ b/test/sql/types.result
@@ -54,8 +54,8 @@ box.execute("CREATE VIEW v1 AS SELECT b + a, b - a FROM t1;")
 ...
 box.space.V1:format()
 ---
-- [{'type': 'number', 'nullable_action': 'none', 'name': 'b + a', 'is_nullable': true},
-  {'type': 'number', 'nullable_action': 'none', 'name': 'b - a', 'is_nullable': true}]
+- [{'type': 'number', 'nullable_action': 'none', 'name': 'COLUMN_1', 'is_nullable': true},
+  {'type': 'number', 'nullable_action': 'none', 'name': 'COLUMN_2', 'is_nullable': true}]
 ...
 -- gh-2494: index's part also features correct declared type.
 --
@@ -197,7 +197,7 @@ box.execute("SELECT randomblob(5) || 'x';")
 box.execute("VALUES (TYPEOF(randomblob(5) || zeroblob(5)));")
 ---
 - metadata:
-  - name: column1
+  - name: COLUMN_1
     type: string
   rows:
   - ['varbinary']
@@ -230,7 +230,7 @@ box.execute("SELECT * FROM t1 WHERE 'blob' LIKE x'0000';")
 box.execute("SELECT s LIKE NULL FROM t1;")
 ---
 - metadata:
-  - name: s LIKE NULL
+  - name: COLUMN_1
     type: integer
   rows:
   - [null]
@@ -256,7 +256,7 @@ box.execute("SELECT * FROM t1 WHERE 'int' LIKE 4;")
 box.execute("SELECT NULL LIKE s FROM t1;")
 ---
 - metadata:
-  - name: NULL LIKE s
+  - name: COLUMN_1
     type: integer
   rows:
   - [null]
@@ -295,7 +295,7 @@ box.space.T1:drop()
 box.execute('SELECT 1 + 1;')
 ---
 - metadata:
-  - name: 1 + 1
+  - name: COLUMN_1
     type: integer
   rows:
   - [2]
@@ -303,7 +303,7 @@ box.execute('SELECT 1 + 1;')
 box.execute('SELECT 1 + 1.1;')
 ---
 - metadata:
-  - name: 1 + 1.1
+  - name: COLUMN_1
     type: double
   rows:
   - [2.1]
@@ -311,7 +311,7 @@ box.execute('SELECT 1 + 1.1;')
 box.execute('SELECT \'9223372036854\' + 1;')
 ---
 - metadata:
-  - name: '''9223372036854'' + 1'
+  - name: COLUMN_1
     type: integer
   rows:
   - [9223372036855]
@@ -320,7 +320,7 @@ box.execute('SELECT \'9223372036854\' + 1;')
 box.execute('SELECT ?', {true})
 ---
 - metadata:
-  - name: '?'
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -481,7 +481,7 @@ s:drop()
 box.execute("SELECT 18446744073709551615 > 18446744073709551614;")
 ---
 - metadata:
-  - name: 18446744073709551615 > 18446744073709551614
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -489,7 +489,7 @@ box.execute("SELECT 18446744073709551615 > 18446744073709551614;")
 box.execute("SELECT 18446744073709551615 > -9223372036854775808;")
 ---
 - metadata:
-  - name: 18446744073709551615 > -9223372036854775808
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -497,7 +497,7 @@ box.execute("SELECT 18446744073709551615 > -9223372036854775808;")
 box.execute("SELECT -1 < 18446744073709551615;")
 ---
 - metadata:
-  - name: -1 < 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -505,7 +505,7 @@ box.execute("SELECT -1 < 18446744073709551615;")
 box.execute("SELECT 1.5 < 18446744073709551615")
 ---
 - metadata:
-  - name: 1.5 < 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -513,7 +513,7 @@ box.execute("SELECT 1.5 < 18446744073709551615")
 box.execute("SELECT 1.5 > 18446744073709551615")
 ---
 - metadata:
-  - name: 1.5 > 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [false]
@@ -521,7 +521,7 @@ box.execute("SELECT 1.5 > 18446744073709551615")
 box.execute("SELECT 18446744073709551615 > 1.5")
 ---
 - metadata:
-  - name: 18446744073709551615 > 1.5
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -529,7 +529,7 @@ box.execute("SELECT 18446744073709551615 > 1.5")
 box.execute("SELECT 18446744073709551615 < 1.5")
 ---
 - metadata:
-  - name: 18446744073709551615 < 1.5
+  - name: COLUMN_1
     type: boolean
   rows:
   - [false]
@@ -537,7 +537,7 @@ box.execute("SELECT 18446744073709551615 < 1.5")
 box.execute("SELECT 18446744073709551615 = 18446744073709551615;")
 ---
 - metadata:
-  - name: 18446744073709551615 = 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -545,7 +545,7 @@ box.execute("SELECT 18446744073709551615 = 18446744073709551615;")
 box.execute("SELECT 18446744073709551615 > -9223372036854775808;")
 ---
 - metadata:
-  - name: 18446744073709551615 > -9223372036854775808
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -553,7 +553,7 @@ box.execute("SELECT 18446744073709551615 > -9223372036854775808;")
 box.execute("SELECT 18446744073709551615 < -9223372036854775808;")
 ---
 - metadata:
-  - name: 18446744073709551615 < -9223372036854775808
+  - name: COLUMN_1
     type: boolean
   rows:
   - [false]
@@ -561,7 +561,7 @@ box.execute("SELECT 18446744073709551615 < -9223372036854775808;")
 box.execute("SELECT -1 < 18446744073709551615;")
 ---
 - metadata:
-  - name: -1 < 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -569,7 +569,7 @@ box.execute("SELECT -1 < 18446744073709551615;")
 box.execute("SELECT -1 > 18446744073709551615;")
 ---
 - metadata:
-  - name: -1 > 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [false]
@@ -577,7 +577,7 @@ box.execute("SELECT -1 > 18446744073709551615;")
 box.execute("SELECT 18446744073709551610 - 18446744073709551615;")
 ---
 - metadata:
-  - name: 18446744073709551610 - 18446744073709551615
+  - name: COLUMN_1
     type: integer
   rows:
   - [-5]
@@ -585,7 +585,7 @@ box.execute("SELECT 18446744073709551610 - 18446744073709551615;")
 box.execute("SELECT 18446744073709551615 = null;")
 ---
 - metadata:
-  - name: 18446744073709551615 = null
+  - name: COLUMN_1
     type: boolean
   rows:
   - [null]
@@ -593,7 +593,7 @@ box.execute("SELECT 18446744073709551615 = null;")
 box.execute("SELECT 18446744073709551615 = 18446744073709551615.0;")
 ---
 - metadata:
-  - name: 18446744073709551615 = 18446744073709551615.0
+  - name: COLUMN_1
     type: boolean
   rows:
   - [false]
@@ -601,7 +601,7 @@ box.execute("SELECT 18446744073709551615 = 18446744073709551615.0;")
 box.execute("SELECT 18446744073709551615.0 > 18446744073709551615")
 ---
 - metadata:
-  - name: 18446744073709551615.0 > 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -609,7 +609,7 @@ box.execute("SELECT 18446744073709551615.0 > 18446744073709551615")
 box.execute("SELECT 18446744073709551615 IN ('18446744073709551615', 18446744073709551615.0)")
 ---
 - metadata:
-  - name: 18446744073709551615 IN ('18446744073709551615', 18446744073709551615.0)
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -617,7 +617,7 @@ box.execute("SELECT 18446744073709551615 IN ('18446744073709551615', 18446744073
 box.execute("SELECT 1 LIMIT 18446744073709551615;")
 ---
 - metadata:
-  - name: '1'
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -625,7 +625,7 @@ box.execute("SELECT 1 LIMIT 18446744073709551615;")
 box.execute("SELECT 1 LIMIT 1 OFFSET 18446744073709551614;")
 ---
 - metadata:
-  - name: '1'
+  - name: COLUMN_1
     type: integer
   rows: []
 ...
@@ -637,7 +637,7 @@ box.execute("SELECT CAST('18446744073' || '709551616' AS INTEGER);")
 box.execute("SELECT CAST('18446744073' || '709551615' AS INTEGER);")
 ---
 - metadata:
-  - name: CAST('18446744073' || '709551615' AS INTEGER)
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551615]
@@ -645,7 +645,7 @@ box.execute("SELECT CAST('18446744073' || '709551615' AS INTEGER);")
 box.execute("SELECT 18446744073709551610 + 5;")
 ---
 - metadata:
-  - name: 18446744073709551610 + 5
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551615]
@@ -653,7 +653,7 @@ box.execute("SELECT 18446744073709551610 + 5;")
 box.execute("SELECT 18446744073709551615 * 1;")
 ---
 - metadata:
-  - name: 18446744073709551615 * 1
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551615]
@@ -661,7 +661,7 @@ box.execute("SELECT 18446744073709551615 * 1;")
 box.execute("SELECT 1 / 18446744073709551615;")
 ---
 - metadata:
-  - name: 1 / 18446744073709551615
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -669,7 +669,7 @@ box.execute("SELECT 1 / 18446744073709551615;")
 box.execute("SELECT 18446744073709551615 / 18446744073709551615;")
 ---
 - metadata:
-  - name: 18446744073709551615 / 18446744073709551615
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -677,7 +677,7 @@ box.execute("SELECT 18446744073709551615 / 18446744073709551615;")
 box.execute("SELECT 18446744073709551615 / -9223372036854775808;")
 ---
 - metadata:
-  - name: 18446744073709551615 / -9223372036854775808
+  - name: COLUMN_1
     type: integer
   rows:
   - [-1]
@@ -771,7 +771,7 @@ box.execute("INSERT INTO t VALUES (2, -1);")
 box.execute("SELECT sum(i) FROM t;")
 ---
 - metadata:
-  - name: sum(i)
+  - name: COLUMN_1
     type: number
   rows:
   - [18446744073709551613]
@@ -779,7 +779,7 @@ box.execute("SELECT sum(i) FROM t;")
 box.execute("SELECT avg(i) FROM t;")
 ---
 - metadata:
-  - name: avg(i)
+  - name: COLUMN_1
     type: number
   rows:
   - [6148914691236516864]
@@ -787,7 +787,7 @@ box.execute("SELECT avg(i) FROM t;")
 box.execute("SELECT total(i) FROM t;")
 ---
 - metadata:
-  - name: total(i)
+  - name: COLUMN_1
     type: number
   rows:
   - [1.844674407371e+19]
@@ -795,7 +795,7 @@ box.execute("SELECT total(i) FROM t;")
 box.execute("SELECT min(i) FROM t;")
 ---
 - metadata:
-  - name: min(i)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [-1]
@@ -803,7 +803,7 @@ box.execute("SELECT min(i) FROM t;")
 box.execute("SELECT max(i) FROM t;")
 ---
 - metadata:
-  - name: max(i)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [18446744073709551613]
@@ -811,7 +811,7 @@ box.execute("SELECT max(i) FROM t;")
 box.execute("SELECT count(i) FROM t;")
 ---
 - metadata:
-  - name: count(i)
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -819,7 +819,7 @@ box.execute("SELECT count(i) FROM t;")
 box.execute("SELECT group_concat(i) FROM t;")
 ---
 - metadata:
-  - name: group_concat(i)
+  - name: COLUMN_1
     type: string
   rows:
   - ['1,-1,18446744073709551613']
@@ -831,7 +831,7 @@ box.execute("DELETE FROM t WHERE i < 18446744073709551613;")
 box.execute("SELECT lower(i) FROM t;")
 ---
 - metadata:
-  - name: lower(i)
+  - name: COLUMN_1
     type: string
   rows:
   - ['18446744073709551613']
@@ -839,7 +839,7 @@ box.execute("SELECT lower(i) FROM t;")
 box.execute("SELECT upper(i) FROM t;")
 ---
 - metadata:
-  - name: upper(i)
+  - name: COLUMN_1
     type: string
   rows:
   - ['18446744073709551613']
@@ -847,7 +847,7 @@ box.execute("SELECT upper(i) FROM t;")
 box.execute("SELECT abs(i) FROM t;")
 ---
 - metadata:
-  - name: abs(i)
+  - name: COLUMN_1
     type: number
   rows:
   - [18446744073709551613]
@@ -855,7 +855,7 @@ box.execute("SELECT abs(i) FROM t;")
 box.execute("SELECT typeof(i) FROM t;")
 ---
 - metadata:
-  - name: typeof(i)
+  - name: COLUMN_1
     type: string
   rows:
   - ['integer']
@@ -863,7 +863,7 @@ box.execute("SELECT typeof(i) FROM t;")
 box.execute("SELECT quote(i) FROM t;")
 ---
 - metadata:
-  - name: quote(i)
+  - name: COLUMN_1
     type: string
   rows:
   - [18446744073709551613]
@@ -871,7 +871,7 @@ box.execute("SELECT quote(i) FROM t;")
 box.execute("SELECT LEAST(-1, i) FROM t;")
 ---
 - metadata:
-  - name: LEAST(-1, i)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [-1]
@@ -879,7 +879,7 @@ box.execute("SELECT LEAST(-1, i) FROM t;")
 box.execute("SELECT quote(i) FROM t;")
 ---
 - metadata:
-  - name: quote(i)
+  - name: COLUMN_1
     type: string
   rows:
   - [18446744073709551613]
@@ -1012,7 +1012,7 @@ box.space.T1:drop()
 box.execute("SELECT CAST(18446744073709551615 AS NUMBER);")
 ---
 - metadata:
-  - name: CAST(18446744073709551615 AS NUMBER)
+  - name: COLUMN_1
     type: number
   rows:
   - [18446744073709551615]
@@ -1020,7 +1020,7 @@ box.execute("SELECT CAST(18446744073709551615 AS NUMBER);")
 box.execute("SELECT CAST(18446744073709551615 AS TEXT);")
 ---
 - metadata:
-  - name: CAST(18446744073709551615 AS TEXT)
+  - name: COLUMN_1
     type: string
   rows:
   - ['18446744073709551615']
@@ -1028,7 +1028,7 @@ box.execute("SELECT CAST(18446744073709551615 AS TEXT);")
 box.execute("SELECT CAST(18446744073709551615 AS SCALAR);")
 ---
 - metadata:
-  - name: CAST(18446744073709551615 AS SCALAR)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [18446744073709551615]
@@ -1036,7 +1036,7 @@ box.execute("SELECT CAST(18446744073709551615 AS SCALAR);")
 box.execute("SELECT CAST(18446744073709551615 AS BOOLEAN);")
 ---
 - metadata:
-  - name: CAST(18446744073709551615 AS BOOLEAN)
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -1044,7 +1044,7 @@ box.execute("SELECT CAST(18446744073709551615 AS BOOLEAN);")
 box.execute("SELECT CAST('18446744073709551615' AS INTEGER);")
 ---
 - metadata:
-  - name: CAST('18446744073709551615' AS INTEGER)
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551615]
@@ -1077,7 +1077,7 @@ box.execute("SELECT id FROM t1;")
 box.execute("SELECT CAST(123 AS UNSIGNED);")
 ---
 - metadata:
-  - name: CAST(123 AS UNSIGNED)
+  - name: COLUMN_1
     type: unsigned
   rows:
   - [123]
@@ -1090,7 +1090,7 @@ box.execute("SELECT CAST(-123 AS UNSIGNED);")
 box.execute("SELECT CAST(1.5 AS UNSIGNED);")
 ---
 - metadata:
-  - name: CAST(1.5 AS UNSIGNED)
+  - name: COLUMN_1
     type: unsigned
   rows:
   - [1]
@@ -1098,7 +1098,7 @@ box.execute("SELECT CAST(1.5 AS UNSIGNED);")
 box.execute("SELECT CAST(-1.5 AS UNSIGNED);")
 ---
 - metadata:
-  - name: CAST(-1.5 AS UNSIGNED)
+  - name: COLUMN_1
     type: unsigned
   rows:
   - [-1]
@@ -1106,7 +1106,7 @@ box.execute("SELECT CAST(-1.5 AS UNSIGNED);")
 box.execute("SELECT CAST(true AS UNSIGNED);")
 ---
 - metadata:
-  - name: CAST(true AS UNSIGNED)
+  - name: COLUMN_1
     type: unsigned
   rows:
   - [1]
@@ -1114,7 +1114,7 @@ box.execute("SELECT CAST(true AS UNSIGNED);")
 box.execute("SELECT CAST('123' AS UNSIGNED);")
 ---
 - metadata:
-  - name: CAST('123' AS UNSIGNED)
+  - name: COLUMN_1
     type: unsigned
   rows:
   - [123]
@@ -1146,7 +1146,7 @@ box.space.T:drop()
 box.execute("SELECT CASE 1 WHEN 1 THEN x'0000000000' WHEN 2 THEN 'str' END")
 ---
 - metadata:
-  - name: CASE 1 WHEN 1 THEN x'0000000000' WHEN 2 THEN 'str' END
+  - name: COLUMN_1
     type: scalar
   rows:
   - ["\0\0\0\0\0"]
@@ -1154,7 +1154,7 @@ box.execute("SELECT CASE 1 WHEN 1 THEN x'0000000000' WHEN 2 THEN 'str' END")
 box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 END")
 ---
 - metadata:
-  - name: CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 END
+  - name: COLUMN_1
     type: integer
   rows:
   - [666]
@@ -1162,7 +1162,7 @@ box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 END")
 box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 ELSE 321 END")
 ---
 - metadata:
-  - name: CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 ELSE 321 END
+  - name: COLUMN_1
     type: integer
   rows:
   - [666]
@@ -1170,7 +1170,7 @@ box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 ELSE 321 END")
 box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 ELSE 'asd' END")
 ---
 - metadata:
-  - name: CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 ELSE 'asd' END
+  - name: COLUMN_1
     type: scalar
   rows:
   - [666]
@@ -1178,8 +1178,7 @@ box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 ELSE 'asd' END")
 box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4 WHEN 'e' THEN 5 WHEN 'f' THEN 6 END;")
 ---
 - metadata:
-  - name: CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4
-      WHEN 'e' THEN 5 WHEN 'f' THEN 6 END
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -1187,8 +1186,7 @@ box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHE
 box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4 WHEN 'e' THEN 5 WHEN 'f' THEN 'asd' END;")
 ---
 - metadata:
-  - name: CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4
-      WHEN 'e' THEN 5 WHEN 'f' THEN 'asd' END
+  - name: COLUMN_1
     type: scalar
   rows:
   - [1]
@@ -1196,8 +1194,7 @@ box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHE
 box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4 WHEN 'e' THEN 5 WHEN 'f' THEN 6 ELSE 'asd' END;")
 ---
 - metadata:
-  - name: CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4
-      WHEN 'e' THEN 5 WHEN 'f' THEN 6 ELSE 'asd' END
+  - name: COLUMN_1
     type: scalar
   rows:
   - [1]
@@ -1205,8 +1202,7 @@ box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHE
 box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4 WHEN 'e' THEN 5 WHEN 'f' THEN 6 ELSE 7 END;")
 ---
 - metadata:
-  - name: CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4
-      WHEN 'e' THEN 5 WHEN 'f' THEN 6 ELSE 7 END
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -1284,7 +1280,7 @@ box.execute("SELECT total(v) FROM t;")
 box.execute("SELECT min(v) FROM t;")
 ---
 - metadata:
-  - name: min(v)
+  - name: COLUMN_1
     type: scalar
   rows:
   - ['abc']
@@ -1292,7 +1288,7 @@ box.execute("SELECT min(v) FROM t;")
 box.execute("SELECT max(v) FROM t;")
 ---
 - metadata:
-  - name: max(v)
+  - name: COLUMN_1
     type: scalar
   rows:
   - ['abc']
@@ -1300,7 +1296,7 @@ box.execute("SELECT max(v) FROM t;")
 box.execute("SELECT count(v) FROM t;")
 ---
 - metadata:
-  - name: count(v)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -1308,7 +1304,7 @@ box.execute("SELECT count(v) FROM t;")
 box.execute("SELECT group_concat(v) FROM t;")
 ---
 - metadata:
-  - name: group_concat(v)
+  - name: COLUMN_1
     type: string
   rows:
   - ['abc']
@@ -1331,7 +1327,7 @@ box.execute("SELECT abs(v) FROM t;")
 box.execute("SELECT typeof(v) FROM t;")
 ---
 - metadata:
-  - name: typeof(v)
+  - name: COLUMN_1
     type: string
   rows:
   - ['varbinary']
@@ -1339,7 +1335,7 @@ box.execute("SELECT typeof(v) FROM t;")
 box.execute("SELECT quote(v) FROM t;")
 ---
 - metadata:
-  - name: quote(v)
+  - name: COLUMN_1
     type: string
   rows:
   - ['X''616263''']
@@ -1347,7 +1343,7 @@ box.execute("SELECT quote(v) FROM t;")
 box.execute("SELECT LEAST(v, x'') FROM t;")
 ---
 - metadata:
-  - name: LEAST(v, x'')
+  - name: COLUMN_1
     type: scalar
   rows:
   - ['']
@@ -1467,7 +1463,7 @@ box.execute("SELECT CAST(true AS VARBINARY);")
 box.execute("SELECT CAST('asd' AS VARBINARY);")
 ---
 - metadata:
-  - name: CAST('asd' AS VARBINARY)
+  - name: COLUMN_1
     type: varbinary
   rows:
   - ['asd']
@@ -1475,7 +1471,7 @@ box.execute("SELECT CAST('asd' AS VARBINARY);")
 box.execute("SELECT CAST(x'' AS VARBINARY);")
 ---
 - metadata:
-  - name: CAST(x'' AS VARBINARY)
+  - name: COLUMN_1
     type: varbinary
   rows:
   - ['']
@@ -1494,9 +1490,9 @@ box.execute("INSERT INTO t VALUES (1, 1, 1), (2, NULL, NULL);")
 box.execute("SELECT typeof(a), typeof(s) FROM t;")
 ---
 - metadata:
-  - name: typeof(a)
+  - name: COLUMN_1
     type: string
-  - name: typeof(s)
+  - name: COLUMN_2
     type: string
   rows:
   - ['integer', 'integer']
@@ -1513,7 +1509,7 @@ box.execute('INSERT INTO t1 VALUES (1, NULL, NULL);')
 box.execute('SELECT typeof(a & b) FROM t1;')
 ---
 - metadata:
-  - name: typeof(a & b)
+  - name: COLUMN_1
     type: string
   rows:
   - ['integer']
@@ -1521,11 +1517,11 @@ box.execute('SELECT typeof(a & b) FROM t1;')
 box.execute('SELECT typeof(a), typeof(b), typeof(a & b) FROM t1')
 ---
 - metadata:
-  - name: typeof(a)
+  - name: COLUMN_1
     type: string
-  - name: typeof(b)
+  - name: COLUMN_2
     type: string
-  - name: typeof(a & b)
+  - name: COLUMN_3
     type: string
   rows:
   - ['integer', 'integer', 'integer']
@@ -1533,7 +1529,7 @@ box.execute('SELECT typeof(a), typeof(b), typeof(a & b) FROM t1')
 box.execute("SELECT typeof(CAST(0 AS UNSIGNED));")
 ---
 - metadata:
-  - name: typeof(CAST(0 AS UNSIGNED))
+  - name: COLUMN_1
     type: string
   rows:
   - ['unsigned']
@@ -1693,7 +1689,7 @@ box.execute('DROP TABLE t1;')
 box.execute("SELECT 1.0;")
 ---
 - metadata:
-  - name: '1.0'
+  - name: COLUMN_1
     type: double
   rows:
   - [1]
@@ -1701,7 +1697,7 @@ box.execute("SELECT 1.0;")
 box.execute("SELECT .01;")
 ---
 - metadata:
-  - name: '.01'
+  - name: COLUMN_1
     type: double
   rows:
   - [0.01]
@@ -1709,7 +1705,7 @@ box.execute("SELECT .01;")
 box.execute("SELECT CAST(1 AS DOUBLE);")
 ---
 - metadata:
-  - name: CAST(1 AS DOUBLE)
+  - name: COLUMN_1
     type: double
   rows:
   - [1]
@@ -1717,7 +1713,7 @@ box.execute("SELECT CAST(1 AS DOUBLE);")
 box.execute("SELECT CAST(1.123 AS DOUBLE);")
 ---
 - metadata:
-  - name: CAST(1.123 AS DOUBLE)
+  - name: COLUMN_1
     type: double
   rows:
   - [1.123]
@@ -1735,7 +1731,7 @@ box.execute("SELECT CAST('asd' AS DOUBLE);")
 box.execute("SELECT CAST('1' AS DOUBLE);")
 ---
 - metadata:
-  - name: CAST('1' AS DOUBLE)
+  - name: COLUMN_1
     type: double
   rows:
   - [1]
@@ -1743,7 +1739,7 @@ box.execute("SELECT CAST('1' AS DOUBLE);")
 box.execute("SELECT CAST('1.123' AS DOUBLE);")
 ---
 - metadata:
-  - name: CAST('1.123' AS DOUBLE)
+  - name: COLUMN_1
     type: double
   rows:
   - [1.123]
@@ -1761,7 +1757,7 @@ box.execute("SELECT CAST(x'35' AS DOUBLE);")
 box.execute("SELECT CAST(CAST(x'35' AS STRING) AS DOUBLE);")
 ---
 - metadata:
-  - name: CAST(CAST(x'35' AS STRING) AS DOUBLE)
+  - name: COLUMN_1
     type: double
   rows:
   - [5]
@@ -1795,7 +1791,7 @@ box.execute('SELECT * FROM t;')
 box.execute('SELECT d / 100 FROM t;')
 ---
 - metadata:
-  - name: d / 100
+  - name: COLUMN_1
     type: double
   rows:
   - [0.1]
@@ -1828,7 +1824,7 @@ box.execute('SELECT * from t WHERE d = 3.3;')
 box.execute("SELECT sum(d) FROM t;")
 ---
 - metadata:
-  - name: sum(d)
+  - name: COLUMN_1
     type: number
   rows:
   - [18000000000000000000]
@@ -1836,7 +1832,7 @@ box.execute("SELECT sum(d) FROM t;")
 box.execute("SELECT avg(d) FROM t;")
 ---
 - metadata:
-  - name: avg(d)
+  - name: COLUMN_1
     type: number
   rows:
   - [4500000000000000000]
@@ -1844,7 +1840,7 @@ box.execute("SELECT avg(d) FROM t;")
 box.execute("SELECT total(d) FROM t;")
 ---
 - metadata:
-  - name: total(d)
+  - name: COLUMN_1
     type: number
   rows:
   - [18000000000000000000]
@@ -1852,7 +1848,7 @@ box.execute("SELECT total(d) FROM t;")
 box.execute("SELECT min(d) FROM t;")
 ---
 - metadata:
-  - name: min(d)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [-2]
@@ -1860,7 +1856,7 @@ box.execute("SELECT min(d) FROM t;")
 box.execute("SELECT max(d) FROM t;")
 ---
 - metadata:
-  - name: max(d)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [18000000000000000000]
@@ -1868,7 +1864,7 @@ box.execute("SELECT max(d) FROM t;")
 box.execute("SELECT count(d) FROM t;")
 ---
 - metadata:
-  - name: count(d)
+  - name: COLUMN_1
     type: integer
   rows:
   - [4]
@@ -1876,7 +1872,7 @@ box.execute("SELECT count(d) FROM t;")
 box.execute("SELECT group_concat(d) FROM t;")
 ---
 - metadata:
-  - name: group_concat(d)
+  - name: COLUMN_1
     type: string
   rows:
   - ['10.0,-2.0,3.3,1.8e+19']
@@ -1884,7 +1880,7 @@ box.execute("SELECT group_concat(d) FROM t;")
 box.execute("SELECT lower(d) FROM t;")
 ---
 - metadata:
-  - name: lower(d)
+  - name: COLUMN_1
     type: string
   rows:
   - ['10.0']
@@ -1895,7 +1891,7 @@ box.execute("SELECT lower(d) FROM t;")
 box.execute("SELECT upper(d) FROM t;")
 ---
 - metadata:
-  - name: upper(d)
+  - name: COLUMN_1
     type: string
   rows:
   - ['10.0']
@@ -1906,7 +1902,7 @@ box.execute("SELECT upper(d) FROM t;")
 box.execute("SELECT abs(d) FROM t;")
 ---
 - metadata:
-  - name: abs(d)
+  - name: COLUMN_1
     type: number
   rows:
   - [10]
@@ -1917,7 +1913,7 @@ box.execute("SELECT abs(d) FROM t;")
 box.execute("SELECT typeof(d) FROM t;")
 ---
 - metadata:
-  - name: typeof(d)
+  - name: COLUMN_1
     type: string
   rows:
   - ['double']
@@ -1928,7 +1924,7 @@ box.execute("SELECT typeof(d) FROM t;")
 box.execute("SELECT quote(d) FROM t;")
 ---
 - metadata:
-  - name: quote(d)
+  - name: COLUMN_1
     type: string
   rows:
   - ['10.0']
@@ -1939,7 +1935,7 @@ box.execute("SELECT quote(d) FROM t;")
 box.execute("SELECT LEAST(d, 0) FROM t;")
 ---
 - metadata:
-  - name: LEAST(d, 0)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [0]
@@ -2081,9 +2077,9 @@ box.execute("DROP TABLE t4;")
 box.execute("SELECT 1.0, typeof(1.0);")
 ---
 - metadata:
-  - name: '1.0'
+  - name: COLUMN_1
     type: double
-  - name: typeof(1.0)
+  - name: COLUMN_2
     type: string
   rows:
   - [1, 'double']
@@ -2091,9 +2087,9 @@ box.execute("SELECT 1.0, typeof(1.0);")
 box.execute("SELECT CAST(2 AS DOUBLE), typeof(CAST(2 AS DOUBLE));")
 ---
 - metadata:
-  - name: CAST(2 AS DOUBLE)
+  - name: COLUMN_1
     type: double
-  - name: typeof(CAST(2 AS DOUBLE))
+  - name: COLUMN_2
     type: string
   rows:
   - [2, 'double']
@@ -2101,9 +2097,9 @@ box.execute("SELECT CAST(2 AS DOUBLE), typeof(CAST(2 AS DOUBLE));")
 box.execute("SELECT 3e3, typeof(3e3);")
 ---
 - metadata:
-  - name: '3e3'
+  - name: COLUMN_1
     type: double
-  - name: typeof(3e3)
+  - name: COLUMN_2
     type: string
   rows:
   - [3000, 'double']
@@ -2121,7 +2117,7 @@ box.execute("SELECT d, TYPEOF(d) FROM t5;")
 - metadata:
   - name: D
     type: double
-  - name: TYPEOF(d)
+  - name: COLUMN_1
     type: string
   rows:
   - [4, 'double']

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Tarantool-patches] [PATCH v3 1/2] sql: use unify pattern for column names
  2020-06-25 14:35         ` Roman Khabibov
@ 2020-06-25 21:25           ` Vladislav Shpilevoy
  2020-06-27 11:50             ` Roman Khabibov
  0 siblings, 1 reply; 20+ messages in thread
From: Vladislav Shpilevoy @ 2020-06-25 21:25 UTC (permalink / raw)
  To: Roman Khabibov; +Cc: tarantool-patches

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.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Tarantool-patches] [PATCH v3 1/2] sql: use unify pattern for column names
  2020-06-25 21:25           ` Vladislav Shpilevoy
@ 2020-06-27 11:50             ` Roman Khabibov
  2020-06-29 20:08               ` Vladislav Shpilevoy
  0 siblings, 1 reply; 20+ messages in thread
From: Roman Khabibov @ 2020-06-27 11:50 UTC (permalink / raw)
  To: Vladislav Shpilevoy; +Cc: tarantool-patches

Hi! Thanks for the review.

> On Jun 26, 2020, at 00:25, Vladislav Shpilevoy <v.shpilevoy@tarantool.org> wrote:
> 
> 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.

I was mistaken when I said that the first column is used. When an
identifier from ORDER BY is resolved, matching with aliases is first
checked (resolveOrderGroupBy() in resolve.c). See an example below.

tarantool> box.execute("CREATE TABLE t(a INT PRIMARY KEY, b INT)")
---
- row_count: 1
...

tarantool> box.execute("INSERT INTO t VALUES(1, -1);")
---
- row_count: 1
...

tarantool> box.execute("INSERT INTO t VALUES(2, -2);")
---
- row_count: 1
...

tarantool> box.execute("SELECT a, b AS a FROM t ORDER BY a;")
---
- metadata:
  - name: A
    type: integer
  - name: A
    type: integer
  rows:
  - [2, -2]
  - [1, -1]
...

tarantool> box.execute("SELECT a, b AS a FROM t ORDER BY b;")
---
- metadata:
  - name: A
    type: integer
  - name: A
    type: integer
  rows:
  - [2, -2]
  - [1, -1]
…

In my patch, I used the zName field of the struct ExprList_item,
which is also used for aliases. But I did not find words in the
code that this field is only for aliases (<AS> clause), therefore
I considered it legitimate to put auto names in it.

PostgreSQL would throw an error in the case above: "ambiguous names”.
But it works for us. Is it a bug or not? Perhaps yes. In any case,
this does not apply to the patch and requires a separate discussion,
so I just delete this test.

commit ed196a4446177eb14aa1b86a382c32416edb5794
Author: Roman Khabibov <roman.habibov@tarantool.org>
Date:   Thu Mar 5 12:48:58 2020 +0300

    sql: unify pattern for column names
    
    Name resulting columns generated by an expression or <VALUES>
    construction by the "COLUMN_N" pattern.
    
    Closes #3962
    
    @TarantoolBot document
    Title: Column naming in SQL
    
    Now, every auto generated column is named by the "COLUMN_N"
    pattern, where N is the number of generated column in a query
    (starting  from 1). Auto generated column is a column in a query
    result generated by an expression or a column from <VALUES>
    construction.
    
    Examples:
    ```
    box.execute("VALUES(1, 2, 3);")
    ---
    - metadata:
      - name: COLUMN_1
        type: integer
      - name: COLUMN_2
        type: integer
      - name: COLUMN_3
        type: integer
      rows:
      - [1, 2, 3]
    ...
    box.execute("SELECT * FROM (VALUES (1+1, 1+1));")
    ---
    - metadata:
      - name: COLUMN_1
        type: integer
      - name: COLUMN_2
        type: integer
      rows:
      - [2, 2]
    ...
    box.execute("SELECT 1+1, 1+1;")
    ---
    - metadata:
      - name: COLUMN_1
        type: integer
      - name: COLUMN_2
        type: integer
      rows:
      - [2, 2]
    ...
    ```
    
    Here, the expression "mycol + 1" generates a new column, so that
    it is the first auto generated resulting column will be named as
    "COLUMN_1".
    ```
    tarantool> CREATE TABLE test (mycol INT PRIMARY KEY);
    ---
    - row_count: 1
    ...
    
    tarantool> SELECT mycol, mycol + 1 FROM test;
    ---
    - metadata:
      - name: MYCOL
        type: integer
      - name: COLUMN_1
        type: integer
      rows: []
    ...
    ```
    Note that you can use generated names already within the query,
    e.g. in <ORDER BY> clause.
    ```
    tarantool> SELECT mycol, mycol + 1 FROM test ORDER BY column_1;
    ---
    - metadata:
      - name: MYCOL
        type: integer
      - name: COLUMN_1
        type: integer
      rows: []
    ...
    ```
    
    It should also be noted that if you use column names similar to
    the "COLUMN_N" pattern, you can get the same names as a result:
    
    ```
    tarantool> CREATE TABLE test (column_1 SCALAR PRIMARY KEY);
    ---
    - row_count: 1
    ...
    
    tarantool> INSERT INTO test VALUES(1);
    ---
    - row_count: 1
    ...
    
    tarantool> SELECT column_1, column_1 COLLATE "unicode_ci" FROM test;
    ---
    - metadata:
      - name: COLUMN_1
        type: scalar
      - name: COLUMN_1
        type: scalar
      rows:
      - [1, 1]
    ...
    ```

diff --git a/src/box/sql/select.c b/src/box/sql/select.c
index 4b069addb..26c735ed7 100644
--- a/src/box/sql/select.c
+++ b/src/box/sql/select.c
@@ -1854,14 +1854,14 @@ generate_column_metadata(struct Parse *pParse, struct SrcList *pTabList,
 			}
 		} else {
 			const char *z = NULL;
-			if (colname != NULL)
+			if (colname != NULL) {
 				z = colname;
-			else if (span != NULL)
-				z = span;
-			else
-				z = tt_sprintf("column%d", i + 1);
+			} else {
+				uint32_t idx = ++pParse->autoname_i;
+				z = sql_generate_column_name(idx);
+			}
 			vdbe_metadata_set_col_name(v, i, z);
-			if (is_full_meta && colname != NULL)
+			if (is_full_meta)
 				vdbe_metadata_set_col_span(v, i, span);
 		}
 	}
@@ -1897,7 +1897,6 @@ sqlColumnsFromExprList(Parse * parse, ExprList * expr_list,
 	/* Database connection */
 	sql *db = parse->db;
 	u32 cnt;		/* Index added to make the name unique */
-	Expr *p;		/* Expression for a single result column */
 	char *zName;		/* Column name */
 	int nName;		/* Size of name in zName[] */
 	Hash ht;		/* Hash table of column names */
@@ -1929,13 +1928,12 @@ sqlColumnsFromExprList(Parse * parse, ExprList * expr_list,
 	space_def->field_count = column_count;
 
 	for (uint32_t i = 0; i < column_count; i++) {
-		/* Get an appropriate name for the column
+		/*
+		 * Check if the column contains an "AS <name>"
+		 * phrase.
 		 */
-		p = sqlExprSkipCollate(expr_list->a[i].pExpr);
-		if ((zName = expr_list->a[i].zName) != 0) {
-			/* If the column contains an "AS <name>" phrase, use <name> as the name */
-		} else {
-			Expr *pColExpr = p;	/* The expression that is the result column name */
+		if ((zName = expr_list->a[i].zName) == 0) {
+			struct Expr *pColExpr = expr_list->a[i].pExpr;
 			struct space_def *space_def = NULL;
 			while (pColExpr->op == TK_DOT) {
 				pColExpr = pColExpr->pRight;
@@ -1951,14 +1949,14 @@ sqlColumnsFromExprList(Parse * parse, ExprList * expr_list,
 			} else if (pColExpr->op == TK_ID) {
 				assert(!ExprHasProperty(pColExpr, EP_IntValue));
 				zName = pColExpr->u.zToken;
-			} else {
-				/* Use the original text of the column expression as its name */
-				zName = expr_list->a[i].zSpan;
 			}
 		}
-		if (zName == NULL)
-			zName = "_auto_field_";
-		zName = sqlMPrintf(db, "%s", zName);
+		if (zName == NULL) {
+			uint32_t idx = ++parse->autoname_i;
+			zName = sqlDbStrDup(db, sql_generate_column_name(idx));
+		} else {
+			zName = sqlDbStrDup(db, zName);
+		}
 
 		/* Make sure the column name is unique.  If the name is not unique,
 		 * append an integer to the name so that it becomes unique.
@@ -4792,6 +4790,24 @@ selectPopWith(Walker * pWalker, Select * p)
 	}
 }
 
+/**
+ * Determine whether to generate a name for @a expr or not.
+ *
+ * Auto generated names is needed for every item in  a <SELECT>
+ * expression list except asterisks, dots and column names (also
+ * if this item hasn't alias).
+ *
+ * @param expr Expression from expression list to analyze.
+ *
+ * @retval true/false If item is/isn't needed needed to name.
+ */
+static bool
+is_needed_to_name(struct Expr *expr)
+{
+	return (expr->op != TK_ASTERISK && expr->op != TK_DOT && expr->op !=
+		TK_ID);
+}
+
 /*
  * This routine is a Walker callback for "expanding" a SELECT statement.
  * "Expanding" means to do the following:
@@ -4941,19 +4957,26 @@ selectExpander(Walker * pWalker, Select * p)
 	 * all tables.
 	 *
 	 * The first loop just checks to see if there are any "*" operators
-	 * that need expanding.
+	 * that need expanding and names items of the expression
+	 * list if needed.
 	 */
+	bool has_asterisk = false;
 	for (k = 0; k < pEList->nExpr; k++) {
 		pE = pEList->a[k].pExpr;
 		if (pE->op == TK_ASTERISK)
-			break;
+			has_asterisk = true;
 		assert(pE->op != TK_DOT || pE->pRight != 0);
 		assert(pE->op != TK_DOT
 		       || (pE->pLeft != 0 && pE->pLeft->op == TK_ID));
 		if (pE->op == TK_DOT && pE->pRight->op == TK_ASTERISK)
-			break;
+			has_asterisk = true;
+		if (pEList->a[k].zName == NULL && is_needed_to_name(pE)) {
+			uint32_t idx = ++pParse->autoname_i;
+			pEList->a[k].zName =
+				sqlDbStrDup(db, sql_generate_column_name(idx));
+		}
 	}
-	if (k < pEList->nExpr) {
+	if (has_asterisk) {
 		/*
 		 * If we get here it means the result set contains one or more "*"
 		 * operators that need to be expanded.  Loop through each expression
diff --git a/src/box/sql/sqlInt.h b/src/box/sql/sqlInt.h
index 37283e506..adf90d824 100644
--- a/src/box/sql/sqlInt.h
+++ b/src/box/sql/sqlInt.h
@@ -2227,6 +2227,8 @@ struct Parse {
 	TriggerPrg *pTriggerPrg;	/* Linked list of coded triggers */
 	With *pWith;		/* Current WITH clause, or NULL */
 	With *pWithToFree;	/* Free this WITH object at the end of the parse */
+	/** Index of previous auto generated name. */
+	uint32_t autoname_i;
 	/** Space triggers are being coded for. */
 	struct space *triggered_space;
 	/**
@@ -4530,4 +4532,17 @@ void
 sql_setting_set(struct Parse *parse_context, struct Token *name,
 		struct Expr *value);
 
+/**
+ * Return a string of the form "COLUMN_N", where N is @a number.
+ *
+ * We decided to name every auto generated column in output by
+ * this pattern (like PostgreSQL), because it is more convenient
+ * than "_auto_name_" and naming with span like MariaDB do.
+ */
+static inline const char *
+sql_generate_column_name(uint32_t number)
+{
+	return tt_sprintf("COLUMN_%d", number);
+}
+
 #endif				/* sqlINT_H */
diff --git a/test/box/function1.result b/test/box/function1.result
index 905a4cdab..928cd5758 100644
--- a/test/box/function1.result
+++ b/test/box/function1.result
@@ -449,7 +449,7 @@ box.execute('SELECT "function1.divide"(6, 3, 3)')
 box.execute('SELECT "function1.divide"(6, 3)')
 ---
 - metadata:
-  - name: '"function1.divide"(6, 3)'
+  - name: COLUMN_1
     type: number
   rows:
   - [2]
@@ -457,7 +457,7 @@ box.execute('SELECT "function1.divide"(6, 3)')
 box.execute('SELECT "function1.divide"(5, 2)')
 ---
 - metadata:
-  - name: '"function1.divide"(5, 2)'
+  - name: COLUMN_1
     type: number
   rows:
   - [2.5]
@@ -482,7 +482,7 @@ test_run:cmd("setopt delimiter ''");
 box.execute('SELECT summarize(1, 2)')
 ---
 - metadata:
-  - name: summarize(1, 2)
+  - name: COLUMN_1
     type: number
   rows:
   - [3]
@@ -505,7 +505,7 @@ test_run:cmd("setopt delimiter ''");
 box.execute('SELECT summarize(1, 2)')
 ---
 - metadata:
-  - name: summarize(1, 2)
+  - name: COLUMN_1
     type: number
   rows:
   - [3]
@@ -519,7 +519,7 @@ box.func.SUMMARIZE:drop()
 box.execute('SELECT lua(\'return 1 + 1\')')
 ---
 - metadata:
-  - name: lua('return 1 + 1')
+  - name: COLUMN_1
     type: any
   rows:
   - [2]
@@ -537,7 +537,7 @@ box.execute('SELECT lua(\'return box.cfg()\')')
 box.execute('SELECT lua(\'return box.cfg.memtx_memory\')')
 ---
 - metadata:
-  - name: lua('return box.cfg.memtx_memory')
+  - name: COLUMN_1
     type: any
   rows:
   - [107374182]
diff --git a/test/sql-tap/colname.test.lua b/test/sql-tap/colname.test.lua
index caa61a07a..f27ffe413 100755
--- a/test/sql-tap/colname.test.lua
+++ b/test/sql-tap/colname.test.lua
@@ -1,6 +1,6 @@
 #!/usr/bin/env tarantool
 test = require("sqltester")
-test:plan(62)
+test:plan(77)
 
 --!./tcltestrunner.lua
 -- 2008 July 15
@@ -94,7 +94,7 @@ test:do_execsql2_test(
         SELECT +tabc.a, -tabc.b, tabc.c, * FROM tabc
     ]], {
         -- <colname-2.3>
-        "+tabc.a",1,"-tabc.b",-2,"C",3,"A",1,"B",2,"C",3
+        "COLUMN_1",1,"COLUMN_2",-2,"C",3,"A",1,"B",2,"C",3
         -- </colname-2.3>
     })
 
@@ -194,7 +194,7 @@ test:do_execsql2_test(
         SELECT +tabc.a, -tabc.b, tabc.c FROM tabc
     ]], {
         -- <colname-3.3>
-        "+tabc.a", 1, "-tabc.b", -2, "C", 3
+        "COLUMN_1",1,"COLUMN_2",-2,"C",3
         -- </colname-3.3>
     })
 
@@ -314,7 +314,7 @@ test:do_execsql2_test(
         SELECT +tabc.a, -tabc.b, tabc.c FROM tabc
     ]], {
         -- <colname-4.3>
-        "+tabc.a", 1, "-tabc.b", -2, "TABC.C", 3
+        "COLUMN_1",1,"COLUMN_2",-2,"TABC.C",3
         -- </colname-4.3>
     })
 
@@ -635,4 +635,133 @@ test:do_catchsql_test(
     [[ CREATE INDEX t1c ON table1('c'); ]],
     {1, "/Tarantool does not support functional indexes/"})
 
+--
+-- gh-3962: Check auto generated names in different selects.
+--
+test:do_execsql2_test(
+    "colname-12.1",
+    [[
+        VALUES(1, 2, 'aaa');
+    ]], {
+        "COLUMN_1",1,"COLUMN_2",2,"COLUMN_3","aaa"
+    })
+
+test:do_execsql2_test(
+    "colname-12.2",
+    [[
+        SELECT * FROM (VALUES (1+1, 1+1, 'aaa'));
+    ]], {
+        "COLUMN_1",2,"COLUMN_2",2,"COLUMN_3","aaa"
+    })
+
+test:do_execsql2_test(
+    "colname-12.3",
+    [[
+        SELECT 1+1, 1+1, 'aaa';
+    ]], {
+        "COLUMN_1",2,"COLUMN_2",2,"COLUMN_3","aaa"
+    })
+
+test:do_execsql2_test(
+    "colname-12.4",
+    [[
+        SELECT * FROM (SELECT * FROM (VALUES(1, 2, 'aaa'))),
+                      (SELECT * FROM (VALUES(1, 2, 'aaa')))
+    ]], {
+        "COLUMN_1",1,"COLUMN_2",2,"COLUMN_3","aaa","COLUMN_4",1,"COLUMN_5",2,
+        "COLUMN_6","aaa"
+    })
+
+test:do_execsql2_test(
+    "colname-12.5",
+    [[
+        CREATE TABLE j (s1 SCALAR PRIMARY KEY);
+        INSERT INTO j VALUES(1);
+    ]], {})
+
+--
+-- Column named as 'COLUMN_1', because of <COLLATE>.
+--
+test:do_execsql2_test(
+    "colname-12.6",
+    [[
+        SELECT s1 COLLATE "unicode_ci" FROM j;
+    ]], {
+        "COLUMN_1",1
+    })
+
+test:do_execsql2_test(
+    "colname-12.7",
+    [[
+        SELECT s1 COLLATE "unicode_ci" FROM j ORDER BY column_1;
+    ]], {
+        "COLUMN_1",1
+    })
+
+test:do_execsql2_test(
+    "colname-12.8",
+    [[
+        SELECT * FROM (SELECT s1 COLLATE "unicode_ci" FROM j
+                       ORDER BY column_1) ORDER BY column_1;
+    ]], {
+        "COLUMN_1",1
+    })
+
+test:do_execsql2_test(
+    "colname-12.9",
+    [[
+        SELECT s1 COLLATE "unicode_ci" FROM j GROUP BY column_1;
+    ]], {
+        "COLUMN_1",1
+    })
+
+test:do_execsql2_test(
+    "colname-12.10",
+    [[
+        SELECT * FROM (SELECT s1 COLLATE "unicode_ci" FROM j
+                       ORDER BY column_1) GROUP BY column_1;
+    ]], {
+        "COLUMN_1",1
+    })
+
+test:do_execsql2_test(
+    "colname-12.11",
+    [[
+        SELECT * FROM (SELECT s1 COLLATE "unicode_ci" FROM j
+                       ORDER BY column_1) WHERE column_1 = 1;
+    ]], {
+        "COLUMN_1",1
+    })
+
+test:do_execsql2_test(
+    "colname-12.12",
+    [[
+        SELECT *, s1 COLLATE "unicode_ci" FROM j ORDER BY column_1;
+    ]], {
+        "S1",1,"COLUMN_1",1
+    })
+
+test:do_execsql2_test(
+    "colname-12.13",
+    [[
+        SELECT s1 COLLATE "unicode_ci", * FROM j ORDER BY column_1;
+    ]], {
+        "COLUMN_1",1,"S1",1
+    })
+
+test:do_execsql2_test(
+    "colname-12.14",
+    [[
+        CREATE TABLE j_1 (column_1 SCALAR PRIMARY KEY, column_2 SCALAR);
+        INSERT INTO j_1 VALUES(1, 1);
+    ]], {})
+
+test:do_execsql2_test(
+    "colname-12.15",
+    [[
+        SELECT column_1, column_1 COLLATE "unicode_ci", column_2, 1 FROM j_1;
+    ]], {
+        "COLUMN_1",1,"COLUMN_1",1,"COLUMN_2",1,"COLUMN_2",1
+    })
+
 test:finish_test()
diff --git a/test/sql-tap/select1.test.lua b/test/sql-tap/select1.test.lua
index fbebfab37..80e94b019 100755
--- a/test/sql-tap/select1.test.lua
+++ b/test/sql-tap/select1.test.lua
@@ -1032,7 +1032,7 @@ test:do_catchsql2_test(
         SELECT f1+F2 FROM test1 ORDER BY f2
     ]], {
         -- <select1-6.4a>
-        0, {"f1+F2", 33, "f1+F2", 77}
+        0, {"COLUMN_1",33,"COLUMN_1",77}
         -- </select1-6.4a>
     })
 
@@ -1042,7 +1042,7 @@ test:do_catchsql2_test(
         SELECT test1.f1+F2 FROM test1 ORDER BY f2
     ]], {
         -- <select1-6.5>
-        0, {"test1.f1+F2", 33, "test1.f1+F2", 77}
+        0, {"COLUMN_1",33,"COLUMN_1",77}
         -- </select1-6.5>
     })
 
@@ -1059,7 +1059,7 @@ test:do_test(
         return table.insert(v,msg) or v
     end, {
         -- <select1-6.5.1>
-        0, {'test1.f1+F2', 33, 'test1.f1+F2', 77}
+        0, {"COLUMN_1",33,"COLUMN_1",77}
         -- </select1-6.5.1>
     })
 
@@ -1068,7 +1068,7 @@ test:do_catchsql2_test(
     [[SELECT test1.f1+F2, t1 FROM test1, test2 
          ORDER BY f2]], {
         -- <select1-6.6>
-        0, {"test1.f1+F2", 33, "T1", "abc", "test1.f1+F2", 77, "T1", "abc"}
+        0, {"COLUMN_1",33,"T1","abc","COLUMN_1",77,"T1","abc"}
         -- </select1-6.6>
     })
 
@@ -1161,7 +1161,7 @@ test:do_test(
         ]]
     end, {
         -- <select1-6.9.5>
-        "123.45", 123.45
+        "COLUMN_1",123.45
         -- </select1-6.9.5>
     })
 
@@ -1189,7 +1189,8 @@ test:do_test(
         return x
     end, {
         -- <select1-6.9.7>
-        "A.F1", 11, "A.F2", 22, "sql_subquery.5", 5, "sql_subquery.6", 6
+        "A.F1", 11, "A.F2", 22, "sql_subquery.COLUMN_1", 5,
+        "sql_subquery.COLUMN_2", 6
         -- </select1-6.9.7>
     })
 
@@ -1816,7 +1817,7 @@ test:do_execsql2_test(
             SELECT * FROM t3, (SELECT max(a), max(b) FROM t4) as "tx"
         ]], {
             -- <select1-11.14>
-            "ID", 0, "A", "1", "B", "2", "max(a)", 3, "max(b)", "4"
+            "ID", 0, "A", "1", "B", "2", "COLUMN_1", 3, "COLUMN_2", "4"
             -- </select1-11.14>
         })
 
@@ -1826,7 +1827,7 @@ test:do_execsql2_test(
             SELECT y.*, t3.* FROM t3, (SELECT max(a), max(b) FROM t4) AS y
         ]], {
             -- <select1-11.15>
-            "max(a)", 3, "max(b)", "4", "ID", 0, "A", "1", "B", "2"
+            "COLUMN_1", 3, "COLUMN_2", "4", "ID", 0, "A", "1", "B", "2"
             -- </select1-11.15>
         })
 
@@ -1850,7 +1851,7 @@ test:do_execsql2_test(
         SELECT 1+2+3
     ]], {
         -- <select1-12.1>
-        "1+2+3", 6
+        "COLUMN_1",6
         -- </select1-12.1>
     })
 
@@ -1860,7 +1861,7 @@ test:do_execsql2_test(
         SELECT 1,'hello',2
     ]], {
         -- <select1-12.2>
-        '1', 1, "'hello'", "hello", '2', 2
+        "COLUMN_1",1,"COLUMN_2","hello","COLUMN_3",2
         -- </select1-12.2>
     })
 
diff --git a/test/sql-tap/select6.test.lua b/test/sql-tap/select6.test.lua
index c9960dc29..380fd67c1 100755
--- a/test/sql-tap/select6.test.lua
+++ b/test/sql-tap/select6.test.lua
@@ -128,9 +128,9 @@ test:do_execsql_test(
 test:do_execsql_test(
     "select6-1.7",
     [=[
-        SELECT a.y, a."count(*)", "max(x)", "count(*)"
-        FROM (SELECT count(*),y FROM t1 GROUP BY y) AS a,
-             (SELECT max(x),y FROM t1 GROUP BY y) as b
+        SELECT a.y, a.COLUMN_1, COLUMN_2, COLUMN_1
+        FROM (SELECT count(*), y FROM t1 GROUP BY y) AS a,
+             (SELECT max(x), y FROM t1 GROUP BY y) as b
         WHERE a.y=b.y ORDER BY a.y
     ]=], {
         -- <select6-1.7>
@@ -154,9 +154,9 @@ test:do_execsql_test(
 test:do_execsql_test(
     "select6-1.9",
     [=[
-        SELECT q, p, r, b."min(x)+y"
+        SELECT q, p, r, min
         FROM (SELECT count(*) as p , y as q FROM t1 GROUP BY y) AS a,
-             (SELECT max(x) as r, y as s, min(x)+y FROM t1 GROUP BY y) as b
+             (SELECT max(x) as r, y as s, min(x)+y AS min FROM t1 GROUP BY y) as b
         WHERE q=s ORDER BY s
     ]=], {
         -- <select6-1.9>
@@ -247,9 +247,9 @@ test:do_execsql_test(
 test:do_execsql_test(
     "select6-2.7",
     [=[
-        SELECT a.b, a."count(*)", "max(a)", "count(*)"
-        FROM (SELECT count(*),b FROM t2 GROUP BY b) AS a,
-             (SELECT max(a),b FROM t2 GROUP BY b) as b
+        SELECT a.b, a.count, max, count
+        FROM (SELECT count(*) AS count, b FROM t2 GROUP BY b) AS a,
+             (SELECT max(a) AS max, b FROM t2 GROUP BY b) as b
         WHERE a.b=b.b ORDER BY a.b
     ]=], {
         -- <select6-2.7>
@@ -432,8 +432,8 @@ test:do_execsql_test(
 test:do_execsql_test(
     "select6-3.14",
     [=[
-        SELECT "count(*)",y FROM (SELECT count(*), y FROM t1 GROUP BY y)
-        ORDER BY "count(*)"
+        SELECT count, y FROM (SELECT count(*) AS count, y FROM t1 GROUP BY y)
+        ORDER BY count
     ]=], {
         -- <select6-3.14>
         1, 1, 2, 2, 4, 3, 5, 5, 8, 4
@@ -443,7 +443,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "select6-3.15",
     [=[
-        SELECT "count(*)",y FROM (SELECT count(*), y FROM t1 GROUP BY y)
+        SELECT count, y FROM (SELECT count(*) AS count, y FROM t1 GROUP BY y)
         ORDER BY y
     ]=], {
         -- <select6-3.15>
diff --git a/test/sql-tap/view.test.lua b/test/sql-tap/view.test.lua
index e553b91c7..66374e374 100755
--- a/test/sql-tap/view.test.lua
+++ b/test/sql-tap/view.test.lua
@@ -265,7 +265,7 @@ test:do_execsql2_test(
         SELECT * FROM v1 LIMIT 1
     ]], {
         -- <view-3.3.1>
-        "XYZ", 2, "PQR", 7, "c-b", 1
+        "XYZ", 2, "PQR", 7, "COLUMN_1", 1
         -- </view-3.3.1>
     })
 
@@ -276,7 +276,7 @@ test:do_execsql2_test(
         SELECT * FROM v1b LIMIT 1
     ]], {
         -- <view-3.3.2>
-        "A", 2, "b+c", 7, "C", 4
+        "A", 2, "COLUMN_1", 7, "C", 4
         -- </view-3.3.2>
     })
 
diff --git a/test/sql/bind.result b/test/sql/bind.result
index b24094052..cb0302885 100644
--- a/test/sql/bind.result
+++ b/test/sql/bind.result
@@ -77,11 +77,11 @@ execute('SELECT * FROM test WHERE id = :value', parameters)
 execute('SELECT ?, ?, ?', {1, 2, 3})
 ---
 - metadata:
-  - name: '?'
+  - name: COLUMN_1
     type: integer
-  - name: '?'
+  - name: COLUMN_2
     type: integer
-  - name: '?'
+  - name: COLUMN_3
     type: integer
   rows:
   - [1, 2, 3]
@@ -107,11 +107,11 @@ parameters[3][':value1'] = 11
 execute('SELECT ?, :value1, @value2', parameters)
 ---
 - metadata:
-  - name: '?'
+  - name: COLUMN_1
     type: integer
-  - name: :value1
+  - name: COLUMN_2
     type: integer
-  - name: '@value2'
+  - name: COLUMN_3
     type: integer
   rows:
   - [10, 11, 12]
@@ -149,22 +149,22 @@ parameters[6]['@value2'] = 6
 execute('SELECT :value3, ?, :value1, ?, ?, @value2, ?, :value3', parameters)
 ---
 - metadata:
-  - name: :value3
+  - name: COLUMN_1
     type: integer
-  - name: '?'
+  - name: COLUMN_2
     type: integer
-  - name: :value1
+  - name: COLUMN_3
     type: integer
-  - name: '?'
+  - name: COLUMN_4
     type: integer
-  - name: '?'
+  - name: COLUMN_5
     type: integer
-  - name: '@value2'
+  - name: COLUMN_6
     type: integer
-  - name: '?'
+  - name: COLUMN_7
+    type: boolean
+  - name: COLUMN_8
     type: boolean
-  - name: :value3
-    type: integer
   rows:
   - [1, 2, 3, 4, 5, 6, null, 1]
 ...
@@ -175,15 +175,15 @@ msgpack = require('msgpack')
 execute('SELECT ?, ?, ?, ?, ?', {'abc', -123.456, msgpack.NULL, true, false})
 ---
 - metadata:
-  - name: '?'
+  - name: COLUMN_1
     type: text
-  - name: '?'
+  - name: COLUMN_2
     type: numeric
-  - name: '?'
+  - name: COLUMN_3
     type: boolean
-  - name: '?'
+  - name: COLUMN_4
     type: boolean
-  - name: '?'
+  - name: COLUMN_5
     type: boolean
   rows:
   - ['abc', -123.456, null, true, false]
@@ -290,7 +290,7 @@ execute('SELECT :value', parameters)
 execute('SELECT ? ', {18446744073709551615ULL})
 ---
 - metadata:
-  - name: '?'
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551615]
diff --git a/test/sql/boolean.result b/test/sql/boolean.result
index 112e41a12..51ec5820b 100644
--- a/test/sql/boolean.result
+++ b/test/sql/boolean.result
@@ -241,7 +241,7 @@ i > 0
 SELECT return_type(a) FROM t;
  | ---
  | - metadata:
- |   - name: return_type(a)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['boolean']
@@ -250,7 +250,7 @@ SELECT return_type(a) FROM t;
 SELECT return_type('false');
  | ---
  | - metadata:
- |   - name: return_type('false')
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['string']
@@ -258,7 +258,7 @@ SELECT return_type('false');
 SELECT is_boolean(a) FROM t LIMIT 1;
  | ---
  | - metadata:
- |   - name: is_boolean(a)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -266,7 +266,7 @@ SELECT is_boolean(a) FROM t LIMIT 1;
 SELECT is_boolean('true');
  | ---
  | - metadata:
- |   - name: is_boolean('true')
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -281,7 +281,7 @@ SELECT abs(a) FROM t0;
 SELECT lower(a) FROM t0;
  | ---
  | - metadata:
- |   - name: lower(a)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['false']
@@ -292,7 +292,7 @@ SELECT lower(a) FROM t0;
 SELECT upper(a) FROM t0;
  | ---
  | - metadata:
- |   - name: upper(a)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['FALSE']
@@ -303,7 +303,7 @@ SELECT upper(a) FROM t0;
 SELECT quote(a) FROM t0;
  | ---
  | - metadata:
- |   - name: quote(a)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['FALSE']
@@ -315,7 +315,7 @@ SELECT quote(a) FROM t0;
 SELECT length(a) FROM t0;
  | ---
  | - metadata:
- |   - name: length(a)
+ |   - name: COLUMN_1
  |     type: integer
  |   rows:
  |   - [5]
@@ -326,7 +326,7 @@ SELECT length(a) FROM t0;
 SELECT typeof(a) FROM t0;
  | ---
  | - metadata:
- |   - name: typeof(a)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['boolean']
@@ -344,7 +344,7 @@ SELECT AVG(a) FROM t0;
 SELECT MIN(a) FROM t0;
  | ---
  | - metadata:
- |   - name: MIN(a)
+ |   - name: COLUMN_1
  |     type: scalar
  |   rows:
  |   - [false]
@@ -352,7 +352,7 @@ SELECT MIN(a) FROM t0;
 SELECT MAX(a) FROM t0;
  | ---
  | - metadata:
- |   - name: MAX(a)
+ |   - name: COLUMN_1
  |     type: scalar
  |   rows:
  |   - [true]
@@ -365,7 +365,7 @@ SELECT SUM(a) FROM t0;
 SELECT COUNT(a) FROM t0;
  | ---
  | - metadata:
- |   - name: COUNT(a)
+ |   - name: COLUMN_1
  |     type: integer
  |   rows:
  |   - [2]
@@ -378,7 +378,7 @@ SELECT TOTAL(a) FROM t0;
 SELECT GROUP_CONCAT(a, ' +++ ') FROM t0;
  | ---
  | - metadata:
- |   - name: GROUP_CONCAT(a, ' +++ ')
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['FALSE +++ TRUE']
@@ -392,13 +392,13 @@ SELECT GROUP_CONCAT(a, ' +++ ') FROM t0;
 box.execute('SELECT ?, ?, return_type($1), typeof($2);', {true, false})
  | ---
  | - metadata:
- |   - name: '?'
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: '?'
+ |   - name: COLUMN_2
  |     type: boolean
- |   - name: return_type($1)
+ |   - name: COLUMN_3
  |     type: string
- |   - name: typeof($2)
+ |   - name: COLUMN_4
  |     type: string
  |   rows:
  |   - [true, false, 'boolean', 'boolean']
@@ -422,9 +422,9 @@ parameters[2][':value1'] = false
 box.execute('SELECT :value1, @value2;', parameters)
  | ---
  | - metadata:
- |   - name: :value1
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: '@value2'
+ |   - name: COLUMN_2
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -501,9 +501,9 @@ INSERT INTO t3 VALUES (4, false)
 SELECT cast(true AS INTEGER), cast(false AS INTEGER);
  | ---
  | - metadata:
- |   - name: cast(true AS INTEGER)
+ |   - name: COLUMN_1
  |     type: integer
- |   - name: cast(false AS INTEGER)
+ |   - name: COLUMN_2
  |     type: integer
  |   rows:
  |   - [1, 0]
@@ -511,9 +511,9 @@ SELECT cast(true AS INTEGER), cast(false AS INTEGER);
 SELECT cast(true AS NUMBER), cast(false AS NUMBER);
  | ---
  | - metadata:
- |   - name: cast(true AS NUMBER)
+ |   - name: COLUMN_1
  |     type: number
- |   - name: cast(false AS NUMBER)
+ |   - name: COLUMN_2
  |     type: number
  |   rows:
  |   - [1, 0]
@@ -522,9 +522,9 @@ SELECT cast(true AS NUMBER), cast(false AS NUMBER);
 SELECT cast(true AS TEXT), cast(false AS TEXT);
  | ---
  | - metadata:
- |   - name: cast(true AS TEXT)
+ |   - name: COLUMN_1
  |     type: string
- |   - name: cast(false AS TEXT)
+ |   - name: COLUMN_2
  |     type: string
  |   rows:
  |   - ['TRUE', 'FALSE']
@@ -532,9 +532,9 @@ SELECT cast(true AS TEXT), cast(false AS TEXT);
 SELECT cast(true AS BOOLEAN), cast(false AS BOOLEAN);
  | ---
  | - metadata:
- |   - name: cast(true AS BOOLEAN)
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: cast(false AS BOOLEAN)
+ |   - name: COLUMN_2
  |     type: boolean
  |   rows:
  |   - [true, false]
@@ -544,11 +544,11 @@ SELECT cast(true AS BOOLEAN), cast(false AS BOOLEAN);
 SELECT cast(100 AS BOOLEAN), cast(1 AS BOOLEAN), cast(0 AS BOOLEAN);
  | ---
  | - metadata:
- |   - name: cast(100 AS BOOLEAN)
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: cast(1 AS BOOLEAN)
+ |   - name: COLUMN_2
  |     type: boolean
- |   - name: cast(0 AS BOOLEAN)
+ |   - name: COLUMN_3
  |     type: boolean
  |   rows:
  |   - [true, true, false]
@@ -556,9 +556,9 @@ SELECT cast(100 AS BOOLEAN), cast(1 AS BOOLEAN), cast(0 AS BOOLEAN);
 SELECT cast(0.123 AS BOOLEAN), cast(0.0 AS BOOLEAN);
  | ---
  | - metadata:
- |   - name: cast(0.123 AS BOOLEAN)
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: cast(0.0 AS BOOLEAN)
+ |   - name: COLUMN_2
  |     type: boolean
  |   rows:
  |   - [true, false]
@@ -566,9 +566,9 @@ SELECT cast(0.123 AS BOOLEAN), cast(0.0 AS BOOLEAN);
 SELECT cast('true' AS BOOLEAN), cast('false' AS BOOLEAN);
  | ---
  | - metadata:
- |   - name: cast('true' AS BOOLEAN)
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: cast('false' AS BOOLEAN)
+ |   - name: COLUMN_2
  |     type: boolean
  |   rows:
  |   - [true, false]
@@ -576,9 +576,9 @@ SELECT cast('true' AS BOOLEAN), cast('false' AS BOOLEAN);
 SELECT cast('TRUE' AS BOOLEAN), cast('FALSE' AS BOOLEAN);
  | ---
  | - metadata:
- |   - name: cast('TRUE' AS BOOLEAN)
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: cast('FALSE' AS BOOLEAN)
+ |   - name: COLUMN_2
  |     type: boolean
  |   rows:
  |   - [true, false]
@@ -887,7 +887,7 @@ SELECT a, COUNT(*) FROM (SELECT * FROM t4 UNION SELECT * FROM t5) GROUP BY a;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: COUNT(*)
+ |   - name: COLUMN_1
  |     type: integer
  |   rows:
  |   - [false, 3]
@@ -907,7 +907,7 @@ INSERT INTO t6 VALUES (true, false), (false, true);
 SELECT NOT true;
  | ---
  | - metadata:
- |   - name: NOT true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -915,7 +915,7 @@ SELECT NOT true;
 SELECT NOT false;
  | ---
  | - metadata:
- |   - name: NOT false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -925,7 +925,7 @@ SELECT a, NOT a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: NOT a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -935,7 +935,7 @@ SELECT a, NOT a FROM t;
 SELECT true AND true;
  | ---
  | - metadata:
- |   - name: true AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -943,7 +943,7 @@ SELECT true AND true;
 SELECT true AND false;
  | ---
  | - metadata:
- |   - name: true AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -951,7 +951,7 @@ SELECT true AND false;
 SELECT false AND true;
  | ---
  | - metadata:
- |   - name: false AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -959,7 +959,7 @@ SELECT false AND true;
 SELECT false AND false;
  | ---
  | - metadata:
- |   - name: false AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -967,7 +967,7 @@ SELECT false AND false;
 SELECT true OR true;
  | ---
  | - metadata:
- |   - name: true OR true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -975,7 +975,7 @@ SELECT true OR true;
 SELECT true OR false;
  | ---
  | - metadata:
- |   - name: true OR false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -983,7 +983,7 @@ SELECT true OR false;
 SELECT false OR true;
  | ---
  | - metadata:
- |   - name: false OR true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -991,7 +991,7 @@ SELECT false OR true;
 SELECT false OR false;
  | ---
  | - metadata:
- |   - name: false OR false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1002,7 +1002,7 @@ SELECT a, true AND a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true AND a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1013,7 +1013,7 @@ SELECT a, false AND a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false AND a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1024,7 +1024,7 @@ SELECT a, true OR a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true OR a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1035,7 +1035,7 @@ SELECT a, false OR a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false OR a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1046,7 +1046,7 @@ SELECT a, a AND true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1057,7 +1057,7 @@ SELECT a, a AND false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1068,7 +1068,7 @@ SELECT a, a OR true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a OR true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1079,7 +1079,7 @@ SELECT a, a OR false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a OR false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1093,7 +1093,7 @@ SELECT a, a1, a AND a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a AND a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, false]
@@ -1108,7 +1108,7 @@ SELECT a, a1, a OR a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a OR a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, false]
@@ -1622,7 +1622,7 @@ SELECT a1, a2, a2 || a2 FROM t6;
 SELECT true > true;
  | ---
  | - metadata:
- |   - name: true > true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1630,7 +1630,7 @@ SELECT true > true;
 SELECT true > false;
  | ---
  | - metadata:
- |   - name: true > false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -1638,7 +1638,7 @@ SELECT true > false;
 SELECT false > true;
  | ---
  | - metadata:
- |   - name: false > true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1646,7 +1646,7 @@ SELECT false > true;
 SELECT false > false;
  | ---
  | - metadata:
- |   - name: false > false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1654,7 +1654,7 @@ SELECT false > false;
 SELECT true < true;
  | ---
  | - metadata:
- |   - name: true < true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1662,7 +1662,7 @@ SELECT true < true;
 SELECT true < false;
  | ---
  | - metadata:
- |   - name: true < false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1670,7 +1670,7 @@ SELECT true < false;
 SELECT false < true;
  | ---
  | - metadata:
- |   - name: false < true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -1678,7 +1678,7 @@ SELECT false < true;
 SELECT false < false;
  | ---
  | - metadata:
- |   - name: false < false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1689,7 +1689,7 @@ SELECT a, true > a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true > a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1700,7 +1700,7 @@ SELECT a, false > a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false > a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1711,7 +1711,7 @@ SELECT a, true < a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true < a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1722,7 +1722,7 @@ SELECT a, false < a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false < a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1733,7 +1733,7 @@ SELECT a, a > true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a > true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1744,7 +1744,7 @@ SELECT a, a > false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a > false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1755,7 +1755,7 @@ SELECT a, a < true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a < true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1766,7 +1766,7 @@ SELECT a, a < false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a < false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1780,7 +1780,7 @@ SELECT a, a1, a > a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a > a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, false]
@@ -1795,7 +1795,7 @@ SELECT a, a1, a < a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a < a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, false]
@@ -1807,7 +1807,7 @@ SELECT a, a1, a < a1 FROM t, t6;
 SELECT true >= true;
  | ---
  | - metadata:
- |   - name: true >= true
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [true]
@@ -1815,7 +1815,7 @@ SELECT true >= true;
 SELECT true >= false;
  | ---
  | - metadata:
- |   - name: true >= false
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [true]
@@ -1823,7 +1823,7 @@ SELECT true >= false;
 SELECT false >= true;
  | ---
  | - metadata:
- |   - name: false >= true
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [false]
@@ -1831,7 +1831,7 @@ SELECT false >= true;
 SELECT false >= false;
  | ---
  | - metadata:
- |   - name: false >= false
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [true]
@@ -1839,7 +1839,7 @@ SELECT false >= false;
 SELECT true <= true;
  | ---
  | - metadata:
- |   - name: true <= true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -1847,7 +1847,7 @@ SELECT true <= true;
 SELECT true <= false;
  | ---
  | - metadata:
- |   - name: true <= false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1855,7 +1855,7 @@ SELECT true <= false;
 SELECT false <= true;
  | ---
  | - metadata:
- |   - name: false <= true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -1863,7 +1863,7 @@ SELECT false <= true;
 SELECT false <= false;
  | ---
  | - metadata:
- |   - name: false <= false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -1874,7 +1874,7 @@ SELECT a, true >= a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true >= a
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [false, true]
@@ -1885,7 +1885,7 @@ SELECT a, false >= a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false >= a
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [false, true]
@@ -1896,7 +1896,7 @@ SELECT a, true <= a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true <= a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1907,7 +1907,7 @@ SELECT a, false <= a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false <= a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1918,7 +1918,7 @@ SELECT a, a >= true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a >= true
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [false, false]
@@ -1929,7 +1929,7 @@ SELECT a, a >= false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a >= false
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [false, true]
@@ -1940,7 +1940,7 @@ SELECT a, a <= true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a <= true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1951,7 +1951,7 @@ SELECT a, a <= false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a <= false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1965,7 +1965,7 @@ SELECT a, a1, a >= a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a >= a1
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [false, false, true]
@@ -1980,7 +1980,7 @@ SELECT a, a1, a <= a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a <= a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, true]
@@ -1992,7 +1992,7 @@ SELECT a, a1, a <= a1 FROM t, t6;
 SELECT true == true;
  | ---
  | - metadata:
- |   - name: true == true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2000,7 +2000,7 @@ SELECT true == true;
 SELECT true == false;
  | ---
  | - metadata:
- |   - name: true == false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2008,7 +2008,7 @@ SELECT true == false;
 SELECT false == true;
  | ---
  | - metadata:
- |   - name: false == true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2016,7 +2016,7 @@ SELECT false == true;
 SELECT false == false;
  | ---
  | - metadata:
- |   - name: false == false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2024,7 +2024,7 @@ SELECT false == false;
 SELECT true != true;
  | ---
  | - metadata:
- |   - name: true != true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2032,7 +2032,7 @@ SELECT true != true;
 SELECT true != false;
  | ---
  | - metadata:
- |   - name: true != false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2040,7 +2040,7 @@ SELECT true != false;
 SELECT false != true;
  | ---
  | - metadata:
- |   - name: false != true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2048,7 +2048,7 @@ SELECT false != true;
 SELECT false != false;
  | ---
  | - metadata:
- |   - name: false != false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2059,7 +2059,7 @@ SELECT a, true == a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true == a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2070,7 +2070,7 @@ SELECT a, false == a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false == a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2081,7 +2081,7 @@ SELECT a, true != a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true != a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2092,7 +2092,7 @@ SELECT a, false != a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false != a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2103,7 +2103,7 @@ SELECT a, a == true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a == true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2114,7 +2114,7 @@ SELECT a, a == false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a == false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2125,7 +2125,7 @@ SELECT a, a != true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a != true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2136,7 +2136,7 @@ SELECT a, a != false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a != false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2150,7 +2150,7 @@ SELECT a, a1, a == a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a == a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, true]
@@ -2165,7 +2165,7 @@ SELECT a, a1, a != a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a != a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, false]
@@ -2177,7 +2177,7 @@ SELECT a, a1, a != a1 FROM t, t6;
 SELECT true IN (true);
  | ---
  | - metadata:
- |   - name: true IN (true)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2185,7 +2185,7 @@ SELECT true IN (true);
 SELECT false IN (true);
  | ---
  | - metadata:
- |   - name: false IN (true)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2193,7 +2193,7 @@ SELECT false IN (true);
 SELECT true IN (false);
  | ---
  | - metadata:
- |   - name: true IN (false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2201,7 +2201,7 @@ SELECT true IN (false);
 SELECT false IN (false);
  | ---
  | - metadata:
- |   - name: false IN (false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2209,7 +2209,7 @@ SELECT false IN (false);
 SELECT true IN (true, false);
  | ---
  | - metadata:
- |   - name: true IN (true, false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2217,7 +2217,7 @@ SELECT true IN (true, false);
 SELECT false IN (true, false);
  | ---
  | - metadata:
- |   - name: false IN (true, false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2225,7 +2225,7 @@ SELECT false IN (true, false);
 SELECT true IN (SELECT a1 FROM t6);
  | ---
  | - metadata:
- |   - name: true IN (SELECT a1 FROM t6)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2233,7 +2233,7 @@ SELECT true IN (SELECT a1 FROM t6);
 SELECT false IN (SELECT a1 FROM t6);
  | ---
  | - metadata:
- |   - name: false IN (SELECT a1 FROM t6)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2241,7 +2241,7 @@ SELECT false IN (SELECT a1 FROM t6);
 SELECT true IN (SELECT a1 FROM t6 LIMIT 1);
  | ---
  | - metadata:
- |   - name: true IN (SELECT a1 FROM t6 LIMIT 1)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2249,7 +2249,7 @@ SELECT true IN (SELECT a1 FROM t6 LIMIT 1);
 SELECT false IN (SELECT a1 FROM t6 LIMIT 1);
  | ---
  | - metadata:
- |   - name: false IN (SELECT a1 FROM t6 LIMIT 1)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2257,7 +2257,7 @@ SELECT false IN (SELECT a1 FROM t6 LIMIT 1);
 SELECT true IN (1, 1.2, 'true', false);
  | ---
  | - metadata:
- |   - name: true IN (1, 1.2, 'true', false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2265,7 +2265,7 @@ SELECT true IN (1, 1.2, 'true', false);
 SELECT false IN (1, 1.2, 'true', false);
  | ---
  | - metadata:
- |   - name: false IN (1, 1.2, 'true', false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2276,7 +2276,7 @@ SELECT a, a IN (true) FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a IN (true)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2287,7 +2287,7 @@ SELECT a, a IN (false) FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a IN (false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2298,7 +2298,7 @@ SELECT a, a IN (true, false) FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a IN (true, false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2309,7 +2309,7 @@ SELECT a, a IN (SELECT a1 FROM t6 LIMIT 1) FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a IN (SELECT a1 FROM t6 LIMIT 1)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2320,7 +2320,7 @@ SELECT a, a IN (SELECT a1 FROM t6) FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a IN (SELECT a1 FROM t6)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2331,7 +2331,7 @@ SELECT a, a IN (1, 1.2, 'true', false) FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a IN (1, 1.2, 'true', false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2341,7 +2341,7 @@ SELECT a, a IN (1, 1.2, 'true', false) FROM t;
 SELECT true BETWEEN true AND true;
  | ---
  | - metadata:
- |   - name: true BETWEEN true AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2349,7 +2349,7 @@ SELECT true BETWEEN true AND true;
 SELECT false BETWEEN true AND true;
  | ---
  | - metadata:
- |   - name: false BETWEEN true AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2357,7 +2357,7 @@ SELECT false BETWEEN true AND true;
 SELECT true BETWEEN false AND false;
  | ---
  | - metadata:
- |   - name: true BETWEEN false AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2365,7 +2365,7 @@ SELECT true BETWEEN false AND false;
 SELECT false BETWEEN false AND false;
  | ---
  | - metadata:
- |   - name: false BETWEEN false AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2373,7 +2373,7 @@ SELECT false BETWEEN false AND false;
 SELECT true BETWEEN true AND false;
  | ---
  | - metadata:
- |   - name: true BETWEEN true AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2381,7 +2381,7 @@ SELECT true BETWEEN true AND false;
 SELECT false BETWEEN true AND false;
  | ---
  | - metadata:
- |   - name: false BETWEEN true AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2389,7 +2389,7 @@ SELECT false BETWEEN true AND false;
 SELECT true BETWEEN false AND true;
  | ---
  | - metadata:
- |   - name: true BETWEEN false AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2397,7 +2397,7 @@ SELECT true BETWEEN false AND true;
 SELECT false BETWEEN false AND true;
  | ---
  | - metadata:
- |   - name: false BETWEEN false AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2408,7 +2408,7 @@ SELECT a, a BETWEEN true AND true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a BETWEEN true AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2419,7 +2419,7 @@ SELECT a, a BETWEEN false AND false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a BETWEEN false AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2430,7 +2430,7 @@ SELECT a, a BETWEEN true AND false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a BETWEEN true AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2441,7 +2441,7 @@ SELECT a, a BETWEEN false AND true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a BETWEEN false AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2466,7 +2466,7 @@ SELECT true AND 2;
 SELECT false AND 2;
  | ---
  | - metadata:
- |   - name: false AND 2
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2489,7 +2489,7 @@ SELECT 2 AND true;
 SELECT 2 AND false;
  | ---
  | - metadata:
- |   - name: 2 AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2556,7 +2556,7 @@ SELECT b, false AND b FROM t7;
  | - metadata:
  |   - name: B
  |     type: integer
- |   - name: false AND b
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [123, false]
@@ -2581,7 +2581,7 @@ SELECT b, b AND false FROM t7;
  | - metadata:
  |   - name: B
  |     type: integer
- |   - name: b AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [123, false]
@@ -3861,7 +3861,7 @@ SELECT a2, b, b != a2 FROM t6, t7;
 SELECT true IN (0, 1, 2, 3);
  | ---
  | - metadata:
- |   - name: true IN (0, 1, 2, 3)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -3869,7 +3869,7 @@ SELECT true IN (0, 1, 2, 3);
 SELECT false IN (0, 1, 2, 3);
  | ---
  | - metadata:
- |   - name: false IN (0, 1, 2, 3)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -3889,7 +3889,7 @@ SELECT a1, a1 IN (0, 1, 2, 3) FROM t6
  | - metadata:
  |   - name: A1
  |     type: boolean
- |   - name: a1 IN (0, 1, 2, 3)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -3935,7 +3935,7 @@ SELECT true AND 2.3;
 SELECT false AND 2.3;
  | ---
  | - metadata:
- |   - name: false AND 2.3
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -3958,7 +3958,7 @@ SELECT 2.3 AND true;
 SELECT 2.3 AND false;
  | ---
  | - metadata:
- |   - name: 2.3 AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -4025,7 +4025,7 @@ SELECT c, false AND c FROM t8;
  | - metadata:
  |   - name: C
  |     type: number
- |   - name: false AND c
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [4.56, false]
@@ -4050,7 +4050,7 @@ SELECT c, c AND false FROM t8;
  | - metadata:
  |   - name: C
  |     type: number
- |   - name: c AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [4.56, false]
@@ -5006,7 +5006,7 @@ SELECT a2, c, c != a2 FROM t6, t8;
 SELECT true IN (0.1, 1.2, 2.3, 3.4);
  | ---
  | - metadata:
- |   - name: true IN (0.1, 1.2, 2.3, 3.4)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5014,7 +5014,7 @@ SELECT true IN (0.1, 1.2, 2.3, 3.4);
 SELECT false IN (0.1, 1.2, 2.3, 3.4);
  | ---
  | - metadata:
- |   - name: false IN (0.1, 1.2, 2.3, 3.4)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5022,7 +5022,7 @@ SELECT false IN (0.1, 1.2, 2.3, 3.4);
 SELECT a1 IN (0.1, 1.2, 2.3, 3.4) FROM t6 LIMIT 1;
  | ---
  | - metadata:
- |   - name: a1 IN (0.1, 1.2, 2.3, 3.4)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5030,7 +5030,7 @@ SELECT a1 IN (0.1, 1.2, 2.3, 3.4) FROM t6 LIMIT 1;
 SELECT a2 IN (0.1, 1.2, 2.3, 3.4) FROM t6 LIMIT 1;
  | ---
  | - metadata:
- |   - name: a2 IN (0.1, 1.2, 2.3, 3.4)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5095,7 +5095,7 @@ SELECT true AND 'abc';
 SELECT false AND 'abc';
  | ---
  | - metadata:
- |   - name: false AND 'abc'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5118,7 +5118,7 @@ SELECT 'abc' AND true;
 SELECT 'abc' AND false;
  | ---
  | - metadata:
- |   - name: '''abc'' AND false'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5185,7 +5185,7 @@ SELECT d, false AND d FROM t9;
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: false AND d
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['AsdF', false]
@@ -5210,7 +5210,7 @@ SELECT d, d AND false FROM t9;
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: d AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['AsdF', false]
@@ -5470,7 +5470,7 @@ SELECT true AND 'TRUE';
 SELECT false AND 'TRUE';
  | ---
  | - metadata:
- |   - name: false AND 'TRUE'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5493,7 +5493,7 @@ SELECT 'TRUE' AND true;
 SELECT 'TRUE' AND false;
  | ---
  | - metadata:
- |   - name: '''TRUE'' AND false'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5560,7 +5560,7 @@ SELECT d, false AND d FROM t9 WHERE d = 'TRUE';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: false AND d
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['TRUE', false]
@@ -5585,7 +5585,7 @@ SELECT d, d AND false FROM t9 WHERE d = 'TRUE';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: d AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['TRUE', false]
@@ -5650,7 +5650,7 @@ SELECT true AND 'true';
 SELECT false AND 'true';
  | ---
  | - metadata:
- |   - name: false AND 'true'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5673,7 +5673,7 @@ SELECT 'true' AND true;
 SELECT 'true' AND false;
  | ---
  | - metadata:
- |   - name: '''true'' AND false'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5740,7 +5740,7 @@ SELECT d, false AND d FROM t9 WHERE d = 'true';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: false AND d
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['true', false]
@@ -5765,7 +5765,7 @@ SELECT d, d AND false FROM t9 WHERE d = 'true';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: d AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['true', false]
@@ -5830,7 +5830,7 @@ SELECT true AND 'FALSE';
 SELECT false AND 'FALSE';
  | ---
  | - metadata:
- |   - name: false AND 'FALSE'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5853,7 +5853,7 @@ SELECT 'FALSE' AND true;
 SELECT 'FALSE' AND false;
  | ---
  | - metadata:
- |   - name: '''FALSE'' AND false'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5920,7 +5920,7 @@ SELECT d, false AND d FROM t9 WHERE d = 'FALSE';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: false AND d
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['FALSE', false]
@@ -5945,7 +5945,7 @@ SELECT d, d AND false FROM t9 WHERE d = 'FALSE';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: d AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['FALSE', false]
@@ -6010,7 +6010,7 @@ SELECT true AND 'false';
 SELECT false AND 'false';
  | ---
  | - metadata:
- |   - name: false AND 'false'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -6033,7 +6033,7 @@ SELECT 'false' AND true;
 SELECT 'false' AND false;
  | ---
  | - metadata:
- |   - name: '''false'' AND false'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -6100,7 +6100,7 @@ SELECT d, false AND d FROM t9 WHERE d = 'false';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: false AND d
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['false', false]
@@ -6125,7 +6125,7 @@ SELECT d, d AND false FROM t9 WHERE d = 'false';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: d AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['false', false]
diff --git a/test/sql/collation.result b/test/sql/collation.result
index 4e4c27ef0..bfc89e1b8 100644
--- a/test/sql/collation.result
+++ b/test/sql/collation.result
@@ -111,7 +111,7 @@ box.execute([[SELECT descriptor, upper(letter), letter FROM tu where UPPER(lette
 - metadata:
   - name: DESCRIPTOR
     type: string
-  - name: upper(letter)
+  - name: COLUMN_1
     type: string
   - name: LETTER
     type: string
@@ -124,7 +124,7 @@ box.execute([[SELECT descriptor, upper(letter COLLATE "GERMAN"), letter FROM tu
 - metadata:
   - name: DESCRIPTOR
     type: string
-  - name: upper(letter COLLATE "GERMAN")
+  - name: COLUMN_1
     type: string
   - name: LETTER
     type: string
@@ -335,14 +335,14 @@ box.execute("SELECT a FROM t UNION SELECT c FROM t;")
 box.execute("SELECT c COLLATE \"binary\" FROM t UNION SELECT a FROM t;")
 ---
 - metadata:
-  - name: c COLLATE "binary"
+  - name: COLUMN_1
     type: string
   rows: []
 ...
 box.execute("SELECT b COLLATE \"unicode\" FROM t UNION SELECT a FROM t;")
 ---
 - metadata:
-  - name: b COLLATE "unicode"
+  - name: COLUMN_1
     type: string
   rows: []
 ...
@@ -1128,7 +1128,7 @@ box.execute("INSERT INTO jj VALUES (1,'A'), (2,'a')")
 box.execute("SELECT DISTINCT trim(s2) FROM jj;")
 ---
 - metadata:
-  - name: trim(s2)
+  - name: COLUMN_1
     type: string
   rows:
   - ['A']
@@ -1140,7 +1140,7 @@ box.execute("INSERT INTO jj VALUES (3, 'aS'), (4, 'AS');")
 box.execute("SELECT DISTINCT replace(s2, 'S', 's') FROM jj;")
 ---
 - metadata:
-  - name: replace(s2, 'S', 's')
+  - name: COLUMN_1
     type: string
   rows:
   - ['A']
@@ -1149,7 +1149,7 @@ box.execute("SELECT DISTINCT replace(s2, 'S', 's') FROM jj;")
 box.execute("SELECT DISTINCT substr(s2, 1, 1) FROM jj;")
 ---
 - metadata:
-  - name: substr(s2, 1, 1)
+  - name: COLUMN_1
     type: string
   rows:
   - ['A']
diff --git a/test/sql/errinj.result b/test/sql/errinj.result
index 68c001f28..f19203bc6 100644
--- a/test/sql/errinj.result
+++ b/test/sql/errinj.result
@@ -120,7 +120,7 @@ insert_res
 select_res
 ---
 - metadata:
-  - name: '1'
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
diff --git a/test/sql/foreign-keys.result b/test/sql/foreign-keys.result
index f1d973443..33689a06e 100644
--- a/test/sql/foreign-keys.result
+++ b/test/sql/foreign-keys.result
@@ -357,7 +357,7 @@ box.execute('ALTER TABLE tc ADD CONSTRAINT fk1 FOREIGN KEY (id) REFERENCES tp(id
 box.execute('SELECT row_count();')
 ---
 - metadata:
-  - name: row_count()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -374,7 +374,7 @@ box.execute('ALTER TABLE tc DROP CONSTRAINT fk1;')
 box.execute('SELECT row_count();')
 ---
 - metadata:
-  - name: row_count()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
diff --git a/test/sql/full_metadata.result b/test/sql/full_metadata.result
index 5a93c41ec..25bac6d86 100644
--- a/test/sql/full_metadata.result
+++ b/test/sql/full_metadata.result
@@ -57,7 +57,7 @@ execute("SELECT 'aSd' COLLATE \"unicode_ci\";")
  | - metadata:
  |   - type: string
  |     span: '''aSd'' COLLATE "unicode_ci"'
- |     name: '''aSd'' COLLATE "unicode_ci"'
+ |     name: COLUMN_1
  |     collation: unicode_ci
  |   rows:
  |   - ['aSd']
@@ -78,7 +78,7 @@ execute("SELECT c COLLATE \"unicode\" FROM t;")
  | - metadata:
  |   - type: string
  |     span: c COLLATE "unicode"
- |     name: c COLLATE "unicode"
+ |     name: COLUMN_1
  |     collation: unicode
  |   rows:
  |   - ['aSd']
@@ -165,7 +165,7 @@ execute("SELECT *, id + 1 AS x, a AS y, c || 'abc' FROM t;")
  |     is_nullable: false
  |   - type: string
  |     span: c || 'abc'
- |     name: c || 'abc'
+ |     name: COLUMN_1
  |   rows:
  |   - [1, 1, 'aSd', 2, 1, 'aSdabc']
  | ...
@@ -185,8 +185,8 @@ execute("SELECT * FROM v;")
  |     name: Y
  |     is_nullable: false
  |   - type: string
- |     span: c || 'abc'
- |     name: c || 'abc'
+ |     span: COLUMN_1
+ |     name: COLUMN_1
  |   rows:
  |   - [2, 1, 'aSdabc']
  | ...
diff --git a/test/sql/func-recreate.result b/test/sql/func-recreate.result
index 3709df787..5fd2b79c0 100644
--- a/test/sql/func-recreate.result
+++ b/test/sql/func-recreate.result
@@ -48,7 +48,7 @@ test_run:cmd("setopt delimiter ''");
 ch:get()
 ---
 - metadata:
-  - name: WAITFOR(0.2)
+  - name: COLUMN_1
     type: number
   rows:
   - [0.2]
diff --git a/test/sql/gh-3199-no-mem-leaks.result b/test/sql/gh-3199-no-mem-leaks.result
index d8590779a..6ce8df436 100644
--- a/test/sql/gh-3199-no-mem-leaks.result
+++ b/test/sql/gh-3199-no-mem-leaks.result
@@ -32,7 +32,7 @@ box.execute('SELECT x, y, x + y FROM test ORDER BY y')
     type: integer
   - name: Y
     type: integer
-  - name: x + y
+  - name: COLUMN_1
     type: integer
   rows:
   - [1, 1, 2]
@@ -49,7 +49,7 @@ box.execute('SELECT x, y, x + y FROM test ORDER BY y')
     type: integer
   - name: Y
     type: integer
-  - name: x + y
+  - name: COLUMN_1
     type: integer
   rows:
   - [1, 1, 2]
@@ -62,7 +62,7 @@ box.execute('SELECT x, y, x + y FROM test ORDER BY y')
     type: integer
   - name: Y
     type: integer
-  - name: x + y
+  - name: COLUMN_1
     type: integer
   rows:
   - [1, 1, 2]
@@ -75,7 +75,7 @@ box.execute('SELECT x, y, x + y FROM test ORDER BY y')
     type: integer
   - name: Y
     type: integer
-  - name: x + y
+  - name: COLUMN_1
     type: integer
   rows:
   - [1, 1, 2]
@@ -88,7 +88,7 @@ box.execute('SELECT x, y, x + y FROM test ORDER BY y')
     type: integer
   - name: Y
     type: integer
-  - name: x + y
+  - name: COLUMN_1
     type: integer
   rows:
   - [1, 1, 2]
@@ -115,7 +115,7 @@ box.execute('SELECT a, id + 2, b FROM test2 WHERE b < id * 2 ORDER BY a ')
 - metadata:
   - name: A
     type: string
-  - name: id + 2
+  - name: COLUMN_1
     type: integer
   - name: B
     type: integer
@@ -134,7 +134,7 @@ box.execute('SELECT a, id + 2 * b, a FROM test2 WHERE b < id * 2 ORDER BY a ')
 - metadata:
   - name: A
     type: string
-  - name: id + 2 * b
+  - name: COLUMN_1
     type: integer
   - name: A
     type: string
@@ -149,7 +149,7 @@ box.execute('SELECT a, id + 2 * b, a FROM test2 WHERE b < id * 2 ORDER BY a ')
 - metadata:
   - name: A
     type: string
-  - name: id + 2 * b
+  - name: COLUMN_1
     type: integer
   - name: A
     type: string
@@ -164,7 +164,7 @@ box.execute('SELECT a, id + 2 * b, a FROM test2 WHERE b < id * 2 ORDER BY a ')
 - metadata:
   - name: A
     type: string
-  - name: id + 2 * b
+  - name: COLUMN_1
     type: integer
   - name: A
     type: string
@@ -183,7 +183,7 @@ box.execute('SELECT x, y + 3 * b, b FROM test2, test WHERE b = x')
 - metadata:
   - name: X
     type: integer
-  - name: y + 3 * b
+  - name: COLUMN_1
     type: integer
   - name: B
     type: integer
@@ -196,7 +196,7 @@ box.execute('SELECT x, y + 3 * b, b FROM test2, test WHERE b = x')
 - metadata:
   - name: X
     type: integer
-  - name: y + 3 * b
+  - name: COLUMN_1
     type: integer
   - name: B
     type: integer
@@ -209,7 +209,7 @@ box.execute('SELECT x, y + 3 * b, b FROM test2, test WHERE b = x')
 - metadata:
   - name: X
     type: integer
-  - name: y + 3 * b
+  - name: COLUMN_1
     type: integer
   - name: B
     type: integer
diff --git a/test/sql/gh-3888-values-blob-assert.result b/test/sql/gh-3888-values-blob-assert.result
index 0a1af28f2..669f2eb2f 100644
--- a/test/sql/gh-3888-values-blob-assert.result
+++ b/test/sql/gh-3888-values-blob-assert.result
@@ -51,7 +51,7 @@ box.execute('SELECT TheColumnName')
 box.execute('VALUES(-0.5e-2)')
 ---
 - metadata:
-  - name: column1
+  - name: COLUMN_1
     type: double
   rows:
   - [-0.005]
@@ -59,7 +59,7 @@ box.execute('VALUES(-0.5e-2)')
 box.execute('SELECT X\'507265766564\'')
 ---
 - metadata:
-  - name: X'507265766564'
+  - name: COLUMN_1
     type: varbinary
   rows:
   - ['Preved']
@@ -68,7 +68,7 @@ box.execute('SELECT X\'507265766564\'')
 box.execute('SELECT 3.14')
 ---
 - metadata:
-  - name: '3.14'
+  - name: COLUMN_1
     type: double
   rows:
   - [3.14]
@@ -76,7 +76,7 @@ box.execute('SELECT 3.14')
 box.execute('SELECT X\'4D6564766564\'')
 ---
 - metadata:
-  - name: X'4D6564766564'
+  - name: COLUMN_1
     type: varbinary
   rows:
   - ['Medved']
diff --git a/test/sql/gh-4697-scalar-bool-sort-cmp.result b/test/sql/gh-4697-scalar-bool-sort-cmp.result
index 2423cd894..6f7fbd62b 100644
--- a/test/sql/gh-4697-scalar-bool-sort-cmp.result
+++ b/test/sql/gh-4697-scalar-bool-sort-cmp.result
@@ -30,7 +30,7 @@ SELECT s2, typeof(s2) FROM test ORDER BY s2;
  | - metadata:
  |   - name: S2
  |     type: scalar
- |   - name: typeof(s2)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - [null, 'boolean']
@@ -43,7 +43,7 @@ SELECT s3, typeof(s3) FROM test ORDER BY s3;
  | - metadata:
  |   - name: S3
  |     type: scalar
- |   - name: typeof(s3)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - [null, 'boolean']
diff --git a/test/sql/icu-upper-lower.result b/test/sql/icu-upper-lower.result
index f7b9dfa38..3ecc07d94 100644
--- a/test/sql/icu-upper-lower.result
+++ b/test/sql/icu-upper-lower.result
@@ -23,11 +23,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Zəfər, jaketini də, papağını da götür, bu axşam hava çox soyuq
-      olacaq. ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Zəfər, jaketini də, papağını da götür, bu axşam hava çox soyuq
-      olacaq. ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     zəfər, jaketini də, papağını da götür, bu axşam hava çox soyuq olacaq. ',
@@ -38,9 +36,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     The quick brown fox jumps over the lazy dog. ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     The quick brown fox jumps over the lazy dog. ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     the quick brown fox jumps over the lazy dog. ', '     THE QUICK BROWN FOX
@@ -52,9 +50,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     The quick brown fox jumps over the lazy dog. ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     The quick brown fox jumps over the lazy dog. ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     the quick brown fox jumps over the lazy dog. ', '     THE QUICK BROWN FOX
@@ -66,11 +64,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Բել դղյակի ձախ ժամն օֆ ազգությանը ցպահանջ չճշտած վնաս էր եւ
-      փառք ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Բել դղյակի ձախ ժամն օֆ ազգությանը ցպահանջ չճշտած վնաս էր եւ
-      փառք ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     բել դղյակի ձախ ժամն օֆ ազգությանը ցպահանջ չճշտած վնաս էր եւ փառք ', '     ԲԵԼ
@@ -82,11 +78,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     У Іўі худы жвавы чорт у зялёнай камізэльцы пабег пад’есці фаршу
-      з юшкай ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     У Іўі худы жвавы чорт у зялёнай камізэльцы пабег пад’есці фаршу
-      з юшкай ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     у іўі худы жвавы чорт у зялёнай камізэльцы пабег пад’есці фаршу з юшкай ',
@@ -98,11 +92,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός
-      ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός
-      ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός ', '     ΤΆΧΙΣΤΗ
@@ -114,11 +106,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Chuaigh bé mhórshách le dlúthspád fíorfhinn trí hata mo dhea-phorcáin
-      bhig ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Chuaigh bé mhórshách le dlúthspád fíorfhinn trí hata mo dhea-phorcáin
-      bhig ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     chuaigh bé mhórshách le dlúthspád fíorfhinn trí hata mo dhea-phorcáin bhig ',
@@ -130,9 +120,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Quiere la boca exhausta vid, kiwi, piña y fugaz jamón ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Quiere la boca exhausta vid, kiwi, piña y fugaz jamón ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     quiere la boca exhausta vid, kiwi, piña y fugaz jamón ', '     QUIERE LA
@@ -144,9 +134,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     키스의 고유조건은 입술끼리 만나야 하고 특별한 기술은 필요치 않다 ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     키스의 고유조건은 입술끼리 만나야 하고 특별한 기술은 필요치 않다 ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     키스의 고유조건은 입술끼리 만나야 하고 특별한 기술은 필요치 않다 ', '     키스의 고유조건은 입술끼리 만나야 하고 특별한
@@ -158,9 +148,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Glāžšķūņa rūķīši dzērumā čiepj Baha koncertflīģeļu vākus ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Glāžšķūņa rūķīši dzērumā čiepj Baha koncertflīģeļu vākus ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     glāžšķūņa rūķīši dzērumā čiepj baha koncertflīģeļu vākus ', '     GLĀŽŠĶŪŅA
@@ -172,11 +162,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Zwölf große Boxkämpfer jagen Viktor quer über den Sylter Deich
-      ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Zwölf große Boxkämpfer jagen Viktor quer über den Sylter Deich
-      ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     zwölf große boxkämpfer jagen viktor quer über den sylter deich ', '     ZWÖLF
@@ -188,9 +176,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Pchnąć w tę łódź jeża lub ośm skrzyń fig. ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Pchnąć w tę łódź jeża lub ośm skrzyń fig. ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     pchnąć w tę łódź jeża lub ośm skrzyń fig. ', '     PCHNĄĆ W TĘ ŁÓDŹ JEŻA
@@ -202,9 +190,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Чуєш їх, доцю, га? Кумедна ж ти, прощайся без ґольфів! ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Чуєш їх, доцю, га? Кумедна ж ти, прощайся без ґольфів! ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     чуєш їх, доцю, га? кумедна ж ти, прощайся без ґольфів! ', '     ЧУЄШ ЇХ,
@@ -216,9 +204,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Příliš žluťoučký kůň úpěl ďábelské ódy ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Příliš žluťoučký kůň úpěl ďábelské ódy ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     příliš žluťoučký kůň úpěl ďábelské ódy ', '     PŘÍLIŠ ŽLUŤOUČKÝ KŮŇ ÚPĚL
@@ -230,11 +218,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Laŭ Ludoviko Zamenhof bongustas freŝa ĉeĥa manĝaĵo kun spicoj
-      ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Laŭ Ludoviko Zamenhof bongustas freŝa ĉeĥa manĝaĵo kun spicoj
-      ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     laŭ ludoviko zamenhof bongustas freŝa ĉeĥa manĝaĵo kun spicoj ', '     LAŬ
@@ -246,9 +232,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     いろはにほへと ちりぬるを わかよたれそ つねならむ うゐのおくやま けふこえて あさきゆめみし ゑひもせす ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     いろはにほへと ちりぬるを わかよたれそ つねならむ うゐのおくやま けふこえて あさきゆめみし ゑひもせす ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     いろはにほへと ちりぬるを わかよたれそ つねならむ うゐのおくやま けふこえて あさきゆめみし ゑひもせす ', '     いろはにほへと
@@ -260,9 +246,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: 'lower(''     Pijamalı hasta yağız şoföre çabucak güvendi. EXTRA: İ '')'
+  - name: COLUMN_1
     type: string
-  - name: 'upper(''     Pijamalı hasta yağız şoföre çabucak güvendi. EXTRA: İ '')'
+  - name: COLUMN_2
     type: string
   rows:
   - ['     pijamalı hasta yağız şoföre çabucak güvendi. extra: i̇ ', '     PIJAMALI
diff --git a/test/sql/integer-overflow.result b/test/sql/integer-overflow.result
index 6269cb547..a56fb2412 100644
--- a/test/sql/integer-overflow.result
+++ b/test/sql/integer-overflow.result
@@ -19,7 +19,7 @@ box.execute('SELECT (2147483647 * 2147483647 * 2147483647);')
 box.execute('SELECT (-9223372036854775808 / -1);')
 ---
 - metadata:
-  - name: (-9223372036854775808 / -1)
+  - name: COLUMN_1
     type: integer
   rows:
   - [9223372036854775808]
@@ -32,7 +32,7 @@ box.execute('SELECT (-9223372036854775808 - 1);')
 box.execute('SELECT (9223372036854775807 + 1);')
 ---
 - metadata:
-  - name: (9223372036854775807 + 1)
+  - name: COLUMN_1
     type: integer
   rows:
   - [9223372036854775808]
@@ -50,7 +50,7 @@ box.execute('SELECT 18446744073709551615 * 2;')
 box.execute('SELECT (-9223372036854775807 * (-2));')
 ---
 - metadata:
-  - name: (-9223372036854775807 * (-2))
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551614]
@@ -60,7 +60,7 @@ box.execute('SELECT (-9223372036854775807 * (-2));')
 box.execute('SELECT 9223372036854775808;')
 ---
 - metadata:
-  - name: '9223372036854775808'
+  - name: COLUMN_1
     type: integer
   rows:
   - [9223372036854775808]
@@ -74,7 +74,7 @@ box.execute('SELECT -9223372036854775809;')
 box.execute('SELECT 9223372036854775808 - 1;')
 ---
 - metadata:
-  - name: 9223372036854775808 - 1
+  - name: COLUMN_1
     type: integer
   rows:
   - [9223372036854775807]
@@ -82,7 +82,7 @@ box.execute('SELECT 9223372036854775808 - 1;')
 box.execute('SELECT 18446744073709551615;')
 ---
 - metadata:
-  - name: '18446744073709551615'
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551615]
@@ -98,7 +98,7 @@ box.execute('SELECT 18446744073709551616;')
 box.execute('SELECT CAST(\'9223372036854775808\' AS INTEGER);')
 ---
 - metadata:
-  - name: CAST('9223372036854775808' AS INTEGER)
+  - name: COLUMN_1
     type: integer
   rows:
   - [9223372036854775808]
diff --git a/test/sql/iproto.result b/test/sql/iproto.result
index 44ba499a0..ee1047fc1 100644
--- a/test/sql/iproto.result
+++ b/test/sql/iproto.result
@@ -372,11 +372,11 @@ parameters[3] = 33
 cn:execute('select $2, $1, $3', parameters)
 ---
 - metadata:
-  - name: $2
+  - name: COLUMN_1
     type: integer
-  - name: $1
+  - name: COLUMN_2
     type: integer
-  - name: $3
+  - name: COLUMN_3
     type: integer
   rows:
   - [22, 11, 33]
@@ -736,7 +736,7 @@ res.metadata
 cn:execute("SELECT zeroblob(1);")
 ---
 - metadata:
-  - name: zeroblob(1)
+  - name: COLUMN_1
     type: varbinary
   rows:
   - ["\0"]
@@ -749,7 +749,7 @@ res = cn:execute("SELECT randomblob(1);")
 ...
 res.metadata
 ---
-- - name: randomblob(1)
+- - name: COLUMN_1
     type: varbinary
 ...
 -- Type set during compilation stage, and since min/max are accept
@@ -759,7 +759,7 @@ res.metadata
 cn:execute("SELECT LEAST(1, 2, 3);")
 ---
 - metadata:
-  - name: LEAST(1, 2, 3)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [1]
@@ -767,7 +767,7 @@ cn:execute("SELECT LEAST(1, 2, 3);")
 cn:execute("SELECT GREATEST(1, 2, 3);")
 ---
 - metadata:
-  - name: GREATEST(1, 2, 3)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [3]
@@ -803,7 +803,7 @@ s = box.prepare([[ SELECT ?; ]])
 s:execute({42})
 ---
 - metadata:
-  - name: '?'
+  - name: COLUMN_1
     type: integer
   rows:
   - [42]
@@ -811,7 +811,7 @@ s:execute({42})
 box.execute('SELECT 1;')
 ---
 - metadata:
-  - name: '1'
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
diff --git a/test/sql/max-on-index.result b/test/sql/max-on-index.result
index 1cd488f85..a90f30993 100644
--- a/test/sql/max-on-index.result
+++ b/test/sql/max-on-index.result
@@ -48,7 +48,7 @@ box.execute("INSERT INTO test2 VALUES(1, 2)");
 box.execute("SELECT MAX(f1) FROM test1")
 ---
 - metadata:
-  - name: MAX(f1)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [4]
@@ -56,7 +56,7 @@ box.execute("SELECT MAX(f1) FROM test1")
 box.execute("SELECT MAX(f2) FROM test1")
 ---
 - metadata:
-  - name: MAX(f2)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [3]
@@ -64,7 +64,7 @@ box.execute("SELECT MAX(f2) FROM test1")
 box.execute("SELECT MAX(f1) FROM test2")
 ---
 - metadata:
-  - name: MAX(f1)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [1]
diff --git a/test/sql/misc.result b/test/sql/misc.result
index 0190a5897..6af11bfba 100644
--- a/test/sql/misc.result
+++ b/test/sql/misc.result
@@ -11,7 +11,7 @@ _ = box.space._session_settings:update('sql_default_engine', {{'=', 2, engine}})
 box.execute('select 1;')
 ---
 - metadata:
-  - name: '1'
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -78,7 +78,7 @@ box.execute('CREATE TABLE test (id INTEGER PRIMARY KEY, b TEXT CONSTRAINT c1 COL
 box.execute('SELECT 1;')
 ---
 - metadata:
-  - name: '1'
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -86,7 +86,7 @@ box.execute('SELECT 1;')
 box.execute('SELECT 1.5;')
 ---
 - metadata:
-  - name: '1.5'
+  - name: COLUMN_1
     type: double
   rows:
   - [1.5]
@@ -94,7 +94,7 @@ box.execute('SELECT 1.5;')
 box.execute('SELECT 1.0;')
 ---
 - metadata:
-  - name: '1.0'
+  - name: COLUMN_1
     type: double
   rows:
   - [1]
@@ -102,7 +102,7 @@ box.execute('SELECT 1.0;')
 box.execute('SELECT \'abc\';')
 ---
 - metadata:
-  - name: '''abc'''
+  - name: COLUMN_1
     type: string
   rows:
   - ['abc']
@@ -110,7 +110,7 @@ box.execute('SELECT \'abc\';')
 box.execute('SELECT X\'4D6564766564\'')
 ---
 - metadata:
-  - name: X'4D6564766564'
+  - name: COLUMN_1
     type: varbinary
   rows:
   - ['Medved']
diff --git a/test/sql/persistency.result b/test/sql/persistency.result
index 6d14d4c4e..95dde5714 100644
--- a/test/sql/persistency.result
+++ b/test/sql/persistency.result
@@ -41,9 +41,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -57,9 +57,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar LIMIT 2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -72,9 +72,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo=2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['bar', 2, 42, 'awesome']
@@ -86,9 +86,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo>2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foobar', 1000, 42, 'awesome']
@@ -100,9 +100,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo>=2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['bar', 2, 42, 'awesome']
@@ -115,9 +115,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo=10000")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows: []
 ...
@@ -128,9 +128,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo>10000")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows: []
 ...
@@ -141,9 +141,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -155,9 +155,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<2.001")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -170,9 +170,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<=2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -185,9 +185,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<100")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -200,9 +200,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE bar='foo'")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -210,7 +210,7 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE bar='foo'")
 box.execute("SELECT count(*) FROM foobar")
 ---
 - metadata:
-  - name: count(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -218,7 +218,7 @@ box.execute("SELECT count(*) FROM foobar")
 box.execute("SELECT count(*) FROM foobar WHERE bar='foo'")
 ---
 - metadata:
-  - name: count(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -230,9 +230,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar ORDER BY bar")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['bar', 2, 42, 'awesome']
@@ -246,9 +246,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar ORDER BY bar DESC")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foobar', 1000, 42, 'awesome']
@@ -263,7 +263,7 @@ box.execute("REPLACE INTO foobar VALUES (1, 'cacodaemon')")
 box.execute("SELECT COUNT(*) FROM foobar WHERE foo=1")
 ---
 - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -271,7 +271,7 @@ box.execute("SELECT COUNT(*) FROM foobar WHERE foo=1")
 box.execute("SELECT COUNT(*) FROM foobar WHERE bar='cacodaemon'")
 ---
 - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -283,7 +283,7 @@ box.execute("DELETE FROM foobar WHERE bar='cacodaemon'")
 box.execute("SELECT COUNT(*) FROM foobar WHERE bar='cacodaemon'")
 ---
 - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
diff --git a/test/sql/prepared.result b/test/sql/prepared.result
index 666f6e1d3..0db2cc03f 100644
--- a/test/sql/prepared.result
+++ b/test/sql/prepared.result
@@ -425,13 +425,13 @@ s = prepare("SELECT count(*), count(a - 3), max(b), abs(id) FROM test WHERE b =
 execute(s.stmt_id)
  | ---
  | - metadata:
- |   - name: count(*)
+ |   - name: COLUMN_1
  |     type: integer
- |   - name: count(a - 3)
+ |   - name: COLUMN_2
  |     type: integer
- |   - name: max(b)
+ |   - name: COLUMN_3
  |     type: scalar
- |   - name: abs(id)
+ |   - name: COLUMN_4
  |     type: number
  |   rows:
  |   - [1, 1, '3', 1]
@@ -439,13 +439,13 @@ execute(s.stmt_id)
 execute(s.stmt_id)
  | ---
  | - metadata:
- |   - name: count(*)
+ |   - name: COLUMN_1
  |     type: integer
- |   - name: count(a - 3)
+ |   - name: COLUMN_2
  |     type: integer
- |   - name: max(b)
+ |   - name: COLUMN_3
  |     type: scalar
- |   - name: abs(id)
+ |   - name: COLUMN_4
  |     type: number
  |   rows:
  |   - [1, 1, '3', 1]
@@ -480,7 +480,7 @@ res = execute(s.stmt_id)
  | ...
 res.metadata
  | ---
- | - - name: group_concat(TRIM(TRAILING FROM t),x'0a')
+ | - - name: COLUMN_13
  |     type: string
  | ...
 unprepare(s.stmt_id)
@@ -838,11 +838,11 @@ s = prepare('SELECT :a, :b, :c');
 execute(s.stmt_id, {{[':a'] = 1}, {[':b'] = 2}, {[':c'] = 3}});
  | ---
  | - metadata:
- |   - name: :a
+ |   - name: COLUMN_1
  |     type: integer
- |   - name: :b
+ |   - name: COLUMN_2
  |     type: integer
- |   - name: :c
+ |   - name: COLUMN_3
  |     type: integer
  |   rows:
  |   - [1, 2, 3]
@@ -850,11 +850,11 @@ execute(s.stmt_id, {{[':a'] = 1}, {[':b'] = 2}, {[':c'] = 3}});
 execute(s.stmt_id, {{[':a'] = 1}, {[':b'] = 2}});
  | ---
  | - metadata:
- |   - name: :a
+ |   - name: COLUMN_1
  |     type: integer
- |   - name: :b
+ |   - name: COLUMN_2
  |     type: integer
- |   - name: :c
+ |   - name: COLUMN_3
  |     type: boolean
  |   rows:
  |   - [1, 2, null]
@@ -862,11 +862,11 @@ execute(s.stmt_id, {{[':a'] = 1}, {[':b'] = 2}});
 execute(s.stmt_id);
  | ---
  | - metadata:
- |   - name: :a
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: :b
+ |   - name: COLUMN_2
  |     type: boolean
- |   - name: :c
+ |   - name: COLUMN_3
  |     type: boolean
  |   rows:
  |   - [null, null, null]
diff --git a/test/sql/row-count.result b/test/sql/row-count.result
index 02acd79b5..7591d1630 100644
--- a/test/sql/row-count.result
+++ b/test/sql/row-count.result
@@ -16,7 +16,7 @@ box.execute("CREATE TABLE t1 (s1 VARCHAR(10) PRIMARY KEY);")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -24,7 +24,7 @@ box.execute("SELECT ROW_COUNT();")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -36,7 +36,7 @@ box.execute("CREATE TABLE t2 (s1 VARCHAR(10) PRIMARY KEY, s2 VARCHAR(10) REFEREN
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -52,7 +52,7 @@ box.execute("INSERT INTO t3 VALUES (0, 0, 0);")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -64,7 +64,7 @@ box.execute("CREATE TRIGGER x AFTER DELETE ON t1 FOR EACH ROW BEGIN UPDATE t3 SE
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -76,7 +76,7 @@ box.execute("INSERT INTO t1 VALUES ('a');")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -88,7 +88,7 @@ box.execute("INSERT INTO t2 VALUES ('a','a');")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -100,7 +100,7 @@ box.execute("INSERT INTO t1 VALUES ('b'), ('c'), ('d');")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -113,7 +113,7 @@ box.execute("REPLACE INTO t2 VALUES('a', 'c');")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [2]
@@ -125,7 +125,7 @@ box.execute("DELETE FROM t1;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [4]
@@ -141,7 +141,7 @@ box.execute("TRUNCATE TABLE t3;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -157,7 +157,7 @@ box.execute("UPDATE t3 SET i2 = 666;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -172,7 +172,7 @@ box.execute("DELETE FROM t3 WHERE 0 = 0;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -188,7 +188,7 @@ box.execute("DELETE FROM t3")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -222,7 +222,7 @@ box.execute("DELETE FROM tt1 WHERE id = 2;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -252,7 +252,7 @@ box.execute("START TRANSACTION;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -264,7 +264,7 @@ box.execute("COMMIT;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -277,7 +277,7 @@ box.execute("COMMIT;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -286,7 +286,7 @@ box.execute("SELECT ROW_COUNT();")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -308,7 +308,7 @@ box.execute("EXPLAIN QUERY PLAN INSERT INTO t1 VALUES ('b'), ('c'), ('d');")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
diff --git a/test/sql/transition.result b/test/sql/transition.result
index c14055b4e..8680e3cec 100644
--- a/test/sql/transition.result
+++ b/test/sql/transition.result
@@ -38,9 +38,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -54,9 +54,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar LIMIT 2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -69,9 +69,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo=2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['bar', 2, 42, 'awesome']
@@ -83,9 +83,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo>2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foobar', 1000, 42, 'awesome']
@@ -97,9 +97,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo>=2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['bar', 2, 42, 'awesome']
@@ -112,9 +112,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo=10000")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows: []
 ...
@@ -125,9 +125,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo>10000")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows: []
 ...
@@ -138,9 +138,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -152,9 +152,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<2.001")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -167,9 +167,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<=2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -182,9 +182,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<100")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -197,9 +197,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE bar='foo'")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -207,7 +207,7 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE bar='foo'")
 box.execute("SELECT count(*) FROM foobar")
 ---
 - metadata:
-  - name: count(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -215,7 +215,7 @@ box.execute("SELECT count(*) FROM foobar")
 box.execute("SELECT count(*) FROM foobar WHERE bar='foo'")
 ---
 - metadata:
-  - name: count(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -227,9 +227,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar ORDER BY bar")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['bar', 2, 42, 'awesome']
@@ -243,9 +243,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar ORDER BY bar DESC")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foobar', 1000, 42, 'awesome']
@@ -260,7 +260,7 @@ box.execute("REPLACE INTO foobar VALUES (1, 'cacodaemon')")
 box.execute("SELECT COUNT(*) FROM foobar WHERE foo=1")
 ---
 - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -268,7 +268,7 @@ box.execute("SELECT COUNT(*) FROM foobar WHERE foo=1")
 box.execute("SELECT COUNT(*) FROM foobar WHERE bar='cacodaemon'")
 ---
 - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -280,7 +280,7 @@ box.execute("DELETE FROM foobar WHERE bar='cacodaemon'")
 box.execute("SELECT COUNT(*) FROM foobar WHERE bar='cacodaemon'")
 ---
 - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
diff --git a/test/sql/types.result b/test/sql/types.result
index 54aff460e..8204b22bd 100644
--- a/test/sql/types.result
+++ b/test/sql/types.result
@@ -54,8 +54,8 @@ box.execute("CREATE VIEW v1 AS SELECT b + a, b - a FROM t1;")
 ...
 box.space.V1:format()
 ---
-- [{'type': 'number', 'nullable_action': 'none', 'name': 'b + a', 'is_nullable': true},
-  {'type': 'number', 'nullable_action': 'none', 'name': 'b - a', 'is_nullable': true}]
+- [{'type': 'number', 'nullable_action': 'none', 'name': 'COLUMN_1', 'is_nullable': true},
+  {'type': 'number', 'nullable_action': 'none', 'name': 'COLUMN_2', 'is_nullable': true}]
 ...
 -- gh-2494: index's part also features correct declared type.
 --
@@ -197,7 +197,7 @@ box.execute("SELECT randomblob(5) || 'x';")
 box.execute("VALUES (TYPEOF(randomblob(5) || zeroblob(5)));")
 ---
 - metadata:
-  - name: column1
+  - name: COLUMN_1
     type: string
   rows:
   - ['varbinary']
@@ -230,7 +230,7 @@ box.execute("SELECT * FROM t1 WHERE 'blob' LIKE x'0000';")
 box.execute("SELECT s LIKE NULL FROM t1;")
 ---
 - metadata:
-  - name: s LIKE NULL
+  - name: COLUMN_1
     type: integer
   rows:
   - [null]
@@ -256,7 +256,7 @@ box.execute("SELECT * FROM t1 WHERE 'int' LIKE 4;")
 box.execute("SELECT NULL LIKE s FROM t1;")
 ---
 - metadata:
-  - name: NULL LIKE s
+  - name: COLUMN_1
     type: integer
   rows:
   - [null]
@@ -295,7 +295,7 @@ box.space.T1:drop()
 box.execute('SELECT 1 + 1;')
 ---
 - metadata:
-  - name: 1 + 1
+  - name: COLUMN_1
     type: integer
   rows:
   - [2]
@@ -303,7 +303,7 @@ box.execute('SELECT 1 + 1;')
 box.execute('SELECT 1 + 1.1;')
 ---
 - metadata:
-  - name: 1 + 1.1
+  - name: COLUMN_1
     type: double
   rows:
   - [2.1]
@@ -311,7 +311,7 @@ box.execute('SELECT 1 + 1.1;')
 box.execute('SELECT \'9223372036854\' + 1;')
 ---
 - metadata:
-  - name: '''9223372036854'' + 1'
+  - name: COLUMN_1
     type: integer
   rows:
   - [9223372036855]
@@ -320,7 +320,7 @@ box.execute('SELECT \'9223372036854\' + 1;')
 box.execute('SELECT ?', {true})
 ---
 - metadata:
-  - name: '?'
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -481,7 +481,7 @@ s:drop()
 box.execute("SELECT 18446744073709551615 > 18446744073709551614;")
 ---
 - metadata:
-  - name: 18446744073709551615 > 18446744073709551614
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -489,7 +489,7 @@ box.execute("SELECT 18446744073709551615 > 18446744073709551614;")
 box.execute("SELECT 18446744073709551615 > -9223372036854775808;")
 ---
 - metadata:
-  - name: 18446744073709551615 > -9223372036854775808
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -497,7 +497,7 @@ box.execute("SELECT 18446744073709551615 > -9223372036854775808;")
 box.execute("SELECT -1 < 18446744073709551615;")
 ---
 - metadata:
-  - name: -1 < 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -505,7 +505,7 @@ box.execute("SELECT -1 < 18446744073709551615;")
 box.execute("SELECT 1.5 < 18446744073709551615")
 ---
 - metadata:
-  - name: 1.5 < 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -513,7 +513,7 @@ box.execute("SELECT 1.5 < 18446744073709551615")
 box.execute("SELECT 1.5 > 18446744073709551615")
 ---
 - metadata:
-  - name: 1.5 > 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [false]
@@ -521,7 +521,7 @@ box.execute("SELECT 1.5 > 18446744073709551615")
 box.execute("SELECT 18446744073709551615 > 1.5")
 ---
 - metadata:
-  - name: 18446744073709551615 > 1.5
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -529,7 +529,7 @@ box.execute("SELECT 18446744073709551615 > 1.5")
 box.execute("SELECT 18446744073709551615 < 1.5")
 ---
 - metadata:
-  - name: 18446744073709551615 < 1.5
+  - name: COLUMN_1
     type: boolean
   rows:
   - [false]
@@ -537,7 +537,7 @@ box.execute("SELECT 18446744073709551615 < 1.5")
 box.execute("SELECT 18446744073709551615 = 18446744073709551615;")
 ---
 - metadata:
-  - name: 18446744073709551615 = 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -545,7 +545,7 @@ box.execute("SELECT 18446744073709551615 = 18446744073709551615;")
 box.execute("SELECT 18446744073709551615 > -9223372036854775808;")
 ---
 - metadata:
-  - name: 18446744073709551615 > -9223372036854775808
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -553,7 +553,7 @@ box.execute("SELECT 18446744073709551615 > -9223372036854775808;")
 box.execute("SELECT 18446744073709551615 < -9223372036854775808;")
 ---
 - metadata:
-  - name: 18446744073709551615 < -9223372036854775808
+  - name: COLUMN_1
     type: boolean
   rows:
   - [false]
@@ -561,7 +561,7 @@ box.execute("SELECT 18446744073709551615 < -9223372036854775808;")
 box.execute("SELECT -1 < 18446744073709551615;")
 ---
 - metadata:
-  - name: -1 < 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -569,7 +569,7 @@ box.execute("SELECT -1 < 18446744073709551615;")
 box.execute("SELECT -1 > 18446744073709551615;")
 ---
 - metadata:
-  - name: -1 > 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [false]
@@ -577,7 +577,7 @@ box.execute("SELECT -1 > 18446744073709551615;")
 box.execute("SELECT 18446744073709551610 - 18446744073709551615;")
 ---
 - metadata:
-  - name: 18446744073709551610 - 18446744073709551615
+  - name: COLUMN_1
     type: integer
   rows:
   - [-5]
@@ -585,7 +585,7 @@ box.execute("SELECT 18446744073709551610 - 18446744073709551615;")
 box.execute("SELECT 18446744073709551615 = null;")
 ---
 - metadata:
-  - name: 18446744073709551615 = null
+  - name: COLUMN_1
     type: boolean
   rows:
   - [null]
@@ -593,7 +593,7 @@ box.execute("SELECT 18446744073709551615 = null;")
 box.execute("SELECT 18446744073709551615 = 18446744073709551615.0;")
 ---
 - metadata:
-  - name: 18446744073709551615 = 18446744073709551615.0
+  - name: COLUMN_1
     type: boolean
   rows:
   - [false]
@@ -601,7 +601,7 @@ box.execute("SELECT 18446744073709551615 = 18446744073709551615.0;")
 box.execute("SELECT 18446744073709551615.0 > 18446744073709551615")
 ---
 - metadata:
-  - name: 18446744073709551615.0 > 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -609,7 +609,7 @@ box.execute("SELECT 18446744073709551615.0 > 18446744073709551615")
 box.execute("SELECT 18446744073709551615 IN ('18446744073709551615', 18446744073709551615.0)")
 ---
 - metadata:
-  - name: 18446744073709551615 IN ('18446744073709551615', 18446744073709551615.0)
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -617,7 +617,7 @@ box.execute("SELECT 18446744073709551615 IN ('18446744073709551615', 18446744073
 box.execute("SELECT 1 LIMIT 18446744073709551615;")
 ---
 - metadata:
-  - name: '1'
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -625,7 +625,7 @@ box.execute("SELECT 1 LIMIT 18446744073709551615;")
 box.execute("SELECT 1 LIMIT 1 OFFSET 18446744073709551614;")
 ---
 - metadata:
-  - name: '1'
+  - name: COLUMN_1
     type: integer
   rows: []
 ...
@@ -637,7 +637,7 @@ box.execute("SELECT CAST('18446744073' || '709551616' AS INTEGER);")
 box.execute("SELECT CAST('18446744073' || '709551615' AS INTEGER);")
 ---
 - metadata:
-  - name: CAST('18446744073' || '709551615' AS INTEGER)
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551615]
@@ -645,7 +645,7 @@ box.execute("SELECT CAST('18446744073' || '709551615' AS INTEGER);")
 box.execute("SELECT 18446744073709551610 + 5;")
 ---
 - metadata:
-  - name: 18446744073709551610 + 5
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551615]
@@ -653,7 +653,7 @@ box.execute("SELECT 18446744073709551610 + 5;")
 box.execute("SELECT 18446744073709551615 * 1;")
 ---
 - metadata:
-  - name: 18446744073709551615 * 1
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551615]
@@ -661,7 +661,7 @@ box.execute("SELECT 18446744073709551615 * 1;")
 box.execute("SELECT 1 / 18446744073709551615;")
 ---
 - metadata:
-  - name: 1 / 18446744073709551615
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -669,7 +669,7 @@ box.execute("SELECT 1 / 18446744073709551615;")
 box.execute("SELECT 18446744073709551615 / 18446744073709551615;")
 ---
 - metadata:
-  - name: 18446744073709551615 / 18446744073709551615
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -677,7 +677,7 @@ box.execute("SELECT 18446744073709551615 / 18446744073709551615;")
 box.execute("SELECT 18446744073709551615 / -9223372036854775808;")
 ---
 - metadata:
-  - name: 18446744073709551615 / -9223372036854775808
+  - name: COLUMN_1
     type: integer
   rows:
   - [-1]
@@ -771,7 +771,7 @@ box.execute("INSERT INTO t VALUES (2, -1);")
 box.execute("SELECT sum(i) FROM t;")
 ---
 - metadata:
-  - name: sum(i)
+  - name: COLUMN_1
     type: number
   rows:
   - [18446744073709551613]
@@ -779,7 +779,7 @@ box.execute("SELECT sum(i) FROM t;")
 box.execute("SELECT avg(i) FROM t;")
 ---
 - metadata:
-  - name: avg(i)
+  - name: COLUMN_1
     type: number
   rows:
   - [6148914691236516864]
@@ -787,7 +787,7 @@ box.execute("SELECT avg(i) FROM t;")
 box.execute("SELECT total(i) FROM t;")
 ---
 - metadata:
-  - name: total(i)
+  - name: COLUMN_1
     type: number
   rows:
   - [1.844674407371e+19]
@@ -795,7 +795,7 @@ box.execute("SELECT total(i) FROM t;")
 box.execute("SELECT min(i) FROM t;")
 ---
 - metadata:
-  - name: min(i)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [-1]
@@ -803,7 +803,7 @@ box.execute("SELECT min(i) FROM t;")
 box.execute("SELECT max(i) FROM t;")
 ---
 - metadata:
-  - name: max(i)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [18446744073709551613]
@@ -811,7 +811,7 @@ box.execute("SELECT max(i) FROM t;")
 box.execute("SELECT count(i) FROM t;")
 ---
 - metadata:
-  - name: count(i)
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -819,7 +819,7 @@ box.execute("SELECT count(i) FROM t;")
 box.execute("SELECT group_concat(i) FROM t;")
 ---
 - metadata:
-  - name: group_concat(i)
+  - name: COLUMN_1
     type: string
   rows:
   - ['1,-1,18446744073709551613']
@@ -831,7 +831,7 @@ box.execute("DELETE FROM t WHERE i < 18446744073709551613;")
 box.execute("SELECT lower(i) FROM t;")
 ---
 - metadata:
-  - name: lower(i)
+  - name: COLUMN_1
     type: string
   rows:
   - ['18446744073709551613']
@@ -839,7 +839,7 @@ box.execute("SELECT lower(i) FROM t;")
 box.execute("SELECT upper(i) FROM t;")
 ---
 - metadata:
-  - name: upper(i)
+  - name: COLUMN_1
     type: string
   rows:
   - ['18446744073709551613']
@@ -847,7 +847,7 @@ box.execute("SELECT upper(i) FROM t;")
 box.execute("SELECT abs(i) FROM t;")
 ---
 - metadata:
-  - name: abs(i)
+  - name: COLUMN_1
     type: number
   rows:
   - [18446744073709551613]
@@ -855,7 +855,7 @@ box.execute("SELECT abs(i) FROM t;")
 box.execute("SELECT typeof(i) FROM t;")
 ---
 - metadata:
-  - name: typeof(i)
+  - name: COLUMN_1
     type: string
   rows:
   - ['integer']
@@ -863,7 +863,7 @@ box.execute("SELECT typeof(i) FROM t;")
 box.execute("SELECT quote(i) FROM t;")
 ---
 - metadata:
-  - name: quote(i)
+  - name: COLUMN_1
     type: string
   rows:
   - [18446744073709551613]
@@ -871,7 +871,7 @@ box.execute("SELECT quote(i) FROM t;")
 box.execute("SELECT LEAST(-1, i) FROM t;")
 ---
 - metadata:
-  - name: LEAST(-1, i)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [-1]
@@ -879,7 +879,7 @@ box.execute("SELECT LEAST(-1, i) FROM t;")
 box.execute("SELECT quote(i) FROM t;")
 ---
 - metadata:
-  - name: quote(i)
+  - name: COLUMN_1
     type: string
   rows:
   - [18446744073709551613]
@@ -1012,7 +1012,7 @@ box.space.T1:drop()
 box.execute("SELECT CAST(18446744073709551615 AS NUMBER);")
 ---
 - metadata:
-  - name: CAST(18446744073709551615 AS NUMBER)
+  - name: COLUMN_1
     type: number
   rows:
   - [18446744073709551615]
@@ -1020,7 +1020,7 @@ box.execute("SELECT CAST(18446744073709551615 AS NUMBER);")
 box.execute("SELECT CAST(18446744073709551615 AS TEXT);")
 ---
 - metadata:
-  - name: CAST(18446744073709551615 AS TEXT)
+  - name: COLUMN_1
     type: string
   rows:
   - ['18446744073709551615']
@@ -1028,7 +1028,7 @@ box.execute("SELECT CAST(18446744073709551615 AS TEXT);")
 box.execute("SELECT CAST(18446744073709551615 AS SCALAR);")
 ---
 - metadata:
-  - name: CAST(18446744073709551615 AS SCALAR)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [18446744073709551615]
@@ -1036,7 +1036,7 @@ box.execute("SELECT CAST(18446744073709551615 AS SCALAR);")
 box.execute("SELECT CAST(18446744073709551615 AS BOOLEAN);")
 ---
 - metadata:
-  - name: CAST(18446744073709551615 AS BOOLEAN)
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -1044,7 +1044,7 @@ box.execute("SELECT CAST(18446744073709551615 AS BOOLEAN);")
 box.execute("SELECT CAST('18446744073709551615' AS INTEGER);")
 ---
 - metadata:
-  - name: CAST('18446744073709551615' AS INTEGER)
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551615]
@@ -1077,7 +1077,7 @@ box.execute("SELECT id FROM t1;")
 box.execute("SELECT CAST(123 AS UNSIGNED);")
 ---
 - metadata:
-  - name: CAST(123 AS UNSIGNED)
+  - name: COLUMN_1
     type: unsigned
   rows:
   - [123]
@@ -1090,7 +1090,7 @@ box.execute("SELECT CAST(-123 AS UNSIGNED);")
 box.execute("SELECT CAST(1.5 AS UNSIGNED);")
 ---
 - metadata:
-  - name: CAST(1.5 AS UNSIGNED)
+  - name: COLUMN_1
     type: unsigned
   rows:
   - [1]
@@ -1098,7 +1098,7 @@ box.execute("SELECT CAST(1.5 AS UNSIGNED);")
 box.execute("SELECT CAST(-1.5 AS UNSIGNED);")
 ---
 - metadata:
-  - name: CAST(-1.5 AS UNSIGNED)
+  - name: COLUMN_1
     type: unsigned
   rows:
   - [-1]
@@ -1106,7 +1106,7 @@ box.execute("SELECT CAST(-1.5 AS UNSIGNED);")
 box.execute("SELECT CAST(true AS UNSIGNED);")
 ---
 - metadata:
-  - name: CAST(true AS UNSIGNED)
+  - name: COLUMN_1
     type: unsigned
   rows:
   - [1]
@@ -1114,7 +1114,7 @@ box.execute("SELECT CAST(true AS UNSIGNED);")
 box.execute("SELECT CAST('123' AS UNSIGNED);")
 ---
 - metadata:
-  - name: CAST('123' AS UNSIGNED)
+  - name: COLUMN_1
     type: unsigned
   rows:
   - [123]
@@ -1146,7 +1146,7 @@ box.space.T:drop()
 box.execute("SELECT CASE 1 WHEN 1 THEN x'0000000000' WHEN 2 THEN 'str' END")
 ---
 - metadata:
-  - name: CASE 1 WHEN 1 THEN x'0000000000' WHEN 2 THEN 'str' END
+  - name: COLUMN_1
     type: scalar
   rows:
   - ["\0\0\0\0\0"]
@@ -1154,7 +1154,7 @@ box.execute("SELECT CASE 1 WHEN 1 THEN x'0000000000' WHEN 2 THEN 'str' END")
 box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 END")
 ---
 - metadata:
-  - name: CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 END
+  - name: COLUMN_1
     type: integer
   rows:
   - [666]
@@ -1162,7 +1162,7 @@ box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 END")
 box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 ELSE 321 END")
 ---
 - metadata:
-  - name: CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 ELSE 321 END
+  - name: COLUMN_1
     type: integer
   rows:
   - [666]
@@ -1170,7 +1170,7 @@ box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 ELSE 321 END")
 box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 ELSE 'asd' END")
 ---
 - metadata:
-  - name: CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 ELSE 'asd' END
+  - name: COLUMN_1
     type: scalar
   rows:
   - [666]
@@ -1178,8 +1178,7 @@ box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 ELSE 'asd' END")
 box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4 WHEN 'e' THEN 5 WHEN 'f' THEN 6 END;")
 ---
 - metadata:
-  - name: CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4
-      WHEN 'e' THEN 5 WHEN 'f' THEN 6 END
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -1187,8 +1186,7 @@ box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHE
 box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4 WHEN 'e' THEN 5 WHEN 'f' THEN 'asd' END;")
 ---
 - metadata:
-  - name: CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4
-      WHEN 'e' THEN 5 WHEN 'f' THEN 'asd' END
+  - name: COLUMN_1
     type: scalar
   rows:
   - [1]
@@ -1196,8 +1194,7 @@ box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHE
 box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4 WHEN 'e' THEN 5 WHEN 'f' THEN 6 ELSE 'asd' END;")
 ---
 - metadata:
-  - name: CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4
-      WHEN 'e' THEN 5 WHEN 'f' THEN 6 ELSE 'asd' END
+  - name: COLUMN_1
     type: scalar
   rows:
   - [1]
@@ -1205,8 +1202,7 @@ box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHE
 box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4 WHEN 'e' THEN 5 WHEN 'f' THEN 6 ELSE 7 END;")
 ---
 - metadata:
-  - name: CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4
-      WHEN 'e' THEN 5 WHEN 'f' THEN 6 ELSE 7 END
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -1284,7 +1280,7 @@ box.execute("SELECT total(v) FROM t;")
 box.execute("SELECT min(v) FROM t;")
 ---
 - metadata:
-  - name: min(v)
+  - name: COLUMN_1
     type: scalar
   rows:
   - ['abc']
@@ -1292,7 +1288,7 @@ box.execute("SELECT min(v) FROM t;")
 box.execute("SELECT max(v) FROM t;")
 ---
 - metadata:
-  - name: max(v)
+  - name: COLUMN_1
     type: scalar
   rows:
   - ['abc']
@@ -1300,7 +1296,7 @@ box.execute("SELECT max(v) FROM t;")
 box.execute("SELECT count(v) FROM t;")
 ---
 - metadata:
-  - name: count(v)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -1308,7 +1304,7 @@ box.execute("SELECT count(v) FROM t;")
 box.execute("SELECT group_concat(v) FROM t;")
 ---
 - metadata:
-  - name: group_concat(v)
+  - name: COLUMN_1
     type: string
   rows:
   - ['abc']
@@ -1331,7 +1327,7 @@ box.execute("SELECT abs(v) FROM t;")
 box.execute("SELECT typeof(v) FROM t;")
 ---
 - metadata:
-  - name: typeof(v)
+  - name: COLUMN_1
     type: string
   rows:
   - ['varbinary']
@@ -1339,7 +1335,7 @@ box.execute("SELECT typeof(v) FROM t;")
 box.execute("SELECT quote(v) FROM t;")
 ---
 - metadata:
-  - name: quote(v)
+  - name: COLUMN_1
     type: string
   rows:
   - ['X''616263''']
@@ -1347,7 +1343,7 @@ box.execute("SELECT quote(v) FROM t;")
 box.execute("SELECT LEAST(v, x'') FROM t;")
 ---
 - metadata:
-  - name: LEAST(v, x'')
+  - name: COLUMN_1
     type: scalar
   rows:
   - ['']
@@ -1467,7 +1463,7 @@ box.execute("SELECT CAST(true AS VARBINARY);")
 box.execute("SELECT CAST('asd' AS VARBINARY);")
 ---
 - metadata:
-  - name: CAST('asd' AS VARBINARY)
+  - name: COLUMN_1
     type: varbinary
   rows:
   - ['asd']
@@ -1475,7 +1471,7 @@ box.execute("SELECT CAST('asd' AS VARBINARY);")
 box.execute("SELECT CAST(x'' AS VARBINARY);")
 ---
 - metadata:
-  - name: CAST(x'' AS VARBINARY)
+  - name: COLUMN_1
     type: varbinary
   rows:
   - ['']
@@ -1494,9 +1490,9 @@ box.execute("INSERT INTO t VALUES (1, 1, 1), (2, NULL, NULL);")
 box.execute("SELECT typeof(a), typeof(s) FROM t;")
 ---
 - metadata:
-  - name: typeof(a)
+  - name: COLUMN_1
     type: string
-  - name: typeof(s)
+  - name: COLUMN_2
     type: string
   rows:
   - ['integer', 'integer']
@@ -1513,7 +1509,7 @@ box.execute('INSERT INTO t1 VALUES (1, NULL, NULL);')
 box.execute('SELECT typeof(a & b) FROM t1;')
 ---
 - metadata:
-  - name: typeof(a & b)
+  - name: COLUMN_1
     type: string
   rows:
   - ['integer']
@@ -1521,11 +1517,11 @@ box.execute('SELECT typeof(a & b) FROM t1;')
 box.execute('SELECT typeof(a), typeof(b), typeof(a & b) FROM t1')
 ---
 - metadata:
-  - name: typeof(a)
+  - name: COLUMN_1
     type: string
-  - name: typeof(b)
+  - name: COLUMN_2
     type: string
-  - name: typeof(a & b)
+  - name: COLUMN_3
     type: string
   rows:
   - ['integer', 'integer', 'integer']
@@ -1533,7 +1529,7 @@ box.execute('SELECT typeof(a), typeof(b), typeof(a & b) FROM t1')
 box.execute("SELECT typeof(CAST(0 AS UNSIGNED));")
 ---
 - metadata:
-  - name: typeof(CAST(0 AS UNSIGNED))
+  - name: COLUMN_1
     type: string
   rows:
   - ['unsigned']
@@ -1693,7 +1689,7 @@ box.execute('DROP TABLE t1;')
 box.execute("SELECT 1.0;")
 ---
 - metadata:
-  - name: '1.0'
+  - name: COLUMN_1
     type: double
   rows:
   - [1]
@@ -1701,7 +1697,7 @@ box.execute("SELECT 1.0;")
 box.execute("SELECT .01;")
 ---
 - metadata:
-  - name: '.01'
+  - name: COLUMN_1
     type: double
   rows:
   - [0.01]
@@ -1709,7 +1705,7 @@ box.execute("SELECT .01;")
 box.execute("SELECT CAST(1 AS DOUBLE);")
 ---
 - metadata:
-  - name: CAST(1 AS DOUBLE)
+  - name: COLUMN_1
     type: double
   rows:
   - [1]
@@ -1717,7 +1713,7 @@ box.execute("SELECT CAST(1 AS DOUBLE);")
 box.execute("SELECT CAST(1.123 AS DOUBLE);")
 ---
 - metadata:
-  - name: CAST(1.123 AS DOUBLE)
+  - name: COLUMN_1
     type: double
   rows:
   - [1.123]
@@ -1735,7 +1731,7 @@ box.execute("SELECT CAST('asd' AS DOUBLE);")
 box.execute("SELECT CAST('1' AS DOUBLE);")
 ---
 - metadata:
-  - name: CAST('1' AS DOUBLE)
+  - name: COLUMN_1
     type: double
   rows:
   - [1]
@@ -1743,7 +1739,7 @@ box.execute("SELECT CAST('1' AS DOUBLE);")
 box.execute("SELECT CAST('1.123' AS DOUBLE);")
 ---
 - metadata:
-  - name: CAST('1.123' AS DOUBLE)
+  - name: COLUMN_1
     type: double
   rows:
   - [1.123]
@@ -1761,7 +1757,7 @@ box.execute("SELECT CAST(x'35' AS DOUBLE);")
 box.execute("SELECT CAST(CAST(x'35' AS STRING) AS DOUBLE);")
 ---
 - metadata:
-  - name: CAST(CAST(x'35' AS STRING) AS DOUBLE)
+  - name: COLUMN_1
     type: double
   rows:
   - [5]
@@ -1795,7 +1791,7 @@ box.execute('SELECT * FROM t;')
 box.execute('SELECT d / 100 FROM t;')
 ---
 - metadata:
-  - name: d / 100
+  - name: COLUMN_1
     type: double
   rows:
   - [0.1]
@@ -1828,7 +1824,7 @@ box.execute('SELECT * from t WHERE d = 3.3;')
 box.execute("SELECT sum(d) FROM t;")
 ---
 - metadata:
-  - name: sum(d)
+  - name: COLUMN_1
     type: number
   rows:
   - [18000000000000000000]
@@ -1836,7 +1832,7 @@ box.execute("SELECT sum(d) FROM t;")
 box.execute("SELECT avg(d) FROM t;")
 ---
 - metadata:
-  - name: avg(d)
+  - name: COLUMN_1
     type: number
   rows:
   - [4500000000000000000]
@@ -1844,7 +1840,7 @@ box.execute("SELECT avg(d) FROM t;")
 box.execute("SELECT total(d) FROM t;")
 ---
 - metadata:
-  - name: total(d)
+  - name: COLUMN_1
     type: number
   rows:
   - [18000000000000000000]
@@ -1852,7 +1848,7 @@ box.execute("SELECT total(d) FROM t;")
 box.execute("SELECT min(d) FROM t;")
 ---
 - metadata:
-  - name: min(d)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [-2]
@@ -1860,7 +1856,7 @@ box.execute("SELECT min(d) FROM t;")
 box.execute("SELECT max(d) FROM t;")
 ---
 - metadata:
-  - name: max(d)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [18000000000000000000]
@@ -1868,7 +1864,7 @@ box.execute("SELECT max(d) FROM t;")
 box.execute("SELECT count(d) FROM t;")
 ---
 - metadata:
-  - name: count(d)
+  - name: COLUMN_1
     type: integer
   rows:
   - [4]
@@ -1876,7 +1872,7 @@ box.execute("SELECT count(d) FROM t;")
 box.execute("SELECT group_concat(d) FROM t;")
 ---
 - metadata:
-  - name: group_concat(d)
+  - name: COLUMN_1
     type: string
   rows:
   - ['10.0,-2.0,3.3,1.8e+19']
@@ -1884,7 +1880,7 @@ box.execute("SELECT group_concat(d) FROM t;")
 box.execute("SELECT lower(d) FROM t;")
 ---
 - metadata:
-  - name: lower(d)
+  - name: COLUMN_1
     type: string
   rows:
   - ['10.0']
@@ -1895,7 +1891,7 @@ box.execute("SELECT lower(d) FROM t;")
 box.execute("SELECT upper(d) FROM t;")
 ---
 - metadata:
-  - name: upper(d)
+  - name: COLUMN_1
     type: string
   rows:
   - ['10.0']
@@ -1906,7 +1902,7 @@ box.execute("SELECT upper(d) FROM t;")
 box.execute("SELECT abs(d) FROM t;")
 ---
 - metadata:
-  - name: abs(d)
+  - name: COLUMN_1
     type: number
   rows:
   - [10]
@@ -1917,7 +1913,7 @@ box.execute("SELECT abs(d) FROM t;")
 box.execute("SELECT typeof(d) FROM t;")
 ---
 - metadata:
-  - name: typeof(d)
+  - name: COLUMN_1
     type: string
   rows:
   - ['double']
@@ -1928,7 +1924,7 @@ box.execute("SELECT typeof(d) FROM t;")
 box.execute("SELECT quote(d) FROM t;")
 ---
 - metadata:
-  - name: quote(d)
+  - name: COLUMN_1
     type: string
   rows:
   - ['10.0']
@@ -1939,7 +1935,7 @@ box.execute("SELECT quote(d) FROM t;")
 box.execute("SELECT LEAST(d, 0) FROM t;")
 ---
 - metadata:
-  - name: LEAST(d, 0)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [0]
@@ -2081,9 +2077,9 @@ box.execute("DROP TABLE t4;")
 box.execute("SELECT 1.0, typeof(1.0);")
 ---
 - metadata:
-  - name: '1.0'
+  - name: COLUMN_1
     type: double
-  - name: typeof(1.0)
+  - name: COLUMN_2
     type: string
   rows:
   - [1, 'double']
@@ -2091,9 +2087,9 @@ box.execute("SELECT 1.0, typeof(1.0);")
 box.execute("SELECT CAST(2 AS DOUBLE), typeof(CAST(2 AS DOUBLE));")
 ---
 - metadata:
-  - name: CAST(2 AS DOUBLE)
+  - name: COLUMN_1
     type: double
-  - name: typeof(CAST(2 AS DOUBLE))
+  - name: COLUMN_2
     type: string
   rows:
   - [2, 'double']
@@ -2101,9 +2097,9 @@ box.execute("SELECT CAST(2 AS DOUBLE), typeof(CAST(2 AS DOUBLE));")
 box.execute("SELECT 3e3, typeof(3e3);")
 ---
 - metadata:
-  - name: '3e3'
+  - name: COLUMN_1
     type: double
-  - name: typeof(3e3)
+  - name: COLUMN_2
     type: string
   rows:
   - [3000, 'double']
@@ -2121,7 +2117,7 @@ box.execute("SELECT d, TYPEOF(d) FROM t5;")
 - metadata:
   - name: D
     type: double
-  - name: TYPEOF(d)
+  - name: COLUMN_1
     type: string
   rows:
   - [4, 'double']

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Tarantool-patches] [PATCH v3 1/2] sql: use unify pattern for column names
  2020-06-27 11:50             ` Roman Khabibov
@ 2020-06-29 20:08               ` Vladislav Shpilevoy
  2020-06-29 23:46                 ` Roman Khabibov
  0 siblings, 1 reply; 20+ messages in thread
From: Vladislav Shpilevoy @ 2020-06-29 20:08 UTC (permalink / raw)
  To: Roman Khabibov; +Cc: tarantool-patches

Hi! Thanks for the patch!

> In my patch, I used the zName field of the struct ExprList_item,
> which is also used for aliases. But I did not find words in the
> code that this field is only for aliases (<AS> clause), therefore
> I considered it legitimate to put auto names in it.
> 
> PostgreSQL would throw an error in the case above: "ambiguous names”.
> But it works for us. Is it a bug or not? Perhaps yes. In any case,
> this does not apply to the patch and requires a separate discussion,
> so I just delete this test.

I wouldn't consider it a bug. And it is totally not related to this
patchset. So I would leave it as is now.

Please, don't delete any tests unless they are duplicate, or useless.

See 2 comments below.

> commit ed196a4446177eb14aa1b86a382c32416edb5794
> Author: Roman Khabibov <roman.habibov@tarantool.org>
> Date:   Thu Mar 5 12:48:58 2020 +0300
> 
>     sql: unify pattern for column names
>     
>     Name resulting columns generated by an expression or <VALUES>
>     construction by the "COLUMN_N" pattern.
>     
>     Closes #3962
>     
>     @TarantoolBot document
>     Title: Column naming in SQL
>     
>     Now, every auto generated column is named by the "COLUMN_N"
>     pattern, where N is the number of generated column in a query
>     (starting  from 1). Auto generated column is a column in a query
>     result generated by an expression or a column from <VALUES>
>     construction.
>     
>     Examples:
>     ```
>     box.execute("VALUES(1, 2, 3);")
>     ---
>     - metadata:
>       - name: COLUMN_1
>         type: integer
>       - name: COLUMN_2
>         type: integer
>       - name: COLUMN_3
>         type: integer
>       rows:
>       - [1, 2, 3]
>     ...
>     box.execute("SELECT * FROM (VALUES (1+1, 1+1));")
>     ---
>     - metadata:
>       - name: COLUMN_1
>         type: integer
>       - name: COLUMN_2
>         type: integer
>       rows:
>       - [2, 2]
>     ...
>     box.execute("SELECT 1+1, 1+1;")
>     ---
>     - metadata:
>       - name: COLUMN_1
>         type: integer
>       - name: COLUMN_2
>         type: integer
>       rows:
>       - [2, 2]
>     ...
>     ```
>     
>     Here, the expression "mycol + 1" generates a new column, so that
>     it is the first auto generated resulting column will be named as
>     "COLUMN_1".
>     ```
>     tarantool> CREATE TABLE test (mycol INT PRIMARY KEY);
>     ---
>     - row_count: 1
>     ...
>     
>     tarantool> SELECT mycol, mycol + 1 FROM test;
>     ---
>     - metadata:
>       - name: MYCOL
>         type: integer
>       - name: COLUMN_1
>         type: integer
>       rows: []
>     ...
>     ```
>     Note that you can use generated names already within the query,
>     e.g. in <ORDER BY> clause.
>     ```
>     tarantool> SELECT mycol, mycol + 1 FROM test ORDER BY column_1;
>     ---
>     - metadata:
>       - name: MYCOL
>         type: integer
>       - name: COLUMN_1
>         type: integer
>       rows: []
>     ...
>     ```
>     
>     It should also be noted that if you use column names similar to
>     the "COLUMN_N" pattern, you can get the same names as a result:
>     
>     ```
>     tarantool> CREATE TABLE test (column_1 SCALAR PRIMARY KEY);
>     ---
>     - row_count: 1
>     ...
>     
>     tarantool> INSERT INTO test VALUES(1);
>     ---
>     - row_count: 1
>     ...
>     
>     tarantool> SELECT column_1, column_1 COLLATE "unicode_ci" FROM test;

1. In my only comment to the previous patch I asked not to use
COLLATE for numbers, and make the example more representative.
Here if I remove 'COLLATE "unicode_ci"', the result won't change.
That makes the example close to useless.

Please, reconsider my comment from the previous email.

>     ---
>     - metadata:
>       - name: COLUMN_1
>         type: scalar
>       - name: COLUMN_1
>         type: scalar
>       rows:
>       - [1, 1]
>     ...
>     ```
> 
> diff --git a/test/sql-tap/colname.test.lua b/test/sql-tap/colname.test.lua
> index caa61a07a..f27ffe413 100755
> --- a/test/sql-tap/colname.test.lua
> +++ b/test/sql-tap/colname.test.lua
> @@ -635,4 +635,133 @@ test:do_catchsql_test(> +
> +test:do_execsql2_test(
> +    "colname-12.14",
> +    [[
> +        CREATE TABLE j_1 (column_1 SCALAR PRIMARY KEY, column_2 SCALAR);
> +        INSERT INTO j_1 VALUES(1, 1);
> +    ]], {})
> +
> +test:do_execsql2_test(
> +    "colname-12.15",
> +    [[
> +        SELECT column_1, column_1 COLLATE "unicode_ci", column_2, 1 FROM j_1;
> +    ]], {
> +        "COLUMN_1",1,"COLUMN_1",1,"COLUMN_2",1,"COLUMN_2",1

2. Ditto.

> +    })
> +

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Tarantool-patches] [PATCH v3 1/2] sql: use unify pattern for column names
  2020-06-29 20:08               ` Vladislav Shpilevoy
@ 2020-06-29 23:46                 ` Roman Khabibov
  2020-06-30 21:23                   ` Vladislav Shpilevoy
  0 siblings, 1 reply; 20+ messages in thread
From: Roman Khabibov @ 2020-06-29 23:46 UTC (permalink / raw)
  To: Vladislav Shpilevoy; +Cc: tarantool-patches

Hi! Thanks for the review.

> On Jun 29, 2020, at 23:08, Vladislav Shpilevoy <v.shpilevoy@tarantool.org> wrote:
> 
> Hi! Thanks for the patch!
> 
>> In my patch, I used the zName field of the struct ExprList_item,
>> which is also used for aliases. But I did not find words in the
>> code that this field is only for aliases (<AS> clause), therefore
>> I considered it legitimate to put auto names in it.
>> 
>> PostgreSQL would throw an error in the case above: "ambiguous names”.
>> But it works for us. Is it a bug or not? Perhaps yes. In any case,
>> this does not apply to the patch and requires a separate discussion,
>> so I just delete this test.
> 
> I wouldn't consider it a bug. And it is totally not related to this
> patchset. So I would leave it as is now.
> 
> Please, don't delete any tests unless they are duplicate, or useless.
> 
> See 2 comments below.
> 
>> commit ed196a4446177eb14aa1b86a382c32416edb5794
>> Author: Roman Khabibov <roman.habibov@tarantool.org>
>> Date:   Thu Mar 5 12:48:58 2020 +0300
>> 
>>    sql: unify pattern for column names
>> 
>>    Name resulting columns generated by an expression or <VALUES>
>>    construction by the "COLUMN_N" pattern.
>> 
>>    Closes #3962
>> 
>>    @TarantoolBot document
>>    Title: Column naming in SQL
>> 
>>    Now, every auto generated column is named by the "COLUMN_N"
>>    pattern, where N is the number of generated column in a query
>>    (starting  from 1). Auto generated column is a column in a query
>>    result generated by an expression or a column from <VALUES>
>>    construction.
>> 
>>    Examples:
>>    ```
>>    box.execute("VALUES(1, 2, 3);")
>>    ---
>>    - metadata:
>>      - name: COLUMN_1
>>        type: integer
>>      - name: COLUMN_2
>>        type: integer
>>      - name: COLUMN_3
>>        type: integer
>>      rows:
>>      - [1, 2, 3]
>>    ...
>>    box.execute("SELECT * FROM (VALUES (1+1, 1+1));")
>>    ---
>>    - metadata:
>>      - name: COLUMN_1
>>        type: integer
>>      - name: COLUMN_2
>>        type: integer
>>      rows:
>>      - [2, 2]
>>    ...
>>    box.execute("SELECT 1+1, 1+1;")
>>    ---
>>    - metadata:
>>      - name: COLUMN_1
>>        type: integer
>>      - name: COLUMN_2
>>        type: integer
>>      rows:
>>      - [2, 2]
>>    ...
>>    ```
>> 
>>    Here, the expression "mycol + 1" generates a new column, so that
>>    it is the first auto generated resulting column will be named as
>>    "COLUMN_1".
>>    ```
>>    tarantool> CREATE TABLE test (mycol INT PRIMARY KEY);
>>    ---
>>    - row_count: 1
>>    ...
>> 
>>    tarantool> SELECT mycol, mycol + 1 FROM test;
>>    ---
>>    - metadata:
>>      - name: MYCOL
>>        type: integer
>>      - name: COLUMN_1
>>        type: integer
>>      rows: []
>>    ...
>>    ```
>>    Note that you can use generated names already within the query,
>>    e.g. in <ORDER BY> clause.
>>    ```
>>    tarantool> SELECT mycol, mycol + 1 FROM test ORDER BY column_1;
>>    ---
>>    - metadata:
>>      - name: MYCOL
>>        type: integer
>>      - name: COLUMN_1
>>        type: integer
>>      rows: []
>>    ...
>>    ```
>> 
>>    It should also be noted that if you use column names similar to
>>    the "COLUMN_N" pattern, you can get the same names as a result:
>> 
>>    ```
>>    tarantool> CREATE TABLE test (column_1 SCALAR PRIMARY KEY);
>>    ---
>>    - row_count: 1
>>    ...
>> 
>>    tarantool> INSERT INTO test VALUES(1);
>>    ---
>>    - row_count: 1
>>    ...
>> 
>>    tarantool> SELECT column_1, column_1 COLLATE "unicode_ci" FROM test;
> 
> 1. In my only comment to the previous patch I asked not to use
> COLLATE for numbers, and make the example more representative.
> Here if I remove 'COLLATE "unicode_ci"', the result won't change.
> That makes the example close to useless.
> 
> Please, reconsider my comment from the previous email.
Yes. ‘colname + 1’ seems more logical.

>>    ---
>>    - metadata:
>>      - name: COLUMN_1
>>        type: scalar
>>      - name: COLUMN_1
>>        type: scalar
>>      rows:
>>      - [1, 1]
>>    ...
>>    ```
>> 
>> diff --git a/test/sql-tap/colname.test.lua b/test/sql-tap/colname.test.lua
>> index caa61a07a..f27ffe413 100755
>> --- a/test/sql-tap/colname.test.lua
>> +++ b/test/sql-tap/colname.test.lua
>> @@ -635,4 +635,133 @@ test:do_catchsql_test(> +
>> +test:do_execsql2_test(
>> +    "colname-12.14",
>> +    [[
>> +        CREATE TABLE j_1 (column_1 SCALAR PRIMARY KEY, column_2 SCALAR);
>> +        INSERT INTO j_1 VALUES(1, 1);
>> +    ]], {})
>> +
>> +test:do_execsql2_test(
>> +    "colname-12.15",
>> +    [[
>> +        SELECT column_1, column_1 COLLATE "unicode_ci", column_2, 1 FROM j_1;
>> +    ]], {
>> +        "COLUMN_1",1,"COLUMN_1",1,"COLUMN_2",1,"COLUMN_2",1
> 
> 2. Ditto.
+test:do_execsql2_test(
+    "colname-12.5",
+    [[
+        CREATE TABLE j (s1 SCALAR PRIMARY KEY);
+        INSERT INTO j VALUES(1);
+    ]], {})
+
+--
+-- Column named as 'COLUMN_1', because 's1 + 1' is a expression.
+--
+test:do_execsql2_test(
+    "colname-12.6",
+    [[
+        SELECT s1 + 1 FROM j;
+    ]], {
+        "COLUMN_1",2
+    })
+
+test:do_execsql2_test(
+    "colname-12.7",
+    [[
+        SELECT s1 + 1 FROM j ORDER BY column_1;
+    ]], {
+        "COLUMN_1",2
+    })
+
+test:do_execsql2_test(
+    "colname-12.8",
+    [[
+        SELECT * FROM (SELECT s1 + 1 FROM j
+                       ORDER BY column_1) ORDER BY column_1;
+    ]], {
+        "COLUMN_1",2
+    })
+
+test:do_execsql2_test(
+    "colname-12.9",
+    [[
+        SELECT s1 + 1 FROM j GROUP BY column_1;
+    ]], {
+        "COLUMN_1",2
+    })
+
+test:do_execsql2_test(
+    "colname-12.10",
+    [[
+        SELECT * FROM (SELECT s1 + 1 FROM j
+                       ORDER BY column_1) GROUP BY column_1;
+    ]], {
+        "COLUMN_1",2
+    })
+
+test:do_execsql2_test(
+    "colname-12.11",
+    [[
+        SELECT * FROM (SELECT s1 + 1 FROM j
+                       ORDER BY column_1) WHERE column_1 = 2;
+    ]], {
+        "COLUMN_1",2
+    })
+
+test:do_execsql2_test(
+    "colname-12.12",
+    [[
+        SELECT *, s1 + 1 FROM j ORDER BY column_1;
+    ]], {
+        "S1",1,"COLUMN_1",2
+    })
+
+test:do_execsql2_test(
+    "colname-12.13",
+    [[
+        SELECT s1 + 1, * FROM j ORDER BY column_1;
+    ]], {
+        "COLUMN_1",2,"S1",1
+    })
+
+test:do_execsql2_test(
+    "colname-12.14",
+    [[
+        CREATE TABLE j_1 (column_1 SCALAR PRIMARY KEY, column_2 SCALAR);
+        INSERT INTO j_1 VALUES(1, 1);
+    ]], {})
+
+test:do_execsql2_test(
+    "colname-12.15",
+    [[
+        SELECT column_1, column_1 + 1, column_2, 2 FROM j_1;
+    ]], {
+        "COLUMN_1",1,"COLUMN_1",2,"COLUMN_2",1,"COLUMN_2",2
+    })
+

>> +    })
>> +

commit 6ec3cfd814229f81d12ab77ac92bdb986d91e958
Author: Roman Khabibov <roman.habibov@tarantool.org>
Date:   Thu Mar 5 12:48:58 2020 +0300

    sql: unify pattern for column names
    
    Name resulting columns generated by an expression or <VALUES>
    construction by the "COLUMN_N" pattern.
    
    Closes #3962
    
    @TarantoolBot document
    Title: Column naming in SQL
    
    Now, every auto generated column is named by the "COLUMN_N"
    pattern, where N is the number of generated column in a query
    (starting  from 1). Auto generated column is a column in a query
    result generated by an expression or a column from <VALUES>
    construction.
    
    Examples:
    ```
    box.execute("VALUES(1, 2, 3);")
    ---
    - metadata:
      - name: COLUMN_1
        type: integer
      - name: COLUMN_2
        type: integer
      - name: COLUMN_3
        type: integer
      rows:
      - [1, 2, 3]
    ...
    box.execute("SELECT * FROM (VALUES (1+1, 1+1));")
    ---
    - metadata:
      - name: COLUMN_1
        type: integer
      - name: COLUMN_2
        type: integer
      rows:
      - [2, 2]
    ...
    box.execute("SELECT 1+1, 1+1;")
    ---
    - metadata:
      - name: COLUMN_1
        type: integer
      - name: COLUMN_2
        type: integer
      rows:
      - [2, 2]
    ...
    ```
    
    Here, the expression "mycol + 1" generates a new column, so that
    it is the first auto generated resulting column will be named as
    "COLUMN_1".
    ```
    tarantool> CREATE TABLE test (mycol INT PRIMARY KEY);
    ---
    - row_count: 1
    ...
    
    tarantool> SELECT mycol, mycol + 1 FROM test;
    ---
    - metadata:
      - name: MYCOL
        type: integer
      - name: COLUMN_1
        type: integer
      rows: []
    ...
    ```
    Note that you can use generated names already within the query,
    e.g. in <ORDER BY> clause.
    ```
    tarantool> SELECT mycol, mycol + 1 FROM test ORDER BY column_1;
    ---
    - metadata:
      - name: MYCOL
        type: integer
      - name: COLUMN_1
        type: integer
      rows: []
    ...
    ```
    
    It should also be noted that if you use column names similar to
    the "COLUMN_N" pattern, you can get the same names as a result:
    
    ```
    tarantool> CREATE TABLE test (column_1 SCALAR PRIMARY KEY);
    ---
    - row_count: 1
    ...
    
    tarantool> INSERT INTO test VALUES(1);
    ---
    - row_count: 1
    ...
    
    tarantool> SELECT column_1, column_1 + 1 FROM test;
    ---
    - metadata:
      - name: COLUMN_1
        type: scalar
      - name: COLUMN_1
        type: scalar
      rows:
      - [1, 2]
    ...
    ```

diff --git a/src/box/sql/select.c b/src/box/sql/select.c
index 4b069addb..26c735ed7 100644
--- a/src/box/sql/select.c
+++ b/src/box/sql/select.c
@@ -1854,14 +1854,14 @@ generate_column_metadata(struct Parse *pParse, struct SrcList *pTabList,
 			}
 		} else {
 			const char *z = NULL;
-			if (colname != NULL)
+			if (colname != NULL) {
 				z = colname;
-			else if (span != NULL)
-				z = span;
-			else
-				z = tt_sprintf("column%d", i + 1);
+			} else {
+				uint32_t idx = ++pParse->autoname_i;
+				z = sql_generate_column_name(idx);
+			}
 			vdbe_metadata_set_col_name(v, i, z);
-			if (is_full_meta && colname != NULL)
+			if (is_full_meta)
 				vdbe_metadata_set_col_span(v, i, span);
 		}
 	}
@@ -1897,7 +1897,6 @@ sqlColumnsFromExprList(Parse * parse, ExprList * expr_list,
 	/* Database connection */
 	sql *db = parse->db;
 	u32 cnt;		/* Index added to make the name unique */
-	Expr *p;		/* Expression for a single result column */
 	char *zName;		/* Column name */
 	int nName;		/* Size of name in zName[] */
 	Hash ht;		/* Hash table of column names */
@@ -1929,13 +1928,12 @@ sqlColumnsFromExprList(Parse * parse, ExprList * expr_list,
 	space_def->field_count = column_count;
 
 	for (uint32_t i = 0; i < column_count; i++) {
-		/* Get an appropriate name for the column
+		/*
+		 * Check if the column contains an "AS <name>"
+		 * phrase.
 		 */
-		p = sqlExprSkipCollate(expr_list->a[i].pExpr);
-		if ((zName = expr_list->a[i].zName) != 0) {
-			/* If the column contains an "AS <name>" phrase, use <name> as the name */
-		} else {
-			Expr *pColExpr = p;	/* The expression that is the result column name */
+		if ((zName = expr_list->a[i].zName) == 0) {
+			struct Expr *pColExpr = expr_list->a[i].pExpr;
 			struct space_def *space_def = NULL;
 			while (pColExpr->op == TK_DOT) {
 				pColExpr = pColExpr->pRight;
@@ -1951,14 +1949,14 @@ sqlColumnsFromExprList(Parse * parse, ExprList * expr_list,
 			} else if (pColExpr->op == TK_ID) {
 				assert(!ExprHasProperty(pColExpr, EP_IntValue));
 				zName = pColExpr->u.zToken;
-			} else {
-				/* Use the original text of the column expression as its name */
-				zName = expr_list->a[i].zSpan;
 			}
 		}
-		if (zName == NULL)
-			zName = "_auto_field_";
-		zName = sqlMPrintf(db, "%s", zName);
+		if (zName == NULL) {
+			uint32_t idx = ++parse->autoname_i;
+			zName = sqlDbStrDup(db, sql_generate_column_name(idx));
+		} else {
+			zName = sqlDbStrDup(db, zName);
+		}
 
 		/* Make sure the column name is unique.  If the name is not unique,
 		 * append an integer to the name so that it becomes unique.
@@ -4792,6 +4790,24 @@ selectPopWith(Walker * pWalker, Select * p)
 	}
 }
 
+/**
+ * Determine whether to generate a name for @a expr or not.
+ *
+ * Auto generated names is needed for every item in  a <SELECT>
+ * expression list except asterisks, dots and column names (also
+ * if this item hasn't alias).
+ *
+ * @param expr Expression from expression list to analyze.
+ *
+ * @retval true/false If item is/isn't needed needed to name.
+ */
+static bool
+is_needed_to_name(struct Expr *expr)
+{
+	return (expr->op != TK_ASTERISK && expr->op != TK_DOT && expr->op !=
+		TK_ID);
+}
+
 /*
  * This routine is a Walker callback for "expanding" a SELECT statement.
  * "Expanding" means to do the following:
@@ -4941,19 +4957,26 @@ selectExpander(Walker * pWalker, Select * p)
 	 * all tables.
 	 *
 	 * The first loop just checks to see if there are any "*" operators
-	 * that need expanding.
+	 * that need expanding and names items of the expression
+	 * list if needed.
 	 */
+	bool has_asterisk = false;
 	for (k = 0; k < pEList->nExpr; k++) {
 		pE = pEList->a[k].pExpr;
 		if (pE->op == TK_ASTERISK)
-			break;
+			has_asterisk = true;
 		assert(pE->op != TK_DOT || pE->pRight != 0);
 		assert(pE->op != TK_DOT
 		       || (pE->pLeft != 0 && pE->pLeft->op == TK_ID));
 		if (pE->op == TK_DOT && pE->pRight->op == TK_ASTERISK)
-			break;
+			has_asterisk = true;
+		if (pEList->a[k].zName == NULL && is_needed_to_name(pE)) {
+			uint32_t idx = ++pParse->autoname_i;
+			pEList->a[k].zName =
+				sqlDbStrDup(db, sql_generate_column_name(idx));
+		}
 	}
-	if (k < pEList->nExpr) {
+	if (has_asterisk) {
 		/*
 		 * If we get here it means the result set contains one or more "*"
 		 * operators that need to be expanded.  Loop through each expression
diff --git a/src/box/sql/sqlInt.h b/src/box/sql/sqlInt.h
index 37283e506..adf90d824 100644
--- a/src/box/sql/sqlInt.h
+++ b/src/box/sql/sqlInt.h
@@ -2227,6 +2227,8 @@ struct Parse {
 	TriggerPrg *pTriggerPrg;	/* Linked list of coded triggers */
 	With *pWith;		/* Current WITH clause, or NULL */
 	With *pWithToFree;	/* Free this WITH object at the end of the parse */
+	/** Index of previous auto generated name. */
+	uint32_t autoname_i;
 	/** Space triggers are being coded for. */
 	struct space *triggered_space;
 	/**
@@ -4530,4 +4532,17 @@ void
 sql_setting_set(struct Parse *parse_context, struct Token *name,
 		struct Expr *value);
 
+/**
+ * Return a string of the form "COLUMN_N", where N is @a number.
+ *
+ * We decided to name every auto generated column in output by
+ * this pattern (like PostgreSQL), because it is more convenient
+ * than "_auto_name_" and naming with span like MariaDB do.
+ */
+static inline const char *
+sql_generate_column_name(uint32_t number)
+{
+	return tt_sprintf("COLUMN_%d", number);
+}
+
 #endif				/* sqlINT_H */
diff --git a/test/box/function1.result b/test/box/function1.result
index 905a4cdab..928cd5758 100644
--- a/test/box/function1.result
+++ b/test/box/function1.result
@@ -449,7 +449,7 @@ box.execute('SELECT "function1.divide"(6, 3, 3)')
 box.execute('SELECT "function1.divide"(6, 3)')
 ---
 - metadata:
-  - name: '"function1.divide"(6, 3)'
+  - name: COLUMN_1
     type: number
   rows:
   - [2]
@@ -457,7 +457,7 @@ box.execute('SELECT "function1.divide"(6, 3)')
 box.execute('SELECT "function1.divide"(5, 2)')
 ---
 - metadata:
-  - name: '"function1.divide"(5, 2)'
+  - name: COLUMN_1
     type: number
   rows:
   - [2.5]
@@ -482,7 +482,7 @@ test_run:cmd("setopt delimiter ''");
 box.execute('SELECT summarize(1, 2)')
 ---
 - metadata:
-  - name: summarize(1, 2)
+  - name: COLUMN_1
     type: number
   rows:
   - [3]
@@ -505,7 +505,7 @@ test_run:cmd("setopt delimiter ''");
 box.execute('SELECT summarize(1, 2)')
 ---
 - metadata:
-  - name: summarize(1, 2)
+  - name: COLUMN_1
     type: number
   rows:
   - [3]
@@ -519,7 +519,7 @@ box.func.SUMMARIZE:drop()
 box.execute('SELECT lua(\'return 1 + 1\')')
 ---
 - metadata:
-  - name: lua('return 1 + 1')
+  - name: COLUMN_1
     type: any
   rows:
   - [2]
@@ -537,7 +537,7 @@ box.execute('SELECT lua(\'return box.cfg()\')')
 box.execute('SELECT lua(\'return box.cfg.memtx_memory\')')
 ---
 - metadata:
-  - name: lua('return box.cfg.memtx_memory')
+  - name: COLUMN_1
     type: any
   rows:
   - [107374182]
diff --git a/test/sql-tap/colname.test.lua b/test/sql-tap/colname.test.lua
index caa61a07a..7be5b881c 100755
--- a/test/sql-tap/colname.test.lua
+++ b/test/sql-tap/colname.test.lua
@@ -1,6 +1,6 @@
 #!/usr/bin/env tarantool
 test = require("sqltester")
-test:plan(62)
+test:plan(77)
 
 --!./tcltestrunner.lua
 -- 2008 July 15
@@ -94,7 +94,7 @@ test:do_execsql2_test(
         SELECT +tabc.a, -tabc.b, tabc.c, * FROM tabc
     ]], {
         -- <colname-2.3>
-        "+tabc.a",1,"-tabc.b",-2,"C",3,"A",1,"B",2,"C",3
+        "COLUMN_1",1,"COLUMN_2",-2,"C",3,"A",1,"B",2,"C",3
         -- </colname-2.3>
     })
 
@@ -194,7 +194,7 @@ test:do_execsql2_test(
         SELECT +tabc.a, -tabc.b, tabc.c FROM tabc
     ]], {
         -- <colname-3.3>
-        "+tabc.a", 1, "-tabc.b", -2, "C", 3
+        "COLUMN_1",1,"COLUMN_2",-2,"C",3
         -- </colname-3.3>
     })
 
@@ -314,7 +314,7 @@ test:do_execsql2_test(
         SELECT +tabc.a, -tabc.b, tabc.c FROM tabc
     ]], {
         -- <colname-4.3>
-        "+tabc.a", 1, "-tabc.b", -2, "TABC.C", 3
+        "COLUMN_1",1,"COLUMN_2",-2,"TABC.C",3
         -- </colname-4.3>
     })
 
@@ -635,4 +635,133 @@ test:do_catchsql_test(
     [[ CREATE INDEX t1c ON table1('c'); ]],
     {1, "/Tarantool does not support functional indexes/"})
 
+--
+-- gh-3962: Check auto generated names in different selects.
+--
+test:do_execsql2_test(
+    "colname-12.1",
+    [[
+        VALUES(1, 2, 'aaa');
+    ]], {
+        "COLUMN_1",1,"COLUMN_2",2,"COLUMN_3","aaa"
+    })
+
+test:do_execsql2_test(
+    "colname-12.2",
+    [[
+        SELECT * FROM (VALUES (1+1, 1+1, 'aaa'));
+    ]], {
+        "COLUMN_1",2,"COLUMN_2",2,"COLUMN_3","aaa"
+    })
+
+test:do_execsql2_test(
+    "colname-12.3",
+    [[
+        SELECT 1+1, 1+1, 'aaa';
+    ]], {
+        "COLUMN_1",2,"COLUMN_2",2,"COLUMN_3","aaa"
+    })
+
+test:do_execsql2_test(
+    "colname-12.4",
+    [[
+        SELECT * FROM (SELECT * FROM (VALUES(1, 2, 'aaa'))),
+                      (SELECT * FROM (VALUES(1, 2, 'aaa')))
+    ]], {
+        "COLUMN_1",1,"COLUMN_2",2,"COLUMN_3","aaa","COLUMN_4",1,"COLUMN_5",2,
+        "COLUMN_6","aaa"
+    })
+
+test:do_execsql2_test(
+    "colname-12.5",
+    [[
+        CREATE TABLE j (s1 SCALAR PRIMARY KEY);
+        INSERT INTO j VALUES(1);
+    ]], {})
+
+--
+-- Column named as 'COLUMN_1', because 's1 + 1' is a expression.
+--
+test:do_execsql2_test(
+    "colname-12.6",
+    [[
+        SELECT s1 + 1 FROM j;
+    ]], {
+        "COLUMN_1",2
+    })
+
+test:do_execsql2_test(
+    "colname-12.7",
+    [[
+        SELECT s1 + 1 FROM j ORDER BY column_1;
+    ]], {
+        "COLUMN_1",2
+    })
+
+test:do_execsql2_test(
+    "colname-12.8",
+    [[
+        SELECT * FROM (SELECT s1 + 1 FROM j
+                       ORDER BY column_1) ORDER BY column_1;
+    ]], {
+        "COLUMN_1",2
+    })
+
+test:do_execsql2_test(
+    "colname-12.9",
+    [[
+        SELECT s1 + 1 FROM j GROUP BY column_1;
+    ]], {
+        "COLUMN_1",2
+    })
+
+test:do_execsql2_test(
+    "colname-12.10",
+    [[
+        SELECT * FROM (SELECT s1 + 1 FROM j
+                       ORDER BY column_1) GROUP BY column_1;
+    ]], {
+        "COLUMN_1",2
+    })
+
+test:do_execsql2_test(
+    "colname-12.11",
+    [[
+        SELECT * FROM (SELECT s1 + 1 FROM j
+                       ORDER BY column_1) WHERE column_1 = 2;
+    ]], {
+        "COLUMN_1",2
+    })
+
+test:do_execsql2_test(
+    "colname-12.12",
+    [[
+        SELECT *, s1 + 1 FROM j ORDER BY column_1;
+    ]], {
+        "S1",1,"COLUMN_1",2
+    })
+
+test:do_execsql2_test(
+    "colname-12.13",
+    [[
+        SELECT s1 + 1, * FROM j ORDER BY column_1;
+    ]], {
+        "COLUMN_1",2,"S1",1
+    })
+
+test:do_execsql2_test(
+    "colname-12.14",
+    [[
+        CREATE TABLE j_1 (column_1 SCALAR PRIMARY KEY, column_2 SCALAR);
+        INSERT INTO j_1 VALUES(1, 1);
+    ]], {})
+
+test:do_execsql2_test(
+    "colname-12.15",
+    [[
+        SELECT column_1, column_1 + 1, column_2, 2 FROM j_1;
+    ]], {
+        "COLUMN_1",1,"COLUMN_1",2,"COLUMN_2",1,"COLUMN_2",2
+    })
+
 test:finish_test()
diff --git a/test/sql-tap/select1.test.lua b/test/sql-tap/select1.test.lua
index fbebfab37..80e94b019 100755
--- a/test/sql-tap/select1.test.lua
+++ b/test/sql-tap/select1.test.lua
@@ -1032,7 +1032,7 @@ test:do_catchsql2_test(
         SELECT f1+F2 FROM test1 ORDER BY f2
     ]], {
         -- <select1-6.4a>
-        0, {"f1+F2", 33, "f1+F2", 77}
+        0, {"COLUMN_1",33,"COLUMN_1",77}
         -- </select1-6.4a>
     })
 
@@ -1042,7 +1042,7 @@ test:do_catchsql2_test(
         SELECT test1.f1+F2 FROM test1 ORDER BY f2
     ]], {
         -- <select1-6.5>
-        0, {"test1.f1+F2", 33, "test1.f1+F2", 77}
+        0, {"COLUMN_1",33,"COLUMN_1",77}
         -- </select1-6.5>
     })
 
@@ -1059,7 +1059,7 @@ test:do_test(
         return table.insert(v,msg) or v
     end, {
         -- <select1-6.5.1>
-        0, {'test1.f1+F2', 33, 'test1.f1+F2', 77}
+        0, {"COLUMN_1",33,"COLUMN_1",77}
         -- </select1-6.5.1>
     })
 
@@ -1068,7 +1068,7 @@ test:do_catchsql2_test(
     [[SELECT test1.f1+F2, t1 FROM test1, test2 
          ORDER BY f2]], {
         -- <select1-6.6>
-        0, {"test1.f1+F2", 33, "T1", "abc", "test1.f1+F2", 77, "T1", "abc"}
+        0, {"COLUMN_1",33,"T1","abc","COLUMN_1",77,"T1","abc"}
         -- </select1-6.6>
     })
 
@@ -1161,7 +1161,7 @@ test:do_test(
         ]]
     end, {
         -- <select1-6.9.5>
-        "123.45", 123.45
+        "COLUMN_1",123.45
         -- </select1-6.9.5>
     })
 
@@ -1189,7 +1189,8 @@ test:do_test(
         return x
     end, {
         -- <select1-6.9.7>
-        "A.F1", 11, "A.F2", 22, "sql_subquery.5", 5, "sql_subquery.6", 6
+        "A.F1", 11, "A.F2", 22, "sql_subquery.COLUMN_1", 5,
+        "sql_subquery.COLUMN_2", 6
         -- </select1-6.9.7>
     })
 
@@ -1816,7 +1817,7 @@ test:do_execsql2_test(
             SELECT * FROM t3, (SELECT max(a), max(b) FROM t4) as "tx"
         ]], {
             -- <select1-11.14>
-            "ID", 0, "A", "1", "B", "2", "max(a)", 3, "max(b)", "4"
+            "ID", 0, "A", "1", "B", "2", "COLUMN_1", 3, "COLUMN_2", "4"
             -- </select1-11.14>
         })
 
@@ -1826,7 +1827,7 @@ test:do_execsql2_test(
             SELECT y.*, t3.* FROM t3, (SELECT max(a), max(b) FROM t4) AS y
         ]], {
             -- <select1-11.15>
-            "max(a)", 3, "max(b)", "4", "ID", 0, "A", "1", "B", "2"
+            "COLUMN_1", 3, "COLUMN_2", "4", "ID", 0, "A", "1", "B", "2"
             -- </select1-11.15>
         })
 
@@ -1850,7 +1851,7 @@ test:do_execsql2_test(
         SELECT 1+2+3
     ]], {
         -- <select1-12.1>
-        "1+2+3", 6
+        "COLUMN_1",6
         -- </select1-12.1>
     })
 
@@ -1860,7 +1861,7 @@ test:do_execsql2_test(
         SELECT 1,'hello',2
     ]], {
         -- <select1-12.2>
-        '1', 1, "'hello'", "hello", '2', 2
+        "COLUMN_1",1,"COLUMN_2","hello","COLUMN_3",2
         -- </select1-12.2>
     })
 
diff --git a/test/sql-tap/select6.test.lua b/test/sql-tap/select6.test.lua
index c9960dc29..380fd67c1 100755
--- a/test/sql-tap/select6.test.lua
+++ b/test/sql-tap/select6.test.lua
@@ -128,9 +128,9 @@ test:do_execsql_test(
 test:do_execsql_test(
     "select6-1.7",
     [=[
-        SELECT a.y, a."count(*)", "max(x)", "count(*)"
-        FROM (SELECT count(*),y FROM t1 GROUP BY y) AS a,
-             (SELECT max(x),y FROM t1 GROUP BY y) as b
+        SELECT a.y, a.COLUMN_1, COLUMN_2, COLUMN_1
+        FROM (SELECT count(*), y FROM t1 GROUP BY y) AS a,
+             (SELECT max(x), y FROM t1 GROUP BY y) as b
         WHERE a.y=b.y ORDER BY a.y
     ]=], {
         -- <select6-1.7>
@@ -154,9 +154,9 @@ test:do_execsql_test(
 test:do_execsql_test(
     "select6-1.9",
     [=[
-        SELECT q, p, r, b."min(x)+y"
+        SELECT q, p, r, min
         FROM (SELECT count(*) as p , y as q FROM t1 GROUP BY y) AS a,
-             (SELECT max(x) as r, y as s, min(x)+y FROM t1 GROUP BY y) as b
+             (SELECT max(x) as r, y as s, min(x)+y AS min FROM t1 GROUP BY y) as b
         WHERE q=s ORDER BY s
     ]=], {
         -- <select6-1.9>
@@ -247,9 +247,9 @@ test:do_execsql_test(
 test:do_execsql_test(
     "select6-2.7",
     [=[
-        SELECT a.b, a."count(*)", "max(a)", "count(*)"
-        FROM (SELECT count(*),b FROM t2 GROUP BY b) AS a,
-             (SELECT max(a),b FROM t2 GROUP BY b) as b
+        SELECT a.b, a.count, max, count
+        FROM (SELECT count(*) AS count, b FROM t2 GROUP BY b) AS a,
+             (SELECT max(a) AS max, b FROM t2 GROUP BY b) as b
         WHERE a.b=b.b ORDER BY a.b
     ]=], {
         -- <select6-2.7>
@@ -432,8 +432,8 @@ test:do_execsql_test(
 test:do_execsql_test(
     "select6-3.14",
     [=[
-        SELECT "count(*)",y FROM (SELECT count(*), y FROM t1 GROUP BY y)
-        ORDER BY "count(*)"
+        SELECT count, y FROM (SELECT count(*) AS count, y FROM t1 GROUP BY y)
+        ORDER BY count
     ]=], {
         -- <select6-3.14>
         1, 1, 2, 2, 4, 3, 5, 5, 8, 4
@@ -443,7 +443,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "select6-3.15",
     [=[
-        SELECT "count(*)",y FROM (SELECT count(*), y FROM t1 GROUP BY y)
+        SELECT count, y FROM (SELECT count(*) AS count, y FROM t1 GROUP BY y)
         ORDER BY y
     ]=], {
         -- <select6-3.15>
diff --git a/test/sql-tap/view.test.lua b/test/sql-tap/view.test.lua
index e553b91c7..66374e374 100755
--- a/test/sql-tap/view.test.lua
+++ b/test/sql-tap/view.test.lua
@@ -265,7 +265,7 @@ test:do_execsql2_test(
         SELECT * FROM v1 LIMIT 1
     ]], {
         -- <view-3.3.1>
-        "XYZ", 2, "PQR", 7, "c-b", 1
+        "XYZ", 2, "PQR", 7, "COLUMN_1", 1
         -- </view-3.3.1>
     })
 
@@ -276,7 +276,7 @@ test:do_execsql2_test(
         SELECT * FROM v1b LIMIT 1
     ]], {
         -- <view-3.3.2>
-        "A", 2, "b+c", 7, "C", 4
+        "A", 2, "COLUMN_1", 7, "C", 4
         -- </view-3.3.2>
     })
 
diff --git a/test/sql/bind.result b/test/sql/bind.result
index b24094052..cb0302885 100644
--- a/test/sql/bind.result
+++ b/test/sql/bind.result
@@ -77,11 +77,11 @@ execute('SELECT * FROM test WHERE id = :value', parameters)
 execute('SELECT ?, ?, ?', {1, 2, 3})
 ---
 - metadata:
-  - name: '?'
+  - name: COLUMN_1
     type: integer
-  - name: '?'
+  - name: COLUMN_2
     type: integer
-  - name: '?'
+  - name: COLUMN_3
     type: integer
   rows:
   - [1, 2, 3]
@@ -107,11 +107,11 @@ parameters[3][':value1'] = 11
 execute('SELECT ?, :value1, @value2', parameters)
 ---
 - metadata:
-  - name: '?'
+  - name: COLUMN_1
     type: integer
-  - name: :value1
+  - name: COLUMN_2
     type: integer
-  - name: '@value2'
+  - name: COLUMN_3
     type: integer
   rows:
   - [10, 11, 12]
@@ -149,22 +149,22 @@ parameters[6]['@value2'] = 6
 execute('SELECT :value3, ?, :value1, ?, ?, @value2, ?, :value3', parameters)
 ---
 - metadata:
-  - name: :value3
+  - name: COLUMN_1
     type: integer
-  - name: '?'
+  - name: COLUMN_2
     type: integer
-  - name: :value1
+  - name: COLUMN_3
     type: integer
-  - name: '?'
+  - name: COLUMN_4
     type: integer
-  - name: '?'
+  - name: COLUMN_5
     type: integer
-  - name: '@value2'
+  - name: COLUMN_6
     type: integer
-  - name: '?'
+  - name: COLUMN_7
+    type: boolean
+  - name: COLUMN_8
     type: boolean
-  - name: :value3
-    type: integer
   rows:
   - [1, 2, 3, 4, 5, 6, null, 1]
 ...
@@ -175,15 +175,15 @@ msgpack = require('msgpack')
 execute('SELECT ?, ?, ?, ?, ?', {'abc', -123.456, msgpack.NULL, true, false})
 ---
 - metadata:
-  - name: '?'
+  - name: COLUMN_1
     type: text
-  - name: '?'
+  - name: COLUMN_2
     type: numeric
-  - name: '?'
+  - name: COLUMN_3
     type: boolean
-  - name: '?'
+  - name: COLUMN_4
     type: boolean
-  - name: '?'
+  - name: COLUMN_5
     type: boolean
   rows:
   - ['abc', -123.456, null, true, false]
@@ -290,7 +290,7 @@ execute('SELECT :value', parameters)
 execute('SELECT ? ', {18446744073709551615ULL})
 ---
 - metadata:
-  - name: '?'
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551615]
diff --git a/test/sql/boolean.result b/test/sql/boolean.result
index 112e41a12..51ec5820b 100644
--- a/test/sql/boolean.result
+++ b/test/sql/boolean.result
@@ -241,7 +241,7 @@ i > 0
 SELECT return_type(a) FROM t;
  | ---
  | - metadata:
- |   - name: return_type(a)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['boolean']
@@ -250,7 +250,7 @@ SELECT return_type(a) FROM t;
 SELECT return_type('false');
  | ---
  | - metadata:
- |   - name: return_type('false')
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['string']
@@ -258,7 +258,7 @@ SELECT return_type('false');
 SELECT is_boolean(a) FROM t LIMIT 1;
  | ---
  | - metadata:
- |   - name: is_boolean(a)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -266,7 +266,7 @@ SELECT is_boolean(a) FROM t LIMIT 1;
 SELECT is_boolean('true');
  | ---
  | - metadata:
- |   - name: is_boolean('true')
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -281,7 +281,7 @@ SELECT abs(a) FROM t0;
 SELECT lower(a) FROM t0;
  | ---
  | - metadata:
- |   - name: lower(a)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['false']
@@ -292,7 +292,7 @@ SELECT lower(a) FROM t0;
 SELECT upper(a) FROM t0;
  | ---
  | - metadata:
- |   - name: upper(a)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['FALSE']
@@ -303,7 +303,7 @@ SELECT upper(a) FROM t0;
 SELECT quote(a) FROM t0;
  | ---
  | - metadata:
- |   - name: quote(a)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['FALSE']
@@ -315,7 +315,7 @@ SELECT quote(a) FROM t0;
 SELECT length(a) FROM t0;
  | ---
  | - metadata:
- |   - name: length(a)
+ |   - name: COLUMN_1
  |     type: integer
  |   rows:
  |   - [5]
@@ -326,7 +326,7 @@ SELECT length(a) FROM t0;
 SELECT typeof(a) FROM t0;
  | ---
  | - metadata:
- |   - name: typeof(a)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['boolean']
@@ -344,7 +344,7 @@ SELECT AVG(a) FROM t0;
 SELECT MIN(a) FROM t0;
  | ---
  | - metadata:
- |   - name: MIN(a)
+ |   - name: COLUMN_1
  |     type: scalar
  |   rows:
  |   - [false]
@@ -352,7 +352,7 @@ SELECT MIN(a) FROM t0;
 SELECT MAX(a) FROM t0;
  | ---
  | - metadata:
- |   - name: MAX(a)
+ |   - name: COLUMN_1
  |     type: scalar
  |   rows:
  |   - [true]
@@ -365,7 +365,7 @@ SELECT SUM(a) FROM t0;
 SELECT COUNT(a) FROM t0;
  | ---
  | - metadata:
- |   - name: COUNT(a)
+ |   - name: COLUMN_1
  |     type: integer
  |   rows:
  |   - [2]
@@ -378,7 +378,7 @@ SELECT TOTAL(a) FROM t0;
 SELECT GROUP_CONCAT(a, ' +++ ') FROM t0;
  | ---
  | - metadata:
- |   - name: GROUP_CONCAT(a, ' +++ ')
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['FALSE +++ TRUE']
@@ -392,13 +392,13 @@ SELECT GROUP_CONCAT(a, ' +++ ') FROM t0;
 box.execute('SELECT ?, ?, return_type($1), typeof($2);', {true, false})
  | ---
  | - metadata:
- |   - name: '?'
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: '?'
+ |   - name: COLUMN_2
  |     type: boolean
- |   - name: return_type($1)
+ |   - name: COLUMN_3
  |     type: string
- |   - name: typeof($2)
+ |   - name: COLUMN_4
  |     type: string
  |   rows:
  |   - [true, false, 'boolean', 'boolean']
@@ -422,9 +422,9 @@ parameters[2][':value1'] = false
 box.execute('SELECT :value1, @value2;', parameters)
  | ---
  | - metadata:
- |   - name: :value1
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: '@value2'
+ |   - name: COLUMN_2
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -501,9 +501,9 @@ INSERT INTO t3 VALUES (4, false)
 SELECT cast(true AS INTEGER), cast(false AS INTEGER);
  | ---
  | - metadata:
- |   - name: cast(true AS INTEGER)
+ |   - name: COLUMN_1
  |     type: integer
- |   - name: cast(false AS INTEGER)
+ |   - name: COLUMN_2
  |     type: integer
  |   rows:
  |   - [1, 0]
@@ -511,9 +511,9 @@ SELECT cast(true AS INTEGER), cast(false AS INTEGER);
 SELECT cast(true AS NUMBER), cast(false AS NUMBER);
  | ---
  | - metadata:
- |   - name: cast(true AS NUMBER)
+ |   - name: COLUMN_1
  |     type: number
- |   - name: cast(false AS NUMBER)
+ |   - name: COLUMN_2
  |     type: number
  |   rows:
  |   - [1, 0]
@@ -522,9 +522,9 @@ SELECT cast(true AS NUMBER), cast(false AS NUMBER);
 SELECT cast(true AS TEXT), cast(false AS TEXT);
  | ---
  | - metadata:
- |   - name: cast(true AS TEXT)
+ |   - name: COLUMN_1
  |     type: string
- |   - name: cast(false AS TEXT)
+ |   - name: COLUMN_2
  |     type: string
  |   rows:
  |   - ['TRUE', 'FALSE']
@@ -532,9 +532,9 @@ SELECT cast(true AS TEXT), cast(false AS TEXT);
 SELECT cast(true AS BOOLEAN), cast(false AS BOOLEAN);
  | ---
  | - metadata:
- |   - name: cast(true AS BOOLEAN)
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: cast(false AS BOOLEAN)
+ |   - name: COLUMN_2
  |     type: boolean
  |   rows:
  |   - [true, false]
@@ -544,11 +544,11 @@ SELECT cast(true AS BOOLEAN), cast(false AS BOOLEAN);
 SELECT cast(100 AS BOOLEAN), cast(1 AS BOOLEAN), cast(0 AS BOOLEAN);
  | ---
  | - metadata:
- |   - name: cast(100 AS BOOLEAN)
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: cast(1 AS BOOLEAN)
+ |   - name: COLUMN_2
  |     type: boolean
- |   - name: cast(0 AS BOOLEAN)
+ |   - name: COLUMN_3
  |     type: boolean
  |   rows:
  |   - [true, true, false]
@@ -556,9 +556,9 @@ SELECT cast(100 AS BOOLEAN), cast(1 AS BOOLEAN), cast(0 AS BOOLEAN);
 SELECT cast(0.123 AS BOOLEAN), cast(0.0 AS BOOLEAN);
  | ---
  | - metadata:
- |   - name: cast(0.123 AS BOOLEAN)
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: cast(0.0 AS BOOLEAN)
+ |   - name: COLUMN_2
  |     type: boolean
  |   rows:
  |   - [true, false]
@@ -566,9 +566,9 @@ SELECT cast(0.123 AS BOOLEAN), cast(0.0 AS BOOLEAN);
 SELECT cast('true' AS BOOLEAN), cast('false' AS BOOLEAN);
  | ---
  | - metadata:
- |   - name: cast('true' AS BOOLEAN)
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: cast('false' AS BOOLEAN)
+ |   - name: COLUMN_2
  |     type: boolean
  |   rows:
  |   - [true, false]
@@ -576,9 +576,9 @@ SELECT cast('true' AS BOOLEAN), cast('false' AS BOOLEAN);
 SELECT cast('TRUE' AS BOOLEAN), cast('FALSE' AS BOOLEAN);
  | ---
  | - metadata:
- |   - name: cast('TRUE' AS BOOLEAN)
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: cast('FALSE' AS BOOLEAN)
+ |   - name: COLUMN_2
  |     type: boolean
  |   rows:
  |   - [true, false]
@@ -887,7 +887,7 @@ SELECT a, COUNT(*) FROM (SELECT * FROM t4 UNION SELECT * FROM t5) GROUP BY a;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: COUNT(*)
+ |   - name: COLUMN_1
  |     type: integer
  |   rows:
  |   - [false, 3]
@@ -907,7 +907,7 @@ INSERT INTO t6 VALUES (true, false), (false, true);
 SELECT NOT true;
  | ---
  | - metadata:
- |   - name: NOT true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -915,7 +915,7 @@ SELECT NOT true;
 SELECT NOT false;
  | ---
  | - metadata:
- |   - name: NOT false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -925,7 +925,7 @@ SELECT a, NOT a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: NOT a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -935,7 +935,7 @@ SELECT a, NOT a FROM t;
 SELECT true AND true;
  | ---
  | - metadata:
- |   - name: true AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -943,7 +943,7 @@ SELECT true AND true;
 SELECT true AND false;
  | ---
  | - metadata:
- |   - name: true AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -951,7 +951,7 @@ SELECT true AND false;
 SELECT false AND true;
  | ---
  | - metadata:
- |   - name: false AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -959,7 +959,7 @@ SELECT false AND true;
 SELECT false AND false;
  | ---
  | - metadata:
- |   - name: false AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -967,7 +967,7 @@ SELECT false AND false;
 SELECT true OR true;
  | ---
  | - metadata:
- |   - name: true OR true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -975,7 +975,7 @@ SELECT true OR true;
 SELECT true OR false;
  | ---
  | - metadata:
- |   - name: true OR false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -983,7 +983,7 @@ SELECT true OR false;
 SELECT false OR true;
  | ---
  | - metadata:
- |   - name: false OR true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -991,7 +991,7 @@ SELECT false OR true;
 SELECT false OR false;
  | ---
  | - metadata:
- |   - name: false OR false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1002,7 +1002,7 @@ SELECT a, true AND a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true AND a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1013,7 +1013,7 @@ SELECT a, false AND a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false AND a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1024,7 +1024,7 @@ SELECT a, true OR a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true OR a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1035,7 +1035,7 @@ SELECT a, false OR a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false OR a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1046,7 +1046,7 @@ SELECT a, a AND true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1057,7 +1057,7 @@ SELECT a, a AND false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1068,7 +1068,7 @@ SELECT a, a OR true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a OR true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1079,7 +1079,7 @@ SELECT a, a OR false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a OR false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1093,7 +1093,7 @@ SELECT a, a1, a AND a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a AND a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, false]
@@ -1108,7 +1108,7 @@ SELECT a, a1, a OR a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a OR a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, false]
@@ -1622,7 +1622,7 @@ SELECT a1, a2, a2 || a2 FROM t6;
 SELECT true > true;
  | ---
  | - metadata:
- |   - name: true > true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1630,7 +1630,7 @@ SELECT true > true;
 SELECT true > false;
  | ---
  | - metadata:
- |   - name: true > false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -1638,7 +1638,7 @@ SELECT true > false;
 SELECT false > true;
  | ---
  | - metadata:
- |   - name: false > true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1646,7 +1646,7 @@ SELECT false > true;
 SELECT false > false;
  | ---
  | - metadata:
- |   - name: false > false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1654,7 +1654,7 @@ SELECT false > false;
 SELECT true < true;
  | ---
  | - metadata:
- |   - name: true < true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1662,7 +1662,7 @@ SELECT true < true;
 SELECT true < false;
  | ---
  | - metadata:
- |   - name: true < false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1670,7 +1670,7 @@ SELECT true < false;
 SELECT false < true;
  | ---
  | - metadata:
- |   - name: false < true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -1678,7 +1678,7 @@ SELECT false < true;
 SELECT false < false;
  | ---
  | - metadata:
- |   - name: false < false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1689,7 +1689,7 @@ SELECT a, true > a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true > a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1700,7 +1700,7 @@ SELECT a, false > a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false > a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1711,7 +1711,7 @@ SELECT a, true < a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true < a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1722,7 +1722,7 @@ SELECT a, false < a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false < a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1733,7 +1733,7 @@ SELECT a, a > true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a > true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1744,7 +1744,7 @@ SELECT a, a > false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a > false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1755,7 +1755,7 @@ SELECT a, a < true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a < true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1766,7 +1766,7 @@ SELECT a, a < false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a < false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1780,7 +1780,7 @@ SELECT a, a1, a > a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a > a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, false]
@@ -1795,7 +1795,7 @@ SELECT a, a1, a < a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a < a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, false]
@@ -1807,7 +1807,7 @@ SELECT a, a1, a < a1 FROM t, t6;
 SELECT true >= true;
  | ---
  | - metadata:
- |   - name: true >= true
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [true]
@@ -1815,7 +1815,7 @@ SELECT true >= true;
 SELECT true >= false;
  | ---
  | - metadata:
- |   - name: true >= false
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [true]
@@ -1823,7 +1823,7 @@ SELECT true >= false;
 SELECT false >= true;
  | ---
  | - metadata:
- |   - name: false >= true
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [false]
@@ -1831,7 +1831,7 @@ SELECT false >= true;
 SELECT false >= false;
  | ---
  | - metadata:
- |   - name: false >= false
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [true]
@@ -1839,7 +1839,7 @@ SELECT false >= false;
 SELECT true <= true;
  | ---
  | - metadata:
- |   - name: true <= true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -1847,7 +1847,7 @@ SELECT true <= true;
 SELECT true <= false;
  | ---
  | - metadata:
- |   - name: true <= false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1855,7 +1855,7 @@ SELECT true <= false;
 SELECT false <= true;
  | ---
  | - metadata:
- |   - name: false <= true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -1863,7 +1863,7 @@ SELECT false <= true;
 SELECT false <= false;
  | ---
  | - metadata:
- |   - name: false <= false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -1874,7 +1874,7 @@ SELECT a, true >= a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true >= a
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [false, true]
@@ -1885,7 +1885,7 @@ SELECT a, false >= a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false >= a
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [false, true]
@@ -1896,7 +1896,7 @@ SELECT a, true <= a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true <= a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1907,7 +1907,7 @@ SELECT a, false <= a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false <= a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1918,7 +1918,7 @@ SELECT a, a >= true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a >= true
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [false, false]
@@ -1929,7 +1929,7 @@ SELECT a, a >= false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a >= false
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [false, true]
@@ -1940,7 +1940,7 @@ SELECT a, a <= true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a <= true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1951,7 +1951,7 @@ SELECT a, a <= false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a <= false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1965,7 +1965,7 @@ SELECT a, a1, a >= a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a >= a1
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [false, false, true]
@@ -1980,7 +1980,7 @@ SELECT a, a1, a <= a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a <= a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, true]
@@ -1992,7 +1992,7 @@ SELECT a, a1, a <= a1 FROM t, t6;
 SELECT true == true;
  | ---
  | - metadata:
- |   - name: true == true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2000,7 +2000,7 @@ SELECT true == true;
 SELECT true == false;
  | ---
  | - metadata:
- |   - name: true == false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2008,7 +2008,7 @@ SELECT true == false;
 SELECT false == true;
  | ---
  | - metadata:
- |   - name: false == true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2016,7 +2016,7 @@ SELECT false == true;
 SELECT false == false;
  | ---
  | - metadata:
- |   - name: false == false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2024,7 +2024,7 @@ SELECT false == false;
 SELECT true != true;
  | ---
  | - metadata:
- |   - name: true != true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2032,7 +2032,7 @@ SELECT true != true;
 SELECT true != false;
  | ---
  | - metadata:
- |   - name: true != false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2040,7 +2040,7 @@ SELECT true != false;
 SELECT false != true;
  | ---
  | - metadata:
- |   - name: false != true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2048,7 +2048,7 @@ SELECT false != true;
 SELECT false != false;
  | ---
  | - metadata:
- |   - name: false != false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2059,7 +2059,7 @@ SELECT a, true == a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true == a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2070,7 +2070,7 @@ SELECT a, false == a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false == a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2081,7 +2081,7 @@ SELECT a, true != a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true != a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2092,7 +2092,7 @@ SELECT a, false != a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false != a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2103,7 +2103,7 @@ SELECT a, a == true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a == true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2114,7 +2114,7 @@ SELECT a, a == false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a == false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2125,7 +2125,7 @@ SELECT a, a != true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a != true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2136,7 +2136,7 @@ SELECT a, a != false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a != false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2150,7 +2150,7 @@ SELECT a, a1, a == a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a == a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, true]
@@ -2165,7 +2165,7 @@ SELECT a, a1, a != a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a != a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, false]
@@ -2177,7 +2177,7 @@ SELECT a, a1, a != a1 FROM t, t6;
 SELECT true IN (true);
  | ---
  | - metadata:
- |   - name: true IN (true)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2185,7 +2185,7 @@ SELECT true IN (true);
 SELECT false IN (true);
  | ---
  | - metadata:
- |   - name: false IN (true)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2193,7 +2193,7 @@ SELECT false IN (true);
 SELECT true IN (false);
  | ---
  | - metadata:
- |   - name: true IN (false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2201,7 +2201,7 @@ SELECT true IN (false);
 SELECT false IN (false);
  | ---
  | - metadata:
- |   - name: false IN (false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2209,7 +2209,7 @@ SELECT false IN (false);
 SELECT true IN (true, false);
  | ---
  | - metadata:
- |   - name: true IN (true, false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2217,7 +2217,7 @@ SELECT true IN (true, false);
 SELECT false IN (true, false);
  | ---
  | - metadata:
- |   - name: false IN (true, false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2225,7 +2225,7 @@ SELECT false IN (true, false);
 SELECT true IN (SELECT a1 FROM t6);
  | ---
  | - metadata:
- |   - name: true IN (SELECT a1 FROM t6)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2233,7 +2233,7 @@ SELECT true IN (SELECT a1 FROM t6);
 SELECT false IN (SELECT a1 FROM t6);
  | ---
  | - metadata:
- |   - name: false IN (SELECT a1 FROM t6)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2241,7 +2241,7 @@ SELECT false IN (SELECT a1 FROM t6);
 SELECT true IN (SELECT a1 FROM t6 LIMIT 1);
  | ---
  | - metadata:
- |   - name: true IN (SELECT a1 FROM t6 LIMIT 1)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2249,7 +2249,7 @@ SELECT true IN (SELECT a1 FROM t6 LIMIT 1);
 SELECT false IN (SELECT a1 FROM t6 LIMIT 1);
  | ---
  | - metadata:
- |   - name: false IN (SELECT a1 FROM t6 LIMIT 1)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2257,7 +2257,7 @@ SELECT false IN (SELECT a1 FROM t6 LIMIT 1);
 SELECT true IN (1, 1.2, 'true', false);
  | ---
  | - metadata:
- |   - name: true IN (1, 1.2, 'true', false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2265,7 +2265,7 @@ SELECT true IN (1, 1.2, 'true', false);
 SELECT false IN (1, 1.2, 'true', false);
  | ---
  | - metadata:
- |   - name: false IN (1, 1.2, 'true', false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2276,7 +2276,7 @@ SELECT a, a IN (true) FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a IN (true)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2287,7 +2287,7 @@ SELECT a, a IN (false) FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a IN (false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2298,7 +2298,7 @@ SELECT a, a IN (true, false) FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a IN (true, false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2309,7 +2309,7 @@ SELECT a, a IN (SELECT a1 FROM t6 LIMIT 1) FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a IN (SELECT a1 FROM t6 LIMIT 1)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2320,7 +2320,7 @@ SELECT a, a IN (SELECT a1 FROM t6) FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a IN (SELECT a1 FROM t6)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2331,7 +2331,7 @@ SELECT a, a IN (1, 1.2, 'true', false) FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a IN (1, 1.2, 'true', false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2341,7 +2341,7 @@ SELECT a, a IN (1, 1.2, 'true', false) FROM t;
 SELECT true BETWEEN true AND true;
  | ---
  | - metadata:
- |   - name: true BETWEEN true AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2349,7 +2349,7 @@ SELECT true BETWEEN true AND true;
 SELECT false BETWEEN true AND true;
  | ---
  | - metadata:
- |   - name: false BETWEEN true AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2357,7 +2357,7 @@ SELECT false BETWEEN true AND true;
 SELECT true BETWEEN false AND false;
  | ---
  | - metadata:
- |   - name: true BETWEEN false AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2365,7 +2365,7 @@ SELECT true BETWEEN false AND false;
 SELECT false BETWEEN false AND false;
  | ---
  | - metadata:
- |   - name: false BETWEEN false AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2373,7 +2373,7 @@ SELECT false BETWEEN false AND false;
 SELECT true BETWEEN true AND false;
  | ---
  | - metadata:
- |   - name: true BETWEEN true AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2381,7 +2381,7 @@ SELECT true BETWEEN true AND false;
 SELECT false BETWEEN true AND false;
  | ---
  | - metadata:
- |   - name: false BETWEEN true AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2389,7 +2389,7 @@ SELECT false BETWEEN true AND false;
 SELECT true BETWEEN false AND true;
  | ---
  | - metadata:
- |   - name: true BETWEEN false AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2397,7 +2397,7 @@ SELECT true BETWEEN false AND true;
 SELECT false BETWEEN false AND true;
  | ---
  | - metadata:
- |   - name: false BETWEEN false AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2408,7 +2408,7 @@ SELECT a, a BETWEEN true AND true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a BETWEEN true AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2419,7 +2419,7 @@ SELECT a, a BETWEEN false AND false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a BETWEEN false AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2430,7 +2430,7 @@ SELECT a, a BETWEEN true AND false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a BETWEEN true AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2441,7 +2441,7 @@ SELECT a, a BETWEEN false AND true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a BETWEEN false AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2466,7 +2466,7 @@ SELECT true AND 2;
 SELECT false AND 2;
  | ---
  | - metadata:
- |   - name: false AND 2
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2489,7 +2489,7 @@ SELECT 2 AND true;
 SELECT 2 AND false;
  | ---
  | - metadata:
- |   - name: 2 AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2556,7 +2556,7 @@ SELECT b, false AND b FROM t7;
  | - metadata:
  |   - name: B
  |     type: integer
- |   - name: false AND b
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [123, false]
@@ -2581,7 +2581,7 @@ SELECT b, b AND false FROM t7;
  | - metadata:
  |   - name: B
  |     type: integer
- |   - name: b AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [123, false]
@@ -3861,7 +3861,7 @@ SELECT a2, b, b != a2 FROM t6, t7;
 SELECT true IN (0, 1, 2, 3);
  | ---
  | - metadata:
- |   - name: true IN (0, 1, 2, 3)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -3869,7 +3869,7 @@ SELECT true IN (0, 1, 2, 3);
 SELECT false IN (0, 1, 2, 3);
  | ---
  | - metadata:
- |   - name: false IN (0, 1, 2, 3)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -3889,7 +3889,7 @@ SELECT a1, a1 IN (0, 1, 2, 3) FROM t6
  | - metadata:
  |   - name: A1
  |     type: boolean
- |   - name: a1 IN (0, 1, 2, 3)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -3935,7 +3935,7 @@ SELECT true AND 2.3;
 SELECT false AND 2.3;
  | ---
  | - metadata:
- |   - name: false AND 2.3
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -3958,7 +3958,7 @@ SELECT 2.3 AND true;
 SELECT 2.3 AND false;
  | ---
  | - metadata:
- |   - name: 2.3 AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -4025,7 +4025,7 @@ SELECT c, false AND c FROM t8;
  | - metadata:
  |   - name: C
  |     type: number
- |   - name: false AND c
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [4.56, false]
@@ -4050,7 +4050,7 @@ SELECT c, c AND false FROM t8;
  | - metadata:
  |   - name: C
  |     type: number
- |   - name: c AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [4.56, false]
@@ -5006,7 +5006,7 @@ SELECT a2, c, c != a2 FROM t6, t8;
 SELECT true IN (0.1, 1.2, 2.3, 3.4);
  | ---
  | - metadata:
- |   - name: true IN (0.1, 1.2, 2.3, 3.4)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5014,7 +5014,7 @@ SELECT true IN (0.1, 1.2, 2.3, 3.4);
 SELECT false IN (0.1, 1.2, 2.3, 3.4);
  | ---
  | - metadata:
- |   - name: false IN (0.1, 1.2, 2.3, 3.4)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5022,7 +5022,7 @@ SELECT false IN (0.1, 1.2, 2.3, 3.4);
 SELECT a1 IN (0.1, 1.2, 2.3, 3.4) FROM t6 LIMIT 1;
  | ---
  | - metadata:
- |   - name: a1 IN (0.1, 1.2, 2.3, 3.4)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5030,7 +5030,7 @@ SELECT a1 IN (0.1, 1.2, 2.3, 3.4) FROM t6 LIMIT 1;
 SELECT a2 IN (0.1, 1.2, 2.3, 3.4) FROM t6 LIMIT 1;
  | ---
  | - metadata:
- |   - name: a2 IN (0.1, 1.2, 2.3, 3.4)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5095,7 +5095,7 @@ SELECT true AND 'abc';
 SELECT false AND 'abc';
  | ---
  | - metadata:
- |   - name: false AND 'abc'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5118,7 +5118,7 @@ SELECT 'abc' AND true;
 SELECT 'abc' AND false;
  | ---
  | - metadata:
- |   - name: '''abc'' AND false'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5185,7 +5185,7 @@ SELECT d, false AND d FROM t9;
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: false AND d
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['AsdF', false]
@@ -5210,7 +5210,7 @@ SELECT d, d AND false FROM t9;
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: d AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['AsdF', false]
@@ -5470,7 +5470,7 @@ SELECT true AND 'TRUE';
 SELECT false AND 'TRUE';
  | ---
  | - metadata:
- |   - name: false AND 'TRUE'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5493,7 +5493,7 @@ SELECT 'TRUE' AND true;
 SELECT 'TRUE' AND false;
  | ---
  | - metadata:
- |   - name: '''TRUE'' AND false'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5560,7 +5560,7 @@ SELECT d, false AND d FROM t9 WHERE d = 'TRUE';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: false AND d
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['TRUE', false]
@@ -5585,7 +5585,7 @@ SELECT d, d AND false FROM t9 WHERE d = 'TRUE';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: d AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['TRUE', false]
@@ -5650,7 +5650,7 @@ SELECT true AND 'true';
 SELECT false AND 'true';
  | ---
  | - metadata:
- |   - name: false AND 'true'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5673,7 +5673,7 @@ SELECT 'true' AND true;
 SELECT 'true' AND false;
  | ---
  | - metadata:
- |   - name: '''true'' AND false'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5740,7 +5740,7 @@ SELECT d, false AND d FROM t9 WHERE d = 'true';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: false AND d
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['true', false]
@@ -5765,7 +5765,7 @@ SELECT d, d AND false FROM t9 WHERE d = 'true';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: d AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['true', false]
@@ -5830,7 +5830,7 @@ SELECT true AND 'FALSE';
 SELECT false AND 'FALSE';
  | ---
  | - metadata:
- |   - name: false AND 'FALSE'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5853,7 +5853,7 @@ SELECT 'FALSE' AND true;
 SELECT 'FALSE' AND false;
  | ---
  | - metadata:
- |   - name: '''FALSE'' AND false'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5920,7 +5920,7 @@ SELECT d, false AND d FROM t9 WHERE d = 'FALSE';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: false AND d
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['FALSE', false]
@@ -5945,7 +5945,7 @@ SELECT d, d AND false FROM t9 WHERE d = 'FALSE';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: d AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['FALSE', false]
@@ -6010,7 +6010,7 @@ SELECT true AND 'false';
 SELECT false AND 'false';
  | ---
  | - metadata:
- |   - name: false AND 'false'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -6033,7 +6033,7 @@ SELECT 'false' AND true;
 SELECT 'false' AND false;
  | ---
  | - metadata:
- |   - name: '''false'' AND false'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -6100,7 +6100,7 @@ SELECT d, false AND d FROM t9 WHERE d = 'false';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: false AND d
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['false', false]
@@ -6125,7 +6125,7 @@ SELECT d, d AND false FROM t9 WHERE d = 'false';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: d AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['false', false]
diff --git a/test/sql/collation.result b/test/sql/collation.result
index 4e4c27ef0..bfc89e1b8 100644
--- a/test/sql/collation.result
+++ b/test/sql/collation.result
@@ -111,7 +111,7 @@ box.execute([[SELECT descriptor, upper(letter), letter FROM tu where UPPER(lette
 - metadata:
   - name: DESCRIPTOR
     type: string
-  - name: upper(letter)
+  - name: COLUMN_1
     type: string
   - name: LETTER
     type: string
@@ -124,7 +124,7 @@ box.execute([[SELECT descriptor, upper(letter COLLATE "GERMAN"), letter FROM tu
 - metadata:
   - name: DESCRIPTOR
     type: string
-  - name: upper(letter COLLATE "GERMAN")
+  - name: COLUMN_1
     type: string
   - name: LETTER
     type: string
@@ -335,14 +335,14 @@ box.execute("SELECT a FROM t UNION SELECT c FROM t;")
 box.execute("SELECT c COLLATE \"binary\" FROM t UNION SELECT a FROM t;")
 ---
 - metadata:
-  - name: c COLLATE "binary"
+  - name: COLUMN_1
     type: string
   rows: []
 ...
 box.execute("SELECT b COLLATE \"unicode\" FROM t UNION SELECT a FROM t;")
 ---
 - metadata:
-  - name: b COLLATE "unicode"
+  - name: COLUMN_1
     type: string
   rows: []
 ...
@@ -1128,7 +1128,7 @@ box.execute("INSERT INTO jj VALUES (1,'A'), (2,'a')")
 box.execute("SELECT DISTINCT trim(s2) FROM jj;")
 ---
 - metadata:
-  - name: trim(s2)
+  - name: COLUMN_1
     type: string
   rows:
   - ['A']
@@ -1140,7 +1140,7 @@ box.execute("INSERT INTO jj VALUES (3, 'aS'), (4, 'AS');")
 box.execute("SELECT DISTINCT replace(s2, 'S', 's') FROM jj;")
 ---
 - metadata:
-  - name: replace(s2, 'S', 's')
+  - name: COLUMN_1
     type: string
   rows:
   - ['A']
@@ -1149,7 +1149,7 @@ box.execute("SELECT DISTINCT replace(s2, 'S', 's') FROM jj;")
 box.execute("SELECT DISTINCT substr(s2, 1, 1) FROM jj;")
 ---
 - metadata:
-  - name: substr(s2, 1, 1)
+  - name: COLUMN_1
     type: string
   rows:
   - ['A']
diff --git a/test/sql/errinj.result b/test/sql/errinj.result
index 68c001f28..f19203bc6 100644
--- a/test/sql/errinj.result
+++ b/test/sql/errinj.result
@@ -120,7 +120,7 @@ insert_res
 select_res
 ---
 - metadata:
-  - name: '1'
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
diff --git a/test/sql/foreign-keys.result b/test/sql/foreign-keys.result
index f1d973443..33689a06e 100644
--- a/test/sql/foreign-keys.result
+++ b/test/sql/foreign-keys.result
@@ -357,7 +357,7 @@ box.execute('ALTER TABLE tc ADD CONSTRAINT fk1 FOREIGN KEY (id) REFERENCES tp(id
 box.execute('SELECT row_count();')
 ---
 - metadata:
-  - name: row_count()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -374,7 +374,7 @@ box.execute('ALTER TABLE tc DROP CONSTRAINT fk1;')
 box.execute('SELECT row_count();')
 ---
 - metadata:
-  - name: row_count()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
diff --git a/test/sql/full_metadata.result b/test/sql/full_metadata.result
index 5a93c41ec..25bac6d86 100644
--- a/test/sql/full_metadata.result
+++ b/test/sql/full_metadata.result
@@ -57,7 +57,7 @@ execute("SELECT 'aSd' COLLATE \"unicode_ci\";")
  | - metadata:
  |   - type: string
  |     span: '''aSd'' COLLATE "unicode_ci"'
- |     name: '''aSd'' COLLATE "unicode_ci"'
+ |     name: COLUMN_1
  |     collation: unicode_ci
  |   rows:
  |   - ['aSd']
@@ -78,7 +78,7 @@ execute("SELECT c COLLATE \"unicode\" FROM t;")
  | - metadata:
  |   - type: string
  |     span: c COLLATE "unicode"
- |     name: c COLLATE "unicode"
+ |     name: COLUMN_1
  |     collation: unicode
  |   rows:
  |   - ['aSd']
@@ -165,7 +165,7 @@ execute("SELECT *, id + 1 AS x, a AS y, c || 'abc' FROM t;")
  |     is_nullable: false
  |   - type: string
  |     span: c || 'abc'
- |     name: c || 'abc'
+ |     name: COLUMN_1
  |   rows:
  |   - [1, 1, 'aSd', 2, 1, 'aSdabc']
  | ...
@@ -185,8 +185,8 @@ execute("SELECT * FROM v;")
  |     name: Y
  |     is_nullable: false
  |   - type: string
- |     span: c || 'abc'
- |     name: c || 'abc'
+ |     span: COLUMN_1
+ |     name: COLUMN_1
  |   rows:
  |   - [2, 1, 'aSdabc']
  | ...
diff --git a/test/sql/func-recreate.result b/test/sql/func-recreate.result
index 3709df787..5fd2b79c0 100644
--- a/test/sql/func-recreate.result
+++ b/test/sql/func-recreate.result
@@ -48,7 +48,7 @@ test_run:cmd("setopt delimiter ''");
 ch:get()
 ---
 - metadata:
-  - name: WAITFOR(0.2)
+  - name: COLUMN_1
     type: number
   rows:
   - [0.2]
diff --git a/test/sql/gh-3199-no-mem-leaks.result b/test/sql/gh-3199-no-mem-leaks.result
index d8590779a..6ce8df436 100644
--- a/test/sql/gh-3199-no-mem-leaks.result
+++ b/test/sql/gh-3199-no-mem-leaks.result
@@ -32,7 +32,7 @@ box.execute('SELECT x, y, x + y FROM test ORDER BY y')
     type: integer
   - name: Y
     type: integer
-  - name: x + y
+  - name: COLUMN_1
     type: integer
   rows:
   - [1, 1, 2]
@@ -49,7 +49,7 @@ box.execute('SELECT x, y, x + y FROM test ORDER BY y')
     type: integer
   - name: Y
     type: integer
-  - name: x + y
+  - name: COLUMN_1
     type: integer
   rows:
   - [1, 1, 2]
@@ -62,7 +62,7 @@ box.execute('SELECT x, y, x + y FROM test ORDER BY y')
     type: integer
   - name: Y
     type: integer
-  - name: x + y
+  - name: COLUMN_1
     type: integer
   rows:
   - [1, 1, 2]
@@ -75,7 +75,7 @@ box.execute('SELECT x, y, x + y FROM test ORDER BY y')
     type: integer
   - name: Y
     type: integer
-  - name: x + y
+  - name: COLUMN_1
     type: integer
   rows:
   - [1, 1, 2]
@@ -88,7 +88,7 @@ box.execute('SELECT x, y, x + y FROM test ORDER BY y')
     type: integer
   - name: Y
     type: integer
-  - name: x + y
+  - name: COLUMN_1
     type: integer
   rows:
   - [1, 1, 2]
@@ -115,7 +115,7 @@ box.execute('SELECT a, id + 2, b FROM test2 WHERE b < id * 2 ORDER BY a ')
 - metadata:
   - name: A
     type: string
-  - name: id + 2
+  - name: COLUMN_1
     type: integer
   - name: B
     type: integer
@@ -134,7 +134,7 @@ box.execute('SELECT a, id + 2 * b, a FROM test2 WHERE b < id * 2 ORDER BY a ')
 - metadata:
   - name: A
     type: string
-  - name: id + 2 * b
+  - name: COLUMN_1
     type: integer
   - name: A
     type: string
@@ -149,7 +149,7 @@ box.execute('SELECT a, id + 2 * b, a FROM test2 WHERE b < id * 2 ORDER BY a ')
 - metadata:
   - name: A
     type: string
-  - name: id + 2 * b
+  - name: COLUMN_1
     type: integer
   - name: A
     type: string
@@ -164,7 +164,7 @@ box.execute('SELECT a, id + 2 * b, a FROM test2 WHERE b < id * 2 ORDER BY a ')
 - metadata:
   - name: A
     type: string
-  - name: id + 2 * b
+  - name: COLUMN_1
     type: integer
   - name: A
     type: string
@@ -183,7 +183,7 @@ box.execute('SELECT x, y + 3 * b, b FROM test2, test WHERE b = x')
 - metadata:
   - name: X
     type: integer
-  - name: y + 3 * b
+  - name: COLUMN_1
     type: integer
   - name: B
     type: integer
@@ -196,7 +196,7 @@ box.execute('SELECT x, y + 3 * b, b FROM test2, test WHERE b = x')
 - metadata:
   - name: X
     type: integer
-  - name: y + 3 * b
+  - name: COLUMN_1
     type: integer
   - name: B
     type: integer
@@ -209,7 +209,7 @@ box.execute('SELECT x, y + 3 * b, b FROM test2, test WHERE b = x')
 - metadata:
   - name: X
     type: integer
-  - name: y + 3 * b
+  - name: COLUMN_1
     type: integer
   - name: B
     type: integer
diff --git a/test/sql/gh-3888-values-blob-assert.result b/test/sql/gh-3888-values-blob-assert.result
index 0a1af28f2..669f2eb2f 100644
--- a/test/sql/gh-3888-values-blob-assert.result
+++ b/test/sql/gh-3888-values-blob-assert.result
@@ -51,7 +51,7 @@ box.execute('SELECT TheColumnName')
 box.execute('VALUES(-0.5e-2)')
 ---
 - metadata:
-  - name: column1
+  - name: COLUMN_1
     type: double
   rows:
   - [-0.005]
@@ -59,7 +59,7 @@ box.execute('VALUES(-0.5e-2)')
 box.execute('SELECT X\'507265766564\'')
 ---
 - metadata:
-  - name: X'507265766564'
+  - name: COLUMN_1
     type: varbinary
   rows:
   - ['Preved']
@@ -68,7 +68,7 @@ box.execute('SELECT X\'507265766564\'')
 box.execute('SELECT 3.14')
 ---
 - metadata:
-  - name: '3.14'
+  - name: COLUMN_1
     type: double
   rows:
   - [3.14]
@@ -76,7 +76,7 @@ box.execute('SELECT 3.14')
 box.execute('SELECT X\'4D6564766564\'')
 ---
 - metadata:
-  - name: X'4D6564766564'
+  - name: COLUMN_1
     type: varbinary
   rows:
   - ['Medved']
diff --git a/test/sql/gh-4697-scalar-bool-sort-cmp.result b/test/sql/gh-4697-scalar-bool-sort-cmp.result
index 2423cd894..6f7fbd62b 100644
--- a/test/sql/gh-4697-scalar-bool-sort-cmp.result
+++ b/test/sql/gh-4697-scalar-bool-sort-cmp.result
@@ -30,7 +30,7 @@ SELECT s2, typeof(s2) FROM test ORDER BY s2;
  | - metadata:
  |   - name: S2
  |     type: scalar
- |   - name: typeof(s2)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - [null, 'boolean']
@@ -43,7 +43,7 @@ SELECT s3, typeof(s3) FROM test ORDER BY s3;
  | - metadata:
  |   - name: S3
  |     type: scalar
- |   - name: typeof(s3)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - [null, 'boolean']
diff --git a/test/sql/icu-upper-lower.result b/test/sql/icu-upper-lower.result
index f7b9dfa38..3ecc07d94 100644
--- a/test/sql/icu-upper-lower.result
+++ b/test/sql/icu-upper-lower.result
@@ -23,11 +23,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Zəfər, jaketini də, papağını da götür, bu axşam hava çox soyuq
-      olacaq. ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Zəfər, jaketini də, papağını da götür, bu axşam hava çox soyuq
-      olacaq. ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     zəfər, jaketini də, papağını da götür, bu axşam hava çox soyuq olacaq. ',
@@ -38,9 +36,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     The quick brown fox jumps over the lazy dog. ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     The quick brown fox jumps over the lazy dog. ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     the quick brown fox jumps over the lazy dog. ', '     THE QUICK BROWN FOX
@@ -52,9 +50,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     The quick brown fox jumps over the lazy dog. ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     The quick brown fox jumps over the lazy dog. ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     the quick brown fox jumps over the lazy dog. ', '     THE QUICK BROWN FOX
@@ -66,11 +64,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Բել դղյակի ձախ ժամն օֆ ազգությանը ցպահանջ չճշտած վնաս էր եւ
-      փառք ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Բել դղյակի ձախ ժամն օֆ ազգությանը ցպահանջ չճշտած վնաս էր եւ
-      փառք ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     բել դղյակի ձախ ժամն օֆ ազգությանը ցպահանջ չճշտած վնաս էր եւ փառք ', '     ԲԵԼ
@@ -82,11 +78,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     У Іўі худы жвавы чорт у зялёнай камізэльцы пабег пад’есці фаршу
-      з юшкай ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     У Іўі худы жвавы чорт у зялёнай камізэльцы пабег пад’есці фаршу
-      з юшкай ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     у іўі худы жвавы чорт у зялёнай камізэльцы пабег пад’есці фаршу з юшкай ',
@@ -98,11 +92,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός
-      ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός
-      ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός ', '     ΤΆΧΙΣΤΗ
@@ -114,11 +106,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Chuaigh bé mhórshách le dlúthspád fíorfhinn trí hata mo dhea-phorcáin
-      bhig ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Chuaigh bé mhórshách le dlúthspád fíorfhinn trí hata mo dhea-phorcáin
-      bhig ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     chuaigh bé mhórshách le dlúthspád fíorfhinn trí hata mo dhea-phorcáin bhig ',
@@ -130,9 +120,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Quiere la boca exhausta vid, kiwi, piña y fugaz jamón ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Quiere la boca exhausta vid, kiwi, piña y fugaz jamón ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     quiere la boca exhausta vid, kiwi, piña y fugaz jamón ', '     QUIERE LA
@@ -144,9 +134,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     키스의 고유조건은 입술끼리 만나야 하고 특별한 기술은 필요치 않다 ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     키스의 고유조건은 입술끼리 만나야 하고 특별한 기술은 필요치 않다 ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     키스의 고유조건은 입술끼리 만나야 하고 특별한 기술은 필요치 않다 ', '     키스의 고유조건은 입술끼리 만나야 하고 특별한
@@ -158,9 +148,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Glāžšķūņa rūķīši dzērumā čiepj Baha koncertflīģeļu vākus ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Glāžšķūņa rūķīši dzērumā čiepj Baha koncertflīģeļu vākus ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     glāžšķūņa rūķīši dzērumā čiepj baha koncertflīģeļu vākus ', '     GLĀŽŠĶŪŅA
@@ -172,11 +162,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Zwölf große Boxkämpfer jagen Viktor quer über den Sylter Deich
-      ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Zwölf große Boxkämpfer jagen Viktor quer über den Sylter Deich
-      ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     zwölf große boxkämpfer jagen viktor quer über den sylter deich ', '     ZWÖLF
@@ -188,9 +176,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Pchnąć w tę łódź jeża lub ośm skrzyń fig. ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Pchnąć w tę łódź jeża lub ośm skrzyń fig. ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     pchnąć w tę łódź jeża lub ośm skrzyń fig. ', '     PCHNĄĆ W TĘ ŁÓDŹ JEŻA
@@ -202,9 +190,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Чуєш їх, доцю, га? Кумедна ж ти, прощайся без ґольфів! ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Чуєш їх, доцю, га? Кумедна ж ти, прощайся без ґольфів! ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     чуєш їх, доцю, га? кумедна ж ти, прощайся без ґольфів! ', '     ЧУЄШ ЇХ,
@@ -216,9 +204,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Příliš žluťoučký kůň úpěl ďábelské ódy ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Příliš žluťoučký kůň úpěl ďábelské ódy ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     příliš žluťoučký kůň úpěl ďábelské ódy ', '     PŘÍLIŠ ŽLUŤOUČKÝ KŮŇ ÚPĚL
@@ -230,11 +218,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Laŭ Ludoviko Zamenhof bongustas freŝa ĉeĥa manĝaĵo kun spicoj
-      ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Laŭ Ludoviko Zamenhof bongustas freŝa ĉeĥa manĝaĵo kun spicoj
-      ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     laŭ ludoviko zamenhof bongustas freŝa ĉeĥa manĝaĵo kun spicoj ', '     LAŬ
@@ -246,9 +232,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     いろはにほへと ちりぬるを わかよたれそ つねならむ うゐのおくやま けふこえて あさきゆめみし ゑひもせす ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     いろはにほへと ちりぬるを わかよたれそ つねならむ うゐのおくやま けふこえて あさきゆめみし ゑひもせす ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     いろはにほへと ちりぬるを わかよたれそ つねならむ うゐのおくやま けふこえて あさきゆめみし ゑひもせす ', '     いろはにほへと
@@ -260,9 +246,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: 'lower(''     Pijamalı hasta yağız şoföre çabucak güvendi. EXTRA: İ '')'
+  - name: COLUMN_1
     type: string
-  - name: 'upper(''     Pijamalı hasta yağız şoföre çabucak güvendi. EXTRA: İ '')'
+  - name: COLUMN_2
     type: string
   rows:
   - ['     pijamalı hasta yağız şoföre çabucak güvendi. extra: i̇ ', '     PIJAMALI
diff --git a/test/sql/integer-overflow.result b/test/sql/integer-overflow.result
index 6269cb547..a56fb2412 100644
--- a/test/sql/integer-overflow.result
+++ b/test/sql/integer-overflow.result
@@ -19,7 +19,7 @@ box.execute('SELECT (2147483647 * 2147483647 * 2147483647);')
 box.execute('SELECT (-9223372036854775808 / -1);')
 ---
 - metadata:
-  - name: (-9223372036854775808 / -1)
+  - name: COLUMN_1
     type: integer
   rows:
   - [9223372036854775808]
@@ -32,7 +32,7 @@ box.execute('SELECT (-9223372036854775808 - 1);')
 box.execute('SELECT (9223372036854775807 + 1);')
 ---
 - metadata:
-  - name: (9223372036854775807 + 1)
+  - name: COLUMN_1
     type: integer
   rows:
   - [9223372036854775808]
@@ -50,7 +50,7 @@ box.execute('SELECT 18446744073709551615 * 2;')
 box.execute('SELECT (-9223372036854775807 * (-2));')
 ---
 - metadata:
-  - name: (-9223372036854775807 * (-2))
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551614]
@@ -60,7 +60,7 @@ box.execute('SELECT (-9223372036854775807 * (-2));')
 box.execute('SELECT 9223372036854775808;')
 ---
 - metadata:
-  - name: '9223372036854775808'
+  - name: COLUMN_1
     type: integer
   rows:
   - [9223372036854775808]
@@ -74,7 +74,7 @@ box.execute('SELECT -9223372036854775809;')
 box.execute('SELECT 9223372036854775808 - 1;')
 ---
 - metadata:
-  - name: 9223372036854775808 - 1
+  - name: COLUMN_1
     type: integer
   rows:
   - [9223372036854775807]
@@ -82,7 +82,7 @@ box.execute('SELECT 9223372036854775808 - 1;')
 box.execute('SELECT 18446744073709551615;')
 ---
 - metadata:
-  - name: '18446744073709551615'
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551615]
@@ -98,7 +98,7 @@ box.execute('SELECT 18446744073709551616;')
 box.execute('SELECT CAST(\'9223372036854775808\' AS INTEGER);')
 ---
 - metadata:
-  - name: CAST('9223372036854775808' AS INTEGER)
+  - name: COLUMN_1
     type: integer
   rows:
   - [9223372036854775808]
diff --git a/test/sql/iproto.result b/test/sql/iproto.result
index 44ba499a0..ee1047fc1 100644
--- a/test/sql/iproto.result
+++ b/test/sql/iproto.result
@@ -372,11 +372,11 @@ parameters[3] = 33
 cn:execute('select $2, $1, $3', parameters)
 ---
 - metadata:
-  - name: $2
+  - name: COLUMN_1
     type: integer
-  - name: $1
+  - name: COLUMN_2
     type: integer
-  - name: $3
+  - name: COLUMN_3
     type: integer
   rows:
   - [22, 11, 33]
@@ -736,7 +736,7 @@ res.metadata
 cn:execute("SELECT zeroblob(1);")
 ---
 - metadata:
-  - name: zeroblob(1)
+  - name: COLUMN_1
     type: varbinary
   rows:
   - ["\0"]
@@ -749,7 +749,7 @@ res = cn:execute("SELECT randomblob(1);")
 ...
 res.metadata
 ---
-- - name: randomblob(1)
+- - name: COLUMN_1
     type: varbinary
 ...
 -- Type set during compilation stage, and since min/max are accept
@@ -759,7 +759,7 @@ res.metadata
 cn:execute("SELECT LEAST(1, 2, 3);")
 ---
 - metadata:
-  - name: LEAST(1, 2, 3)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [1]
@@ -767,7 +767,7 @@ cn:execute("SELECT LEAST(1, 2, 3);")
 cn:execute("SELECT GREATEST(1, 2, 3);")
 ---
 - metadata:
-  - name: GREATEST(1, 2, 3)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [3]
@@ -803,7 +803,7 @@ s = box.prepare([[ SELECT ?; ]])
 s:execute({42})
 ---
 - metadata:
-  - name: '?'
+  - name: COLUMN_1
     type: integer
   rows:
   - [42]
@@ -811,7 +811,7 @@ s:execute({42})
 box.execute('SELECT 1;')
 ---
 - metadata:
-  - name: '1'
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
diff --git a/test/sql/max-on-index.result b/test/sql/max-on-index.result
index 1cd488f85..a90f30993 100644
--- a/test/sql/max-on-index.result
+++ b/test/sql/max-on-index.result
@@ -48,7 +48,7 @@ box.execute("INSERT INTO test2 VALUES(1, 2)");
 box.execute("SELECT MAX(f1) FROM test1")
 ---
 - metadata:
-  - name: MAX(f1)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [4]
@@ -56,7 +56,7 @@ box.execute("SELECT MAX(f1) FROM test1")
 box.execute("SELECT MAX(f2) FROM test1")
 ---
 - metadata:
-  - name: MAX(f2)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [3]
@@ -64,7 +64,7 @@ box.execute("SELECT MAX(f2) FROM test1")
 box.execute("SELECT MAX(f1) FROM test2")
 ---
 - metadata:
-  - name: MAX(f1)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [1]
diff --git a/test/sql/misc.result b/test/sql/misc.result
index 0190a5897..6af11bfba 100644
--- a/test/sql/misc.result
+++ b/test/sql/misc.result
@@ -11,7 +11,7 @@ _ = box.space._session_settings:update('sql_default_engine', {{'=', 2, engine}})
 box.execute('select 1;')
 ---
 - metadata:
-  - name: '1'
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -78,7 +78,7 @@ box.execute('CREATE TABLE test (id INTEGER PRIMARY KEY, b TEXT CONSTRAINT c1 COL
 box.execute('SELECT 1;')
 ---
 - metadata:
-  - name: '1'
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -86,7 +86,7 @@ box.execute('SELECT 1;')
 box.execute('SELECT 1.5;')
 ---
 - metadata:
-  - name: '1.5'
+  - name: COLUMN_1
     type: double
   rows:
   - [1.5]
@@ -94,7 +94,7 @@ box.execute('SELECT 1.5;')
 box.execute('SELECT 1.0;')
 ---
 - metadata:
-  - name: '1.0'
+  - name: COLUMN_1
     type: double
   rows:
   - [1]
@@ -102,7 +102,7 @@ box.execute('SELECT 1.0;')
 box.execute('SELECT \'abc\';')
 ---
 - metadata:
-  - name: '''abc'''
+  - name: COLUMN_1
     type: string
   rows:
   - ['abc']
@@ -110,7 +110,7 @@ box.execute('SELECT \'abc\';')
 box.execute('SELECT X\'4D6564766564\'')
 ---
 - metadata:
-  - name: X'4D6564766564'
+  - name: COLUMN_1
     type: varbinary
   rows:
   - ['Medved']
diff --git a/test/sql/persistency.result b/test/sql/persistency.result
index 6d14d4c4e..95dde5714 100644
--- a/test/sql/persistency.result
+++ b/test/sql/persistency.result
@@ -41,9 +41,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -57,9 +57,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar LIMIT 2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -72,9 +72,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo=2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['bar', 2, 42, 'awesome']
@@ -86,9 +86,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo>2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foobar', 1000, 42, 'awesome']
@@ -100,9 +100,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo>=2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['bar', 2, 42, 'awesome']
@@ -115,9 +115,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo=10000")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows: []
 ...
@@ -128,9 +128,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo>10000")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows: []
 ...
@@ -141,9 +141,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -155,9 +155,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<2.001")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -170,9 +170,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<=2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -185,9 +185,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<100")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -200,9 +200,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE bar='foo'")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -210,7 +210,7 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE bar='foo'")
 box.execute("SELECT count(*) FROM foobar")
 ---
 - metadata:
-  - name: count(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -218,7 +218,7 @@ box.execute("SELECT count(*) FROM foobar")
 box.execute("SELECT count(*) FROM foobar WHERE bar='foo'")
 ---
 - metadata:
-  - name: count(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -230,9 +230,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar ORDER BY bar")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['bar', 2, 42, 'awesome']
@@ -246,9 +246,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar ORDER BY bar DESC")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foobar', 1000, 42, 'awesome']
@@ -263,7 +263,7 @@ box.execute("REPLACE INTO foobar VALUES (1, 'cacodaemon')")
 box.execute("SELECT COUNT(*) FROM foobar WHERE foo=1")
 ---
 - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -271,7 +271,7 @@ box.execute("SELECT COUNT(*) FROM foobar WHERE foo=1")
 box.execute("SELECT COUNT(*) FROM foobar WHERE bar='cacodaemon'")
 ---
 - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -283,7 +283,7 @@ box.execute("DELETE FROM foobar WHERE bar='cacodaemon'")
 box.execute("SELECT COUNT(*) FROM foobar WHERE bar='cacodaemon'")
 ---
 - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
diff --git a/test/sql/prepared.result b/test/sql/prepared.result
index 666f6e1d3..0db2cc03f 100644
--- a/test/sql/prepared.result
+++ b/test/sql/prepared.result
@@ -425,13 +425,13 @@ s = prepare("SELECT count(*), count(a - 3), max(b), abs(id) FROM test WHERE b =
 execute(s.stmt_id)
  | ---
  | - metadata:
- |   - name: count(*)
+ |   - name: COLUMN_1
  |     type: integer
- |   - name: count(a - 3)
+ |   - name: COLUMN_2
  |     type: integer
- |   - name: max(b)
+ |   - name: COLUMN_3
  |     type: scalar
- |   - name: abs(id)
+ |   - name: COLUMN_4
  |     type: number
  |   rows:
  |   - [1, 1, '3', 1]
@@ -439,13 +439,13 @@ execute(s.stmt_id)
 execute(s.stmt_id)
  | ---
  | - metadata:
- |   - name: count(*)
+ |   - name: COLUMN_1
  |     type: integer
- |   - name: count(a - 3)
+ |   - name: COLUMN_2
  |     type: integer
- |   - name: max(b)
+ |   - name: COLUMN_3
  |     type: scalar
- |   - name: abs(id)
+ |   - name: COLUMN_4
  |     type: number
  |   rows:
  |   - [1, 1, '3', 1]
@@ -480,7 +480,7 @@ res = execute(s.stmt_id)
  | ...
 res.metadata
  | ---
- | - - name: group_concat(TRIM(TRAILING FROM t),x'0a')
+ | - - name: COLUMN_13
  |     type: string
  | ...
 unprepare(s.stmt_id)
@@ -838,11 +838,11 @@ s = prepare('SELECT :a, :b, :c');
 execute(s.stmt_id, {{[':a'] = 1}, {[':b'] = 2}, {[':c'] = 3}});
  | ---
  | - metadata:
- |   - name: :a
+ |   - name: COLUMN_1
  |     type: integer
- |   - name: :b
+ |   - name: COLUMN_2
  |     type: integer
- |   - name: :c
+ |   - name: COLUMN_3
  |     type: integer
  |   rows:
  |   - [1, 2, 3]
@@ -850,11 +850,11 @@ execute(s.stmt_id, {{[':a'] = 1}, {[':b'] = 2}, {[':c'] = 3}});
 execute(s.stmt_id, {{[':a'] = 1}, {[':b'] = 2}});
  | ---
  | - metadata:
- |   - name: :a
+ |   - name: COLUMN_1
  |     type: integer
- |   - name: :b
+ |   - name: COLUMN_2
  |     type: integer
- |   - name: :c
+ |   - name: COLUMN_3
  |     type: boolean
  |   rows:
  |   - [1, 2, null]
@@ -862,11 +862,11 @@ execute(s.stmt_id, {{[':a'] = 1}, {[':b'] = 2}});
 execute(s.stmt_id);
  | ---
  | - metadata:
- |   - name: :a
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: :b
+ |   - name: COLUMN_2
  |     type: boolean
- |   - name: :c
+ |   - name: COLUMN_3
  |     type: boolean
  |   rows:
  |   - [null, null, null]
diff --git a/test/sql/row-count.result b/test/sql/row-count.result
index 02acd79b5..7591d1630 100644
--- a/test/sql/row-count.result
+++ b/test/sql/row-count.result
@@ -16,7 +16,7 @@ box.execute("CREATE TABLE t1 (s1 VARCHAR(10) PRIMARY KEY);")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -24,7 +24,7 @@ box.execute("SELECT ROW_COUNT();")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -36,7 +36,7 @@ box.execute("CREATE TABLE t2 (s1 VARCHAR(10) PRIMARY KEY, s2 VARCHAR(10) REFEREN
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -52,7 +52,7 @@ box.execute("INSERT INTO t3 VALUES (0, 0, 0);")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -64,7 +64,7 @@ box.execute("CREATE TRIGGER x AFTER DELETE ON t1 FOR EACH ROW BEGIN UPDATE t3 SE
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -76,7 +76,7 @@ box.execute("INSERT INTO t1 VALUES ('a');")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -88,7 +88,7 @@ box.execute("INSERT INTO t2 VALUES ('a','a');")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -100,7 +100,7 @@ box.execute("INSERT INTO t1 VALUES ('b'), ('c'), ('d');")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -113,7 +113,7 @@ box.execute("REPLACE INTO t2 VALUES('a', 'c');")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [2]
@@ -125,7 +125,7 @@ box.execute("DELETE FROM t1;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [4]
@@ -141,7 +141,7 @@ box.execute("TRUNCATE TABLE t3;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -157,7 +157,7 @@ box.execute("UPDATE t3 SET i2 = 666;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -172,7 +172,7 @@ box.execute("DELETE FROM t3 WHERE 0 = 0;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -188,7 +188,7 @@ box.execute("DELETE FROM t3")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -222,7 +222,7 @@ box.execute("DELETE FROM tt1 WHERE id = 2;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -252,7 +252,7 @@ box.execute("START TRANSACTION;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -264,7 +264,7 @@ box.execute("COMMIT;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -277,7 +277,7 @@ box.execute("COMMIT;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -286,7 +286,7 @@ box.execute("SELECT ROW_COUNT();")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -308,7 +308,7 @@ box.execute("EXPLAIN QUERY PLAN INSERT INTO t1 VALUES ('b'), ('c'), ('d');")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
diff --git a/test/sql/transition.result b/test/sql/transition.result
index c14055b4e..8680e3cec 100644
--- a/test/sql/transition.result
+++ b/test/sql/transition.result
@@ -38,9 +38,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -54,9 +54,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar LIMIT 2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -69,9 +69,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo=2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['bar', 2, 42, 'awesome']
@@ -83,9 +83,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo>2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foobar', 1000, 42, 'awesome']
@@ -97,9 +97,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo>=2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['bar', 2, 42, 'awesome']
@@ -112,9 +112,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo=10000")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows: []
 ...
@@ -125,9 +125,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo>10000")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows: []
 ...
@@ -138,9 +138,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -152,9 +152,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<2.001")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -167,9 +167,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<=2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -182,9 +182,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<100")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -197,9 +197,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE bar='foo'")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -207,7 +207,7 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE bar='foo'")
 box.execute("SELECT count(*) FROM foobar")
 ---
 - metadata:
-  - name: count(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -215,7 +215,7 @@ box.execute("SELECT count(*) FROM foobar")
 box.execute("SELECT count(*) FROM foobar WHERE bar='foo'")
 ---
 - metadata:
-  - name: count(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -227,9 +227,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar ORDER BY bar")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['bar', 2, 42, 'awesome']
@@ -243,9 +243,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar ORDER BY bar DESC")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foobar', 1000, 42, 'awesome']
@@ -260,7 +260,7 @@ box.execute("REPLACE INTO foobar VALUES (1, 'cacodaemon')")
 box.execute("SELECT COUNT(*) FROM foobar WHERE foo=1")
 ---
 - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -268,7 +268,7 @@ box.execute("SELECT COUNT(*) FROM foobar WHERE foo=1")
 box.execute("SELECT COUNT(*) FROM foobar WHERE bar='cacodaemon'")
 ---
 - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -280,7 +280,7 @@ box.execute("DELETE FROM foobar WHERE bar='cacodaemon'")
 box.execute("SELECT COUNT(*) FROM foobar WHERE bar='cacodaemon'")
 ---
 - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
diff --git a/test/sql/types.result b/test/sql/types.result
index 54aff460e..8204b22bd 100644
--- a/test/sql/types.result
+++ b/test/sql/types.result
@@ -54,8 +54,8 @@ box.execute("CREATE VIEW v1 AS SELECT b + a, b - a FROM t1;")
 ...
 box.space.V1:format()
 ---
-- [{'type': 'number', 'nullable_action': 'none', 'name': 'b + a', 'is_nullable': true},
-  {'type': 'number', 'nullable_action': 'none', 'name': 'b - a', 'is_nullable': true}]
+- [{'type': 'number', 'nullable_action': 'none', 'name': 'COLUMN_1', 'is_nullable': true},
+  {'type': 'number', 'nullable_action': 'none', 'name': 'COLUMN_2', 'is_nullable': true}]
 ...
 -- gh-2494: index's part also features correct declared type.
 --
@@ -197,7 +197,7 @@ box.execute("SELECT randomblob(5) || 'x';")
 box.execute("VALUES (TYPEOF(randomblob(5) || zeroblob(5)));")
 ---
 - metadata:
-  - name: column1
+  - name: COLUMN_1
     type: string
   rows:
   - ['varbinary']
@@ -230,7 +230,7 @@ box.execute("SELECT * FROM t1 WHERE 'blob' LIKE x'0000';")
 box.execute("SELECT s LIKE NULL FROM t1;")
 ---
 - metadata:
-  - name: s LIKE NULL
+  - name: COLUMN_1
     type: integer
   rows:
   - [null]
@@ -256,7 +256,7 @@ box.execute("SELECT * FROM t1 WHERE 'int' LIKE 4;")
 box.execute("SELECT NULL LIKE s FROM t1;")
 ---
 - metadata:
-  - name: NULL LIKE s
+  - name: COLUMN_1
     type: integer
   rows:
   - [null]
@@ -295,7 +295,7 @@ box.space.T1:drop()
 box.execute('SELECT 1 + 1;')
 ---
 - metadata:
-  - name: 1 + 1
+  - name: COLUMN_1
     type: integer
   rows:
   - [2]
@@ -303,7 +303,7 @@ box.execute('SELECT 1 + 1;')
 box.execute('SELECT 1 + 1.1;')
 ---
 - metadata:
-  - name: 1 + 1.1
+  - name: COLUMN_1
     type: double
   rows:
   - [2.1]
@@ -311,7 +311,7 @@ box.execute('SELECT 1 + 1.1;')
 box.execute('SELECT \'9223372036854\' + 1;')
 ---
 - metadata:
-  - name: '''9223372036854'' + 1'
+  - name: COLUMN_1
     type: integer
   rows:
   - [9223372036855]
@@ -320,7 +320,7 @@ box.execute('SELECT \'9223372036854\' + 1;')
 box.execute('SELECT ?', {true})
 ---
 - metadata:
-  - name: '?'
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -481,7 +481,7 @@ s:drop()
 box.execute("SELECT 18446744073709551615 > 18446744073709551614;")
 ---
 - metadata:
-  - name: 18446744073709551615 > 18446744073709551614
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -489,7 +489,7 @@ box.execute("SELECT 18446744073709551615 > 18446744073709551614;")
 box.execute("SELECT 18446744073709551615 > -9223372036854775808;")
 ---
 - metadata:
-  - name: 18446744073709551615 > -9223372036854775808
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -497,7 +497,7 @@ box.execute("SELECT 18446744073709551615 > -9223372036854775808;")
 box.execute("SELECT -1 < 18446744073709551615;")
 ---
 - metadata:
-  - name: -1 < 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -505,7 +505,7 @@ box.execute("SELECT -1 < 18446744073709551615;")
 box.execute("SELECT 1.5 < 18446744073709551615")
 ---
 - metadata:
-  - name: 1.5 < 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -513,7 +513,7 @@ box.execute("SELECT 1.5 < 18446744073709551615")
 box.execute("SELECT 1.5 > 18446744073709551615")
 ---
 - metadata:
-  - name: 1.5 > 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [false]
@@ -521,7 +521,7 @@ box.execute("SELECT 1.5 > 18446744073709551615")
 box.execute("SELECT 18446744073709551615 > 1.5")
 ---
 - metadata:
-  - name: 18446744073709551615 > 1.5
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -529,7 +529,7 @@ box.execute("SELECT 18446744073709551615 > 1.5")
 box.execute("SELECT 18446744073709551615 < 1.5")
 ---
 - metadata:
-  - name: 18446744073709551615 < 1.5
+  - name: COLUMN_1
     type: boolean
   rows:
   - [false]
@@ -537,7 +537,7 @@ box.execute("SELECT 18446744073709551615 < 1.5")
 box.execute("SELECT 18446744073709551615 = 18446744073709551615;")
 ---
 - metadata:
-  - name: 18446744073709551615 = 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -545,7 +545,7 @@ box.execute("SELECT 18446744073709551615 = 18446744073709551615;")
 box.execute("SELECT 18446744073709551615 > -9223372036854775808;")
 ---
 - metadata:
-  - name: 18446744073709551615 > -9223372036854775808
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -553,7 +553,7 @@ box.execute("SELECT 18446744073709551615 > -9223372036854775808;")
 box.execute("SELECT 18446744073709551615 < -9223372036854775808;")
 ---
 - metadata:
-  - name: 18446744073709551615 < -9223372036854775808
+  - name: COLUMN_1
     type: boolean
   rows:
   - [false]
@@ -561,7 +561,7 @@ box.execute("SELECT 18446744073709551615 < -9223372036854775808;")
 box.execute("SELECT -1 < 18446744073709551615;")
 ---
 - metadata:
-  - name: -1 < 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -569,7 +569,7 @@ box.execute("SELECT -1 < 18446744073709551615;")
 box.execute("SELECT -1 > 18446744073709551615;")
 ---
 - metadata:
-  - name: -1 > 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [false]
@@ -577,7 +577,7 @@ box.execute("SELECT -1 > 18446744073709551615;")
 box.execute("SELECT 18446744073709551610 - 18446744073709551615;")
 ---
 - metadata:
-  - name: 18446744073709551610 - 18446744073709551615
+  - name: COLUMN_1
     type: integer
   rows:
   - [-5]
@@ -585,7 +585,7 @@ box.execute("SELECT 18446744073709551610 - 18446744073709551615;")
 box.execute("SELECT 18446744073709551615 = null;")
 ---
 - metadata:
-  - name: 18446744073709551615 = null
+  - name: COLUMN_1
     type: boolean
   rows:
   - [null]
@@ -593,7 +593,7 @@ box.execute("SELECT 18446744073709551615 = null;")
 box.execute("SELECT 18446744073709551615 = 18446744073709551615.0;")
 ---
 - metadata:
-  - name: 18446744073709551615 = 18446744073709551615.0
+  - name: COLUMN_1
     type: boolean
   rows:
   - [false]
@@ -601,7 +601,7 @@ box.execute("SELECT 18446744073709551615 = 18446744073709551615.0;")
 box.execute("SELECT 18446744073709551615.0 > 18446744073709551615")
 ---
 - metadata:
-  - name: 18446744073709551615.0 > 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -609,7 +609,7 @@ box.execute("SELECT 18446744073709551615.0 > 18446744073709551615")
 box.execute("SELECT 18446744073709551615 IN ('18446744073709551615', 18446744073709551615.0)")
 ---
 - metadata:
-  - name: 18446744073709551615 IN ('18446744073709551615', 18446744073709551615.0)
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -617,7 +617,7 @@ box.execute("SELECT 18446744073709551615 IN ('18446744073709551615', 18446744073
 box.execute("SELECT 1 LIMIT 18446744073709551615;")
 ---
 - metadata:
-  - name: '1'
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -625,7 +625,7 @@ box.execute("SELECT 1 LIMIT 18446744073709551615;")
 box.execute("SELECT 1 LIMIT 1 OFFSET 18446744073709551614;")
 ---
 - metadata:
-  - name: '1'
+  - name: COLUMN_1
     type: integer
   rows: []
 ...
@@ -637,7 +637,7 @@ box.execute("SELECT CAST('18446744073' || '709551616' AS INTEGER);")
 box.execute("SELECT CAST('18446744073' || '709551615' AS INTEGER);")
 ---
 - metadata:
-  - name: CAST('18446744073' || '709551615' AS INTEGER)
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551615]
@@ -645,7 +645,7 @@ box.execute("SELECT CAST('18446744073' || '709551615' AS INTEGER);")
 box.execute("SELECT 18446744073709551610 + 5;")
 ---
 - metadata:
-  - name: 18446744073709551610 + 5
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551615]
@@ -653,7 +653,7 @@ box.execute("SELECT 18446744073709551610 + 5;")
 box.execute("SELECT 18446744073709551615 * 1;")
 ---
 - metadata:
-  - name: 18446744073709551615 * 1
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551615]
@@ -661,7 +661,7 @@ box.execute("SELECT 18446744073709551615 * 1;")
 box.execute("SELECT 1 / 18446744073709551615;")
 ---
 - metadata:
-  - name: 1 / 18446744073709551615
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -669,7 +669,7 @@ box.execute("SELECT 1 / 18446744073709551615;")
 box.execute("SELECT 18446744073709551615 / 18446744073709551615;")
 ---
 - metadata:
-  - name: 18446744073709551615 / 18446744073709551615
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -677,7 +677,7 @@ box.execute("SELECT 18446744073709551615 / 18446744073709551615;")
 box.execute("SELECT 18446744073709551615 / -9223372036854775808;")
 ---
 - metadata:
-  - name: 18446744073709551615 / -9223372036854775808
+  - name: COLUMN_1
     type: integer
   rows:
   - [-1]
@@ -771,7 +771,7 @@ box.execute("INSERT INTO t VALUES (2, -1);")
 box.execute("SELECT sum(i) FROM t;")
 ---
 - metadata:
-  - name: sum(i)
+  - name: COLUMN_1
     type: number
   rows:
   - [18446744073709551613]
@@ -779,7 +779,7 @@ box.execute("SELECT sum(i) FROM t;")
 box.execute("SELECT avg(i) FROM t;")
 ---
 - metadata:
-  - name: avg(i)
+  - name: COLUMN_1
     type: number
   rows:
   - [6148914691236516864]
@@ -787,7 +787,7 @@ box.execute("SELECT avg(i) FROM t;")
 box.execute("SELECT total(i) FROM t;")
 ---
 - metadata:
-  - name: total(i)
+  - name: COLUMN_1
     type: number
   rows:
   - [1.844674407371e+19]
@@ -795,7 +795,7 @@ box.execute("SELECT total(i) FROM t;")
 box.execute("SELECT min(i) FROM t;")
 ---
 - metadata:
-  - name: min(i)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [-1]
@@ -803,7 +803,7 @@ box.execute("SELECT min(i) FROM t;")
 box.execute("SELECT max(i) FROM t;")
 ---
 - metadata:
-  - name: max(i)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [18446744073709551613]
@@ -811,7 +811,7 @@ box.execute("SELECT max(i) FROM t;")
 box.execute("SELECT count(i) FROM t;")
 ---
 - metadata:
-  - name: count(i)
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -819,7 +819,7 @@ box.execute("SELECT count(i) FROM t;")
 box.execute("SELECT group_concat(i) FROM t;")
 ---
 - metadata:
-  - name: group_concat(i)
+  - name: COLUMN_1
     type: string
   rows:
   - ['1,-1,18446744073709551613']
@@ -831,7 +831,7 @@ box.execute("DELETE FROM t WHERE i < 18446744073709551613;")
 box.execute("SELECT lower(i) FROM t;")
 ---
 - metadata:
-  - name: lower(i)
+  - name: COLUMN_1
     type: string
   rows:
   - ['18446744073709551613']
@@ -839,7 +839,7 @@ box.execute("SELECT lower(i) FROM t;")
 box.execute("SELECT upper(i) FROM t;")
 ---
 - metadata:
-  - name: upper(i)
+  - name: COLUMN_1
     type: string
   rows:
   - ['18446744073709551613']
@@ -847,7 +847,7 @@ box.execute("SELECT upper(i) FROM t;")
 box.execute("SELECT abs(i) FROM t;")
 ---
 - metadata:
-  - name: abs(i)
+  - name: COLUMN_1
     type: number
   rows:
   - [18446744073709551613]
@@ -855,7 +855,7 @@ box.execute("SELECT abs(i) FROM t;")
 box.execute("SELECT typeof(i) FROM t;")
 ---
 - metadata:
-  - name: typeof(i)
+  - name: COLUMN_1
     type: string
   rows:
   - ['integer']
@@ -863,7 +863,7 @@ box.execute("SELECT typeof(i) FROM t;")
 box.execute("SELECT quote(i) FROM t;")
 ---
 - metadata:
-  - name: quote(i)
+  - name: COLUMN_1
     type: string
   rows:
   - [18446744073709551613]
@@ -871,7 +871,7 @@ box.execute("SELECT quote(i) FROM t;")
 box.execute("SELECT LEAST(-1, i) FROM t;")
 ---
 - metadata:
-  - name: LEAST(-1, i)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [-1]
@@ -879,7 +879,7 @@ box.execute("SELECT LEAST(-1, i) FROM t;")
 box.execute("SELECT quote(i) FROM t;")
 ---
 - metadata:
-  - name: quote(i)
+  - name: COLUMN_1
     type: string
   rows:
   - [18446744073709551613]
@@ -1012,7 +1012,7 @@ box.space.T1:drop()
 box.execute("SELECT CAST(18446744073709551615 AS NUMBER);")
 ---
 - metadata:
-  - name: CAST(18446744073709551615 AS NUMBER)
+  - name: COLUMN_1
     type: number
   rows:
   - [18446744073709551615]
@@ -1020,7 +1020,7 @@ box.execute("SELECT CAST(18446744073709551615 AS NUMBER);")
 box.execute("SELECT CAST(18446744073709551615 AS TEXT);")
 ---
 - metadata:
-  - name: CAST(18446744073709551615 AS TEXT)
+  - name: COLUMN_1
     type: string
   rows:
   - ['18446744073709551615']
@@ -1028,7 +1028,7 @@ box.execute("SELECT CAST(18446744073709551615 AS TEXT);")
 box.execute("SELECT CAST(18446744073709551615 AS SCALAR);")
 ---
 - metadata:
-  - name: CAST(18446744073709551615 AS SCALAR)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [18446744073709551615]
@@ -1036,7 +1036,7 @@ box.execute("SELECT CAST(18446744073709551615 AS SCALAR);")
 box.execute("SELECT CAST(18446744073709551615 AS BOOLEAN);")
 ---
 - metadata:
-  - name: CAST(18446744073709551615 AS BOOLEAN)
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -1044,7 +1044,7 @@ box.execute("SELECT CAST(18446744073709551615 AS BOOLEAN);")
 box.execute("SELECT CAST('18446744073709551615' AS INTEGER);")
 ---
 - metadata:
-  - name: CAST('18446744073709551615' AS INTEGER)
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551615]
@@ -1077,7 +1077,7 @@ box.execute("SELECT id FROM t1;")
 box.execute("SELECT CAST(123 AS UNSIGNED);")
 ---
 - metadata:
-  - name: CAST(123 AS UNSIGNED)
+  - name: COLUMN_1
     type: unsigned
   rows:
   - [123]
@@ -1090,7 +1090,7 @@ box.execute("SELECT CAST(-123 AS UNSIGNED);")
 box.execute("SELECT CAST(1.5 AS UNSIGNED);")
 ---
 - metadata:
-  - name: CAST(1.5 AS UNSIGNED)
+  - name: COLUMN_1
     type: unsigned
   rows:
   - [1]
@@ -1098,7 +1098,7 @@ box.execute("SELECT CAST(1.5 AS UNSIGNED);")
 box.execute("SELECT CAST(-1.5 AS UNSIGNED);")
 ---
 - metadata:
-  - name: CAST(-1.5 AS UNSIGNED)
+  - name: COLUMN_1
     type: unsigned
   rows:
   - [-1]
@@ -1106,7 +1106,7 @@ box.execute("SELECT CAST(-1.5 AS UNSIGNED);")
 box.execute("SELECT CAST(true AS UNSIGNED);")
 ---
 - metadata:
-  - name: CAST(true AS UNSIGNED)
+  - name: COLUMN_1
     type: unsigned
   rows:
   - [1]
@@ -1114,7 +1114,7 @@ box.execute("SELECT CAST(true AS UNSIGNED);")
 box.execute("SELECT CAST('123' AS UNSIGNED);")
 ---
 - metadata:
-  - name: CAST('123' AS UNSIGNED)
+  - name: COLUMN_1
     type: unsigned
   rows:
   - [123]
@@ -1146,7 +1146,7 @@ box.space.T:drop()
 box.execute("SELECT CASE 1 WHEN 1 THEN x'0000000000' WHEN 2 THEN 'str' END")
 ---
 - metadata:
-  - name: CASE 1 WHEN 1 THEN x'0000000000' WHEN 2 THEN 'str' END
+  - name: COLUMN_1
     type: scalar
   rows:
   - ["\0\0\0\0\0"]
@@ -1154,7 +1154,7 @@ box.execute("SELECT CASE 1 WHEN 1 THEN x'0000000000' WHEN 2 THEN 'str' END")
 box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 END")
 ---
 - metadata:
-  - name: CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 END
+  - name: COLUMN_1
     type: integer
   rows:
   - [666]
@@ -1162,7 +1162,7 @@ box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 END")
 box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 ELSE 321 END")
 ---
 - metadata:
-  - name: CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 ELSE 321 END
+  - name: COLUMN_1
     type: integer
   rows:
   - [666]
@@ -1170,7 +1170,7 @@ box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 ELSE 321 END")
 box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 ELSE 'asd' END")
 ---
 - metadata:
-  - name: CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 ELSE 'asd' END
+  - name: COLUMN_1
     type: scalar
   rows:
   - [666]
@@ -1178,8 +1178,7 @@ box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 ELSE 'asd' END")
 box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4 WHEN 'e' THEN 5 WHEN 'f' THEN 6 END;")
 ---
 - metadata:
-  - name: CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4
-      WHEN 'e' THEN 5 WHEN 'f' THEN 6 END
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -1187,8 +1186,7 @@ box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHE
 box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4 WHEN 'e' THEN 5 WHEN 'f' THEN 'asd' END;")
 ---
 - metadata:
-  - name: CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4
-      WHEN 'e' THEN 5 WHEN 'f' THEN 'asd' END
+  - name: COLUMN_1
     type: scalar
   rows:
   - [1]
@@ -1196,8 +1194,7 @@ box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHE
 box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4 WHEN 'e' THEN 5 WHEN 'f' THEN 6 ELSE 'asd' END;")
 ---
 - metadata:
-  - name: CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4
-      WHEN 'e' THEN 5 WHEN 'f' THEN 6 ELSE 'asd' END
+  - name: COLUMN_1
     type: scalar
   rows:
   - [1]
@@ -1205,8 +1202,7 @@ box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHE
 box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4 WHEN 'e' THEN 5 WHEN 'f' THEN 6 ELSE 7 END;")
 ---
 - metadata:
-  - name: CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4
-      WHEN 'e' THEN 5 WHEN 'f' THEN 6 ELSE 7 END
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -1284,7 +1280,7 @@ box.execute("SELECT total(v) FROM t;")
 box.execute("SELECT min(v) FROM t;")
 ---
 - metadata:
-  - name: min(v)
+  - name: COLUMN_1
     type: scalar
   rows:
   - ['abc']
@@ -1292,7 +1288,7 @@ box.execute("SELECT min(v) FROM t;")
 box.execute("SELECT max(v) FROM t;")
 ---
 - metadata:
-  - name: max(v)
+  - name: COLUMN_1
     type: scalar
   rows:
   - ['abc']
@@ -1300,7 +1296,7 @@ box.execute("SELECT max(v) FROM t;")
 box.execute("SELECT count(v) FROM t;")
 ---
 - metadata:
-  - name: count(v)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -1308,7 +1304,7 @@ box.execute("SELECT count(v) FROM t;")
 box.execute("SELECT group_concat(v) FROM t;")
 ---
 - metadata:
-  - name: group_concat(v)
+  - name: COLUMN_1
     type: string
   rows:
   - ['abc']
@@ -1331,7 +1327,7 @@ box.execute("SELECT abs(v) FROM t;")
 box.execute("SELECT typeof(v) FROM t;")
 ---
 - metadata:
-  - name: typeof(v)
+  - name: COLUMN_1
     type: string
   rows:
   - ['varbinary']
@@ -1339,7 +1335,7 @@ box.execute("SELECT typeof(v) FROM t;")
 box.execute("SELECT quote(v) FROM t;")
 ---
 - metadata:
-  - name: quote(v)
+  - name: COLUMN_1
     type: string
   rows:
   - ['X''616263''']
@@ -1347,7 +1343,7 @@ box.execute("SELECT quote(v) FROM t;")
 box.execute("SELECT LEAST(v, x'') FROM t;")
 ---
 - metadata:
-  - name: LEAST(v, x'')
+  - name: COLUMN_1
     type: scalar
   rows:
   - ['']
@@ -1467,7 +1463,7 @@ box.execute("SELECT CAST(true AS VARBINARY);")
 box.execute("SELECT CAST('asd' AS VARBINARY);")
 ---
 - metadata:
-  - name: CAST('asd' AS VARBINARY)
+  - name: COLUMN_1
     type: varbinary
   rows:
   - ['asd']
@@ -1475,7 +1471,7 @@ box.execute("SELECT CAST('asd' AS VARBINARY);")
 box.execute("SELECT CAST(x'' AS VARBINARY);")
 ---
 - metadata:
-  - name: CAST(x'' AS VARBINARY)
+  - name: COLUMN_1
     type: varbinary
   rows:
   - ['']
@@ -1494,9 +1490,9 @@ box.execute("INSERT INTO t VALUES (1, 1, 1), (2, NULL, NULL);")
 box.execute("SELECT typeof(a), typeof(s) FROM t;")
 ---
 - metadata:
-  - name: typeof(a)
+  - name: COLUMN_1
     type: string
-  - name: typeof(s)
+  - name: COLUMN_2
     type: string
   rows:
   - ['integer', 'integer']
@@ -1513,7 +1509,7 @@ box.execute('INSERT INTO t1 VALUES (1, NULL, NULL);')
 box.execute('SELECT typeof(a & b) FROM t1;')
 ---
 - metadata:
-  - name: typeof(a & b)
+  - name: COLUMN_1
     type: string
   rows:
   - ['integer']
@@ -1521,11 +1517,11 @@ box.execute('SELECT typeof(a & b) FROM t1;')
 box.execute('SELECT typeof(a), typeof(b), typeof(a & b) FROM t1')
 ---
 - metadata:
-  - name: typeof(a)
+  - name: COLUMN_1
     type: string
-  - name: typeof(b)
+  - name: COLUMN_2
     type: string
-  - name: typeof(a & b)
+  - name: COLUMN_3
     type: string
   rows:
   - ['integer', 'integer', 'integer']
@@ -1533,7 +1529,7 @@ box.execute('SELECT typeof(a), typeof(b), typeof(a & b) FROM t1')
 box.execute("SELECT typeof(CAST(0 AS UNSIGNED));")
 ---
 - metadata:
-  - name: typeof(CAST(0 AS UNSIGNED))
+  - name: COLUMN_1
     type: string
   rows:
   - ['unsigned']
@@ -1693,7 +1689,7 @@ box.execute('DROP TABLE t1;')
 box.execute("SELECT 1.0;")
 ---
 - metadata:
-  - name: '1.0'
+  - name: COLUMN_1
     type: double
   rows:
   - [1]
@@ -1701,7 +1697,7 @@ box.execute("SELECT 1.0;")
 box.execute("SELECT .01;")
 ---
 - metadata:
-  - name: '.01'
+  - name: COLUMN_1
     type: double
   rows:
   - [0.01]
@@ -1709,7 +1705,7 @@ box.execute("SELECT .01;")
 box.execute("SELECT CAST(1 AS DOUBLE);")
 ---
 - metadata:
-  - name: CAST(1 AS DOUBLE)
+  - name: COLUMN_1
     type: double
   rows:
   - [1]
@@ -1717,7 +1713,7 @@ box.execute("SELECT CAST(1 AS DOUBLE);")
 box.execute("SELECT CAST(1.123 AS DOUBLE);")
 ---
 - metadata:
-  - name: CAST(1.123 AS DOUBLE)
+  - name: COLUMN_1
     type: double
   rows:
   - [1.123]
@@ -1735,7 +1731,7 @@ box.execute("SELECT CAST('asd' AS DOUBLE);")
 box.execute("SELECT CAST('1' AS DOUBLE);")
 ---
 - metadata:
-  - name: CAST('1' AS DOUBLE)
+  - name: COLUMN_1
     type: double
   rows:
   - [1]
@@ -1743,7 +1739,7 @@ box.execute("SELECT CAST('1' AS DOUBLE);")
 box.execute("SELECT CAST('1.123' AS DOUBLE);")
 ---
 - metadata:
-  - name: CAST('1.123' AS DOUBLE)
+  - name: COLUMN_1
     type: double
   rows:
   - [1.123]
@@ -1761,7 +1757,7 @@ box.execute("SELECT CAST(x'35' AS DOUBLE);")
 box.execute("SELECT CAST(CAST(x'35' AS STRING) AS DOUBLE);")
 ---
 - metadata:
-  - name: CAST(CAST(x'35' AS STRING) AS DOUBLE)
+  - name: COLUMN_1
     type: double
   rows:
   - [5]
@@ -1795,7 +1791,7 @@ box.execute('SELECT * FROM t;')
 box.execute('SELECT d / 100 FROM t;')
 ---
 - metadata:
-  - name: d / 100
+  - name: COLUMN_1
     type: double
   rows:
   - [0.1]
@@ -1828,7 +1824,7 @@ box.execute('SELECT * from t WHERE d = 3.3;')
 box.execute("SELECT sum(d) FROM t;")
 ---
 - metadata:
-  - name: sum(d)
+  - name: COLUMN_1
     type: number
   rows:
   - [18000000000000000000]
@@ -1836,7 +1832,7 @@ box.execute("SELECT sum(d) FROM t;")
 box.execute("SELECT avg(d) FROM t;")
 ---
 - metadata:
-  - name: avg(d)
+  - name: COLUMN_1
     type: number
   rows:
   - [4500000000000000000]
@@ -1844,7 +1840,7 @@ box.execute("SELECT avg(d) FROM t;")
 box.execute("SELECT total(d) FROM t;")
 ---
 - metadata:
-  - name: total(d)
+  - name: COLUMN_1
     type: number
   rows:
   - [18000000000000000000]
@@ -1852,7 +1848,7 @@ box.execute("SELECT total(d) FROM t;")
 box.execute("SELECT min(d) FROM t;")
 ---
 - metadata:
-  - name: min(d)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [-2]
@@ -1860,7 +1856,7 @@ box.execute("SELECT min(d) FROM t;")
 box.execute("SELECT max(d) FROM t;")
 ---
 - metadata:
-  - name: max(d)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [18000000000000000000]
@@ -1868,7 +1864,7 @@ box.execute("SELECT max(d) FROM t;")
 box.execute("SELECT count(d) FROM t;")
 ---
 - metadata:
-  - name: count(d)
+  - name: COLUMN_1
     type: integer
   rows:
   - [4]
@@ -1876,7 +1872,7 @@ box.execute("SELECT count(d) FROM t;")
 box.execute("SELECT group_concat(d) FROM t;")
 ---
 - metadata:
-  - name: group_concat(d)
+  - name: COLUMN_1
     type: string
   rows:
   - ['10.0,-2.0,3.3,1.8e+19']
@@ -1884,7 +1880,7 @@ box.execute("SELECT group_concat(d) FROM t;")
 box.execute("SELECT lower(d) FROM t;")
 ---
 - metadata:
-  - name: lower(d)
+  - name: COLUMN_1
     type: string
   rows:
   - ['10.0']
@@ -1895,7 +1891,7 @@ box.execute("SELECT lower(d) FROM t;")
 box.execute("SELECT upper(d) FROM t;")
 ---
 - metadata:
-  - name: upper(d)
+  - name: COLUMN_1
     type: string
   rows:
   - ['10.0']
@@ -1906,7 +1902,7 @@ box.execute("SELECT upper(d) FROM t;")
 box.execute("SELECT abs(d) FROM t;")
 ---
 - metadata:
-  - name: abs(d)
+  - name: COLUMN_1
     type: number
   rows:
   - [10]
@@ -1917,7 +1913,7 @@ box.execute("SELECT abs(d) FROM t;")
 box.execute("SELECT typeof(d) FROM t;")
 ---
 - metadata:
-  - name: typeof(d)
+  - name: COLUMN_1
     type: string
   rows:
   - ['double']
@@ -1928,7 +1924,7 @@ box.execute("SELECT typeof(d) FROM t;")
 box.execute("SELECT quote(d) FROM t;")
 ---
 - metadata:
-  - name: quote(d)
+  - name: COLUMN_1
     type: string
   rows:
   - ['10.0']
@@ -1939,7 +1935,7 @@ box.execute("SELECT quote(d) FROM t;")
 box.execute("SELECT LEAST(d, 0) FROM t;")
 ---
 - metadata:
-  - name: LEAST(d, 0)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [0]
@@ -2081,9 +2077,9 @@ box.execute("DROP TABLE t4;")
 box.execute("SELECT 1.0, typeof(1.0);")
 ---
 - metadata:
-  - name: '1.0'
+  - name: COLUMN_1
     type: double
-  - name: typeof(1.0)
+  - name: COLUMN_2
     type: string
   rows:
   - [1, 'double']
@@ -2091,9 +2087,9 @@ box.execute("SELECT 1.0, typeof(1.0);")
 box.execute("SELECT CAST(2 AS DOUBLE), typeof(CAST(2 AS DOUBLE));")
 ---
 - metadata:
-  - name: CAST(2 AS DOUBLE)
+  - name: COLUMN_1
     type: double
-  - name: typeof(CAST(2 AS DOUBLE))
+  - name: COLUMN_2
     type: string
   rows:
   - [2, 'double']
@@ -2101,9 +2097,9 @@ box.execute("SELECT CAST(2 AS DOUBLE), typeof(CAST(2 AS DOUBLE));")
 box.execute("SELECT 3e3, typeof(3e3);")
 ---
 - metadata:
-  - name: '3e3'
+  - name: COLUMN_1
     type: double
-  - name: typeof(3e3)
+  - name: COLUMN_2
     type: string
   rows:
   - [3000, 'double']
@@ -2121,7 +2117,7 @@ box.execute("SELECT d, TYPEOF(d) FROM t5;")
 - metadata:
   - name: D
     type: double
-  - name: TYPEOF(d)
+  - name: COLUMN_1
     type: string
   rows:
   - [4, 'double']

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Tarantool-patches] [PATCH v3 1/2] sql: use unify pattern for column names
  2020-06-29 23:46                 ` Roman Khabibov
@ 2020-06-30 21:23                   ` Vladislav Shpilevoy
  2020-07-01 12:45                     ` Roman Khabibov
  0 siblings, 1 reply; 20+ messages in thread
From: Vladislav Shpilevoy @ 2020-06-30 21:23 UTC (permalink / raw)
  To: Roman Khabibov; +Cc: tarantool-patches

Hi! Thanks for the fixes!

> +test:do_execsql2_test(
> +    "colname-12.5",
> +    [[
> +        CREATE TABLE j (s1 SCALAR PRIMARY KEY);
> +        INSERT INTO j VALUES(1);
> +    ]], {})
> +
> +--
> +-- Column named as 'COLUMN_1', because 's1 + 1' is a expression.
> +--
> +test:do_execsql2_test(
> +    "colname-12.6",
> +    [[
> +        SELECT s1 + 1 FROM j;
> +    ]], {
> +        "COLUMN_1",2
> +    })
> +
> +test:do_execsql2_test(
> +    "colname-12.7",
> +    [[
> +        SELECT s1 + 1 FROM j ORDER BY column_1;
> +    ]], {
> +        "COLUMN_1",2
> +    })
> +
> +test:do_execsql2_test(
> +    "colname-12.8",
> +    [[
> +        SELECT * FROM (SELECT s1 + 1 FROM j
> +                       ORDER BY column_1) ORDER BY column_1;
> +    ]], {
> +        "COLUMN_1",2
> +    })
> +
> +test:do_execsql2_test(
> +    "colname-12.9",
> +    [[
> +        SELECT s1 + 1 FROM j GROUP BY column_1;
> +    ]], {
> +        "COLUMN_1",2
> +    })
> +
> +test:do_execsql2_test(
> +    "colname-12.10",
> +    [[
> +        SELECT * FROM (SELECT s1 + 1 FROM j
> +                       ORDER BY column_1) GROUP BY column_1;
> +    ]], {
> +        "COLUMN_1",2
> +    })
> +
> +test:do_execsql2_test(
> +    "colname-12.11",
> +    [[
> +        SELECT * FROM (SELECT s1 + 1 FROM j
> +                       ORDER BY column_1) WHERE column_1 = 2;
> +    ]], {
> +        "COLUMN_1",2
> +    })
> +
> +test:do_execsql2_test(
> +    "colname-12.12",
> +    [[
> +        SELECT *, s1 + 1 FROM j ORDER BY column_1;
> +    ]], {
> +        "S1",1,"COLUMN_1",2
> +    })
> +
> +test:do_execsql2_test(
> +    "colname-12.13",
> +    [[
> +        SELECT s1 + 1, * FROM j ORDER BY column_1;
> +    ]], {
> +        "COLUMN_1",2,"S1",1
> +    })
> +
> +test:do_execsql2_test(
> +    "colname-12.14",
> +    [[
> +        CREATE TABLE j_1 (column_1 SCALAR PRIMARY KEY, column_2 SCALAR);
> +        INSERT INTO j_1 VALUES(1, 1);
> +    ]], {})
> +
> +test:do_execsql2_test(
> +    "colname-12.15",
> +    [[
> +        SELECT column_1, column_1 + 1, column_2, 2 FROM j_1;
> +    ]], {
> +        "COLUMN_1",1,"COLUMN_1",2,"COLUMN_2",1,"COLUMN_2",2
> +    })
> +

Is there a test on how ORDER BY selects a column?

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Tarantool-patches] [PATCH v3 1/2] sql: use unify pattern for column names
  2020-06-30 21:23                   ` Vladislav Shpilevoy
@ 2020-07-01 12:45                     ` Roman Khabibov
  2020-07-01 21:25                       ` Vladislav Shpilevoy
  0 siblings, 1 reply; 20+ messages in thread
From: Roman Khabibov @ 2020-07-01 12:45 UTC (permalink / raw)
  To: Vladislav Shpilevoy; +Cc: tarantool-patches

Hi! Thanks for the review.

> On Jul 1, 2020, at 00:23, Vladislav Shpilevoy <v.shpilevoy@tarantool.org> wrote:
> 
> Hi! Thanks for the fixes!
> 
>> +test:do_execsql2_test(
>> +    "colname-12.5",
>> +    [[
>> +        CREATE TABLE j (s1 SCALAR PRIMARY KEY);
>> +        INSERT INTO j VALUES(1);
>> +    ]], {})
>> +
>> +--
>> +-- Column named as 'COLUMN_1', because 's1 + 1' is a expression.
>> +--
>> +test:do_execsql2_test(
>> +    "colname-12.6",
>> +    [[
>> +        SELECT s1 + 1 FROM j;
>> +    ]], {
>> +        "COLUMN_1",2
>> +    })
>> +
>> +test:do_execsql2_test(
>> +    "colname-12.7",
>> +    [[
>> +        SELECT s1 + 1 FROM j ORDER BY column_1;
>> +    ]], {
>> +        "COLUMN_1",2
>> +    })
>> +
>> +test:do_execsql2_test(
>> +    "colname-12.8",
>> +    [[
>> +        SELECT * FROM (SELECT s1 + 1 FROM j
>> +                       ORDER BY column_1) ORDER BY column_1;
>> +    ]], {
>> +        "COLUMN_1",2
>> +    })
>> +
>> +test:do_execsql2_test(
>> +    "colname-12.9",
>> +    [[
>> +        SELECT s1 + 1 FROM j GROUP BY column_1;
>> +    ]], {
>> +        "COLUMN_1",2
>> +    })
>> +
>> +test:do_execsql2_test(
>> +    "colname-12.10",
>> +    [[
>> +        SELECT * FROM (SELECT s1 + 1 FROM j
>> +                       ORDER BY column_1) GROUP BY column_1;
>> +    ]], {
>> +        "COLUMN_1",2
>> +    })
>> +
>> +test:do_execsql2_test(
>> +    "colname-12.11",
>> +    [[
>> +        SELECT * FROM (SELECT s1 + 1 FROM j
>> +                       ORDER BY column_1) WHERE column_1 = 2;
>> +    ]], {
>> +        "COLUMN_1",2
>> +    })
>> +
>> +test:do_execsql2_test(
>> +    "colname-12.12",
>> +    [[
>> +        SELECT *, s1 + 1 FROM j ORDER BY column_1;
>> +    ]], {
>> +        "S1",1,"COLUMN_1",2
>> +    })
>> +
>> +test:do_execsql2_test(
>> +    "colname-12.13",
>> +    [[
>> +        SELECT s1 + 1, * FROM j ORDER BY column_1;
>> +    ]], {
>> +        "COLUMN_1",2,"S1",1
>> +    })
>> +
>> +test:do_execsql2_test(
>> +    "colname-12.14",
>> +    [[
>> +        CREATE TABLE j_1 (column_1 SCALAR PRIMARY KEY, column_2 SCALAR);
>> +        INSERT INTO j_1 VALUES(1, 1);
>> +    ]], {})
>> +
>> +test:do_execsql2_test(
>> +    "colname-12.15",
>> +    [[
>> +        SELECT column_1, column_1 + 1, column_2, 2 FROM j_1;
>> +    ]], {
>> +        "COLUMN_1",1,"COLUMN_1",2,"COLUMN_2",1,"COLUMN_2",2
>> +    })
>> +
> 
> Is there a test on how ORDER BY selects a column?
Did you mean this? If it is not a bug,  we should document that, because
because this is not obvious behavior, IMO.

+--
+-- The result order is different, because in the second case
+-- expression "-column_1" with the auto generated name "column_1"
+-- is used for sorting. Auto generated names are considered as
+-- aliases. In the process of resolving an identifier from
+-- <ORDER BY>, it first checks for matching with aliases.
+--
+test:do_execsql2_test(
+    "colname-12.16",
+    [[
+        INSERT INTO j_1 VALUES(2, 2);
+        SELECT column_1 FROM j_1 ORDER BY column_1;
+    ]], {
+        "COLUMN_1",1,"COLUMN_1",2
+    })
+
+test:do_execsql2_test(
+    "colname-12.17",
+    [[
+        SELECT column_1, -column_1 FROM j_1 ORDER BY column_1;
+    ]], {
+        "COLUMN_1",2,"COLUMN_1",-2,"COLUMN_1",1,"COLUMN_1",-1
+    })

commit d676d3e4937ef34464808c7eea8455d474322817
Author: Roman Khabibov <roman.habibov@tarantool.org>
Date:   Thu Mar 5 12:48:58 2020 +0300

    sql: unify pattern for column names
    
    Name resulting columns generated by an expression or <VALUES>
    construction by the "COLUMN_N" pattern.
    
    Closes #3962
    
    @TarantoolBot document
    Title: Column naming in SQL
    
    Now, every auto generated column is named by the "COLUMN_N"
    pattern, where N is the number of generated column in a query
    (starting  from 1). Auto generated column is a column in a query
    result generated by an expression or a column from <VALUES>
    construction.
    
    Examples:
    ```
    box.execute("VALUES(1, 2, 3);")
    ---
    - metadata:
      - name: COLUMN_1
        type: integer
      - name: COLUMN_2
        type: integer
      - name: COLUMN_3
        type: integer
      rows:
      - [1, 2, 3]
    ...
    box.execute("SELECT * FROM (VALUES (1+1, 1+1));")
    ---
    - metadata:
      - name: COLUMN_1
        type: integer
      - name: COLUMN_2
        type: integer
      rows:
      - [2, 2]
    ...
    box.execute("SELECT 1+1, 1+1;")
    ---
    - metadata:
      - name: COLUMN_1
        type: integer
      - name: COLUMN_2
        type: integer
      rows:
      - [2, 2]
    ...
    ```
    
    Here, the expression "mycol + 1" generates a new column, so that
    it is the first auto generated resulting column will be named as
    "COLUMN_1".
    ```
    tarantool> CREATE TABLE test (mycol INT PRIMARY KEY);
    ---
    - row_count: 1
    ...
    
    tarantool> SELECT mycol, mycol + 1 FROM test;
    ---
    - metadata:
      - name: MYCOL
        type: integer
      - name: COLUMN_1
        type: integer
      rows: []
    ...
    ```
    Note that you can use generated names already within the query,
    e.g. in <ORDER BY> clause.
    ```
    tarantool> SELECT mycol, mycol + 1 FROM test ORDER BY column_1;
    ---
    - metadata:
      - name: MYCOL
        type: integer
      - name: COLUMN_1
        type: integer
      rows: []
    ...
    ```
    
    It should also be noted that if you use column names similar to
    the "COLUMN_N" pattern, you can get the same names as a result:
    
    ```
    tarantool> CREATE TABLE test (column_1 SCALAR PRIMARY KEY);
    ---
    - row_count: 1
    ...
    
    tarantool> INSERT INTO test VALUES(1);
    ---
    - row_count: 1
    ...
    
    tarantool> SELECT column_1, column_1 + 1 FROM test;
    ---
    - metadata:
      - name: COLUMN_1
        type: scalar
      - name: COLUMN_1
        type: scalar
      rows:
      - [1, 2]
    ...
    ```

diff --git a/src/box/sql/select.c b/src/box/sql/select.c
index 4b069addb..26c735ed7 100644
--- a/src/box/sql/select.c
+++ b/src/box/sql/select.c
@@ -1854,14 +1854,14 @@ generate_column_metadata(struct Parse *pParse, struct SrcList *pTabList,
 			}
 		} else {
 			const char *z = NULL;
-			if (colname != NULL)
+			if (colname != NULL) {
 				z = colname;
-			else if (span != NULL)
-				z = span;
-			else
-				z = tt_sprintf("column%d", i + 1);
+			} else {
+				uint32_t idx = ++pParse->autoname_i;
+				z = sql_generate_column_name(idx);
+			}
 			vdbe_metadata_set_col_name(v, i, z);
-			if (is_full_meta && colname != NULL)
+			if (is_full_meta)
 				vdbe_metadata_set_col_span(v, i, span);
 		}
 	}
@@ -1897,7 +1897,6 @@ sqlColumnsFromExprList(Parse * parse, ExprList * expr_list,
 	/* Database connection */
 	sql *db = parse->db;
 	u32 cnt;		/* Index added to make the name unique */
-	Expr *p;		/* Expression for a single result column */
 	char *zName;		/* Column name */
 	int nName;		/* Size of name in zName[] */
 	Hash ht;		/* Hash table of column names */
@@ -1929,13 +1928,12 @@ sqlColumnsFromExprList(Parse * parse, ExprList * expr_list,
 	space_def->field_count = column_count;
 
 	for (uint32_t i = 0; i < column_count; i++) {
-		/* Get an appropriate name for the column
+		/*
+		 * Check if the column contains an "AS <name>"
+		 * phrase.
 		 */
-		p = sqlExprSkipCollate(expr_list->a[i].pExpr);
-		if ((zName = expr_list->a[i].zName) != 0) {
-			/* If the column contains an "AS <name>" phrase, use <name> as the name */
-		} else {
-			Expr *pColExpr = p;	/* The expression that is the result column name */
+		if ((zName = expr_list->a[i].zName) == 0) {
+			struct Expr *pColExpr = expr_list->a[i].pExpr;
 			struct space_def *space_def = NULL;
 			while (pColExpr->op == TK_DOT) {
 				pColExpr = pColExpr->pRight;
@@ -1951,14 +1949,14 @@ sqlColumnsFromExprList(Parse * parse, ExprList * expr_list,
 			} else if (pColExpr->op == TK_ID) {
 				assert(!ExprHasProperty(pColExpr, EP_IntValue));
 				zName = pColExpr->u.zToken;
-			} else {
-				/* Use the original text of the column expression as its name */
-				zName = expr_list->a[i].zSpan;
 			}
 		}
-		if (zName == NULL)
-			zName = "_auto_field_";
-		zName = sqlMPrintf(db, "%s", zName);
+		if (zName == NULL) {
+			uint32_t idx = ++parse->autoname_i;
+			zName = sqlDbStrDup(db, sql_generate_column_name(idx));
+		} else {
+			zName = sqlDbStrDup(db, zName);
+		}
 
 		/* Make sure the column name is unique.  If the name is not unique,
 		 * append an integer to the name so that it becomes unique.
@@ -4792,6 +4790,24 @@ selectPopWith(Walker * pWalker, Select * p)
 	}
 }
 
+/**
+ * Determine whether to generate a name for @a expr or not.
+ *
+ * Auto generated names is needed for every item in  a <SELECT>
+ * expression list except asterisks, dots and column names (also
+ * if this item hasn't alias).
+ *
+ * @param expr Expression from expression list to analyze.
+ *
+ * @retval true/false If item is/isn't needed needed to name.
+ */
+static bool
+is_needed_to_name(struct Expr *expr)
+{
+	return (expr->op != TK_ASTERISK && expr->op != TK_DOT && expr->op !=
+		TK_ID);
+}
+
 /*
  * This routine is a Walker callback for "expanding" a SELECT statement.
  * "Expanding" means to do the following:
@@ -4941,19 +4957,26 @@ selectExpander(Walker * pWalker, Select * p)
 	 * all tables.
 	 *
 	 * The first loop just checks to see if there are any "*" operators
-	 * that need expanding.
+	 * that need expanding and names items of the expression
+	 * list if needed.
 	 */
+	bool has_asterisk = false;
 	for (k = 0; k < pEList->nExpr; k++) {
 		pE = pEList->a[k].pExpr;
 		if (pE->op == TK_ASTERISK)
-			break;
+			has_asterisk = true;
 		assert(pE->op != TK_DOT || pE->pRight != 0);
 		assert(pE->op != TK_DOT
 		       || (pE->pLeft != 0 && pE->pLeft->op == TK_ID));
 		if (pE->op == TK_DOT && pE->pRight->op == TK_ASTERISK)
-			break;
+			has_asterisk = true;
+		if (pEList->a[k].zName == NULL && is_needed_to_name(pE)) {
+			uint32_t idx = ++pParse->autoname_i;
+			pEList->a[k].zName =
+				sqlDbStrDup(db, sql_generate_column_name(idx));
+		}
 	}
-	if (k < pEList->nExpr) {
+	if (has_asterisk) {
 		/*
 		 * If we get here it means the result set contains one or more "*"
 		 * operators that need to be expanded.  Loop through each expression
diff --git a/src/box/sql/sqlInt.h b/src/box/sql/sqlInt.h
index 37283e506..adf90d824 100644
--- a/src/box/sql/sqlInt.h
+++ b/src/box/sql/sqlInt.h
@@ -2227,6 +2227,8 @@ struct Parse {
 	TriggerPrg *pTriggerPrg;	/* Linked list of coded triggers */
 	With *pWith;		/* Current WITH clause, or NULL */
 	With *pWithToFree;	/* Free this WITH object at the end of the parse */
+	/** Index of previous auto generated name. */
+	uint32_t autoname_i;
 	/** Space triggers are being coded for. */
 	struct space *triggered_space;
 	/**
@@ -4530,4 +4532,17 @@ void
 sql_setting_set(struct Parse *parse_context, struct Token *name,
 		struct Expr *value);
 
+/**
+ * Return a string of the form "COLUMN_N", where N is @a number.
+ *
+ * We decided to name every auto generated column in output by
+ * this pattern (like PostgreSQL), because it is more convenient
+ * than "_auto_name_" and naming with span like MariaDB do.
+ */
+static inline const char *
+sql_generate_column_name(uint32_t number)
+{
+	return tt_sprintf("COLUMN_%d", number);
+}
+
 #endif				/* sqlINT_H */
diff --git a/test/box/function1.result b/test/box/function1.result
index 905a4cdab..928cd5758 100644
--- a/test/box/function1.result
+++ b/test/box/function1.result
@@ -449,7 +449,7 @@ box.execute('SELECT "function1.divide"(6, 3, 3)')
 box.execute('SELECT "function1.divide"(6, 3)')
 ---
 - metadata:
-  - name: '"function1.divide"(6, 3)'
+  - name: COLUMN_1
     type: number
   rows:
   - [2]
@@ -457,7 +457,7 @@ box.execute('SELECT "function1.divide"(6, 3)')
 box.execute('SELECT "function1.divide"(5, 2)')
 ---
 - metadata:
-  - name: '"function1.divide"(5, 2)'
+  - name: COLUMN_1
     type: number
   rows:
   - [2.5]
@@ -482,7 +482,7 @@ test_run:cmd("setopt delimiter ''");
 box.execute('SELECT summarize(1, 2)')
 ---
 - metadata:
-  - name: summarize(1, 2)
+  - name: COLUMN_1
     type: number
   rows:
   - [3]
@@ -505,7 +505,7 @@ test_run:cmd("setopt delimiter ''");
 box.execute('SELECT summarize(1, 2)')
 ---
 - metadata:
-  - name: summarize(1, 2)
+  - name: COLUMN_1
     type: number
   rows:
   - [3]
@@ -519,7 +519,7 @@ box.func.SUMMARIZE:drop()
 box.execute('SELECT lua(\'return 1 + 1\')')
 ---
 - metadata:
-  - name: lua('return 1 + 1')
+  - name: COLUMN_1
     type: any
   rows:
   - [2]
@@ -537,7 +537,7 @@ box.execute('SELECT lua(\'return box.cfg()\')')
 box.execute('SELECT lua(\'return box.cfg.memtx_memory\')')
 ---
 - metadata:
-  - name: lua('return box.cfg.memtx_memory')
+  - name: COLUMN_1
     type: any
   rows:
   - [107374182]
diff --git a/test/sql-tap/colname.test.lua b/test/sql-tap/colname.test.lua
index caa61a07a..3901feea9 100755
--- a/test/sql-tap/colname.test.lua
+++ b/test/sql-tap/colname.test.lua
@@ -1,6 +1,6 @@
 #!/usr/bin/env tarantool
 test = require("sqltester")
-test:plan(62)
+test:plan(79)
 
 --!./tcltestrunner.lua
 -- 2008 July 15
@@ -94,7 +94,7 @@ test:do_execsql2_test(
         SELECT +tabc.a, -tabc.b, tabc.c, * FROM tabc
     ]], {
         -- <colname-2.3>
-        "+tabc.a",1,"-tabc.b",-2,"C",3,"A",1,"B",2,"C",3
+        "COLUMN_1",1,"COLUMN_2",-2,"C",3,"A",1,"B",2,"C",3
         -- </colname-2.3>
     })
 
@@ -194,7 +194,7 @@ test:do_execsql2_test(
         SELECT +tabc.a, -tabc.b, tabc.c FROM tabc
     ]], {
         -- <colname-3.3>
-        "+tabc.a", 1, "-tabc.b", -2, "C", 3
+        "COLUMN_1",1,"COLUMN_2",-2,"C",3
         -- </colname-3.3>
     })
 
@@ -314,7 +314,7 @@ test:do_execsql2_test(
         SELECT +tabc.a, -tabc.b, tabc.c FROM tabc
     ]], {
         -- <colname-4.3>
-        "+tabc.a", 1, "-tabc.b", -2, "TABC.C", 3
+        "COLUMN_1",1,"COLUMN_2",-2,"TABC.C",3
         -- </colname-4.3>
     })
 
@@ -635,4 +635,157 @@ test:do_catchsql_test(
     [[ CREATE INDEX t1c ON table1('c'); ]],
     {1, "/Tarantool does not support functional indexes/"})
 
+--
+-- gh-3962: Check auto generated names in different selects.
+--
+test:do_execsql2_test(
+    "colname-12.1",
+    [[
+        VALUES(1, 2, 'aaa');
+    ]], {
+        "COLUMN_1",1,"COLUMN_2",2,"COLUMN_3","aaa"
+    })
+
+test:do_execsql2_test(
+    "colname-12.2",
+    [[
+        SELECT * FROM (VALUES (1+1, 1+1, 'aaa'));
+    ]], {
+        "COLUMN_1",2,"COLUMN_2",2,"COLUMN_3","aaa"
+    })
+
+test:do_execsql2_test(
+    "colname-12.3",
+    [[
+        SELECT 1+1, 1+1, 'aaa';
+    ]], {
+        "COLUMN_1",2,"COLUMN_2",2,"COLUMN_3","aaa"
+    })
+
+test:do_execsql2_test(
+    "colname-12.4",
+    [[
+        SELECT * FROM (SELECT * FROM (VALUES(1, 2, 'aaa'))),
+                      (SELECT * FROM (VALUES(1, 2, 'aaa')))
+    ]], {
+        "COLUMN_1",1,"COLUMN_2",2,"COLUMN_3","aaa","COLUMN_4",1,"COLUMN_5",2,
+        "COLUMN_6","aaa"
+    })
+
+test:do_execsql2_test(
+    "colname-12.5",
+    [[
+        CREATE TABLE j (s1 SCALAR PRIMARY KEY);
+        INSERT INTO j VALUES(1);
+    ]], {})
+
+--
+-- Column named as 'COLUMN_1', because 's1 + 1' is a expression.
+--
+test:do_execsql2_test(
+    "colname-12.6",
+    [[
+        SELECT s1 + 1 FROM j;
+    ]], {
+        "COLUMN_1",2
+    })
+
+test:do_execsql2_test(
+    "colname-12.7",
+    [[
+        SELECT s1 + 1 FROM j ORDER BY column_1;
+    ]], {
+        "COLUMN_1",2
+    })
+
+test:do_execsql2_test(
+    "colname-12.8",
+    [[
+        SELECT * FROM (SELECT s1 + 1 FROM j
+                       ORDER BY column_1) ORDER BY column_1;
+    ]], {
+        "COLUMN_1",2
+    })
+
+test:do_execsql2_test(
+    "colname-12.9",
+    [[
+        SELECT s1 + 1 FROM j GROUP BY column_1;
+    ]], {
+        "COLUMN_1",2
+    })
+
+test:do_execsql2_test(
+    "colname-12.10",
+    [[
+        SELECT * FROM (SELECT s1 + 1 FROM j
+                       ORDER BY column_1) GROUP BY column_1;
+    ]], {
+        "COLUMN_1",2
+    })
+
+test:do_execsql2_test(
+    "colname-12.11",
+    [[
+        SELECT * FROM (SELECT s1 + 1 FROM j
+                       ORDER BY column_1) WHERE column_1 = 2;
+    ]], {
+        "COLUMN_1",2
+    })
+
+test:do_execsql2_test(
+    "colname-12.12",
+    [[
+        SELECT *, s1 + 1 FROM j ORDER BY column_1;
+    ]], {
+        "S1",1,"COLUMN_1",2
+    })
+
+test:do_execsql2_test(
+    "colname-12.13",
+    [[
+        SELECT s1 + 1, * FROM j ORDER BY column_1;
+    ]], {
+        "COLUMN_1",2,"S1",1
+    })
+
+test:do_execsql2_test(
+    "colname-12.14",
+    [[
+        CREATE TABLE j_1 (column_1 SCALAR PRIMARY KEY, column_2 SCALAR);
+        INSERT INTO j_1 VALUES(1, 1);
+    ]], {})
+
+test:do_execsql2_test(
+    "colname-12.15",
+    [[
+        SELECT column_1, column_1 + 1, column_2, 2 FROM j_1;
+    ]], {
+        "COLUMN_1",1,"COLUMN_1",2,"COLUMN_2",1,"COLUMN_2",2
+    })
+
+--
+-- The result order is different, because in the second case
+-- expression "-column_1" with the auto generated name "column_1"
+-- is used for sorting. Auto generated names are considered as
+-- aliases. In the process of resolving an identifier from
+-- <ORDER BY>, it first checks for matching with aliases.
+--
+test:do_execsql2_test(
+    "colname-12.16",
+    [[
+        INSERT INTO j_1 VALUES(2, 2);
+        SELECT column_1 FROM j_1 ORDER BY column_1;
+    ]], {
+        "COLUMN_1",1,"COLUMN_1",2
+    })
+
+test:do_execsql2_test(
+    "colname-12.17",
+    [[
+        SELECT column_1, -column_1 FROM j_1 ORDER BY column_1;
+    ]], {
+        "COLUMN_1",2,"COLUMN_1",-2,"COLUMN_1",1,"COLUMN_1",-1
+    })
+
 test:finish_test()
diff --git a/test/sql-tap/select1.test.lua b/test/sql-tap/select1.test.lua
index fbebfab37..80e94b019 100755
--- a/test/sql-tap/select1.test.lua
+++ b/test/sql-tap/select1.test.lua
@@ -1032,7 +1032,7 @@ test:do_catchsql2_test(
         SELECT f1+F2 FROM test1 ORDER BY f2
     ]], {
         -- <select1-6.4a>
-        0, {"f1+F2", 33, "f1+F2", 77}
+        0, {"COLUMN_1",33,"COLUMN_1",77}
         -- </select1-6.4a>
     })
 
@@ -1042,7 +1042,7 @@ test:do_catchsql2_test(
         SELECT test1.f1+F2 FROM test1 ORDER BY f2
     ]], {
         -- <select1-6.5>
-        0, {"test1.f1+F2", 33, "test1.f1+F2", 77}
+        0, {"COLUMN_1",33,"COLUMN_1",77}
         -- </select1-6.5>
     })
 
@@ -1059,7 +1059,7 @@ test:do_test(
         return table.insert(v,msg) or v
     end, {
         -- <select1-6.5.1>
-        0, {'test1.f1+F2', 33, 'test1.f1+F2', 77}
+        0, {"COLUMN_1",33,"COLUMN_1",77}
         -- </select1-6.5.1>
     })
 
@@ -1068,7 +1068,7 @@ test:do_catchsql2_test(
     [[SELECT test1.f1+F2, t1 FROM test1, test2 
          ORDER BY f2]], {
         -- <select1-6.6>
-        0, {"test1.f1+F2", 33, "T1", "abc", "test1.f1+F2", 77, "T1", "abc"}
+        0, {"COLUMN_1",33,"T1","abc","COLUMN_1",77,"T1","abc"}
         -- </select1-6.6>
     })
 
@@ -1161,7 +1161,7 @@ test:do_test(
         ]]
     end, {
         -- <select1-6.9.5>
-        "123.45", 123.45
+        "COLUMN_1",123.45
         -- </select1-6.9.5>
     })
 
@@ -1189,7 +1189,8 @@ test:do_test(
         return x
     end, {
         -- <select1-6.9.7>
-        "A.F1", 11, "A.F2", 22, "sql_subquery.5", 5, "sql_subquery.6", 6
+        "A.F1", 11, "A.F2", 22, "sql_subquery.COLUMN_1", 5,
+        "sql_subquery.COLUMN_2", 6
         -- </select1-6.9.7>
     })
 
@@ -1816,7 +1817,7 @@ test:do_execsql2_test(
             SELECT * FROM t3, (SELECT max(a), max(b) FROM t4) as "tx"
         ]], {
             -- <select1-11.14>
-            "ID", 0, "A", "1", "B", "2", "max(a)", 3, "max(b)", "4"
+            "ID", 0, "A", "1", "B", "2", "COLUMN_1", 3, "COLUMN_2", "4"
             -- </select1-11.14>
         })
 
@@ -1826,7 +1827,7 @@ test:do_execsql2_test(
             SELECT y.*, t3.* FROM t3, (SELECT max(a), max(b) FROM t4) AS y
         ]], {
             -- <select1-11.15>
-            "max(a)", 3, "max(b)", "4", "ID", 0, "A", "1", "B", "2"
+            "COLUMN_1", 3, "COLUMN_2", "4", "ID", 0, "A", "1", "B", "2"
             -- </select1-11.15>
         })
 
@@ -1850,7 +1851,7 @@ test:do_execsql2_test(
         SELECT 1+2+3
     ]], {
         -- <select1-12.1>
-        "1+2+3", 6
+        "COLUMN_1",6
         -- </select1-12.1>
     })
 
@@ -1860,7 +1861,7 @@ test:do_execsql2_test(
         SELECT 1,'hello',2
     ]], {
         -- <select1-12.2>
-        '1', 1, "'hello'", "hello", '2', 2
+        "COLUMN_1",1,"COLUMN_2","hello","COLUMN_3",2
         -- </select1-12.2>
     })
 
diff --git a/test/sql-tap/select6.test.lua b/test/sql-tap/select6.test.lua
index c9960dc29..380fd67c1 100755
--- a/test/sql-tap/select6.test.lua
+++ b/test/sql-tap/select6.test.lua
@@ -128,9 +128,9 @@ test:do_execsql_test(
 test:do_execsql_test(
     "select6-1.7",
     [=[
-        SELECT a.y, a."count(*)", "max(x)", "count(*)"
-        FROM (SELECT count(*),y FROM t1 GROUP BY y) AS a,
-             (SELECT max(x),y FROM t1 GROUP BY y) as b
+        SELECT a.y, a.COLUMN_1, COLUMN_2, COLUMN_1
+        FROM (SELECT count(*), y FROM t1 GROUP BY y) AS a,
+             (SELECT max(x), y FROM t1 GROUP BY y) as b
         WHERE a.y=b.y ORDER BY a.y
     ]=], {
         -- <select6-1.7>
@@ -154,9 +154,9 @@ test:do_execsql_test(
 test:do_execsql_test(
     "select6-1.9",
     [=[
-        SELECT q, p, r, b."min(x)+y"
+        SELECT q, p, r, min
         FROM (SELECT count(*) as p , y as q FROM t1 GROUP BY y) AS a,
-             (SELECT max(x) as r, y as s, min(x)+y FROM t1 GROUP BY y) as b
+             (SELECT max(x) as r, y as s, min(x)+y AS min FROM t1 GROUP BY y) as b
         WHERE q=s ORDER BY s
     ]=], {
         -- <select6-1.9>
@@ -247,9 +247,9 @@ test:do_execsql_test(
 test:do_execsql_test(
     "select6-2.7",
     [=[
-        SELECT a.b, a."count(*)", "max(a)", "count(*)"
-        FROM (SELECT count(*),b FROM t2 GROUP BY b) AS a,
-             (SELECT max(a),b FROM t2 GROUP BY b) as b
+        SELECT a.b, a.count, max, count
+        FROM (SELECT count(*) AS count, b FROM t2 GROUP BY b) AS a,
+             (SELECT max(a) AS max, b FROM t2 GROUP BY b) as b
         WHERE a.b=b.b ORDER BY a.b
     ]=], {
         -- <select6-2.7>
@@ -432,8 +432,8 @@ test:do_execsql_test(
 test:do_execsql_test(
     "select6-3.14",
     [=[
-        SELECT "count(*)",y FROM (SELECT count(*), y FROM t1 GROUP BY y)
-        ORDER BY "count(*)"
+        SELECT count, y FROM (SELECT count(*) AS count, y FROM t1 GROUP BY y)
+        ORDER BY count
     ]=], {
         -- <select6-3.14>
         1, 1, 2, 2, 4, 3, 5, 5, 8, 4
@@ -443,7 +443,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "select6-3.15",
     [=[
-        SELECT "count(*)",y FROM (SELECT count(*), y FROM t1 GROUP BY y)
+        SELECT count, y FROM (SELECT count(*) AS count, y FROM t1 GROUP BY y)
         ORDER BY y
     ]=], {
         -- <select6-3.15>
diff --git a/test/sql-tap/view.test.lua b/test/sql-tap/view.test.lua
index e553b91c7..66374e374 100755
--- a/test/sql-tap/view.test.lua
+++ b/test/sql-tap/view.test.lua
@@ -265,7 +265,7 @@ test:do_execsql2_test(
         SELECT * FROM v1 LIMIT 1
     ]], {
         -- <view-3.3.1>
-        "XYZ", 2, "PQR", 7, "c-b", 1
+        "XYZ", 2, "PQR", 7, "COLUMN_1", 1
         -- </view-3.3.1>
     })
 
@@ -276,7 +276,7 @@ test:do_execsql2_test(
         SELECT * FROM v1b LIMIT 1
     ]], {
         -- <view-3.3.2>
-        "A", 2, "b+c", 7, "C", 4
+        "A", 2, "COLUMN_1", 7, "C", 4
         -- </view-3.3.2>
     })
 
diff --git a/test/sql/bind.result b/test/sql/bind.result
index b24094052..cb0302885 100644
--- a/test/sql/bind.result
+++ b/test/sql/bind.result
@@ -77,11 +77,11 @@ execute('SELECT * FROM test WHERE id = :value', parameters)
 execute('SELECT ?, ?, ?', {1, 2, 3})
 ---
 - metadata:
-  - name: '?'
+  - name: COLUMN_1
     type: integer
-  - name: '?'
+  - name: COLUMN_2
     type: integer
-  - name: '?'
+  - name: COLUMN_3
     type: integer
   rows:
   - [1, 2, 3]
@@ -107,11 +107,11 @@ parameters[3][':value1'] = 11
 execute('SELECT ?, :value1, @value2', parameters)
 ---
 - metadata:
-  - name: '?'
+  - name: COLUMN_1
     type: integer
-  - name: :value1
+  - name: COLUMN_2
     type: integer
-  - name: '@value2'
+  - name: COLUMN_3
     type: integer
   rows:
   - [10, 11, 12]
@@ -149,22 +149,22 @@ parameters[6]['@value2'] = 6
 execute('SELECT :value3, ?, :value1, ?, ?, @value2, ?, :value3', parameters)
 ---
 - metadata:
-  - name: :value3
+  - name: COLUMN_1
     type: integer
-  - name: '?'
+  - name: COLUMN_2
     type: integer
-  - name: :value1
+  - name: COLUMN_3
     type: integer
-  - name: '?'
+  - name: COLUMN_4
     type: integer
-  - name: '?'
+  - name: COLUMN_5
     type: integer
-  - name: '@value2'
+  - name: COLUMN_6
     type: integer
-  - name: '?'
+  - name: COLUMN_7
+    type: boolean
+  - name: COLUMN_8
     type: boolean
-  - name: :value3
-    type: integer
   rows:
   - [1, 2, 3, 4, 5, 6, null, 1]
 ...
@@ -175,15 +175,15 @@ msgpack = require('msgpack')
 execute('SELECT ?, ?, ?, ?, ?', {'abc', -123.456, msgpack.NULL, true, false})
 ---
 - metadata:
-  - name: '?'
+  - name: COLUMN_1
     type: text
-  - name: '?'
+  - name: COLUMN_2
     type: numeric
-  - name: '?'
+  - name: COLUMN_3
     type: boolean
-  - name: '?'
+  - name: COLUMN_4
     type: boolean
-  - name: '?'
+  - name: COLUMN_5
     type: boolean
   rows:
   - ['abc', -123.456, null, true, false]
@@ -290,7 +290,7 @@ execute('SELECT :value', parameters)
 execute('SELECT ? ', {18446744073709551615ULL})
 ---
 - metadata:
-  - name: '?'
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551615]
diff --git a/test/sql/boolean.result b/test/sql/boolean.result
index 112e41a12..51ec5820b 100644
--- a/test/sql/boolean.result
+++ b/test/sql/boolean.result
@@ -241,7 +241,7 @@ i > 0
 SELECT return_type(a) FROM t;
  | ---
  | - metadata:
- |   - name: return_type(a)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['boolean']
@@ -250,7 +250,7 @@ SELECT return_type(a) FROM t;
 SELECT return_type('false');
  | ---
  | - metadata:
- |   - name: return_type('false')
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['string']
@@ -258,7 +258,7 @@ SELECT return_type('false');
 SELECT is_boolean(a) FROM t LIMIT 1;
  | ---
  | - metadata:
- |   - name: is_boolean(a)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -266,7 +266,7 @@ SELECT is_boolean(a) FROM t LIMIT 1;
 SELECT is_boolean('true');
  | ---
  | - metadata:
- |   - name: is_boolean('true')
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -281,7 +281,7 @@ SELECT abs(a) FROM t0;
 SELECT lower(a) FROM t0;
  | ---
  | - metadata:
- |   - name: lower(a)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['false']
@@ -292,7 +292,7 @@ SELECT lower(a) FROM t0;
 SELECT upper(a) FROM t0;
  | ---
  | - metadata:
- |   - name: upper(a)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['FALSE']
@@ -303,7 +303,7 @@ SELECT upper(a) FROM t0;
 SELECT quote(a) FROM t0;
  | ---
  | - metadata:
- |   - name: quote(a)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['FALSE']
@@ -315,7 +315,7 @@ SELECT quote(a) FROM t0;
 SELECT length(a) FROM t0;
  | ---
  | - metadata:
- |   - name: length(a)
+ |   - name: COLUMN_1
  |     type: integer
  |   rows:
  |   - [5]
@@ -326,7 +326,7 @@ SELECT length(a) FROM t0;
 SELECT typeof(a) FROM t0;
  | ---
  | - metadata:
- |   - name: typeof(a)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['boolean']
@@ -344,7 +344,7 @@ SELECT AVG(a) FROM t0;
 SELECT MIN(a) FROM t0;
  | ---
  | - metadata:
- |   - name: MIN(a)
+ |   - name: COLUMN_1
  |     type: scalar
  |   rows:
  |   - [false]
@@ -352,7 +352,7 @@ SELECT MIN(a) FROM t0;
 SELECT MAX(a) FROM t0;
  | ---
  | - metadata:
- |   - name: MAX(a)
+ |   - name: COLUMN_1
  |     type: scalar
  |   rows:
  |   - [true]
@@ -365,7 +365,7 @@ SELECT SUM(a) FROM t0;
 SELECT COUNT(a) FROM t0;
  | ---
  | - metadata:
- |   - name: COUNT(a)
+ |   - name: COLUMN_1
  |     type: integer
  |   rows:
  |   - [2]
@@ -378,7 +378,7 @@ SELECT TOTAL(a) FROM t0;
 SELECT GROUP_CONCAT(a, ' +++ ') FROM t0;
  | ---
  | - metadata:
- |   - name: GROUP_CONCAT(a, ' +++ ')
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['FALSE +++ TRUE']
@@ -392,13 +392,13 @@ SELECT GROUP_CONCAT(a, ' +++ ') FROM t0;
 box.execute('SELECT ?, ?, return_type($1), typeof($2);', {true, false})
  | ---
  | - metadata:
- |   - name: '?'
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: '?'
+ |   - name: COLUMN_2
  |     type: boolean
- |   - name: return_type($1)
+ |   - name: COLUMN_3
  |     type: string
- |   - name: typeof($2)
+ |   - name: COLUMN_4
  |     type: string
  |   rows:
  |   - [true, false, 'boolean', 'boolean']
@@ -422,9 +422,9 @@ parameters[2][':value1'] = false
 box.execute('SELECT :value1, @value2;', parameters)
  | ---
  | - metadata:
- |   - name: :value1
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: '@value2'
+ |   - name: COLUMN_2
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -501,9 +501,9 @@ INSERT INTO t3 VALUES (4, false)
 SELECT cast(true AS INTEGER), cast(false AS INTEGER);
  | ---
  | - metadata:
- |   - name: cast(true AS INTEGER)
+ |   - name: COLUMN_1
  |     type: integer
- |   - name: cast(false AS INTEGER)
+ |   - name: COLUMN_2
  |     type: integer
  |   rows:
  |   - [1, 0]
@@ -511,9 +511,9 @@ SELECT cast(true AS INTEGER), cast(false AS INTEGER);
 SELECT cast(true AS NUMBER), cast(false AS NUMBER);
  | ---
  | - metadata:
- |   - name: cast(true AS NUMBER)
+ |   - name: COLUMN_1
  |     type: number
- |   - name: cast(false AS NUMBER)
+ |   - name: COLUMN_2
  |     type: number
  |   rows:
  |   - [1, 0]
@@ -522,9 +522,9 @@ SELECT cast(true AS NUMBER), cast(false AS NUMBER);
 SELECT cast(true AS TEXT), cast(false AS TEXT);
  | ---
  | - metadata:
- |   - name: cast(true AS TEXT)
+ |   - name: COLUMN_1
  |     type: string
- |   - name: cast(false AS TEXT)
+ |   - name: COLUMN_2
  |     type: string
  |   rows:
  |   - ['TRUE', 'FALSE']
@@ -532,9 +532,9 @@ SELECT cast(true AS TEXT), cast(false AS TEXT);
 SELECT cast(true AS BOOLEAN), cast(false AS BOOLEAN);
  | ---
  | - metadata:
- |   - name: cast(true AS BOOLEAN)
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: cast(false AS BOOLEAN)
+ |   - name: COLUMN_2
  |     type: boolean
  |   rows:
  |   - [true, false]
@@ -544,11 +544,11 @@ SELECT cast(true AS BOOLEAN), cast(false AS BOOLEAN);
 SELECT cast(100 AS BOOLEAN), cast(1 AS BOOLEAN), cast(0 AS BOOLEAN);
  | ---
  | - metadata:
- |   - name: cast(100 AS BOOLEAN)
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: cast(1 AS BOOLEAN)
+ |   - name: COLUMN_2
  |     type: boolean
- |   - name: cast(0 AS BOOLEAN)
+ |   - name: COLUMN_3
  |     type: boolean
  |   rows:
  |   - [true, true, false]
@@ -556,9 +556,9 @@ SELECT cast(100 AS BOOLEAN), cast(1 AS BOOLEAN), cast(0 AS BOOLEAN);
 SELECT cast(0.123 AS BOOLEAN), cast(0.0 AS BOOLEAN);
  | ---
  | - metadata:
- |   - name: cast(0.123 AS BOOLEAN)
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: cast(0.0 AS BOOLEAN)
+ |   - name: COLUMN_2
  |     type: boolean
  |   rows:
  |   - [true, false]
@@ -566,9 +566,9 @@ SELECT cast(0.123 AS BOOLEAN), cast(0.0 AS BOOLEAN);
 SELECT cast('true' AS BOOLEAN), cast('false' AS BOOLEAN);
  | ---
  | - metadata:
- |   - name: cast('true' AS BOOLEAN)
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: cast('false' AS BOOLEAN)
+ |   - name: COLUMN_2
  |     type: boolean
  |   rows:
  |   - [true, false]
@@ -576,9 +576,9 @@ SELECT cast('true' AS BOOLEAN), cast('false' AS BOOLEAN);
 SELECT cast('TRUE' AS BOOLEAN), cast('FALSE' AS BOOLEAN);
  | ---
  | - metadata:
- |   - name: cast('TRUE' AS BOOLEAN)
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: cast('FALSE' AS BOOLEAN)
+ |   - name: COLUMN_2
  |     type: boolean
  |   rows:
  |   - [true, false]
@@ -887,7 +887,7 @@ SELECT a, COUNT(*) FROM (SELECT * FROM t4 UNION SELECT * FROM t5) GROUP BY a;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: COUNT(*)
+ |   - name: COLUMN_1
  |     type: integer
  |   rows:
  |   - [false, 3]
@@ -907,7 +907,7 @@ INSERT INTO t6 VALUES (true, false), (false, true);
 SELECT NOT true;
  | ---
  | - metadata:
- |   - name: NOT true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -915,7 +915,7 @@ SELECT NOT true;
 SELECT NOT false;
  | ---
  | - metadata:
- |   - name: NOT false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -925,7 +925,7 @@ SELECT a, NOT a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: NOT a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -935,7 +935,7 @@ SELECT a, NOT a FROM t;
 SELECT true AND true;
  | ---
  | - metadata:
- |   - name: true AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -943,7 +943,7 @@ SELECT true AND true;
 SELECT true AND false;
  | ---
  | - metadata:
- |   - name: true AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -951,7 +951,7 @@ SELECT true AND false;
 SELECT false AND true;
  | ---
  | - metadata:
- |   - name: false AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -959,7 +959,7 @@ SELECT false AND true;
 SELECT false AND false;
  | ---
  | - metadata:
- |   - name: false AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -967,7 +967,7 @@ SELECT false AND false;
 SELECT true OR true;
  | ---
  | - metadata:
- |   - name: true OR true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -975,7 +975,7 @@ SELECT true OR true;
 SELECT true OR false;
  | ---
  | - metadata:
- |   - name: true OR false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -983,7 +983,7 @@ SELECT true OR false;
 SELECT false OR true;
  | ---
  | - metadata:
- |   - name: false OR true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -991,7 +991,7 @@ SELECT false OR true;
 SELECT false OR false;
  | ---
  | - metadata:
- |   - name: false OR false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1002,7 +1002,7 @@ SELECT a, true AND a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true AND a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1013,7 +1013,7 @@ SELECT a, false AND a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false AND a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1024,7 +1024,7 @@ SELECT a, true OR a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true OR a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1035,7 +1035,7 @@ SELECT a, false OR a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false OR a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1046,7 +1046,7 @@ SELECT a, a AND true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1057,7 +1057,7 @@ SELECT a, a AND false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1068,7 +1068,7 @@ SELECT a, a OR true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a OR true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1079,7 +1079,7 @@ SELECT a, a OR false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a OR false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1093,7 +1093,7 @@ SELECT a, a1, a AND a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a AND a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, false]
@@ -1108,7 +1108,7 @@ SELECT a, a1, a OR a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a OR a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, false]
@@ -1622,7 +1622,7 @@ SELECT a1, a2, a2 || a2 FROM t6;
 SELECT true > true;
  | ---
  | - metadata:
- |   - name: true > true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1630,7 +1630,7 @@ SELECT true > true;
 SELECT true > false;
  | ---
  | - metadata:
- |   - name: true > false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -1638,7 +1638,7 @@ SELECT true > false;
 SELECT false > true;
  | ---
  | - metadata:
- |   - name: false > true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1646,7 +1646,7 @@ SELECT false > true;
 SELECT false > false;
  | ---
  | - metadata:
- |   - name: false > false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1654,7 +1654,7 @@ SELECT false > false;
 SELECT true < true;
  | ---
  | - metadata:
- |   - name: true < true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1662,7 +1662,7 @@ SELECT true < true;
 SELECT true < false;
  | ---
  | - metadata:
- |   - name: true < false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1670,7 +1670,7 @@ SELECT true < false;
 SELECT false < true;
  | ---
  | - metadata:
- |   - name: false < true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -1678,7 +1678,7 @@ SELECT false < true;
 SELECT false < false;
  | ---
  | - metadata:
- |   - name: false < false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1689,7 +1689,7 @@ SELECT a, true > a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true > a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1700,7 +1700,7 @@ SELECT a, false > a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false > a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1711,7 +1711,7 @@ SELECT a, true < a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true < a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1722,7 +1722,7 @@ SELECT a, false < a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false < a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1733,7 +1733,7 @@ SELECT a, a > true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a > true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1744,7 +1744,7 @@ SELECT a, a > false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a > false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1755,7 +1755,7 @@ SELECT a, a < true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a < true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1766,7 +1766,7 @@ SELECT a, a < false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a < false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1780,7 +1780,7 @@ SELECT a, a1, a > a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a > a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, false]
@@ -1795,7 +1795,7 @@ SELECT a, a1, a < a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a < a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, false]
@@ -1807,7 +1807,7 @@ SELECT a, a1, a < a1 FROM t, t6;
 SELECT true >= true;
  | ---
  | - metadata:
- |   - name: true >= true
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [true]
@@ -1815,7 +1815,7 @@ SELECT true >= true;
 SELECT true >= false;
  | ---
  | - metadata:
- |   - name: true >= false
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [true]
@@ -1823,7 +1823,7 @@ SELECT true >= false;
 SELECT false >= true;
  | ---
  | - metadata:
- |   - name: false >= true
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [false]
@@ -1831,7 +1831,7 @@ SELECT false >= true;
 SELECT false >= false;
  | ---
  | - metadata:
- |   - name: false >= false
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [true]
@@ -1839,7 +1839,7 @@ SELECT false >= false;
 SELECT true <= true;
  | ---
  | - metadata:
- |   - name: true <= true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -1847,7 +1847,7 @@ SELECT true <= true;
 SELECT true <= false;
  | ---
  | - metadata:
- |   - name: true <= false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1855,7 +1855,7 @@ SELECT true <= false;
 SELECT false <= true;
  | ---
  | - metadata:
- |   - name: false <= true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -1863,7 +1863,7 @@ SELECT false <= true;
 SELECT false <= false;
  | ---
  | - metadata:
- |   - name: false <= false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -1874,7 +1874,7 @@ SELECT a, true >= a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true >= a
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [false, true]
@@ -1885,7 +1885,7 @@ SELECT a, false >= a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false >= a
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [false, true]
@@ -1896,7 +1896,7 @@ SELECT a, true <= a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true <= a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1907,7 +1907,7 @@ SELECT a, false <= a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false <= a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1918,7 +1918,7 @@ SELECT a, a >= true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a >= true
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [false, false]
@@ -1929,7 +1929,7 @@ SELECT a, a >= false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a >= false
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [false, true]
@@ -1940,7 +1940,7 @@ SELECT a, a <= true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a <= true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1951,7 +1951,7 @@ SELECT a, a <= false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a <= false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1965,7 +1965,7 @@ SELECT a, a1, a >= a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a >= a1
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [false, false, true]
@@ -1980,7 +1980,7 @@ SELECT a, a1, a <= a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a <= a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, true]
@@ -1992,7 +1992,7 @@ SELECT a, a1, a <= a1 FROM t, t6;
 SELECT true == true;
  | ---
  | - metadata:
- |   - name: true == true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2000,7 +2000,7 @@ SELECT true == true;
 SELECT true == false;
  | ---
  | - metadata:
- |   - name: true == false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2008,7 +2008,7 @@ SELECT true == false;
 SELECT false == true;
  | ---
  | - metadata:
- |   - name: false == true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2016,7 +2016,7 @@ SELECT false == true;
 SELECT false == false;
  | ---
  | - metadata:
- |   - name: false == false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2024,7 +2024,7 @@ SELECT false == false;
 SELECT true != true;
  | ---
  | - metadata:
- |   - name: true != true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2032,7 +2032,7 @@ SELECT true != true;
 SELECT true != false;
  | ---
  | - metadata:
- |   - name: true != false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2040,7 +2040,7 @@ SELECT true != false;
 SELECT false != true;
  | ---
  | - metadata:
- |   - name: false != true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2048,7 +2048,7 @@ SELECT false != true;
 SELECT false != false;
  | ---
  | - metadata:
- |   - name: false != false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2059,7 +2059,7 @@ SELECT a, true == a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true == a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2070,7 +2070,7 @@ SELECT a, false == a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false == a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2081,7 +2081,7 @@ SELECT a, true != a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true != a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2092,7 +2092,7 @@ SELECT a, false != a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false != a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2103,7 +2103,7 @@ SELECT a, a == true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a == true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2114,7 +2114,7 @@ SELECT a, a == false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a == false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2125,7 +2125,7 @@ SELECT a, a != true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a != true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2136,7 +2136,7 @@ SELECT a, a != false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a != false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2150,7 +2150,7 @@ SELECT a, a1, a == a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a == a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, true]
@@ -2165,7 +2165,7 @@ SELECT a, a1, a != a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a != a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, false]
@@ -2177,7 +2177,7 @@ SELECT a, a1, a != a1 FROM t, t6;
 SELECT true IN (true);
  | ---
  | - metadata:
- |   - name: true IN (true)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2185,7 +2185,7 @@ SELECT true IN (true);
 SELECT false IN (true);
  | ---
  | - metadata:
- |   - name: false IN (true)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2193,7 +2193,7 @@ SELECT false IN (true);
 SELECT true IN (false);
  | ---
  | - metadata:
- |   - name: true IN (false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2201,7 +2201,7 @@ SELECT true IN (false);
 SELECT false IN (false);
  | ---
  | - metadata:
- |   - name: false IN (false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2209,7 +2209,7 @@ SELECT false IN (false);
 SELECT true IN (true, false);
  | ---
  | - metadata:
- |   - name: true IN (true, false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2217,7 +2217,7 @@ SELECT true IN (true, false);
 SELECT false IN (true, false);
  | ---
  | - metadata:
- |   - name: false IN (true, false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2225,7 +2225,7 @@ SELECT false IN (true, false);
 SELECT true IN (SELECT a1 FROM t6);
  | ---
  | - metadata:
- |   - name: true IN (SELECT a1 FROM t6)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2233,7 +2233,7 @@ SELECT true IN (SELECT a1 FROM t6);
 SELECT false IN (SELECT a1 FROM t6);
  | ---
  | - metadata:
- |   - name: false IN (SELECT a1 FROM t6)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2241,7 +2241,7 @@ SELECT false IN (SELECT a1 FROM t6);
 SELECT true IN (SELECT a1 FROM t6 LIMIT 1);
  | ---
  | - metadata:
- |   - name: true IN (SELECT a1 FROM t6 LIMIT 1)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2249,7 +2249,7 @@ SELECT true IN (SELECT a1 FROM t6 LIMIT 1);
 SELECT false IN (SELECT a1 FROM t6 LIMIT 1);
  | ---
  | - metadata:
- |   - name: false IN (SELECT a1 FROM t6 LIMIT 1)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2257,7 +2257,7 @@ SELECT false IN (SELECT a1 FROM t6 LIMIT 1);
 SELECT true IN (1, 1.2, 'true', false);
  | ---
  | - metadata:
- |   - name: true IN (1, 1.2, 'true', false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2265,7 +2265,7 @@ SELECT true IN (1, 1.2, 'true', false);
 SELECT false IN (1, 1.2, 'true', false);
  | ---
  | - metadata:
- |   - name: false IN (1, 1.2, 'true', false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2276,7 +2276,7 @@ SELECT a, a IN (true) FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a IN (true)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2287,7 +2287,7 @@ SELECT a, a IN (false) FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a IN (false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2298,7 +2298,7 @@ SELECT a, a IN (true, false) FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a IN (true, false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2309,7 +2309,7 @@ SELECT a, a IN (SELECT a1 FROM t6 LIMIT 1) FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a IN (SELECT a1 FROM t6 LIMIT 1)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2320,7 +2320,7 @@ SELECT a, a IN (SELECT a1 FROM t6) FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a IN (SELECT a1 FROM t6)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2331,7 +2331,7 @@ SELECT a, a IN (1, 1.2, 'true', false) FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a IN (1, 1.2, 'true', false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2341,7 +2341,7 @@ SELECT a, a IN (1, 1.2, 'true', false) FROM t;
 SELECT true BETWEEN true AND true;
  | ---
  | - metadata:
- |   - name: true BETWEEN true AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2349,7 +2349,7 @@ SELECT true BETWEEN true AND true;
 SELECT false BETWEEN true AND true;
  | ---
  | - metadata:
- |   - name: false BETWEEN true AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2357,7 +2357,7 @@ SELECT false BETWEEN true AND true;
 SELECT true BETWEEN false AND false;
  | ---
  | - metadata:
- |   - name: true BETWEEN false AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2365,7 +2365,7 @@ SELECT true BETWEEN false AND false;
 SELECT false BETWEEN false AND false;
  | ---
  | - metadata:
- |   - name: false BETWEEN false AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2373,7 +2373,7 @@ SELECT false BETWEEN false AND false;
 SELECT true BETWEEN true AND false;
  | ---
  | - metadata:
- |   - name: true BETWEEN true AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2381,7 +2381,7 @@ SELECT true BETWEEN true AND false;
 SELECT false BETWEEN true AND false;
  | ---
  | - metadata:
- |   - name: false BETWEEN true AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2389,7 +2389,7 @@ SELECT false BETWEEN true AND false;
 SELECT true BETWEEN false AND true;
  | ---
  | - metadata:
- |   - name: true BETWEEN false AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2397,7 +2397,7 @@ SELECT true BETWEEN false AND true;
 SELECT false BETWEEN false AND true;
  | ---
  | - metadata:
- |   - name: false BETWEEN false AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2408,7 +2408,7 @@ SELECT a, a BETWEEN true AND true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a BETWEEN true AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2419,7 +2419,7 @@ SELECT a, a BETWEEN false AND false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a BETWEEN false AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2430,7 +2430,7 @@ SELECT a, a BETWEEN true AND false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a BETWEEN true AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2441,7 +2441,7 @@ SELECT a, a BETWEEN false AND true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a BETWEEN false AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2466,7 +2466,7 @@ SELECT true AND 2;
 SELECT false AND 2;
  | ---
  | - metadata:
- |   - name: false AND 2
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2489,7 +2489,7 @@ SELECT 2 AND true;
 SELECT 2 AND false;
  | ---
  | - metadata:
- |   - name: 2 AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2556,7 +2556,7 @@ SELECT b, false AND b FROM t7;
  | - metadata:
  |   - name: B
  |     type: integer
- |   - name: false AND b
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [123, false]
@@ -2581,7 +2581,7 @@ SELECT b, b AND false FROM t7;
  | - metadata:
  |   - name: B
  |     type: integer
- |   - name: b AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [123, false]
@@ -3861,7 +3861,7 @@ SELECT a2, b, b != a2 FROM t6, t7;
 SELECT true IN (0, 1, 2, 3);
  | ---
  | - metadata:
- |   - name: true IN (0, 1, 2, 3)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -3869,7 +3869,7 @@ SELECT true IN (0, 1, 2, 3);
 SELECT false IN (0, 1, 2, 3);
  | ---
  | - metadata:
- |   - name: false IN (0, 1, 2, 3)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -3889,7 +3889,7 @@ SELECT a1, a1 IN (0, 1, 2, 3) FROM t6
  | - metadata:
  |   - name: A1
  |     type: boolean
- |   - name: a1 IN (0, 1, 2, 3)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -3935,7 +3935,7 @@ SELECT true AND 2.3;
 SELECT false AND 2.3;
  | ---
  | - metadata:
- |   - name: false AND 2.3
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -3958,7 +3958,7 @@ SELECT 2.3 AND true;
 SELECT 2.3 AND false;
  | ---
  | - metadata:
- |   - name: 2.3 AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -4025,7 +4025,7 @@ SELECT c, false AND c FROM t8;
  | - metadata:
  |   - name: C
  |     type: number
- |   - name: false AND c
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [4.56, false]
@@ -4050,7 +4050,7 @@ SELECT c, c AND false FROM t8;
  | - metadata:
  |   - name: C
  |     type: number
- |   - name: c AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [4.56, false]
@@ -5006,7 +5006,7 @@ SELECT a2, c, c != a2 FROM t6, t8;
 SELECT true IN (0.1, 1.2, 2.3, 3.4);
  | ---
  | - metadata:
- |   - name: true IN (0.1, 1.2, 2.3, 3.4)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5014,7 +5014,7 @@ SELECT true IN (0.1, 1.2, 2.3, 3.4);
 SELECT false IN (0.1, 1.2, 2.3, 3.4);
  | ---
  | - metadata:
- |   - name: false IN (0.1, 1.2, 2.3, 3.4)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5022,7 +5022,7 @@ SELECT false IN (0.1, 1.2, 2.3, 3.4);
 SELECT a1 IN (0.1, 1.2, 2.3, 3.4) FROM t6 LIMIT 1;
  | ---
  | - metadata:
- |   - name: a1 IN (0.1, 1.2, 2.3, 3.4)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5030,7 +5030,7 @@ SELECT a1 IN (0.1, 1.2, 2.3, 3.4) FROM t6 LIMIT 1;
 SELECT a2 IN (0.1, 1.2, 2.3, 3.4) FROM t6 LIMIT 1;
  | ---
  | - metadata:
- |   - name: a2 IN (0.1, 1.2, 2.3, 3.4)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5095,7 +5095,7 @@ SELECT true AND 'abc';
 SELECT false AND 'abc';
  | ---
  | - metadata:
- |   - name: false AND 'abc'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5118,7 +5118,7 @@ SELECT 'abc' AND true;
 SELECT 'abc' AND false;
  | ---
  | - metadata:
- |   - name: '''abc'' AND false'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5185,7 +5185,7 @@ SELECT d, false AND d FROM t9;
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: false AND d
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['AsdF', false]
@@ -5210,7 +5210,7 @@ SELECT d, d AND false FROM t9;
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: d AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['AsdF', false]
@@ -5470,7 +5470,7 @@ SELECT true AND 'TRUE';
 SELECT false AND 'TRUE';
  | ---
  | - metadata:
- |   - name: false AND 'TRUE'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5493,7 +5493,7 @@ SELECT 'TRUE' AND true;
 SELECT 'TRUE' AND false;
  | ---
  | - metadata:
- |   - name: '''TRUE'' AND false'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5560,7 +5560,7 @@ SELECT d, false AND d FROM t9 WHERE d = 'TRUE';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: false AND d
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['TRUE', false]
@@ -5585,7 +5585,7 @@ SELECT d, d AND false FROM t9 WHERE d = 'TRUE';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: d AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['TRUE', false]
@@ -5650,7 +5650,7 @@ SELECT true AND 'true';
 SELECT false AND 'true';
  | ---
  | - metadata:
- |   - name: false AND 'true'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5673,7 +5673,7 @@ SELECT 'true' AND true;
 SELECT 'true' AND false;
  | ---
  | - metadata:
- |   - name: '''true'' AND false'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5740,7 +5740,7 @@ SELECT d, false AND d FROM t9 WHERE d = 'true';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: false AND d
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['true', false]
@@ -5765,7 +5765,7 @@ SELECT d, d AND false FROM t9 WHERE d = 'true';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: d AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['true', false]
@@ -5830,7 +5830,7 @@ SELECT true AND 'FALSE';
 SELECT false AND 'FALSE';
  | ---
  | - metadata:
- |   - name: false AND 'FALSE'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5853,7 +5853,7 @@ SELECT 'FALSE' AND true;
 SELECT 'FALSE' AND false;
  | ---
  | - metadata:
- |   - name: '''FALSE'' AND false'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5920,7 +5920,7 @@ SELECT d, false AND d FROM t9 WHERE d = 'FALSE';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: false AND d
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['FALSE', false]
@@ -5945,7 +5945,7 @@ SELECT d, d AND false FROM t9 WHERE d = 'FALSE';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: d AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['FALSE', false]
@@ -6010,7 +6010,7 @@ SELECT true AND 'false';
 SELECT false AND 'false';
  | ---
  | - metadata:
- |   - name: false AND 'false'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -6033,7 +6033,7 @@ SELECT 'false' AND true;
 SELECT 'false' AND false;
  | ---
  | - metadata:
- |   - name: '''false'' AND false'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -6100,7 +6100,7 @@ SELECT d, false AND d FROM t9 WHERE d = 'false';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: false AND d
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['false', false]
@@ -6125,7 +6125,7 @@ SELECT d, d AND false FROM t9 WHERE d = 'false';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: d AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['false', false]
diff --git a/test/sql/collation.result b/test/sql/collation.result
index 4e4c27ef0..bfc89e1b8 100644
--- a/test/sql/collation.result
+++ b/test/sql/collation.result
@@ -111,7 +111,7 @@ box.execute([[SELECT descriptor, upper(letter), letter FROM tu where UPPER(lette
 - metadata:
   - name: DESCRIPTOR
     type: string
-  - name: upper(letter)
+  - name: COLUMN_1
     type: string
   - name: LETTER
     type: string
@@ -124,7 +124,7 @@ box.execute([[SELECT descriptor, upper(letter COLLATE "GERMAN"), letter FROM tu
 - metadata:
   - name: DESCRIPTOR
     type: string
-  - name: upper(letter COLLATE "GERMAN")
+  - name: COLUMN_1
     type: string
   - name: LETTER
     type: string
@@ -335,14 +335,14 @@ box.execute("SELECT a FROM t UNION SELECT c FROM t;")
 box.execute("SELECT c COLLATE \"binary\" FROM t UNION SELECT a FROM t;")
 ---
 - metadata:
-  - name: c COLLATE "binary"
+  - name: COLUMN_1
     type: string
   rows: []
 ...
 box.execute("SELECT b COLLATE \"unicode\" FROM t UNION SELECT a FROM t;")
 ---
 - metadata:
-  - name: b COLLATE "unicode"
+  - name: COLUMN_1
     type: string
   rows: []
 ...
@@ -1128,7 +1128,7 @@ box.execute("INSERT INTO jj VALUES (1,'A'), (2,'a')")
 box.execute("SELECT DISTINCT trim(s2) FROM jj;")
 ---
 - metadata:
-  - name: trim(s2)
+  - name: COLUMN_1
     type: string
   rows:
   - ['A']
@@ -1140,7 +1140,7 @@ box.execute("INSERT INTO jj VALUES (3, 'aS'), (4, 'AS');")
 box.execute("SELECT DISTINCT replace(s2, 'S', 's') FROM jj;")
 ---
 - metadata:
-  - name: replace(s2, 'S', 's')
+  - name: COLUMN_1
     type: string
   rows:
   - ['A']
@@ -1149,7 +1149,7 @@ box.execute("SELECT DISTINCT replace(s2, 'S', 's') FROM jj;")
 box.execute("SELECT DISTINCT substr(s2, 1, 1) FROM jj;")
 ---
 - metadata:
-  - name: substr(s2, 1, 1)
+  - name: COLUMN_1
     type: string
   rows:
   - ['A']
diff --git a/test/sql/errinj.result b/test/sql/errinj.result
index 68c001f28..f19203bc6 100644
--- a/test/sql/errinj.result
+++ b/test/sql/errinj.result
@@ -120,7 +120,7 @@ insert_res
 select_res
 ---
 - metadata:
-  - name: '1'
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
diff --git a/test/sql/foreign-keys.result b/test/sql/foreign-keys.result
index f1d973443..33689a06e 100644
--- a/test/sql/foreign-keys.result
+++ b/test/sql/foreign-keys.result
@@ -357,7 +357,7 @@ box.execute('ALTER TABLE tc ADD CONSTRAINT fk1 FOREIGN KEY (id) REFERENCES tp(id
 box.execute('SELECT row_count();')
 ---
 - metadata:
-  - name: row_count()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -374,7 +374,7 @@ box.execute('ALTER TABLE tc DROP CONSTRAINT fk1;')
 box.execute('SELECT row_count();')
 ---
 - metadata:
-  - name: row_count()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
diff --git a/test/sql/full_metadata.result b/test/sql/full_metadata.result
index 5a93c41ec..25bac6d86 100644
--- a/test/sql/full_metadata.result
+++ b/test/sql/full_metadata.result
@@ -57,7 +57,7 @@ execute("SELECT 'aSd' COLLATE \"unicode_ci\";")
  | - metadata:
  |   - type: string
  |     span: '''aSd'' COLLATE "unicode_ci"'
- |     name: '''aSd'' COLLATE "unicode_ci"'
+ |     name: COLUMN_1
  |     collation: unicode_ci
  |   rows:
  |   - ['aSd']
@@ -78,7 +78,7 @@ execute("SELECT c COLLATE \"unicode\" FROM t;")
  | - metadata:
  |   - type: string
  |     span: c COLLATE "unicode"
- |     name: c COLLATE "unicode"
+ |     name: COLUMN_1
  |     collation: unicode
  |   rows:
  |   - ['aSd']
@@ -165,7 +165,7 @@ execute("SELECT *, id + 1 AS x, a AS y, c || 'abc' FROM t;")
  |     is_nullable: false
  |   - type: string
  |     span: c || 'abc'
- |     name: c || 'abc'
+ |     name: COLUMN_1
  |   rows:
  |   - [1, 1, 'aSd', 2, 1, 'aSdabc']
  | ...
@@ -185,8 +185,8 @@ execute("SELECT * FROM v;")
  |     name: Y
  |     is_nullable: false
  |   - type: string
- |     span: c || 'abc'
- |     name: c || 'abc'
+ |     span: COLUMN_1
+ |     name: COLUMN_1
  |   rows:
  |   - [2, 1, 'aSdabc']
  | ...
diff --git a/test/sql/func-recreate.result b/test/sql/func-recreate.result
index 3709df787..5fd2b79c0 100644
--- a/test/sql/func-recreate.result
+++ b/test/sql/func-recreate.result
@@ -48,7 +48,7 @@ test_run:cmd("setopt delimiter ''");
 ch:get()
 ---
 - metadata:
-  - name: WAITFOR(0.2)
+  - name: COLUMN_1
     type: number
   rows:
   - [0.2]
diff --git a/test/sql/gh-3199-no-mem-leaks.result b/test/sql/gh-3199-no-mem-leaks.result
index d8590779a..6ce8df436 100644
--- a/test/sql/gh-3199-no-mem-leaks.result
+++ b/test/sql/gh-3199-no-mem-leaks.result
@@ -32,7 +32,7 @@ box.execute('SELECT x, y, x + y FROM test ORDER BY y')
     type: integer
   - name: Y
     type: integer
-  - name: x + y
+  - name: COLUMN_1
     type: integer
   rows:
   - [1, 1, 2]
@@ -49,7 +49,7 @@ box.execute('SELECT x, y, x + y FROM test ORDER BY y')
     type: integer
   - name: Y
     type: integer
-  - name: x + y
+  - name: COLUMN_1
     type: integer
   rows:
   - [1, 1, 2]
@@ -62,7 +62,7 @@ box.execute('SELECT x, y, x + y FROM test ORDER BY y')
     type: integer
   - name: Y
     type: integer
-  - name: x + y
+  - name: COLUMN_1
     type: integer
   rows:
   - [1, 1, 2]
@@ -75,7 +75,7 @@ box.execute('SELECT x, y, x + y FROM test ORDER BY y')
     type: integer
   - name: Y
     type: integer
-  - name: x + y
+  - name: COLUMN_1
     type: integer
   rows:
   - [1, 1, 2]
@@ -88,7 +88,7 @@ box.execute('SELECT x, y, x + y FROM test ORDER BY y')
     type: integer
   - name: Y
     type: integer
-  - name: x + y
+  - name: COLUMN_1
     type: integer
   rows:
   - [1, 1, 2]
@@ -115,7 +115,7 @@ box.execute('SELECT a, id + 2, b FROM test2 WHERE b < id * 2 ORDER BY a ')
 - metadata:
   - name: A
     type: string
-  - name: id + 2
+  - name: COLUMN_1
     type: integer
   - name: B
     type: integer
@@ -134,7 +134,7 @@ box.execute('SELECT a, id + 2 * b, a FROM test2 WHERE b < id * 2 ORDER BY a ')
 - metadata:
   - name: A
     type: string
-  - name: id + 2 * b
+  - name: COLUMN_1
     type: integer
   - name: A
     type: string
@@ -149,7 +149,7 @@ box.execute('SELECT a, id + 2 * b, a FROM test2 WHERE b < id * 2 ORDER BY a ')
 - metadata:
   - name: A
     type: string
-  - name: id + 2 * b
+  - name: COLUMN_1
     type: integer
   - name: A
     type: string
@@ -164,7 +164,7 @@ box.execute('SELECT a, id + 2 * b, a FROM test2 WHERE b < id * 2 ORDER BY a ')
 - metadata:
   - name: A
     type: string
-  - name: id + 2 * b
+  - name: COLUMN_1
     type: integer
   - name: A
     type: string
@@ -183,7 +183,7 @@ box.execute('SELECT x, y + 3 * b, b FROM test2, test WHERE b = x')
 - metadata:
   - name: X
     type: integer
-  - name: y + 3 * b
+  - name: COLUMN_1
     type: integer
   - name: B
     type: integer
@@ -196,7 +196,7 @@ box.execute('SELECT x, y + 3 * b, b FROM test2, test WHERE b = x')
 - metadata:
   - name: X
     type: integer
-  - name: y + 3 * b
+  - name: COLUMN_1
     type: integer
   - name: B
     type: integer
@@ -209,7 +209,7 @@ box.execute('SELECT x, y + 3 * b, b FROM test2, test WHERE b = x')
 - metadata:
   - name: X
     type: integer
-  - name: y + 3 * b
+  - name: COLUMN_1
     type: integer
   - name: B
     type: integer
diff --git a/test/sql/gh-3888-values-blob-assert.result b/test/sql/gh-3888-values-blob-assert.result
index 0a1af28f2..669f2eb2f 100644
--- a/test/sql/gh-3888-values-blob-assert.result
+++ b/test/sql/gh-3888-values-blob-assert.result
@@ -51,7 +51,7 @@ box.execute('SELECT TheColumnName')
 box.execute('VALUES(-0.5e-2)')
 ---
 - metadata:
-  - name: column1
+  - name: COLUMN_1
     type: double
   rows:
   - [-0.005]
@@ -59,7 +59,7 @@ box.execute('VALUES(-0.5e-2)')
 box.execute('SELECT X\'507265766564\'')
 ---
 - metadata:
-  - name: X'507265766564'
+  - name: COLUMN_1
     type: varbinary
   rows:
   - ['Preved']
@@ -68,7 +68,7 @@ box.execute('SELECT X\'507265766564\'')
 box.execute('SELECT 3.14')
 ---
 - metadata:
-  - name: '3.14'
+  - name: COLUMN_1
     type: double
   rows:
   - [3.14]
@@ -76,7 +76,7 @@ box.execute('SELECT 3.14')
 box.execute('SELECT X\'4D6564766564\'')
 ---
 - metadata:
-  - name: X'4D6564766564'
+  - name: COLUMN_1
     type: varbinary
   rows:
   - ['Medved']
diff --git a/test/sql/gh-4697-scalar-bool-sort-cmp.result b/test/sql/gh-4697-scalar-bool-sort-cmp.result
index 2423cd894..6f7fbd62b 100644
--- a/test/sql/gh-4697-scalar-bool-sort-cmp.result
+++ b/test/sql/gh-4697-scalar-bool-sort-cmp.result
@@ -30,7 +30,7 @@ SELECT s2, typeof(s2) FROM test ORDER BY s2;
  | - metadata:
  |   - name: S2
  |     type: scalar
- |   - name: typeof(s2)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - [null, 'boolean']
@@ -43,7 +43,7 @@ SELECT s3, typeof(s3) FROM test ORDER BY s3;
  | - metadata:
  |   - name: S3
  |     type: scalar
- |   - name: typeof(s3)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - [null, 'boolean']
diff --git a/test/sql/icu-upper-lower.result b/test/sql/icu-upper-lower.result
index f7b9dfa38..3ecc07d94 100644
--- a/test/sql/icu-upper-lower.result
+++ b/test/sql/icu-upper-lower.result
@@ -23,11 +23,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Zəfər, jaketini də, papağını da götür, bu axşam hava çox soyuq
-      olacaq. ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Zəfər, jaketini də, papağını da götür, bu axşam hava çox soyuq
-      olacaq. ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     zəfər, jaketini də, papağını da götür, bu axşam hava çox soyuq olacaq. ',
@@ -38,9 +36,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     The quick brown fox jumps over the lazy dog. ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     The quick brown fox jumps over the lazy dog. ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     the quick brown fox jumps over the lazy dog. ', '     THE QUICK BROWN FOX
@@ -52,9 +50,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     The quick brown fox jumps over the lazy dog. ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     The quick brown fox jumps over the lazy dog. ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     the quick brown fox jumps over the lazy dog. ', '     THE QUICK BROWN FOX
@@ -66,11 +64,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Բել դղյակի ձախ ժամն օֆ ազգությանը ցպահանջ չճշտած վնաս էր եւ
-      փառք ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Բել դղյակի ձախ ժամն օֆ ազգությանը ցպահանջ չճշտած վնաս էր եւ
-      փառք ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     բել դղյակի ձախ ժամն օֆ ազգությանը ցպահանջ չճշտած վնաս էր եւ փառք ', '     ԲԵԼ
@@ -82,11 +78,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     У Іўі худы жвавы чорт у зялёнай камізэльцы пабег пад’есці фаршу
-      з юшкай ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     У Іўі худы жвавы чорт у зялёнай камізэльцы пабег пад’есці фаршу
-      з юшкай ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     у іўі худы жвавы чорт у зялёнай камізэльцы пабег пад’есці фаршу з юшкай ',
@@ -98,11 +92,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός
-      ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός
-      ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός ', '     ΤΆΧΙΣΤΗ
@@ -114,11 +106,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Chuaigh bé mhórshách le dlúthspád fíorfhinn trí hata mo dhea-phorcáin
-      bhig ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Chuaigh bé mhórshách le dlúthspád fíorfhinn trí hata mo dhea-phorcáin
-      bhig ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     chuaigh bé mhórshách le dlúthspád fíorfhinn trí hata mo dhea-phorcáin bhig ',
@@ -130,9 +120,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Quiere la boca exhausta vid, kiwi, piña y fugaz jamón ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Quiere la boca exhausta vid, kiwi, piña y fugaz jamón ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     quiere la boca exhausta vid, kiwi, piña y fugaz jamón ', '     QUIERE LA
@@ -144,9 +134,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     키스의 고유조건은 입술끼리 만나야 하고 특별한 기술은 필요치 않다 ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     키스의 고유조건은 입술끼리 만나야 하고 특별한 기술은 필요치 않다 ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     키스의 고유조건은 입술끼리 만나야 하고 특별한 기술은 필요치 않다 ', '     키스의 고유조건은 입술끼리 만나야 하고 특별한
@@ -158,9 +148,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Glāžšķūņa rūķīši dzērumā čiepj Baha koncertflīģeļu vākus ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Glāžšķūņa rūķīši dzērumā čiepj Baha koncertflīģeļu vākus ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     glāžšķūņa rūķīši dzērumā čiepj baha koncertflīģeļu vākus ', '     GLĀŽŠĶŪŅA
@@ -172,11 +162,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Zwölf große Boxkämpfer jagen Viktor quer über den Sylter Deich
-      ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Zwölf große Boxkämpfer jagen Viktor quer über den Sylter Deich
-      ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     zwölf große boxkämpfer jagen viktor quer über den sylter deich ', '     ZWÖLF
@@ -188,9 +176,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Pchnąć w tę łódź jeża lub ośm skrzyń fig. ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Pchnąć w tę łódź jeża lub ośm skrzyń fig. ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     pchnąć w tę łódź jeża lub ośm skrzyń fig. ', '     PCHNĄĆ W TĘ ŁÓDŹ JEŻA
@@ -202,9 +190,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Чуєш їх, доцю, га? Кумедна ж ти, прощайся без ґольфів! ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Чуєш їх, доцю, га? Кумедна ж ти, прощайся без ґольфів! ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     чуєш їх, доцю, га? кумедна ж ти, прощайся без ґольфів! ', '     ЧУЄШ ЇХ,
@@ -216,9 +204,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Příliš žluťoučký kůň úpěl ďábelské ódy ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Příliš žluťoučký kůň úpěl ďábelské ódy ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     příliš žluťoučký kůň úpěl ďábelské ódy ', '     PŘÍLIŠ ŽLUŤOUČKÝ KŮŇ ÚPĚL
@@ -230,11 +218,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Laŭ Ludoviko Zamenhof bongustas freŝa ĉeĥa manĝaĵo kun spicoj
-      ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Laŭ Ludoviko Zamenhof bongustas freŝa ĉeĥa manĝaĵo kun spicoj
-      ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     laŭ ludoviko zamenhof bongustas freŝa ĉeĥa manĝaĵo kun spicoj ', '     LAŬ
@@ -246,9 +232,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     いろはにほへと ちりぬるを わかよたれそ つねならむ うゐのおくやま けふこえて あさきゆめみし ゑひもせす ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     いろはにほへと ちりぬるを わかよたれそ つねならむ うゐのおくやま けふこえて あさきゆめみし ゑひもせす ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     いろはにほへと ちりぬるを わかよたれそ つねならむ うゐのおくやま けふこえて あさきゆめみし ゑひもせす ', '     いろはにほへと
@@ -260,9 +246,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: 'lower(''     Pijamalı hasta yağız şoföre çabucak güvendi. EXTRA: İ '')'
+  - name: COLUMN_1
     type: string
-  - name: 'upper(''     Pijamalı hasta yağız şoföre çabucak güvendi. EXTRA: İ '')'
+  - name: COLUMN_2
     type: string
   rows:
   - ['     pijamalı hasta yağız şoföre çabucak güvendi. extra: i̇ ', '     PIJAMALI
diff --git a/test/sql/integer-overflow.result b/test/sql/integer-overflow.result
index 6269cb547..a56fb2412 100644
--- a/test/sql/integer-overflow.result
+++ b/test/sql/integer-overflow.result
@@ -19,7 +19,7 @@ box.execute('SELECT (2147483647 * 2147483647 * 2147483647);')
 box.execute('SELECT (-9223372036854775808 / -1);')
 ---
 - metadata:
-  - name: (-9223372036854775808 / -1)
+  - name: COLUMN_1
     type: integer
   rows:
   - [9223372036854775808]
@@ -32,7 +32,7 @@ box.execute('SELECT (-9223372036854775808 - 1);')
 box.execute('SELECT (9223372036854775807 + 1);')
 ---
 - metadata:
-  - name: (9223372036854775807 + 1)
+  - name: COLUMN_1
     type: integer
   rows:
   - [9223372036854775808]
@@ -50,7 +50,7 @@ box.execute('SELECT 18446744073709551615 * 2;')
 box.execute('SELECT (-9223372036854775807 * (-2));')
 ---
 - metadata:
-  - name: (-9223372036854775807 * (-2))
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551614]
@@ -60,7 +60,7 @@ box.execute('SELECT (-9223372036854775807 * (-2));')
 box.execute('SELECT 9223372036854775808;')
 ---
 - metadata:
-  - name: '9223372036854775808'
+  - name: COLUMN_1
     type: integer
   rows:
   - [9223372036854775808]
@@ -74,7 +74,7 @@ box.execute('SELECT -9223372036854775809;')
 box.execute('SELECT 9223372036854775808 - 1;')
 ---
 - metadata:
-  - name: 9223372036854775808 - 1
+  - name: COLUMN_1
     type: integer
   rows:
   - [9223372036854775807]
@@ -82,7 +82,7 @@ box.execute('SELECT 9223372036854775808 - 1;')
 box.execute('SELECT 18446744073709551615;')
 ---
 - metadata:
-  - name: '18446744073709551615'
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551615]
@@ -98,7 +98,7 @@ box.execute('SELECT 18446744073709551616;')
 box.execute('SELECT CAST(\'9223372036854775808\' AS INTEGER);')
 ---
 - metadata:
-  - name: CAST('9223372036854775808' AS INTEGER)
+  - name: COLUMN_1
     type: integer
   rows:
   - [9223372036854775808]
diff --git a/test/sql/iproto.result b/test/sql/iproto.result
index 44ba499a0..ee1047fc1 100644
--- a/test/sql/iproto.result
+++ b/test/sql/iproto.result
@@ -372,11 +372,11 @@ parameters[3] = 33
 cn:execute('select $2, $1, $3', parameters)
 ---
 - metadata:
-  - name: $2
+  - name: COLUMN_1
     type: integer
-  - name: $1
+  - name: COLUMN_2
     type: integer
-  - name: $3
+  - name: COLUMN_3
     type: integer
   rows:
   - [22, 11, 33]
@@ -736,7 +736,7 @@ res.metadata
 cn:execute("SELECT zeroblob(1);")
 ---
 - metadata:
-  - name: zeroblob(1)
+  - name: COLUMN_1
     type: varbinary
   rows:
   - ["\0"]
@@ -749,7 +749,7 @@ res = cn:execute("SELECT randomblob(1);")
 ...
 res.metadata
 ---
-- - name: randomblob(1)
+- - name: COLUMN_1
     type: varbinary
 ...
 -- Type set during compilation stage, and since min/max are accept
@@ -759,7 +759,7 @@ res.metadata
 cn:execute("SELECT LEAST(1, 2, 3);")
 ---
 - metadata:
-  - name: LEAST(1, 2, 3)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [1]
@@ -767,7 +767,7 @@ cn:execute("SELECT LEAST(1, 2, 3);")
 cn:execute("SELECT GREATEST(1, 2, 3);")
 ---
 - metadata:
-  - name: GREATEST(1, 2, 3)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [3]
@@ -803,7 +803,7 @@ s = box.prepare([[ SELECT ?; ]])
 s:execute({42})
 ---
 - metadata:
-  - name: '?'
+  - name: COLUMN_1
     type: integer
   rows:
   - [42]
@@ -811,7 +811,7 @@ s:execute({42})
 box.execute('SELECT 1;')
 ---
 - metadata:
-  - name: '1'
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
diff --git a/test/sql/max-on-index.result b/test/sql/max-on-index.result
index 1cd488f85..a90f30993 100644
--- a/test/sql/max-on-index.result
+++ b/test/sql/max-on-index.result
@@ -48,7 +48,7 @@ box.execute("INSERT INTO test2 VALUES(1, 2)");
 box.execute("SELECT MAX(f1) FROM test1")
 ---
 - metadata:
-  - name: MAX(f1)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [4]
@@ -56,7 +56,7 @@ box.execute("SELECT MAX(f1) FROM test1")
 box.execute("SELECT MAX(f2) FROM test1")
 ---
 - metadata:
-  - name: MAX(f2)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [3]
@@ -64,7 +64,7 @@ box.execute("SELECT MAX(f2) FROM test1")
 box.execute("SELECT MAX(f1) FROM test2")
 ---
 - metadata:
-  - name: MAX(f1)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [1]
diff --git a/test/sql/misc.result b/test/sql/misc.result
index 0190a5897..6af11bfba 100644
--- a/test/sql/misc.result
+++ b/test/sql/misc.result
@@ -11,7 +11,7 @@ _ = box.space._session_settings:update('sql_default_engine', {{'=', 2, engine}})
 box.execute('select 1;')
 ---
 - metadata:
-  - name: '1'
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -78,7 +78,7 @@ box.execute('CREATE TABLE test (id INTEGER PRIMARY KEY, b TEXT CONSTRAINT c1 COL
 box.execute('SELECT 1;')
 ---
 - metadata:
-  - name: '1'
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -86,7 +86,7 @@ box.execute('SELECT 1;')
 box.execute('SELECT 1.5;')
 ---
 - metadata:
-  - name: '1.5'
+  - name: COLUMN_1
     type: double
   rows:
   - [1.5]
@@ -94,7 +94,7 @@ box.execute('SELECT 1.5;')
 box.execute('SELECT 1.0;')
 ---
 - metadata:
-  - name: '1.0'
+  - name: COLUMN_1
     type: double
   rows:
   - [1]
@@ -102,7 +102,7 @@ box.execute('SELECT 1.0;')
 box.execute('SELECT \'abc\';')
 ---
 - metadata:
-  - name: '''abc'''
+  - name: COLUMN_1
     type: string
   rows:
   - ['abc']
@@ -110,7 +110,7 @@ box.execute('SELECT \'abc\';')
 box.execute('SELECT X\'4D6564766564\'')
 ---
 - metadata:
-  - name: X'4D6564766564'
+  - name: COLUMN_1
     type: varbinary
   rows:
   - ['Medved']
diff --git a/test/sql/persistency.result b/test/sql/persistency.result
index 6d14d4c4e..95dde5714 100644
--- a/test/sql/persistency.result
+++ b/test/sql/persistency.result
@@ -41,9 +41,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -57,9 +57,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar LIMIT 2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -72,9 +72,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo=2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['bar', 2, 42, 'awesome']
@@ -86,9 +86,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo>2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foobar', 1000, 42, 'awesome']
@@ -100,9 +100,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo>=2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['bar', 2, 42, 'awesome']
@@ -115,9 +115,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo=10000")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows: []
 ...
@@ -128,9 +128,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo>10000")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows: []
 ...
@@ -141,9 +141,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -155,9 +155,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<2.001")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -170,9 +170,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<=2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -185,9 +185,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<100")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -200,9 +200,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE bar='foo'")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -210,7 +210,7 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE bar='foo'")
 box.execute("SELECT count(*) FROM foobar")
 ---
 - metadata:
-  - name: count(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -218,7 +218,7 @@ box.execute("SELECT count(*) FROM foobar")
 box.execute("SELECT count(*) FROM foobar WHERE bar='foo'")
 ---
 - metadata:
-  - name: count(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -230,9 +230,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar ORDER BY bar")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['bar', 2, 42, 'awesome']
@@ -246,9 +246,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar ORDER BY bar DESC")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foobar', 1000, 42, 'awesome']
@@ -263,7 +263,7 @@ box.execute("REPLACE INTO foobar VALUES (1, 'cacodaemon')")
 box.execute("SELECT COUNT(*) FROM foobar WHERE foo=1")
 ---
 - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -271,7 +271,7 @@ box.execute("SELECT COUNT(*) FROM foobar WHERE foo=1")
 box.execute("SELECT COUNT(*) FROM foobar WHERE bar='cacodaemon'")
 ---
 - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -283,7 +283,7 @@ box.execute("DELETE FROM foobar WHERE bar='cacodaemon'")
 box.execute("SELECT COUNT(*) FROM foobar WHERE bar='cacodaemon'")
 ---
 - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
diff --git a/test/sql/prepared.result b/test/sql/prepared.result
index 666f6e1d3..0db2cc03f 100644
--- a/test/sql/prepared.result
+++ b/test/sql/prepared.result
@@ -425,13 +425,13 @@ s = prepare("SELECT count(*), count(a - 3), max(b), abs(id) FROM test WHERE b =
 execute(s.stmt_id)
  | ---
  | - metadata:
- |   - name: count(*)
+ |   - name: COLUMN_1
  |     type: integer
- |   - name: count(a - 3)
+ |   - name: COLUMN_2
  |     type: integer
- |   - name: max(b)
+ |   - name: COLUMN_3
  |     type: scalar
- |   - name: abs(id)
+ |   - name: COLUMN_4
  |     type: number
  |   rows:
  |   - [1, 1, '3', 1]
@@ -439,13 +439,13 @@ execute(s.stmt_id)
 execute(s.stmt_id)
  | ---
  | - metadata:
- |   - name: count(*)
+ |   - name: COLUMN_1
  |     type: integer
- |   - name: count(a - 3)
+ |   - name: COLUMN_2
  |     type: integer
- |   - name: max(b)
+ |   - name: COLUMN_3
  |     type: scalar
- |   - name: abs(id)
+ |   - name: COLUMN_4
  |     type: number
  |   rows:
  |   - [1, 1, '3', 1]
@@ -480,7 +480,7 @@ res = execute(s.stmt_id)
  | ...
 res.metadata
  | ---
- | - - name: group_concat(TRIM(TRAILING FROM t),x'0a')
+ | - - name: COLUMN_13
  |     type: string
  | ...
 unprepare(s.stmt_id)
@@ -838,11 +838,11 @@ s = prepare('SELECT :a, :b, :c');
 execute(s.stmt_id, {{[':a'] = 1}, {[':b'] = 2}, {[':c'] = 3}});
  | ---
  | - metadata:
- |   - name: :a
+ |   - name: COLUMN_1
  |     type: integer
- |   - name: :b
+ |   - name: COLUMN_2
  |     type: integer
- |   - name: :c
+ |   - name: COLUMN_3
  |     type: integer
  |   rows:
  |   - [1, 2, 3]
@@ -850,11 +850,11 @@ execute(s.stmt_id, {{[':a'] = 1}, {[':b'] = 2}, {[':c'] = 3}});
 execute(s.stmt_id, {{[':a'] = 1}, {[':b'] = 2}});
  | ---
  | - metadata:
- |   - name: :a
+ |   - name: COLUMN_1
  |     type: integer
- |   - name: :b
+ |   - name: COLUMN_2
  |     type: integer
- |   - name: :c
+ |   - name: COLUMN_3
  |     type: boolean
  |   rows:
  |   - [1, 2, null]
@@ -862,11 +862,11 @@ execute(s.stmt_id, {{[':a'] = 1}, {[':b'] = 2}});
 execute(s.stmt_id);
  | ---
  | - metadata:
- |   - name: :a
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: :b
+ |   - name: COLUMN_2
  |     type: boolean
- |   - name: :c
+ |   - name: COLUMN_3
  |     type: boolean
  |   rows:
  |   - [null, null, null]
diff --git a/test/sql/row-count.result b/test/sql/row-count.result
index 02acd79b5..7591d1630 100644
--- a/test/sql/row-count.result
+++ b/test/sql/row-count.result
@@ -16,7 +16,7 @@ box.execute("CREATE TABLE t1 (s1 VARCHAR(10) PRIMARY KEY);")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -24,7 +24,7 @@ box.execute("SELECT ROW_COUNT();")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -36,7 +36,7 @@ box.execute("CREATE TABLE t2 (s1 VARCHAR(10) PRIMARY KEY, s2 VARCHAR(10) REFEREN
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -52,7 +52,7 @@ box.execute("INSERT INTO t3 VALUES (0, 0, 0);")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -64,7 +64,7 @@ box.execute("CREATE TRIGGER x AFTER DELETE ON t1 FOR EACH ROW BEGIN UPDATE t3 SE
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -76,7 +76,7 @@ box.execute("INSERT INTO t1 VALUES ('a');")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -88,7 +88,7 @@ box.execute("INSERT INTO t2 VALUES ('a','a');")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -100,7 +100,7 @@ box.execute("INSERT INTO t1 VALUES ('b'), ('c'), ('d');")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -113,7 +113,7 @@ box.execute("REPLACE INTO t2 VALUES('a', 'c');")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [2]
@@ -125,7 +125,7 @@ box.execute("DELETE FROM t1;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [4]
@@ -141,7 +141,7 @@ box.execute("TRUNCATE TABLE t3;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -157,7 +157,7 @@ box.execute("UPDATE t3 SET i2 = 666;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -172,7 +172,7 @@ box.execute("DELETE FROM t3 WHERE 0 = 0;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -188,7 +188,7 @@ box.execute("DELETE FROM t3")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -222,7 +222,7 @@ box.execute("DELETE FROM tt1 WHERE id = 2;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -252,7 +252,7 @@ box.execute("START TRANSACTION;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -264,7 +264,7 @@ box.execute("COMMIT;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -277,7 +277,7 @@ box.execute("COMMIT;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -286,7 +286,7 @@ box.execute("SELECT ROW_COUNT();")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -308,7 +308,7 @@ box.execute("EXPLAIN QUERY PLAN INSERT INTO t1 VALUES ('b'), ('c'), ('d');")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
diff --git a/test/sql/transition.result b/test/sql/transition.result
index c14055b4e..8680e3cec 100644
--- a/test/sql/transition.result
+++ b/test/sql/transition.result
@@ -38,9 +38,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -54,9 +54,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar LIMIT 2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -69,9 +69,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo=2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['bar', 2, 42, 'awesome']
@@ -83,9 +83,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo>2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foobar', 1000, 42, 'awesome']
@@ -97,9 +97,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo>=2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['bar', 2, 42, 'awesome']
@@ -112,9 +112,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo=10000")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows: []
 ...
@@ -125,9 +125,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo>10000")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows: []
 ...
@@ -138,9 +138,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -152,9 +152,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<2.001")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -167,9 +167,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<=2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -182,9 +182,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<100")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -197,9 +197,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE bar='foo'")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -207,7 +207,7 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE bar='foo'")
 box.execute("SELECT count(*) FROM foobar")
 ---
 - metadata:
-  - name: count(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -215,7 +215,7 @@ box.execute("SELECT count(*) FROM foobar")
 box.execute("SELECT count(*) FROM foobar WHERE bar='foo'")
 ---
 - metadata:
-  - name: count(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -227,9 +227,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar ORDER BY bar")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['bar', 2, 42, 'awesome']
@@ -243,9 +243,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar ORDER BY bar DESC")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foobar', 1000, 42, 'awesome']
@@ -260,7 +260,7 @@ box.execute("REPLACE INTO foobar VALUES (1, 'cacodaemon')")
 box.execute("SELECT COUNT(*) FROM foobar WHERE foo=1")
 ---
 - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -268,7 +268,7 @@ box.execute("SELECT COUNT(*) FROM foobar WHERE foo=1")
 box.execute("SELECT COUNT(*) FROM foobar WHERE bar='cacodaemon'")
 ---
 - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -280,7 +280,7 @@ box.execute("DELETE FROM foobar WHERE bar='cacodaemon'")
 box.execute("SELECT COUNT(*) FROM foobar WHERE bar='cacodaemon'")
 ---
 - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
diff --git a/test/sql/types.result b/test/sql/types.result
index 54aff460e..8204b22bd 100644
--- a/test/sql/types.result
+++ b/test/sql/types.result
@@ -54,8 +54,8 @@ box.execute("CREATE VIEW v1 AS SELECT b + a, b - a FROM t1;")
 ...
 box.space.V1:format()
 ---
-- [{'type': 'number', 'nullable_action': 'none', 'name': 'b + a', 'is_nullable': true},
-  {'type': 'number', 'nullable_action': 'none', 'name': 'b - a', 'is_nullable': true}]
+- [{'type': 'number', 'nullable_action': 'none', 'name': 'COLUMN_1', 'is_nullable': true},
+  {'type': 'number', 'nullable_action': 'none', 'name': 'COLUMN_2', 'is_nullable': true}]
 ...
 -- gh-2494: index's part also features correct declared type.
 --
@@ -197,7 +197,7 @@ box.execute("SELECT randomblob(5) || 'x';")
 box.execute("VALUES (TYPEOF(randomblob(5) || zeroblob(5)));")
 ---
 - metadata:
-  - name: column1
+  - name: COLUMN_1
     type: string
   rows:
   - ['varbinary']
@@ -230,7 +230,7 @@ box.execute("SELECT * FROM t1 WHERE 'blob' LIKE x'0000';")
 box.execute("SELECT s LIKE NULL FROM t1;")
 ---
 - metadata:
-  - name: s LIKE NULL
+  - name: COLUMN_1
     type: integer
   rows:
   - [null]
@@ -256,7 +256,7 @@ box.execute("SELECT * FROM t1 WHERE 'int' LIKE 4;")
 box.execute("SELECT NULL LIKE s FROM t1;")
 ---
 - metadata:
-  - name: NULL LIKE s
+  - name: COLUMN_1
     type: integer
   rows:
   - [null]
@@ -295,7 +295,7 @@ box.space.T1:drop()
 box.execute('SELECT 1 + 1;')
 ---
 - metadata:
-  - name: 1 + 1
+  - name: COLUMN_1
     type: integer
   rows:
   - [2]
@@ -303,7 +303,7 @@ box.execute('SELECT 1 + 1;')
 box.execute('SELECT 1 + 1.1;')
 ---
 - metadata:
-  - name: 1 + 1.1
+  - name: COLUMN_1
     type: double
   rows:
   - [2.1]
@@ -311,7 +311,7 @@ box.execute('SELECT 1 + 1.1;')
 box.execute('SELECT \'9223372036854\' + 1;')
 ---
 - metadata:
-  - name: '''9223372036854'' + 1'
+  - name: COLUMN_1
     type: integer
   rows:
   - [9223372036855]
@@ -320,7 +320,7 @@ box.execute('SELECT \'9223372036854\' + 1;')
 box.execute('SELECT ?', {true})
 ---
 - metadata:
-  - name: '?'
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -481,7 +481,7 @@ s:drop()
 box.execute("SELECT 18446744073709551615 > 18446744073709551614;")
 ---
 - metadata:
-  - name: 18446744073709551615 > 18446744073709551614
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -489,7 +489,7 @@ box.execute("SELECT 18446744073709551615 > 18446744073709551614;")
 box.execute("SELECT 18446744073709551615 > -9223372036854775808;")
 ---
 - metadata:
-  - name: 18446744073709551615 > -9223372036854775808
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -497,7 +497,7 @@ box.execute("SELECT 18446744073709551615 > -9223372036854775808;")
 box.execute("SELECT -1 < 18446744073709551615;")
 ---
 - metadata:
-  - name: -1 < 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -505,7 +505,7 @@ box.execute("SELECT -1 < 18446744073709551615;")
 box.execute("SELECT 1.5 < 18446744073709551615")
 ---
 - metadata:
-  - name: 1.5 < 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -513,7 +513,7 @@ box.execute("SELECT 1.5 < 18446744073709551615")
 box.execute("SELECT 1.5 > 18446744073709551615")
 ---
 - metadata:
-  - name: 1.5 > 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [false]
@@ -521,7 +521,7 @@ box.execute("SELECT 1.5 > 18446744073709551615")
 box.execute("SELECT 18446744073709551615 > 1.5")
 ---
 - metadata:
-  - name: 18446744073709551615 > 1.5
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -529,7 +529,7 @@ box.execute("SELECT 18446744073709551615 > 1.5")
 box.execute("SELECT 18446744073709551615 < 1.5")
 ---
 - metadata:
-  - name: 18446744073709551615 < 1.5
+  - name: COLUMN_1
     type: boolean
   rows:
   - [false]
@@ -537,7 +537,7 @@ box.execute("SELECT 18446744073709551615 < 1.5")
 box.execute("SELECT 18446744073709551615 = 18446744073709551615;")
 ---
 - metadata:
-  - name: 18446744073709551615 = 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -545,7 +545,7 @@ box.execute("SELECT 18446744073709551615 = 18446744073709551615;")
 box.execute("SELECT 18446744073709551615 > -9223372036854775808;")
 ---
 - metadata:
-  - name: 18446744073709551615 > -9223372036854775808
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -553,7 +553,7 @@ box.execute("SELECT 18446744073709551615 > -9223372036854775808;")
 box.execute("SELECT 18446744073709551615 < -9223372036854775808;")
 ---
 - metadata:
-  - name: 18446744073709551615 < -9223372036854775808
+  - name: COLUMN_1
     type: boolean
   rows:
   - [false]
@@ -561,7 +561,7 @@ box.execute("SELECT 18446744073709551615 < -9223372036854775808;")
 box.execute("SELECT -1 < 18446744073709551615;")
 ---
 - metadata:
-  - name: -1 < 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -569,7 +569,7 @@ box.execute("SELECT -1 < 18446744073709551615;")
 box.execute("SELECT -1 > 18446744073709551615;")
 ---
 - metadata:
-  - name: -1 > 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [false]
@@ -577,7 +577,7 @@ box.execute("SELECT -1 > 18446744073709551615;")
 box.execute("SELECT 18446744073709551610 - 18446744073709551615;")
 ---
 - metadata:
-  - name: 18446744073709551610 - 18446744073709551615
+  - name: COLUMN_1
     type: integer
   rows:
   - [-5]
@@ -585,7 +585,7 @@ box.execute("SELECT 18446744073709551610 - 18446744073709551615;")
 box.execute("SELECT 18446744073709551615 = null;")
 ---
 - metadata:
-  - name: 18446744073709551615 = null
+  - name: COLUMN_1
     type: boolean
   rows:
   - [null]
@@ -593,7 +593,7 @@ box.execute("SELECT 18446744073709551615 = null;")
 box.execute("SELECT 18446744073709551615 = 18446744073709551615.0;")
 ---
 - metadata:
-  - name: 18446744073709551615 = 18446744073709551615.0
+  - name: COLUMN_1
     type: boolean
   rows:
   - [false]
@@ -601,7 +601,7 @@ box.execute("SELECT 18446744073709551615 = 18446744073709551615.0;")
 box.execute("SELECT 18446744073709551615.0 > 18446744073709551615")
 ---
 - metadata:
-  - name: 18446744073709551615.0 > 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -609,7 +609,7 @@ box.execute("SELECT 18446744073709551615.0 > 18446744073709551615")
 box.execute("SELECT 18446744073709551615 IN ('18446744073709551615', 18446744073709551615.0)")
 ---
 - metadata:
-  - name: 18446744073709551615 IN ('18446744073709551615', 18446744073709551615.0)
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -617,7 +617,7 @@ box.execute("SELECT 18446744073709551615 IN ('18446744073709551615', 18446744073
 box.execute("SELECT 1 LIMIT 18446744073709551615;")
 ---
 - metadata:
-  - name: '1'
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -625,7 +625,7 @@ box.execute("SELECT 1 LIMIT 18446744073709551615;")
 box.execute("SELECT 1 LIMIT 1 OFFSET 18446744073709551614;")
 ---
 - metadata:
-  - name: '1'
+  - name: COLUMN_1
     type: integer
   rows: []
 ...
@@ -637,7 +637,7 @@ box.execute("SELECT CAST('18446744073' || '709551616' AS INTEGER);")
 box.execute("SELECT CAST('18446744073' || '709551615' AS INTEGER);")
 ---
 - metadata:
-  - name: CAST('18446744073' || '709551615' AS INTEGER)
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551615]
@@ -645,7 +645,7 @@ box.execute("SELECT CAST('18446744073' || '709551615' AS INTEGER);")
 box.execute("SELECT 18446744073709551610 + 5;")
 ---
 - metadata:
-  - name: 18446744073709551610 + 5
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551615]
@@ -653,7 +653,7 @@ box.execute("SELECT 18446744073709551610 + 5;")
 box.execute("SELECT 18446744073709551615 * 1;")
 ---
 - metadata:
-  - name: 18446744073709551615 * 1
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551615]
@@ -661,7 +661,7 @@ box.execute("SELECT 18446744073709551615 * 1;")
 box.execute("SELECT 1 / 18446744073709551615;")
 ---
 - metadata:
-  - name: 1 / 18446744073709551615
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -669,7 +669,7 @@ box.execute("SELECT 1 / 18446744073709551615;")
 box.execute("SELECT 18446744073709551615 / 18446744073709551615;")
 ---
 - metadata:
-  - name: 18446744073709551615 / 18446744073709551615
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -677,7 +677,7 @@ box.execute("SELECT 18446744073709551615 / 18446744073709551615;")
 box.execute("SELECT 18446744073709551615 / -9223372036854775808;")
 ---
 - metadata:
-  - name: 18446744073709551615 / -9223372036854775808
+  - name: COLUMN_1
     type: integer
   rows:
   - [-1]
@@ -771,7 +771,7 @@ box.execute("INSERT INTO t VALUES (2, -1);")
 box.execute("SELECT sum(i) FROM t;")
 ---
 - metadata:
-  - name: sum(i)
+  - name: COLUMN_1
     type: number
   rows:
   - [18446744073709551613]
@@ -779,7 +779,7 @@ box.execute("SELECT sum(i) FROM t;")
 box.execute("SELECT avg(i) FROM t;")
 ---
 - metadata:
-  - name: avg(i)
+  - name: COLUMN_1
     type: number
   rows:
   - [6148914691236516864]
@@ -787,7 +787,7 @@ box.execute("SELECT avg(i) FROM t;")
 box.execute("SELECT total(i) FROM t;")
 ---
 - metadata:
-  - name: total(i)
+  - name: COLUMN_1
     type: number
   rows:
   - [1.844674407371e+19]
@@ -795,7 +795,7 @@ box.execute("SELECT total(i) FROM t;")
 box.execute("SELECT min(i) FROM t;")
 ---
 - metadata:
-  - name: min(i)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [-1]
@@ -803,7 +803,7 @@ box.execute("SELECT min(i) FROM t;")
 box.execute("SELECT max(i) FROM t;")
 ---
 - metadata:
-  - name: max(i)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [18446744073709551613]
@@ -811,7 +811,7 @@ box.execute("SELECT max(i) FROM t;")
 box.execute("SELECT count(i) FROM t;")
 ---
 - metadata:
-  - name: count(i)
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -819,7 +819,7 @@ box.execute("SELECT count(i) FROM t;")
 box.execute("SELECT group_concat(i) FROM t;")
 ---
 - metadata:
-  - name: group_concat(i)
+  - name: COLUMN_1
     type: string
   rows:
   - ['1,-1,18446744073709551613']
@@ -831,7 +831,7 @@ box.execute("DELETE FROM t WHERE i < 18446744073709551613;")
 box.execute("SELECT lower(i) FROM t;")
 ---
 - metadata:
-  - name: lower(i)
+  - name: COLUMN_1
     type: string
   rows:
   - ['18446744073709551613']
@@ -839,7 +839,7 @@ box.execute("SELECT lower(i) FROM t;")
 box.execute("SELECT upper(i) FROM t;")
 ---
 - metadata:
-  - name: upper(i)
+  - name: COLUMN_1
     type: string
   rows:
   - ['18446744073709551613']
@@ -847,7 +847,7 @@ box.execute("SELECT upper(i) FROM t;")
 box.execute("SELECT abs(i) FROM t;")
 ---
 - metadata:
-  - name: abs(i)
+  - name: COLUMN_1
     type: number
   rows:
   - [18446744073709551613]
@@ -855,7 +855,7 @@ box.execute("SELECT abs(i) FROM t;")
 box.execute("SELECT typeof(i) FROM t;")
 ---
 - metadata:
-  - name: typeof(i)
+  - name: COLUMN_1
     type: string
   rows:
   - ['integer']
@@ -863,7 +863,7 @@ box.execute("SELECT typeof(i) FROM t;")
 box.execute("SELECT quote(i) FROM t;")
 ---
 - metadata:
-  - name: quote(i)
+  - name: COLUMN_1
     type: string
   rows:
   - [18446744073709551613]
@@ -871,7 +871,7 @@ box.execute("SELECT quote(i) FROM t;")
 box.execute("SELECT LEAST(-1, i) FROM t;")
 ---
 - metadata:
-  - name: LEAST(-1, i)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [-1]
@@ -879,7 +879,7 @@ box.execute("SELECT LEAST(-1, i) FROM t;")
 box.execute("SELECT quote(i) FROM t;")
 ---
 - metadata:
-  - name: quote(i)
+  - name: COLUMN_1
     type: string
   rows:
   - [18446744073709551613]
@@ -1012,7 +1012,7 @@ box.space.T1:drop()
 box.execute("SELECT CAST(18446744073709551615 AS NUMBER);")
 ---
 - metadata:
-  - name: CAST(18446744073709551615 AS NUMBER)
+  - name: COLUMN_1
     type: number
   rows:
   - [18446744073709551615]
@@ -1020,7 +1020,7 @@ box.execute("SELECT CAST(18446744073709551615 AS NUMBER);")
 box.execute("SELECT CAST(18446744073709551615 AS TEXT);")
 ---
 - metadata:
-  - name: CAST(18446744073709551615 AS TEXT)
+  - name: COLUMN_1
     type: string
   rows:
   - ['18446744073709551615']
@@ -1028,7 +1028,7 @@ box.execute("SELECT CAST(18446744073709551615 AS TEXT);")
 box.execute("SELECT CAST(18446744073709551615 AS SCALAR);")
 ---
 - metadata:
-  - name: CAST(18446744073709551615 AS SCALAR)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [18446744073709551615]
@@ -1036,7 +1036,7 @@ box.execute("SELECT CAST(18446744073709551615 AS SCALAR);")
 box.execute("SELECT CAST(18446744073709551615 AS BOOLEAN);")
 ---
 - metadata:
-  - name: CAST(18446744073709551615 AS BOOLEAN)
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -1044,7 +1044,7 @@ box.execute("SELECT CAST(18446744073709551615 AS BOOLEAN);")
 box.execute("SELECT CAST('18446744073709551615' AS INTEGER);")
 ---
 - metadata:
-  - name: CAST('18446744073709551615' AS INTEGER)
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551615]
@@ -1077,7 +1077,7 @@ box.execute("SELECT id FROM t1;")
 box.execute("SELECT CAST(123 AS UNSIGNED);")
 ---
 - metadata:
-  - name: CAST(123 AS UNSIGNED)
+  - name: COLUMN_1
     type: unsigned
   rows:
   - [123]
@@ -1090,7 +1090,7 @@ box.execute("SELECT CAST(-123 AS UNSIGNED);")
 box.execute("SELECT CAST(1.5 AS UNSIGNED);")
 ---
 - metadata:
-  - name: CAST(1.5 AS UNSIGNED)
+  - name: COLUMN_1
     type: unsigned
   rows:
   - [1]
@@ -1098,7 +1098,7 @@ box.execute("SELECT CAST(1.5 AS UNSIGNED);")
 box.execute("SELECT CAST(-1.5 AS UNSIGNED);")
 ---
 - metadata:
-  - name: CAST(-1.5 AS UNSIGNED)
+  - name: COLUMN_1
     type: unsigned
   rows:
   - [-1]
@@ -1106,7 +1106,7 @@ box.execute("SELECT CAST(-1.5 AS UNSIGNED);")
 box.execute("SELECT CAST(true AS UNSIGNED);")
 ---
 - metadata:
-  - name: CAST(true AS UNSIGNED)
+  - name: COLUMN_1
     type: unsigned
   rows:
   - [1]
@@ -1114,7 +1114,7 @@ box.execute("SELECT CAST(true AS UNSIGNED);")
 box.execute("SELECT CAST('123' AS UNSIGNED);")
 ---
 - metadata:
-  - name: CAST('123' AS UNSIGNED)
+  - name: COLUMN_1
     type: unsigned
   rows:
   - [123]
@@ -1146,7 +1146,7 @@ box.space.T:drop()
 box.execute("SELECT CASE 1 WHEN 1 THEN x'0000000000' WHEN 2 THEN 'str' END")
 ---
 - metadata:
-  - name: CASE 1 WHEN 1 THEN x'0000000000' WHEN 2 THEN 'str' END
+  - name: COLUMN_1
     type: scalar
   rows:
   - ["\0\0\0\0\0"]
@@ -1154,7 +1154,7 @@ box.execute("SELECT CASE 1 WHEN 1 THEN x'0000000000' WHEN 2 THEN 'str' END")
 box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 END")
 ---
 - metadata:
-  - name: CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 END
+  - name: COLUMN_1
     type: integer
   rows:
   - [666]
@@ -1162,7 +1162,7 @@ box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 END")
 box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 ELSE 321 END")
 ---
 - metadata:
-  - name: CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 ELSE 321 END
+  - name: COLUMN_1
     type: integer
   rows:
   - [666]
@@ -1170,7 +1170,7 @@ box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 ELSE 321 END")
 box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 ELSE 'asd' END")
 ---
 - metadata:
-  - name: CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 ELSE 'asd' END
+  - name: COLUMN_1
     type: scalar
   rows:
   - [666]
@@ -1178,8 +1178,7 @@ box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 ELSE 'asd' END")
 box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4 WHEN 'e' THEN 5 WHEN 'f' THEN 6 END;")
 ---
 - metadata:
-  - name: CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4
-      WHEN 'e' THEN 5 WHEN 'f' THEN 6 END
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -1187,8 +1186,7 @@ box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHE
 box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4 WHEN 'e' THEN 5 WHEN 'f' THEN 'asd' END;")
 ---
 - metadata:
-  - name: CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4
-      WHEN 'e' THEN 5 WHEN 'f' THEN 'asd' END
+  - name: COLUMN_1
     type: scalar
   rows:
   - [1]
@@ -1196,8 +1194,7 @@ box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHE
 box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4 WHEN 'e' THEN 5 WHEN 'f' THEN 6 ELSE 'asd' END;")
 ---
 - metadata:
-  - name: CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4
-      WHEN 'e' THEN 5 WHEN 'f' THEN 6 ELSE 'asd' END
+  - name: COLUMN_1
     type: scalar
   rows:
   - [1]
@@ -1205,8 +1202,7 @@ box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHE
 box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4 WHEN 'e' THEN 5 WHEN 'f' THEN 6 ELSE 7 END;")
 ---
 - metadata:
-  - name: CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4
-      WHEN 'e' THEN 5 WHEN 'f' THEN 6 ELSE 7 END
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -1284,7 +1280,7 @@ box.execute("SELECT total(v) FROM t;")
 box.execute("SELECT min(v) FROM t;")
 ---
 - metadata:
-  - name: min(v)
+  - name: COLUMN_1
     type: scalar
   rows:
   - ['abc']
@@ -1292,7 +1288,7 @@ box.execute("SELECT min(v) FROM t;")
 box.execute("SELECT max(v) FROM t;")
 ---
 - metadata:
-  - name: max(v)
+  - name: COLUMN_1
     type: scalar
   rows:
   - ['abc']
@@ -1300,7 +1296,7 @@ box.execute("SELECT max(v) FROM t;")
 box.execute("SELECT count(v) FROM t;")
 ---
 - metadata:
-  - name: count(v)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -1308,7 +1304,7 @@ box.execute("SELECT count(v) FROM t;")
 box.execute("SELECT group_concat(v) FROM t;")
 ---
 - metadata:
-  - name: group_concat(v)
+  - name: COLUMN_1
     type: string
   rows:
   - ['abc']
@@ -1331,7 +1327,7 @@ box.execute("SELECT abs(v) FROM t;")
 box.execute("SELECT typeof(v) FROM t;")
 ---
 - metadata:
-  - name: typeof(v)
+  - name: COLUMN_1
     type: string
   rows:
   - ['varbinary']
@@ -1339,7 +1335,7 @@ box.execute("SELECT typeof(v) FROM t;")
 box.execute("SELECT quote(v) FROM t;")
 ---
 - metadata:
-  - name: quote(v)
+  - name: COLUMN_1
     type: string
   rows:
   - ['X''616263''']
@@ -1347,7 +1343,7 @@ box.execute("SELECT quote(v) FROM t;")
 box.execute("SELECT LEAST(v, x'') FROM t;")
 ---
 - metadata:
-  - name: LEAST(v, x'')
+  - name: COLUMN_1
     type: scalar
   rows:
   - ['']
@@ -1467,7 +1463,7 @@ box.execute("SELECT CAST(true AS VARBINARY);")
 box.execute("SELECT CAST('asd' AS VARBINARY);")
 ---
 - metadata:
-  - name: CAST('asd' AS VARBINARY)
+  - name: COLUMN_1
     type: varbinary
   rows:
   - ['asd']
@@ -1475,7 +1471,7 @@ box.execute("SELECT CAST('asd' AS VARBINARY);")
 box.execute("SELECT CAST(x'' AS VARBINARY);")
 ---
 - metadata:
-  - name: CAST(x'' AS VARBINARY)
+  - name: COLUMN_1
     type: varbinary
   rows:
   - ['']
@@ -1494,9 +1490,9 @@ box.execute("INSERT INTO t VALUES (1, 1, 1), (2, NULL, NULL);")
 box.execute("SELECT typeof(a), typeof(s) FROM t;")
 ---
 - metadata:
-  - name: typeof(a)
+  - name: COLUMN_1
     type: string
-  - name: typeof(s)
+  - name: COLUMN_2
     type: string
   rows:
   - ['integer', 'integer']
@@ -1513,7 +1509,7 @@ box.execute('INSERT INTO t1 VALUES (1, NULL, NULL);')
 box.execute('SELECT typeof(a & b) FROM t1;')
 ---
 - metadata:
-  - name: typeof(a & b)
+  - name: COLUMN_1
     type: string
   rows:
   - ['integer']
@@ -1521,11 +1517,11 @@ box.execute('SELECT typeof(a & b) FROM t1;')
 box.execute('SELECT typeof(a), typeof(b), typeof(a & b) FROM t1')
 ---
 - metadata:
-  - name: typeof(a)
+  - name: COLUMN_1
     type: string
-  - name: typeof(b)
+  - name: COLUMN_2
     type: string
-  - name: typeof(a & b)
+  - name: COLUMN_3
     type: string
   rows:
   - ['integer', 'integer', 'integer']
@@ -1533,7 +1529,7 @@ box.execute('SELECT typeof(a), typeof(b), typeof(a & b) FROM t1')
 box.execute("SELECT typeof(CAST(0 AS UNSIGNED));")
 ---
 - metadata:
-  - name: typeof(CAST(0 AS UNSIGNED))
+  - name: COLUMN_1
     type: string
   rows:
   - ['unsigned']
@@ -1693,7 +1689,7 @@ box.execute('DROP TABLE t1;')
 box.execute("SELECT 1.0;")
 ---
 - metadata:
-  - name: '1.0'
+  - name: COLUMN_1
     type: double
   rows:
   - [1]
@@ -1701,7 +1697,7 @@ box.execute("SELECT 1.0;")
 box.execute("SELECT .01;")
 ---
 - metadata:
-  - name: '.01'
+  - name: COLUMN_1
     type: double
   rows:
   - [0.01]
@@ -1709,7 +1705,7 @@ box.execute("SELECT .01;")
 box.execute("SELECT CAST(1 AS DOUBLE);")
 ---
 - metadata:
-  - name: CAST(1 AS DOUBLE)
+  - name: COLUMN_1
     type: double
   rows:
   - [1]
@@ -1717,7 +1713,7 @@ box.execute("SELECT CAST(1 AS DOUBLE);")
 box.execute("SELECT CAST(1.123 AS DOUBLE);")
 ---
 - metadata:
-  - name: CAST(1.123 AS DOUBLE)
+  - name: COLUMN_1
     type: double
   rows:
   - [1.123]
@@ -1735,7 +1731,7 @@ box.execute("SELECT CAST('asd' AS DOUBLE);")
 box.execute("SELECT CAST('1' AS DOUBLE);")
 ---
 - metadata:
-  - name: CAST('1' AS DOUBLE)
+  - name: COLUMN_1
     type: double
   rows:
   - [1]
@@ -1743,7 +1739,7 @@ box.execute("SELECT CAST('1' AS DOUBLE);")
 box.execute("SELECT CAST('1.123' AS DOUBLE);")
 ---
 - metadata:
-  - name: CAST('1.123' AS DOUBLE)
+  - name: COLUMN_1
     type: double
   rows:
   - [1.123]
@@ -1761,7 +1757,7 @@ box.execute("SELECT CAST(x'35' AS DOUBLE);")
 box.execute("SELECT CAST(CAST(x'35' AS STRING) AS DOUBLE);")
 ---
 - metadata:
-  - name: CAST(CAST(x'35' AS STRING) AS DOUBLE)
+  - name: COLUMN_1
     type: double
   rows:
   - [5]
@@ -1795,7 +1791,7 @@ box.execute('SELECT * FROM t;')
 box.execute('SELECT d / 100 FROM t;')
 ---
 - metadata:
-  - name: d / 100
+  - name: COLUMN_1
     type: double
   rows:
   - [0.1]
@@ -1828,7 +1824,7 @@ box.execute('SELECT * from t WHERE d = 3.3;')
 box.execute("SELECT sum(d) FROM t;")
 ---
 - metadata:
-  - name: sum(d)
+  - name: COLUMN_1
     type: number
   rows:
   - [18000000000000000000]
@@ -1836,7 +1832,7 @@ box.execute("SELECT sum(d) FROM t;")
 box.execute("SELECT avg(d) FROM t;")
 ---
 - metadata:
-  - name: avg(d)
+  - name: COLUMN_1
     type: number
   rows:
   - [4500000000000000000]
@@ -1844,7 +1840,7 @@ box.execute("SELECT avg(d) FROM t;")
 box.execute("SELECT total(d) FROM t;")
 ---
 - metadata:
-  - name: total(d)
+  - name: COLUMN_1
     type: number
   rows:
   - [18000000000000000000]
@@ -1852,7 +1848,7 @@ box.execute("SELECT total(d) FROM t;")
 box.execute("SELECT min(d) FROM t;")
 ---
 - metadata:
-  - name: min(d)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [-2]
@@ -1860,7 +1856,7 @@ box.execute("SELECT min(d) FROM t;")
 box.execute("SELECT max(d) FROM t;")
 ---
 - metadata:
-  - name: max(d)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [18000000000000000000]
@@ -1868,7 +1864,7 @@ box.execute("SELECT max(d) FROM t;")
 box.execute("SELECT count(d) FROM t;")
 ---
 - metadata:
-  - name: count(d)
+  - name: COLUMN_1
     type: integer
   rows:
   - [4]
@@ -1876,7 +1872,7 @@ box.execute("SELECT count(d) FROM t;")
 box.execute("SELECT group_concat(d) FROM t;")
 ---
 - metadata:
-  - name: group_concat(d)
+  - name: COLUMN_1
     type: string
   rows:
   - ['10.0,-2.0,3.3,1.8e+19']
@@ -1884,7 +1880,7 @@ box.execute("SELECT group_concat(d) FROM t;")
 box.execute("SELECT lower(d) FROM t;")
 ---
 - metadata:
-  - name: lower(d)
+  - name: COLUMN_1
     type: string
   rows:
   - ['10.0']
@@ -1895,7 +1891,7 @@ box.execute("SELECT lower(d) FROM t;")
 box.execute("SELECT upper(d) FROM t;")
 ---
 - metadata:
-  - name: upper(d)
+  - name: COLUMN_1
     type: string
   rows:
   - ['10.0']
@@ -1906,7 +1902,7 @@ box.execute("SELECT upper(d) FROM t;")
 box.execute("SELECT abs(d) FROM t;")
 ---
 - metadata:
-  - name: abs(d)
+  - name: COLUMN_1
     type: number
   rows:
   - [10]
@@ -1917,7 +1913,7 @@ box.execute("SELECT abs(d) FROM t;")
 box.execute("SELECT typeof(d) FROM t;")
 ---
 - metadata:
-  - name: typeof(d)
+  - name: COLUMN_1
     type: string
   rows:
   - ['double']
@@ -1928,7 +1924,7 @@ box.execute("SELECT typeof(d) FROM t;")
 box.execute("SELECT quote(d) FROM t;")
 ---
 - metadata:
-  - name: quote(d)
+  - name: COLUMN_1
     type: string
   rows:
   - ['10.0']
@@ -1939,7 +1935,7 @@ box.execute("SELECT quote(d) FROM t;")
 box.execute("SELECT LEAST(d, 0) FROM t;")
 ---
 - metadata:
-  - name: LEAST(d, 0)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [0]
@@ -2081,9 +2077,9 @@ box.execute("DROP TABLE t4;")
 box.execute("SELECT 1.0, typeof(1.0);")
 ---
 - metadata:
-  - name: '1.0'
+  - name: COLUMN_1
     type: double
-  - name: typeof(1.0)
+  - name: COLUMN_2
     type: string
   rows:
   - [1, 'double']
@@ -2091,9 +2087,9 @@ box.execute("SELECT 1.0, typeof(1.0);")
 box.execute("SELECT CAST(2 AS DOUBLE), typeof(CAST(2 AS DOUBLE));")
 ---
 - metadata:
-  - name: CAST(2 AS DOUBLE)
+  - name: COLUMN_1
     type: double
-  - name: typeof(CAST(2 AS DOUBLE))
+  - name: COLUMN_2
     type: string
   rows:
   - [2, 'double']
@@ -2101,9 +2097,9 @@ box.execute("SELECT CAST(2 AS DOUBLE), typeof(CAST(2 AS DOUBLE));")
 box.execute("SELECT 3e3, typeof(3e3);")
 ---
 - metadata:
-  - name: '3e3'
+  - name: COLUMN_1
     type: double
-  - name: typeof(3e3)
+  - name: COLUMN_2
     type: string
   rows:
   - [3000, 'double']
@@ -2121,7 +2117,7 @@ box.execute("SELECT d, TYPEOF(d) FROM t5;")
 - metadata:
   - name: D
     type: double
-  - name: TYPEOF(d)
+  - name: COLUMN_1
     type: string
   rows:
   - [4, 'double']

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Tarantool-patches] [PATCH v3 1/2] sql: use unify pattern for column names
  2020-07-01 12:45                     ` Roman Khabibov
@ 2020-07-01 21:25                       ` Vladislav Shpilevoy
  2020-07-02 15:55                         ` Roman Khabibov
  0 siblings, 1 reply; 20+ messages in thread
From: Vladislav Shpilevoy @ 2020-07-01 21:25 UTC (permalink / raw)
  To: Roman Khabibov; +Cc: tarantool-patches

>>> +test:do_execsql2_test(
>>> +    "colname-12.5",
>>> +    [[
>>> +        CREATE TABLE j (s1 SCALAR PRIMARY KEY);
>>> +        INSERT INTO j VALUES(1);
>>> +    ]], {})
>>> +
>>> +--
>>> +-- Column named as 'COLUMN_1', because 's1 + 1' is a expression.
>>> +--
>>> +test:do_execsql2_test(
>>> +    "colname-12.6",
>>> +    [[
>>> +        SELECT s1 + 1 FROM j;
>>> +    ]], {
>>> +        "COLUMN_1",2
>>> +    })
>>> +
>>> +test:do_execsql2_test(
>>> +    "colname-12.7",
>>> +    [[
>>> +        SELECT s1 + 1 FROM j ORDER BY column_1;
>>> +    ]], {
>>> +        "COLUMN_1",2
>>> +    })
>>> +
>>> +test:do_execsql2_test(
>>> +    "colname-12.8",
>>> +    [[
>>> +        SELECT * FROM (SELECT s1 + 1 FROM j
>>> +                       ORDER BY column_1) ORDER BY column_1;
>>> +    ]], {
>>> +        "COLUMN_1",2
>>> +    })
>>> +
>>> +test:do_execsql2_test(
>>> +    "colname-12.9",
>>> +    [[
>>> +        SELECT s1 + 1 FROM j GROUP BY column_1;
>>> +    ]], {
>>> +        "COLUMN_1",2
>>> +    })
>>> +
>>> +test:do_execsql2_test(
>>> +    "colname-12.10",
>>> +    [[
>>> +        SELECT * FROM (SELECT s1 + 1 FROM j
>>> +                       ORDER BY column_1) GROUP BY column_1;
>>> +    ]], {
>>> +        "COLUMN_1",2
>>> +    })
>>> +
>>> +test:do_execsql2_test(
>>> +    "colname-12.11",
>>> +    [[
>>> +        SELECT * FROM (SELECT s1 + 1 FROM j
>>> +                       ORDER BY column_1) WHERE column_1 = 2;
>>> +    ]], {
>>> +        "COLUMN_1",2
>>> +    })
>>> +
>>> +test:do_execsql2_test(
>>> +    "colname-12.12",
>>> +    [[
>>> +        SELECT *, s1 + 1 FROM j ORDER BY column_1;
>>> +    ]], {
>>> +        "S1",1,"COLUMN_1",2
>>> +    })
>>> +
>>> +test:do_execsql2_test(
>>> +    "colname-12.13",
>>> +    [[
>>> +        SELECT s1 + 1, * FROM j ORDER BY column_1;
>>> +    ]], {
>>> +        "COLUMN_1",2,"S1",1
>>> +    })
>>> +
>>> +test:do_execsql2_test(
>>> +    "colname-12.14",
>>> +    [[
>>> +        CREATE TABLE j_1 (column_1 SCALAR PRIMARY KEY, column_2 SCALAR);
>>> +        INSERT INTO j_1 VALUES(1, 1);
>>> +    ]], {})
>>> +
>>> +test:do_execsql2_test(
>>> +    "colname-12.15",
>>> +    [[
>>> +        SELECT column_1, column_1 + 1, column_2, 2 FROM j_1;
>>> +    ]], {
>>> +        "COLUMN_1",1,"COLUMN_1",2,"COLUMN_2",1,"COLUMN_2",2
>>> +    })
>>> +
>>
>> Is there a test on how ORDER BY selects a column?
> Did you mean this? If it is not a bug,  we should document that, because
> because this is not obvious behavior, IMO.

Yes, I mean this. It does not depend on whether this is a bug. If
something is a bug, or is not documented, it does not mean it
shouldn't be tested.

You can add this to the doc request.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Tarantool-patches] [PATCH v3 1/2] sql: use unify pattern for column names
  2020-07-01 21:25                       ` Vladislav Shpilevoy
@ 2020-07-02 15:55                         ` Roman Khabibov
  0 siblings, 0 replies; 20+ messages in thread
From: Roman Khabibov @ 2020-07-02 15:55 UTC (permalink / raw)
  To: Nikita Pettik; +Cc: tarantool-patches, Vladislav Shpilevoy

Hi! Thanks for the review. I will do it later separately.

Nikita, could you, please, see the patch?

> On Jul 2, 2020, at 00:25, Vladislav Shpilevoy <v.shpilevoy@tarantool.org> wrote:
> 
>>>> +test:do_execsql2_test(
>>>> +    "colname-12.5",
>>>> +    [[
>>>> +        CREATE TABLE j (s1 SCALAR PRIMARY KEY);
>>>> +        INSERT INTO j VALUES(1);
>>>> +    ]], {})
>>>> +
>>>> +--
>>>> +-- Column named as 'COLUMN_1', because 's1 + 1' is a expression.
>>>> +--
>>>> +test:do_execsql2_test(
>>>> +    "colname-12.6",
>>>> +    [[
>>>> +        SELECT s1 + 1 FROM j;
>>>> +    ]], {
>>>> +        "COLUMN_1",2
>>>> +    })
>>>> +
>>>> +test:do_execsql2_test(
>>>> +    "colname-12.7",
>>>> +    [[
>>>> +        SELECT s1 + 1 FROM j ORDER BY column_1;
>>>> +    ]], {
>>>> +        "COLUMN_1",2
>>>> +    })
>>>> +
>>>> +test:do_execsql2_test(
>>>> +    "colname-12.8",
>>>> +    [[
>>>> +        SELECT * FROM (SELECT s1 + 1 FROM j
>>>> +                       ORDER BY column_1) ORDER BY column_1;
>>>> +    ]], {
>>>> +        "COLUMN_1",2
>>>> +    })
>>>> +
>>>> +test:do_execsql2_test(
>>>> +    "colname-12.9",
>>>> +    [[
>>>> +        SELECT s1 + 1 FROM j GROUP BY column_1;
>>>> +    ]], {
>>>> +        "COLUMN_1",2
>>>> +    })
>>>> +
>>>> +test:do_execsql2_test(
>>>> +    "colname-12.10",
>>>> +    [[
>>>> +        SELECT * FROM (SELECT s1 + 1 FROM j
>>>> +                       ORDER BY column_1) GROUP BY column_1;
>>>> +    ]], {
>>>> +        "COLUMN_1",2
>>>> +    })
>>>> +
>>>> +test:do_execsql2_test(
>>>> +    "colname-12.11",
>>>> +    [[
>>>> +        SELECT * FROM (SELECT s1 + 1 FROM j
>>>> +                       ORDER BY column_1) WHERE column_1 = 2;
>>>> +    ]], {
>>>> +        "COLUMN_1",2
>>>> +    })
>>>> +
>>>> +test:do_execsql2_test(
>>>> +    "colname-12.12",
>>>> +    [[
>>>> +        SELECT *, s1 + 1 FROM j ORDER BY column_1;
>>>> +    ]], {
>>>> +        "S1",1,"COLUMN_1",2
>>>> +    })
>>>> +
>>>> +test:do_execsql2_test(
>>>> +    "colname-12.13",
>>>> +    [[
>>>> +        SELECT s1 + 1, * FROM j ORDER BY column_1;
>>>> +    ]], {
>>>> +        "COLUMN_1",2,"S1",1
>>>> +    })
>>>> +
>>>> +test:do_execsql2_test(
>>>> +    "colname-12.14",
>>>> +    [[
>>>> +        CREATE TABLE j_1 (column_1 SCALAR PRIMARY KEY, column_2 SCALAR);
>>>> +        INSERT INTO j_1 VALUES(1, 1);
>>>> +    ]], {})
>>>> +
>>>> +test:do_execsql2_test(
>>>> +    "colname-12.15",
>>>> +    [[
>>>> +        SELECT column_1, column_1 + 1, column_2, 2 FROM j_1;
>>>> +    ]], {
>>>> +        "COLUMN_1",1,"COLUMN_1",2,"COLUMN_2",1,"COLUMN_2",2
>>>> +    })
>>>> +
>>> 
>>> Is there a test on how ORDER BY selects a column?
>> Did you mean this? If it is not a bug,  we should document that, because
>> because this is not obvious behavior, IMO.
> 
> Yes, I mean this. It does not depend on whether this is a bug. If
> something is a bug, or is not documented, it does not mean it
> shouldn't be tested.
> 
> You can add this to the doc request.

commit 88a84a138550012a8e8476a33deb09b51d0eccba
Author: Roman Khabibov <roman.habibov@tarantool.org>
Date:   Thu Mar 5 12:48:58 2020 +0300

    sql: unify pattern for column names
    
    Name resulting columns generated by an expression or <VALUES>
    construction by the "COLUMN_N" pattern.
    
    Closes #3962
    
    @TarantoolBot document
    Title: Column naming in SQL
    
    Now, every auto generated column is named by the "COLUMN_N"
    pattern, where N is the number of generated column in a query
    (starting  from 1). Auto generated column is a column in a query
    result generated by an expression or a column from <VALUES>
    construction.
    
    Examples:
    ```
    box.execute("VALUES(1, 2, 3);")
    ---
    - metadata:
      - name: COLUMN_1
        type: integer
      - name: COLUMN_2
        type: integer
      - name: COLUMN_3
        type: integer
      rows:
      - [1, 2, 3]
    ...
    box.execute("SELECT * FROM (VALUES (1+1, 1+1));")
    ---
    - metadata:
      - name: COLUMN_1
        type: integer
      - name: COLUMN_2
        type: integer
      rows:
      - [2, 2]
    ...
    box.execute("SELECT 1+1, 1+1;")
    ---
    - metadata:
      - name: COLUMN_1
        type: integer
      - name: COLUMN_2
        type: integer
      rows:
      - [2, 2]
    ...
    ```
    
    Here, the expression "mycol + 1" generates a new column, so that
    it is the first auto generated resulting column will be named as
    "COLUMN_1".
    ```
    tarantool> CREATE TABLE test (mycol INT PRIMARY KEY);
    ---
    - row_count: 1
    ...
    
    tarantool> SELECT mycol, mycol + 1 FROM test;
    ---
    - metadata:
      - name: MYCOL
        type: integer
      - name: COLUMN_1
        type: integer
      rows: []
    ...
    ```
    Note that you can use generated names already within the query,
    e.g. in <ORDER BY> clause.
    ```
    tarantool> SELECT mycol, mycol + 1 FROM test ORDER BY column_1;
    ---
    - metadata:
      - name: MYCOL
        type: integer
      - name: COLUMN_1
        type: integer
      rows: []
    ...
    ```
    
    It should also be noted that if you use column names similar to
    the "COLUMN_N" pattern, you can get the same names as a result:
    
    ```
    tarantool> CREATE TABLE test (column_1 SCALAR PRIMARY KEY);
    ---
    - row_count: 1
    ...
    
    tarantool> INSERT INTO test VALUES(1);
    ---
    - row_count: 1
    ...
    
    tarantool> SELECT column_1, column_1 + 1 FROM test;
    ---
    - metadata:
      - name: COLUMN_1
        type: scalar
      - name: COLUMN_1
        type: scalar
      rows:
      - [1, 2]
    ...
    ```

diff --git a/src/box/sql/select.c b/src/box/sql/select.c
index 4b069addb..26c735ed7 100644
--- a/src/box/sql/select.c
+++ b/src/box/sql/select.c
@@ -1854,14 +1854,14 @@ generate_column_metadata(struct Parse *pParse, struct SrcList *pTabList,
 			}
 		} else {
 			const char *z = NULL;
-			if (colname != NULL)
+			if (colname != NULL) {
 				z = colname;
-			else if (span != NULL)
-				z = span;
-			else
-				z = tt_sprintf("column%d", i + 1);
+			} else {
+				uint32_t idx = ++pParse->autoname_i;
+				z = sql_generate_column_name(idx);
+			}
 			vdbe_metadata_set_col_name(v, i, z);
-			if (is_full_meta && colname != NULL)
+			if (is_full_meta)
 				vdbe_metadata_set_col_span(v, i, span);
 		}
 	}
@@ -1897,7 +1897,6 @@ sqlColumnsFromExprList(Parse * parse, ExprList * expr_list,
 	/* Database connection */
 	sql *db = parse->db;
 	u32 cnt;		/* Index added to make the name unique */
-	Expr *p;		/* Expression for a single result column */
 	char *zName;		/* Column name */
 	int nName;		/* Size of name in zName[] */
 	Hash ht;		/* Hash table of column names */
@@ -1929,13 +1928,12 @@ sqlColumnsFromExprList(Parse * parse, ExprList * expr_list,
 	space_def->field_count = column_count;
 
 	for (uint32_t i = 0; i < column_count; i++) {
-		/* Get an appropriate name for the column
+		/*
+		 * Check if the column contains an "AS <name>"
+		 * phrase.
 		 */
-		p = sqlExprSkipCollate(expr_list->a[i].pExpr);
-		if ((zName = expr_list->a[i].zName) != 0) {
-			/* If the column contains an "AS <name>" phrase, use <name> as the name */
-		} else {
-			Expr *pColExpr = p;	/* The expression that is the result column name */
+		if ((zName = expr_list->a[i].zName) == 0) {
+			struct Expr *pColExpr = expr_list->a[i].pExpr;
 			struct space_def *space_def = NULL;
 			while (pColExpr->op == TK_DOT) {
 				pColExpr = pColExpr->pRight;
@@ -1951,14 +1949,14 @@ sqlColumnsFromExprList(Parse * parse, ExprList * expr_list,
 			} else if (pColExpr->op == TK_ID) {
 				assert(!ExprHasProperty(pColExpr, EP_IntValue));
 				zName = pColExpr->u.zToken;
-			} else {
-				/* Use the original text of the column expression as its name */
-				zName = expr_list->a[i].zSpan;
 			}
 		}
-		if (zName == NULL)
-			zName = "_auto_field_";
-		zName = sqlMPrintf(db, "%s", zName);
+		if (zName == NULL) {
+			uint32_t idx = ++parse->autoname_i;
+			zName = sqlDbStrDup(db, sql_generate_column_name(idx));
+		} else {
+			zName = sqlDbStrDup(db, zName);
+		}
 
 		/* Make sure the column name is unique.  If the name is not unique,
 		 * append an integer to the name so that it becomes unique.
@@ -4792,6 +4790,24 @@ selectPopWith(Walker * pWalker, Select * p)
 	}
 }
 
+/**
+ * Determine whether to generate a name for @a expr or not.
+ *
+ * Auto generated names is needed for every item in  a <SELECT>
+ * expression list except asterisks, dots and column names (also
+ * if this item hasn't alias).
+ *
+ * @param expr Expression from expression list to analyze.
+ *
+ * @retval true/false If item is/isn't needed needed to name.
+ */
+static bool
+is_needed_to_name(struct Expr *expr)
+{
+	return (expr->op != TK_ASTERISK && expr->op != TK_DOT && expr->op !=
+		TK_ID);
+}
+
 /*
  * This routine is a Walker callback for "expanding" a SELECT statement.
  * "Expanding" means to do the following:
@@ -4941,19 +4957,26 @@ selectExpander(Walker * pWalker, Select * p)
 	 * all tables.
 	 *
 	 * The first loop just checks to see if there are any "*" operators
-	 * that need expanding.
+	 * that need expanding and names items of the expression
+	 * list if needed.
 	 */
+	bool has_asterisk = false;
 	for (k = 0; k < pEList->nExpr; k++) {
 		pE = pEList->a[k].pExpr;
 		if (pE->op == TK_ASTERISK)
-			break;
+			has_asterisk = true;
 		assert(pE->op != TK_DOT || pE->pRight != 0);
 		assert(pE->op != TK_DOT
 		       || (pE->pLeft != 0 && pE->pLeft->op == TK_ID));
 		if (pE->op == TK_DOT && pE->pRight->op == TK_ASTERISK)
-			break;
+			has_asterisk = true;
+		if (pEList->a[k].zName == NULL && is_needed_to_name(pE)) {
+			uint32_t idx = ++pParse->autoname_i;
+			pEList->a[k].zName =
+				sqlDbStrDup(db, sql_generate_column_name(idx));
+		}
 	}
-	if (k < pEList->nExpr) {
+	if (has_asterisk) {
 		/*
 		 * If we get here it means the result set contains one or more "*"
 		 * operators that need to be expanded.  Loop through each expression
diff --git a/src/box/sql/sqlInt.h b/src/box/sql/sqlInt.h
index 37283e506..adf90d824 100644
--- a/src/box/sql/sqlInt.h
+++ b/src/box/sql/sqlInt.h
@@ -2227,6 +2227,8 @@ struct Parse {
 	TriggerPrg *pTriggerPrg;	/* Linked list of coded triggers */
 	With *pWith;		/* Current WITH clause, or NULL */
 	With *pWithToFree;	/* Free this WITH object at the end of the parse */
+	/** Index of previous auto generated name. */
+	uint32_t autoname_i;
 	/** Space triggers are being coded for. */
 	struct space *triggered_space;
 	/**
@@ -4530,4 +4532,17 @@ void
 sql_setting_set(struct Parse *parse_context, struct Token *name,
 		struct Expr *value);
 
+/**
+ * Return a string of the form "COLUMN_N", where N is @a number.
+ *
+ * We decided to name every auto generated column in output by
+ * this pattern (like PostgreSQL), because it is more convenient
+ * than "_auto_name_" and naming with span like MariaDB do.
+ */
+static inline const char *
+sql_generate_column_name(uint32_t number)
+{
+	return tt_sprintf("COLUMN_%d", number);
+}
+
 #endif				/* sqlINT_H */
diff --git a/test/box/function1.result b/test/box/function1.result
index 905a4cdab..928cd5758 100644
--- a/test/box/function1.result
+++ b/test/box/function1.result
@@ -449,7 +449,7 @@ box.execute('SELECT "function1.divide"(6, 3, 3)')
 box.execute('SELECT "function1.divide"(6, 3)')
 ---
 - metadata:
-  - name: '"function1.divide"(6, 3)'
+  - name: COLUMN_1
     type: number
   rows:
   - [2]
@@ -457,7 +457,7 @@ box.execute('SELECT "function1.divide"(6, 3)')
 box.execute('SELECT "function1.divide"(5, 2)')
 ---
 - metadata:
-  - name: '"function1.divide"(5, 2)'
+  - name: COLUMN_1
     type: number
   rows:
   - [2.5]
@@ -482,7 +482,7 @@ test_run:cmd("setopt delimiter ''");
 box.execute('SELECT summarize(1, 2)')
 ---
 - metadata:
-  - name: summarize(1, 2)
+  - name: COLUMN_1
     type: number
   rows:
   - [3]
@@ -505,7 +505,7 @@ test_run:cmd("setopt delimiter ''");
 box.execute('SELECT summarize(1, 2)')
 ---
 - metadata:
-  - name: summarize(1, 2)
+  - name: COLUMN_1
     type: number
   rows:
   - [3]
@@ -519,7 +519,7 @@ box.func.SUMMARIZE:drop()
 box.execute('SELECT lua(\'return 1 + 1\')')
 ---
 - metadata:
-  - name: lua('return 1 + 1')
+  - name: COLUMN_1
     type: any
   rows:
   - [2]
@@ -537,7 +537,7 @@ box.execute('SELECT lua(\'return box.cfg()\')')
 box.execute('SELECT lua(\'return box.cfg.memtx_memory\')')
 ---
 - metadata:
-  - name: lua('return box.cfg.memtx_memory')
+  - name: COLUMN_1
     type: any
   rows:
   - [107374182]
diff --git a/test/sql-tap/colname.test.lua b/test/sql-tap/colname.test.lua
index caa61a07a..3901feea9 100755
--- a/test/sql-tap/colname.test.lua
+++ b/test/sql-tap/colname.test.lua
@@ -1,6 +1,6 @@
 #!/usr/bin/env tarantool
 test = require("sqltester")
-test:plan(62)
+test:plan(79)
 
 --!./tcltestrunner.lua
 -- 2008 July 15
@@ -94,7 +94,7 @@ test:do_execsql2_test(
         SELECT +tabc.a, -tabc.b, tabc.c, * FROM tabc
     ]], {
         -- <colname-2.3>
-        "+tabc.a",1,"-tabc.b",-2,"C",3,"A",1,"B",2,"C",3
+        "COLUMN_1",1,"COLUMN_2",-2,"C",3,"A",1,"B",2,"C",3
         -- </colname-2.3>
     })
 
@@ -194,7 +194,7 @@ test:do_execsql2_test(
         SELECT +tabc.a, -tabc.b, tabc.c FROM tabc
     ]], {
         -- <colname-3.3>
-        "+tabc.a", 1, "-tabc.b", -2, "C", 3
+        "COLUMN_1",1,"COLUMN_2",-2,"C",3
         -- </colname-3.3>
     })
 
@@ -314,7 +314,7 @@ test:do_execsql2_test(
         SELECT +tabc.a, -tabc.b, tabc.c FROM tabc
     ]], {
         -- <colname-4.3>
-        "+tabc.a", 1, "-tabc.b", -2, "TABC.C", 3
+        "COLUMN_1",1,"COLUMN_2",-2,"TABC.C",3
         -- </colname-4.3>
     })
 
@@ -635,4 +635,157 @@ test:do_catchsql_test(
     [[ CREATE INDEX t1c ON table1('c'); ]],
     {1, "/Tarantool does not support functional indexes/"})
 
+--
+-- gh-3962: Check auto generated names in different selects.
+--
+test:do_execsql2_test(
+    "colname-12.1",
+    [[
+        VALUES(1, 2, 'aaa');
+    ]], {
+        "COLUMN_1",1,"COLUMN_2",2,"COLUMN_3","aaa"
+    })
+
+test:do_execsql2_test(
+    "colname-12.2",
+    [[
+        SELECT * FROM (VALUES (1+1, 1+1, 'aaa'));
+    ]], {
+        "COLUMN_1",2,"COLUMN_2",2,"COLUMN_3","aaa"
+    })
+
+test:do_execsql2_test(
+    "colname-12.3",
+    [[
+        SELECT 1+1, 1+1, 'aaa';
+    ]], {
+        "COLUMN_1",2,"COLUMN_2",2,"COLUMN_3","aaa"
+    })
+
+test:do_execsql2_test(
+    "colname-12.4",
+    [[
+        SELECT * FROM (SELECT * FROM (VALUES(1, 2, 'aaa'))),
+                      (SELECT * FROM (VALUES(1, 2, 'aaa')))
+    ]], {
+        "COLUMN_1",1,"COLUMN_2",2,"COLUMN_3","aaa","COLUMN_4",1,"COLUMN_5",2,
+        "COLUMN_6","aaa"
+    })
+
+test:do_execsql2_test(
+    "colname-12.5",
+    [[
+        CREATE TABLE j (s1 SCALAR PRIMARY KEY);
+        INSERT INTO j VALUES(1);
+    ]], {})
+
+--
+-- Column named as 'COLUMN_1', because 's1 + 1' is a expression.
+--
+test:do_execsql2_test(
+    "colname-12.6",
+    [[
+        SELECT s1 + 1 FROM j;
+    ]], {
+        "COLUMN_1",2
+    })
+
+test:do_execsql2_test(
+    "colname-12.7",
+    [[
+        SELECT s1 + 1 FROM j ORDER BY column_1;
+    ]], {
+        "COLUMN_1",2
+    })
+
+test:do_execsql2_test(
+    "colname-12.8",
+    [[
+        SELECT * FROM (SELECT s1 + 1 FROM j
+                       ORDER BY column_1) ORDER BY column_1;
+    ]], {
+        "COLUMN_1",2
+    })
+
+test:do_execsql2_test(
+    "colname-12.9",
+    [[
+        SELECT s1 + 1 FROM j GROUP BY column_1;
+    ]], {
+        "COLUMN_1",2
+    })
+
+test:do_execsql2_test(
+    "colname-12.10",
+    [[
+        SELECT * FROM (SELECT s1 + 1 FROM j
+                       ORDER BY column_1) GROUP BY column_1;
+    ]], {
+        "COLUMN_1",2
+    })
+
+test:do_execsql2_test(
+    "colname-12.11",
+    [[
+        SELECT * FROM (SELECT s1 + 1 FROM j
+                       ORDER BY column_1) WHERE column_1 = 2;
+    ]], {
+        "COLUMN_1",2
+    })
+
+test:do_execsql2_test(
+    "colname-12.12",
+    [[
+        SELECT *, s1 + 1 FROM j ORDER BY column_1;
+    ]], {
+        "S1",1,"COLUMN_1",2
+    })
+
+test:do_execsql2_test(
+    "colname-12.13",
+    [[
+        SELECT s1 + 1, * FROM j ORDER BY column_1;
+    ]], {
+        "COLUMN_1",2,"S1",1
+    })
+
+test:do_execsql2_test(
+    "colname-12.14",
+    [[
+        CREATE TABLE j_1 (column_1 SCALAR PRIMARY KEY, column_2 SCALAR);
+        INSERT INTO j_1 VALUES(1, 1);
+    ]], {})
+
+test:do_execsql2_test(
+    "colname-12.15",
+    [[
+        SELECT column_1, column_1 + 1, column_2, 2 FROM j_1;
+    ]], {
+        "COLUMN_1",1,"COLUMN_1",2,"COLUMN_2",1,"COLUMN_2",2
+    })
+
+--
+-- The result order is different, because in the second case
+-- expression "-column_1" with the auto generated name "column_1"
+-- is used for sorting. Auto generated names are considered as
+-- aliases. In the process of resolving an identifier from
+-- <ORDER BY>, it first checks for matching with aliases.
+--
+test:do_execsql2_test(
+    "colname-12.16",
+    [[
+        INSERT INTO j_1 VALUES(2, 2);
+        SELECT column_1 FROM j_1 ORDER BY column_1;
+    ]], {
+        "COLUMN_1",1,"COLUMN_1",2
+    })
+
+test:do_execsql2_test(
+    "colname-12.17",
+    [[
+        SELECT column_1, -column_1 FROM j_1 ORDER BY column_1;
+    ]], {
+        "COLUMN_1",2,"COLUMN_1",-2,"COLUMN_1",1,"COLUMN_1",-1
+    })
+
 test:finish_test()
diff --git a/test/sql-tap/select1.test.lua b/test/sql-tap/select1.test.lua
index fbebfab37..80e94b019 100755
--- a/test/sql-tap/select1.test.lua
+++ b/test/sql-tap/select1.test.lua
@@ -1032,7 +1032,7 @@ test:do_catchsql2_test(
         SELECT f1+F2 FROM test1 ORDER BY f2
     ]], {
         -- <select1-6.4a>
-        0, {"f1+F2", 33, "f1+F2", 77}
+        0, {"COLUMN_1",33,"COLUMN_1",77}
         -- </select1-6.4a>
     })
 
@@ -1042,7 +1042,7 @@ test:do_catchsql2_test(
         SELECT test1.f1+F2 FROM test1 ORDER BY f2
     ]], {
         -- <select1-6.5>
-        0, {"test1.f1+F2", 33, "test1.f1+F2", 77}
+        0, {"COLUMN_1",33,"COLUMN_1",77}
         -- </select1-6.5>
     })
 
@@ -1059,7 +1059,7 @@ test:do_test(
         return table.insert(v,msg) or v
     end, {
         -- <select1-6.5.1>
-        0, {'test1.f1+F2', 33, 'test1.f1+F2', 77}
+        0, {"COLUMN_1",33,"COLUMN_1",77}
         -- </select1-6.5.1>
     })
 
@@ -1068,7 +1068,7 @@ test:do_catchsql2_test(
     [[SELECT test1.f1+F2, t1 FROM test1, test2 
          ORDER BY f2]], {
         -- <select1-6.6>
-        0, {"test1.f1+F2", 33, "T1", "abc", "test1.f1+F2", 77, "T1", "abc"}
+        0, {"COLUMN_1",33,"T1","abc","COLUMN_1",77,"T1","abc"}
         -- </select1-6.6>
     })
 
@@ -1161,7 +1161,7 @@ test:do_test(
         ]]
     end, {
         -- <select1-6.9.5>
-        "123.45", 123.45
+        "COLUMN_1",123.45
         -- </select1-6.9.5>
     })
 
@@ -1189,7 +1189,8 @@ test:do_test(
         return x
     end, {
         -- <select1-6.9.7>
-        "A.F1", 11, "A.F2", 22, "sql_subquery.5", 5, "sql_subquery.6", 6
+        "A.F1", 11, "A.F2", 22, "sql_subquery.COLUMN_1", 5,
+        "sql_subquery.COLUMN_2", 6
         -- </select1-6.9.7>
     })
 
@@ -1816,7 +1817,7 @@ test:do_execsql2_test(
             SELECT * FROM t3, (SELECT max(a), max(b) FROM t4) as "tx"
         ]], {
             -- <select1-11.14>
-            "ID", 0, "A", "1", "B", "2", "max(a)", 3, "max(b)", "4"
+            "ID", 0, "A", "1", "B", "2", "COLUMN_1", 3, "COLUMN_2", "4"
             -- </select1-11.14>
         })
 
@@ -1826,7 +1827,7 @@ test:do_execsql2_test(
             SELECT y.*, t3.* FROM t3, (SELECT max(a), max(b) FROM t4) AS y
         ]], {
             -- <select1-11.15>
-            "max(a)", 3, "max(b)", "4", "ID", 0, "A", "1", "B", "2"
+            "COLUMN_1", 3, "COLUMN_2", "4", "ID", 0, "A", "1", "B", "2"
             -- </select1-11.15>
         })
 
@@ -1850,7 +1851,7 @@ test:do_execsql2_test(
         SELECT 1+2+3
     ]], {
         -- <select1-12.1>
-        "1+2+3", 6
+        "COLUMN_1",6
         -- </select1-12.1>
     })
 
@@ -1860,7 +1861,7 @@ test:do_execsql2_test(
         SELECT 1,'hello',2
     ]], {
         -- <select1-12.2>
-        '1', 1, "'hello'", "hello", '2', 2
+        "COLUMN_1",1,"COLUMN_2","hello","COLUMN_3",2
         -- </select1-12.2>
     })
 
diff --git a/test/sql-tap/select6.test.lua b/test/sql-tap/select6.test.lua
index c9960dc29..380fd67c1 100755
--- a/test/sql-tap/select6.test.lua
+++ b/test/sql-tap/select6.test.lua
@@ -128,9 +128,9 @@ test:do_execsql_test(
 test:do_execsql_test(
     "select6-1.7",
     [=[
-        SELECT a.y, a."count(*)", "max(x)", "count(*)"
-        FROM (SELECT count(*),y FROM t1 GROUP BY y) AS a,
-             (SELECT max(x),y FROM t1 GROUP BY y) as b
+        SELECT a.y, a.COLUMN_1, COLUMN_2, COLUMN_1
+        FROM (SELECT count(*), y FROM t1 GROUP BY y) AS a,
+             (SELECT max(x), y FROM t1 GROUP BY y) as b
         WHERE a.y=b.y ORDER BY a.y
     ]=], {
         -- <select6-1.7>
@@ -154,9 +154,9 @@ test:do_execsql_test(
 test:do_execsql_test(
     "select6-1.9",
     [=[
-        SELECT q, p, r, b."min(x)+y"
+        SELECT q, p, r, min
         FROM (SELECT count(*) as p , y as q FROM t1 GROUP BY y) AS a,
-             (SELECT max(x) as r, y as s, min(x)+y FROM t1 GROUP BY y) as b
+             (SELECT max(x) as r, y as s, min(x)+y AS min FROM t1 GROUP BY y) as b
         WHERE q=s ORDER BY s
     ]=], {
         -- <select6-1.9>
@@ -247,9 +247,9 @@ test:do_execsql_test(
 test:do_execsql_test(
     "select6-2.7",
     [=[
-        SELECT a.b, a."count(*)", "max(a)", "count(*)"
-        FROM (SELECT count(*),b FROM t2 GROUP BY b) AS a,
-             (SELECT max(a),b FROM t2 GROUP BY b) as b
+        SELECT a.b, a.count, max, count
+        FROM (SELECT count(*) AS count, b FROM t2 GROUP BY b) AS a,
+             (SELECT max(a) AS max, b FROM t2 GROUP BY b) as b
         WHERE a.b=b.b ORDER BY a.b
     ]=], {
         -- <select6-2.7>
@@ -432,8 +432,8 @@ test:do_execsql_test(
 test:do_execsql_test(
     "select6-3.14",
     [=[
-        SELECT "count(*)",y FROM (SELECT count(*), y FROM t1 GROUP BY y)
-        ORDER BY "count(*)"
+        SELECT count, y FROM (SELECT count(*) AS count, y FROM t1 GROUP BY y)
+        ORDER BY count
     ]=], {
         -- <select6-3.14>
         1, 1, 2, 2, 4, 3, 5, 5, 8, 4
@@ -443,7 +443,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "select6-3.15",
     [=[
-        SELECT "count(*)",y FROM (SELECT count(*), y FROM t1 GROUP BY y)
+        SELECT count, y FROM (SELECT count(*) AS count, y FROM t1 GROUP BY y)
         ORDER BY y
     ]=], {
         -- <select6-3.15>
diff --git a/test/sql-tap/view.test.lua b/test/sql-tap/view.test.lua
index e553b91c7..66374e374 100755
--- a/test/sql-tap/view.test.lua
+++ b/test/sql-tap/view.test.lua
@@ -265,7 +265,7 @@ test:do_execsql2_test(
         SELECT * FROM v1 LIMIT 1
     ]], {
         -- <view-3.3.1>
-        "XYZ", 2, "PQR", 7, "c-b", 1
+        "XYZ", 2, "PQR", 7, "COLUMN_1", 1
         -- </view-3.3.1>
     })
 
@@ -276,7 +276,7 @@ test:do_execsql2_test(
         SELECT * FROM v1b LIMIT 1
     ]], {
         -- <view-3.3.2>
-        "A", 2, "b+c", 7, "C", 4
+        "A", 2, "COLUMN_1", 7, "C", 4
         -- </view-3.3.2>
     })
 
diff --git a/test/sql/bind.result b/test/sql/bind.result
index b24094052..cb0302885 100644
--- a/test/sql/bind.result
+++ b/test/sql/bind.result
@@ -77,11 +77,11 @@ execute('SELECT * FROM test WHERE id = :value', parameters)
 execute('SELECT ?, ?, ?', {1, 2, 3})
 ---
 - metadata:
-  - name: '?'
+  - name: COLUMN_1
     type: integer
-  - name: '?'
+  - name: COLUMN_2
     type: integer
-  - name: '?'
+  - name: COLUMN_3
     type: integer
   rows:
   - [1, 2, 3]
@@ -107,11 +107,11 @@ parameters[3][':value1'] = 11
 execute('SELECT ?, :value1, @value2', parameters)
 ---
 - metadata:
-  - name: '?'
+  - name: COLUMN_1
     type: integer
-  - name: :value1
+  - name: COLUMN_2
     type: integer
-  - name: '@value2'
+  - name: COLUMN_3
     type: integer
   rows:
   - [10, 11, 12]
@@ -149,22 +149,22 @@ parameters[6]['@value2'] = 6
 execute('SELECT :value3, ?, :value1, ?, ?, @value2, ?, :value3', parameters)
 ---
 - metadata:
-  - name: :value3
+  - name: COLUMN_1
     type: integer
-  - name: '?'
+  - name: COLUMN_2
     type: integer
-  - name: :value1
+  - name: COLUMN_3
     type: integer
-  - name: '?'
+  - name: COLUMN_4
     type: integer
-  - name: '?'
+  - name: COLUMN_5
     type: integer
-  - name: '@value2'
+  - name: COLUMN_6
     type: integer
-  - name: '?'
+  - name: COLUMN_7
+    type: boolean
+  - name: COLUMN_8
     type: boolean
-  - name: :value3
-    type: integer
   rows:
   - [1, 2, 3, 4, 5, 6, null, 1]
 ...
@@ -175,15 +175,15 @@ msgpack = require('msgpack')
 execute('SELECT ?, ?, ?, ?, ?', {'abc', -123.456, msgpack.NULL, true, false})
 ---
 - metadata:
-  - name: '?'
+  - name: COLUMN_1
     type: text
-  - name: '?'
+  - name: COLUMN_2
     type: numeric
-  - name: '?'
+  - name: COLUMN_3
     type: boolean
-  - name: '?'
+  - name: COLUMN_4
     type: boolean
-  - name: '?'
+  - name: COLUMN_5
     type: boolean
   rows:
   - ['abc', -123.456, null, true, false]
@@ -290,7 +290,7 @@ execute('SELECT :value', parameters)
 execute('SELECT ? ', {18446744073709551615ULL})
 ---
 - metadata:
-  - name: '?'
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551615]
diff --git a/test/sql/boolean.result b/test/sql/boolean.result
index 112e41a12..51ec5820b 100644
--- a/test/sql/boolean.result
+++ b/test/sql/boolean.result
@@ -241,7 +241,7 @@ i > 0
 SELECT return_type(a) FROM t;
  | ---
  | - metadata:
- |   - name: return_type(a)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['boolean']
@@ -250,7 +250,7 @@ SELECT return_type(a) FROM t;
 SELECT return_type('false');
  | ---
  | - metadata:
- |   - name: return_type('false')
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['string']
@@ -258,7 +258,7 @@ SELECT return_type('false');
 SELECT is_boolean(a) FROM t LIMIT 1;
  | ---
  | - metadata:
- |   - name: is_boolean(a)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -266,7 +266,7 @@ SELECT is_boolean(a) FROM t LIMIT 1;
 SELECT is_boolean('true');
  | ---
  | - metadata:
- |   - name: is_boolean('true')
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -281,7 +281,7 @@ SELECT abs(a) FROM t0;
 SELECT lower(a) FROM t0;
  | ---
  | - metadata:
- |   - name: lower(a)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['false']
@@ -292,7 +292,7 @@ SELECT lower(a) FROM t0;
 SELECT upper(a) FROM t0;
  | ---
  | - metadata:
- |   - name: upper(a)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['FALSE']
@@ -303,7 +303,7 @@ SELECT upper(a) FROM t0;
 SELECT quote(a) FROM t0;
  | ---
  | - metadata:
- |   - name: quote(a)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['FALSE']
@@ -315,7 +315,7 @@ SELECT quote(a) FROM t0;
 SELECT length(a) FROM t0;
  | ---
  | - metadata:
- |   - name: length(a)
+ |   - name: COLUMN_1
  |     type: integer
  |   rows:
  |   - [5]
@@ -326,7 +326,7 @@ SELECT length(a) FROM t0;
 SELECT typeof(a) FROM t0;
  | ---
  | - metadata:
- |   - name: typeof(a)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['boolean']
@@ -344,7 +344,7 @@ SELECT AVG(a) FROM t0;
 SELECT MIN(a) FROM t0;
  | ---
  | - metadata:
- |   - name: MIN(a)
+ |   - name: COLUMN_1
  |     type: scalar
  |   rows:
  |   - [false]
@@ -352,7 +352,7 @@ SELECT MIN(a) FROM t0;
 SELECT MAX(a) FROM t0;
  | ---
  | - metadata:
- |   - name: MAX(a)
+ |   - name: COLUMN_1
  |     type: scalar
  |   rows:
  |   - [true]
@@ -365,7 +365,7 @@ SELECT SUM(a) FROM t0;
 SELECT COUNT(a) FROM t0;
  | ---
  | - metadata:
- |   - name: COUNT(a)
+ |   - name: COLUMN_1
  |     type: integer
  |   rows:
  |   - [2]
@@ -378,7 +378,7 @@ SELECT TOTAL(a) FROM t0;
 SELECT GROUP_CONCAT(a, ' +++ ') FROM t0;
  | ---
  | - metadata:
- |   - name: GROUP_CONCAT(a, ' +++ ')
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - ['FALSE +++ TRUE']
@@ -392,13 +392,13 @@ SELECT GROUP_CONCAT(a, ' +++ ') FROM t0;
 box.execute('SELECT ?, ?, return_type($1), typeof($2);', {true, false})
  | ---
  | - metadata:
- |   - name: '?'
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: '?'
+ |   - name: COLUMN_2
  |     type: boolean
- |   - name: return_type($1)
+ |   - name: COLUMN_3
  |     type: string
- |   - name: typeof($2)
+ |   - name: COLUMN_4
  |     type: string
  |   rows:
  |   - [true, false, 'boolean', 'boolean']
@@ -422,9 +422,9 @@ parameters[2][':value1'] = false
 box.execute('SELECT :value1, @value2;', parameters)
  | ---
  | - metadata:
- |   - name: :value1
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: '@value2'
+ |   - name: COLUMN_2
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -501,9 +501,9 @@ INSERT INTO t3 VALUES (4, false)
 SELECT cast(true AS INTEGER), cast(false AS INTEGER);
  | ---
  | - metadata:
- |   - name: cast(true AS INTEGER)
+ |   - name: COLUMN_1
  |     type: integer
- |   - name: cast(false AS INTEGER)
+ |   - name: COLUMN_2
  |     type: integer
  |   rows:
  |   - [1, 0]
@@ -511,9 +511,9 @@ SELECT cast(true AS INTEGER), cast(false AS INTEGER);
 SELECT cast(true AS NUMBER), cast(false AS NUMBER);
  | ---
  | - metadata:
- |   - name: cast(true AS NUMBER)
+ |   - name: COLUMN_1
  |     type: number
- |   - name: cast(false AS NUMBER)
+ |   - name: COLUMN_2
  |     type: number
  |   rows:
  |   - [1, 0]
@@ -522,9 +522,9 @@ SELECT cast(true AS NUMBER), cast(false AS NUMBER);
 SELECT cast(true AS TEXT), cast(false AS TEXT);
  | ---
  | - metadata:
- |   - name: cast(true AS TEXT)
+ |   - name: COLUMN_1
  |     type: string
- |   - name: cast(false AS TEXT)
+ |   - name: COLUMN_2
  |     type: string
  |   rows:
  |   - ['TRUE', 'FALSE']
@@ -532,9 +532,9 @@ SELECT cast(true AS TEXT), cast(false AS TEXT);
 SELECT cast(true AS BOOLEAN), cast(false AS BOOLEAN);
  | ---
  | - metadata:
- |   - name: cast(true AS BOOLEAN)
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: cast(false AS BOOLEAN)
+ |   - name: COLUMN_2
  |     type: boolean
  |   rows:
  |   - [true, false]
@@ -544,11 +544,11 @@ SELECT cast(true AS BOOLEAN), cast(false AS BOOLEAN);
 SELECT cast(100 AS BOOLEAN), cast(1 AS BOOLEAN), cast(0 AS BOOLEAN);
  | ---
  | - metadata:
- |   - name: cast(100 AS BOOLEAN)
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: cast(1 AS BOOLEAN)
+ |   - name: COLUMN_2
  |     type: boolean
- |   - name: cast(0 AS BOOLEAN)
+ |   - name: COLUMN_3
  |     type: boolean
  |   rows:
  |   - [true, true, false]
@@ -556,9 +556,9 @@ SELECT cast(100 AS BOOLEAN), cast(1 AS BOOLEAN), cast(0 AS BOOLEAN);
 SELECT cast(0.123 AS BOOLEAN), cast(0.0 AS BOOLEAN);
  | ---
  | - metadata:
- |   - name: cast(0.123 AS BOOLEAN)
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: cast(0.0 AS BOOLEAN)
+ |   - name: COLUMN_2
  |     type: boolean
  |   rows:
  |   - [true, false]
@@ -566,9 +566,9 @@ SELECT cast(0.123 AS BOOLEAN), cast(0.0 AS BOOLEAN);
 SELECT cast('true' AS BOOLEAN), cast('false' AS BOOLEAN);
  | ---
  | - metadata:
- |   - name: cast('true' AS BOOLEAN)
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: cast('false' AS BOOLEAN)
+ |   - name: COLUMN_2
  |     type: boolean
  |   rows:
  |   - [true, false]
@@ -576,9 +576,9 @@ SELECT cast('true' AS BOOLEAN), cast('false' AS BOOLEAN);
 SELECT cast('TRUE' AS BOOLEAN), cast('FALSE' AS BOOLEAN);
  | ---
  | - metadata:
- |   - name: cast('TRUE' AS BOOLEAN)
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: cast('FALSE' AS BOOLEAN)
+ |   - name: COLUMN_2
  |     type: boolean
  |   rows:
  |   - [true, false]
@@ -887,7 +887,7 @@ SELECT a, COUNT(*) FROM (SELECT * FROM t4 UNION SELECT * FROM t5) GROUP BY a;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: COUNT(*)
+ |   - name: COLUMN_1
  |     type: integer
  |   rows:
  |   - [false, 3]
@@ -907,7 +907,7 @@ INSERT INTO t6 VALUES (true, false), (false, true);
 SELECT NOT true;
  | ---
  | - metadata:
- |   - name: NOT true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -915,7 +915,7 @@ SELECT NOT true;
 SELECT NOT false;
  | ---
  | - metadata:
- |   - name: NOT false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -925,7 +925,7 @@ SELECT a, NOT a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: NOT a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -935,7 +935,7 @@ SELECT a, NOT a FROM t;
 SELECT true AND true;
  | ---
  | - metadata:
- |   - name: true AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -943,7 +943,7 @@ SELECT true AND true;
 SELECT true AND false;
  | ---
  | - metadata:
- |   - name: true AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -951,7 +951,7 @@ SELECT true AND false;
 SELECT false AND true;
  | ---
  | - metadata:
- |   - name: false AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -959,7 +959,7 @@ SELECT false AND true;
 SELECT false AND false;
  | ---
  | - metadata:
- |   - name: false AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -967,7 +967,7 @@ SELECT false AND false;
 SELECT true OR true;
  | ---
  | - metadata:
- |   - name: true OR true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -975,7 +975,7 @@ SELECT true OR true;
 SELECT true OR false;
  | ---
  | - metadata:
- |   - name: true OR false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -983,7 +983,7 @@ SELECT true OR false;
 SELECT false OR true;
  | ---
  | - metadata:
- |   - name: false OR true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -991,7 +991,7 @@ SELECT false OR true;
 SELECT false OR false;
  | ---
  | - metadata:
- |   - name: false OR false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1002,7 +1002,7 @@ SELECT a, true AND a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true AND a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1013,7 +1013,7 @@ SELECT a, false AND a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false AND a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1024,7 +1024,7 @@ SELECT a, true OR a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true OR a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1035,7 +1035,7 @@ SELECT a, false OR a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false OR a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1046,7 +1046,7 @@ SELECT a, a AND true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1057,7 +1057,7 @@ SELECT a, a AND false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1068,7 +1068,7 @@ SELECT a, a OR true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a OR true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1079,7 +1079,7 @@ SELECT a, a OR false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a OR false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1093,7 +1093,7 @@ SELECT a, a1, a AND a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a AND a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, false]
@@ -1108,7 +1108,7 @@ SELECT a, a1, a OR a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a OR a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, false]
@@ -1622,7 +1622,7 @@ SELECT a1, a2, a2 || a2 FROM t6;
 SELECT true > true;
  | ---
  | - metadata:
- |   - name: true > true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1630,7 +1630,7 @@ SELECT true > true;
 SELECT true > false;
  | ---
  | - metadata:
- |   - name: true > false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -1638,7 +1638,7 @@ SELECT true > false;
 SELECT false > true;
  | ---
  | - metadata:
- |   - name: false > true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1646,7 +1646,7 @@ SELECT false > true;
 SELECT false > false;
  | ---
  | - metadata:
- |   - name: false > false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1654,7 +1654,7 @@ SELECT false > false;
 SELECT true < true;
  | ---
  | - metadata:
- |   - name: true < true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1662,7 +1662,7 @@ SELECT true < true;
 SELECT true < false;
  | ---
  | - metadata:
- |   - name: true < false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1670,7 +1670,7 @@ SELECT true < false;
 SELECT false < true;
  | ---
  | - metadata:
- |   - name: false < true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -1678,7 +1678,7 @@ SELECT false < true;
 SELECT false < false;
  | ---
  | - metadata:
- |   - name: false < false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1689,7 +1689,7 @@ SELECT a, true > a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true > a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1700,7 +1700,7 @@ SELECT a, false > a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false > a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1711,7 +1711,7 @@ SELECT a, true < a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true < a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1722,7 +1722,7 @@ SELECT a, false < a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false < a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1733,7 +1733,7 @@ SELECT a, a > true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a > true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1744,7 +1744,7 @@ SELECT a, a > false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a > false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1755,7 +1755,7 @@ SELECT a, a < true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a < true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1766,7 +1766,7 @@ SELECT a, a < false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a < false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1780,7 +1780,7 @@ SELECT a, a1, a > a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a > a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, false]
@@ -1795,7 +1795,7 @@ SELECT a, a1, a < a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a < a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, false]
@@ -1807,7 +1807,7 @@ SELECT a, a1, a < a1 FROM t, t6;
 SELECT true >= true;
  | ---
  | - metadata:
- |   - name: true >= true
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [true]
@@ -1815,7 +1815,7 @@ SELECT true >= true;
 SELECT true >= false;
  | ---
  | - metadata:
- |   - name: true >= false
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [true]
@@ -1823,7 +1823,7 @@ SELECT true >= false;
 SELECT false >= true;
  | ---
  | - metadata:
- |   - name: false >= true
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [false]
@@ -1831,7 +1831,7 @@ SELECT false >= true;
 SELECT false >= false;
  | ---
  | - metadata:
- |   - name: false >= false
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [true]
@@ -1839,7 +1839,7 @@ SELECT false >= false;
 SELECT true <= true;
  | ---
  | - metadata:
- |   - name: true <= true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -1847,7 +1847,7 @@ SELECT true <= true;
 SELECT true <= false;
  | ---
  | - metadata:
- |   - name: true <= false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -1855,7 +1855,7 @@ SELECT true <= false;
 SELECT false <= true;
  | ---
  | - metadata:
- |   - name: false <= true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -1863,7 +1863,7 @@ SELECT false <= true;
 SELECT false <= false;
  | ---
  | - metadata:
- |   - name: false <= false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -1874,7 +1874,7 @@ SELECT a, true >= a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true >= a
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [false, true]
@@ -1885,7 +1885,7 @@ SELECT a, false >= a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false >= a
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [false, true]
@@ -1896,7 +1896,7 @@ SELECT a, true <= a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true <= a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -1907,7 +1907,7 @@ SELECT a, false <= a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false <= a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1918,7 +1918,7 @@ SELECT a, a >= true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a >= true
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [false, false]
@@ -1929,7 +1929,7 @@ SELECT a, a >= false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a >= false
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [false, true]
@@ -1940,7 +1940,7 @@ SELECT a, a <= true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a <= true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1951,7 +1951,7 @@ SELECT a, a <= false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a <= false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -1965,7 +1965,7 @@ SELECT a, a1, a >= a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a >= a1
+ |   - name: COLUMN_1
  |     type: any
  |   rows:
  |   - [false, false, true]
@@ -1980,7 +1980,7 @@ SELECT a, a1, a <= a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a <= a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, true]
@@ -1992,7 +1992,7 @@ SELECT a, a1, a <= a1 FROM t, t6;
 SELECT true == true;
  | ---
  | - metadata:
- |   - name: true == true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2000,7 +2000,7 @@ SELECT true == true;
 SELECT true == false;
  | ---
  | - metadata:
- |   - name: true == false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2008,7 +2008,7 @@ SELECT true == false;
 SELECT false == true;
  | ---
  | - metadata:
- |   - name: false == true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2016,7 +2016,7 @@ SELECT false == true;
 SELECT false == false;
  | ---
  | - metadata:
- |   - name: false == false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2024,7 +2024,7 @@ SELECT false == false;
 SELECT true != true;
  | ---
  | - metadata:
- |   - name: true != true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2032,7 +2032,7 @@ SELECT true != true;
 SELECT true != false;
  | ---
  | - metadata:
- |   - name: true != false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2040,7 +2040,7 @@ SELECT true != false;
 SELECT false != true;
  | ---
  | - metadata:
- |   - name: false != true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2048,7 +2048,7 @@ SELECT false != true;
 SELECT false != false;
  | ---
  | - metadata:
- |   - name: false != false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2059,7 +2059,7 @@ SELECT a, true == a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true == a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2070,7 +2070,7 @@ SELECT a, false == a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false == a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2081,7 +2081,7 @@ SELECT a, true != a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: true != a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2092,7 +2092,7 @@ SELECT a, false != a FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: false != a
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2103,7 +2103,7 @@ SELECT a, a == true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a == true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2114,7 +2114,7 @@ SELECT a, a == false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a == false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2125,7 +2125,7 @@ SELECT a, a != true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a != true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2136,7 +2136,7 @@ SELECT a, a != false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a != false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2150,7 +2150,7 @@ SELECT a, a1, a == a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a == a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, true]
@@ -2165,7 +2165,7 @@ SELECT a, a1, a != a1 FROM t, t6;
  |     type: boolean
  |   - name: A1
  |     type: boolean
- |   - name: a != a1
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false, false]
@@ -2177,7 +2177,7 @@ SELECT a, a1, a != a1 FROM t, t6;
 SELECT true IN (true);
  | ---
  | - metadata:
- |   - name: true IN (true)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2185,7 +2185,7 @@ SELECT true IN (true);
 SELECT false IN (true);
  | ---
  | - metadata:
- |   - name: false IN (true)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2193,7 +2193,7 @@ SELECT false IN (true);
 SELECT true IN (false);
  | ---
  | - metadata:
- |   - name: true IN (false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2201,7 +2201,7 @@ SELECT true IN (false);
 SELECT false IN (false);
  | ---
  | - metadata:
- |   - name: false IN (false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2209,7 +2209,7 @@ SELECT false IN (false);
 SELECT true IN (true, false);
  | ---
  | - metadata:
- |   - name: true IN (true, false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2217,7 +2217,7 @@ SELECT true IN (true, false);
 SELECT false IN (true, false);
  | ---
  | - metadata:
- |   - name: false IN (true, false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2225,7 +2225,7 @@ SELECT false IN (true, false);
 SELECT true IN (SELECT a1 FROM t6);
  | ---
  | - metadata:
- |   - name: true IN (SELECT a1 FROM t6)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2233,7 +2233,7 @@ SELECT true IN (SELECT a1 FROM t6);
 SELECT false IN (SELECT a1 FROM t6);
  | ---
  | - metadata:
- |   - name: false IN (SELECT a1 FROM t6)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2241,7 +2241,7 @@ SELECT false IN (SELECT a1 FROM t6);
 SELECT true IN (SELECT a1 FROM t6 LIMIT 1);
  | ---
  | - metadata:
- |   - name: true IN (SELECT a1 FROM t6 LIMIT 1)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2249,7 +2249,7 @@ SELECT true IN (SELECT a1 FROM t6 LIMIT 1);
 SELECT false IN (SELECT a1 FROM t6 LIMIT 1);
  | ---
  | - metadata:
- |   - name: false IN (SELECT a1 FROM t6 LIMIT 1)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2257,7 +2257,7 @@ SELECT false IN (SELECT a1 FROM t6 LIMIT 1);
 SELECT true IN (1, 1.2, 'true', false);
  | ---
  | - metadata:
- |   - name: true IN (1, 1.2, 'true', false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2265,7 +2265,7 @@ SELECT true IN (1, 1.2, 'true', false);
 SELECT false IN (1, 1.2, 'true', false);
  | ---
  | - metadata:
- |   - name: false IN (1, 1.2, 'true', false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2276,7 +2276,7 @@ SELECT a, a IN (true) FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a IN (true)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2287,7 +2287,7 @@ SELECT a, a IN (false) FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a IN (false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2298,7 +2298,7 @@ SELECT a, a IN (true, false) FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a IN (true, false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2309,7 +2309,7 @@ SELECT a, a IN (SELECT a1 FROM t6 LIMIT 1) FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a IN (SELECT a1 FROM t6 LIMIT 1)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2320,7 +2320,7 @@ SELECT a, a IN (SELECT a1 FROM t6) FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a IN (SELECT a1 FROM t6)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2331,7 +2331,7 @@ SELECT a, a IN (1, 1.2, 'true', false) FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a IN (1, 1.2, 'true', false)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2341,7 +2341,7 @@ SELECT a, a IN (1, 1.2, 'true', false) FROM t;
 SELECT true BETWEEN true AND true;
  | ---
  | - metadata:
- |   - name: true BETWEEN true AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2349,7 +2349,7 @@ SELECT true BETWEEN true AND true;
 SELECT false BETWEEN true AND true;
  | ---
  | - metadata:
- |   - name: false BETWEEN true AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2357,7 +2357,7 @@ SELECT false BETWEEN true AND true;
 SELECT true BETWEEN false AND false;
  | ---
  | - metadata:
- |   - name: true BETWEEN false AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2365,7 +2365,7 @@ SELECT true BETWEEN false AND false;
 SELECT false BETWEEN false AND false;
  | ---
  | - metadata:
- |   - name: false BETWEEN false AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2373,7 +2373,7 @@ SELECT false BETWEEN false AND false;
 SELECT true BETWEEN true AND false;
  | ---
  | - metadata:
- |   - name: true BETWEEN true AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2381,7 +2381,7 @@ SELECT true BETWEEN true AND false;
 SELECT false BETWEEN true AND false;
  | ---
  | - metadata:
- |   - name: false BETWEEN true AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2389,7 +2389,7 @@ SELECT false BETWEEN true AND false;
 SELECT true BETWEEN false AND true;
  | ---
  | - metadata:
- |   - name: true BETWEEN false AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2397,7 +2397,7 @@ SELECT true BETWEEN false AND true;
 SELECT false BETWEEN false AND true;
  | ---
  | - metadata:
- |   - name: false BETWEEN false AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [true]
@@ -2408,7 +2408,7 @@ SELECT a, a BETWEEN true AND true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a BETWEEN true AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2419,7 +2419,7 @@ SELECT a, a BETWEEN false AND false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a BETWEEN false AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2430,7 +2430,7 @@ SELECT a, a BETWEEN true AND false FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a BETWEEN true AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -2441,7 +2441,7 @@ SELECT a, a BETWEEN false AND true FROM t;
  | - metadata:
  |   - name: A
  |     type: boolean
- |   - name: a BETWEEN false AND true
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, true]
@@ -2466,7 +2466,7 @@ SELECT true AND 2;
 SELECT false AND 2;
  | ---
  | - metadata:
- |   - name: false AND 2
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2489,7 +2489,7 @@ SELECT 2 AND true;
 SELECT 2 AND false;
  | ---
  | - metadata:
- |   - name: 2 AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -2556,7 +2556,7 @@ SELECT b, false AND b FROM t7;
  | - metadata:
  |   - name: B
  |     type: integer
- |   - name: false AND b
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [123, false]
@@ -2581,7 +2581,7 @@ SELECT b, b AND false FROM t7;
  | - metadata:
  |   - name: B
  |     type: integer
- |   - name: b AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [123, false]
@@ -3861,7 +3861,7 @@ SELECT a2, b, b != a2 FROM t6, t7;
 SELECT true IN (0, 1, 2, 3);
  | ---
  | - metadata:
- |   - name: true IN (0, 1, 2, 3)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -3869,7 +3869,7 @@ SELECT true IN (0, 1, 2, 3);
 SELECT false IN (0, 1, 2, 3);
  | ---
  | - metadata:
- |   - name: false IN (0, 1, 2, 3)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -3889,7 +3889,7 @@ SELECT a1, a1 IN (0, 1, 2, 3) FROM t6
  | - metadata:
  |   - name: A1
  |     type: boolean
- |   - name: a1 IN (0, 1, 2, 3)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false, false]
@@ -3935,7 +3935,7 @@ SELECT true AND 2.3;
 SELECT false AND 2.3;
  | ---
  | - metadata:
- |   - name: false AND 2.3
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -3958,7 +3958,7 @@ SELECT 2.3 AND true;
 SELECT 2.3 AND false;
  | ---
  | - metadata:
- |   - name: 2.3 AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -4025,7 +4025,7 @@ SELECT c, false AND c FROM t8;
  | - metadata:
  |   - name: C
  |     type: number
- |   - name: false AND c
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [4.56, false]
@@ -4050,7 +4050,7 @@ SELECT c, c AND false FROM t8;
  | - metadata:
  |   - name: C
  |     type: number
- |   - name: c AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [4.56, false]
@@ -5006,7 +5006,7 @@ SELECT a2, c, c != a2 FROM t6, t8;
 SELECT true IN (0.1, 1.2, 2.3, 3.4);
  | ---
  | - metadata:
- |   - name: true IN (0.1, 1.2, 2.3, 3.4)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5014,7 +5014,7 @@ SELECT true IN (0.1, 1.2, 2.3, 3.4);
 SELECT false IN (0.1, 1.2, 2.3, 3.4);
  | ---
  | - metadata:
- |   - name: false IN (0.1, 1.2, 2.3, 3.4)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5022,7 +5022,7 @@ SELECT false IN (0.1, 1.2, 2.3, 3.4);
 SELECT a1 IN (0.1, 1.2, 2.3, 3.4) FROM t6 LIMIT 1;
  | ---
  | - metadata:
- |   - name: a1 IN (0.1, 1.2, 2.3, 3.4)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5030,7 +5030,7 @@ SELECT a1 IN (0.1, 1.2, 2.3, 3.4) FROM t6 LIMIT 1;
 SELECT a2 IN (0.1, 1.2, 2.3, 3.4) FROM t6 LIMIT 1;
  | ---
  | - metadata:
- |   - name: a2 IN (0.1, 1.2, 2.3, 3.4)
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5095,7 +5095,7 @@ SELECT true AND 'abc';
 SELECT false AND 'abc';
  | ---
  | - metadata:
- |   - name: false AND 'abc'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5118,7 +5118,7 @@ SELECT 'abc' AND true;
 SELECT 'abc' AND false;
  | ---
  | - metadata:
- |   - name: '''abc'' AND false'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5185,7 +5185,7 @@ SELECT d, false AND d FROM t9;
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: false AND d
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['AsdF', false]
@@ -5210,7 +5210,7 @@ SELECT d, d AND false FROM t9;
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: d AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['AsdF', false]
@@ -5470,7 +5470,7 @@ SELECT true AND 'TRUE';
 SELECT false AND 'TRUE';
  | ---
  | - metadata:
- |   - name: false AND 'TRUE'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5493,7 +5493,7 @@ SELECT 'TRUE' AND true;
 SELECT 'TRUE' AND false;
  | ---
  | - metadata:
- |   - name: '''TRUE'' AND false'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5560,7 +5560,7 @@ SELECT d, false AND d FROM t9 WHERE d = 'TRUE';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: false AND d
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['TRUE', false]
@@ -5585,7 +5585,7 @@ SELECT d, d AND false FROM t9 WHERE d = 'TRUE';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: d AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['TRUE', false]
@@ -5650,7 +5650,7 @@ SELECT true AND 'true';
 SELECT false AND 'true';
  | ---
  | - metadata:
- |   - name: false AND 'true'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5673,7 +5673,7 @@ SELECT 'true' AND true;
 SELECT 'true' AND false;
  | ---
  | - metadata:
- |   - name: '''true'' AND false'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5740,7 +5740,7 @@ SELECT d, false AND d FROM t9 WHERE d = 'true';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: false AND d
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['true', false]
@@ -5765,7 +5765,7 @@ SELECT d, d AND false FROM t9 WHERE d = 'true';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: d AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['true', false]
@@ -5830,7 +5830,7 @@ SELECT true AND 'FALSE';
 SELECT false AND 'FALSE';
  | ---
  | - metadata:
- |   - name: false AND 'FALSE'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5853,7 +5853,7 @@ SELECT 'FALSE' AND true;
 SELECT 'FALSE' AND false;
  | ---
  | - metadata:
- |   - name: '''FALSE'' AND false'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -5920,7 +5920,7 @@ SELECT d, false AND d FROM t9 WHERE d = 'FALSE';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: false AND d
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['FALSE', false]
@@ -5945,7 +5945,7 @@ SELECT d, d AND false FROM t9 WHERE d = 'FALSE';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: d AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['FALSE', false]
@@ -6010,7 +6010,7 @@ SELECT true AND 'false';
 SELECT false AND 'false';
  | ---
  | - metadata:
- |   - name: false AND 'false'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -6033,7 +6033,7 @@ SELECT 'false' AND true;
 SELECT 'false' AND false;
  | ---
  | - metadata:
- |   - name: '''false'' AND false'
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - [false]
@@ -6100,7 +6100,7 @@ SELECT d, false AND d FROM t9 WHERE d = 'false';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: false AND d
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['false', false]
@@ -6125,7 +6125,7 @@ SELECT d, d AND false FROM t9 WHERE d = 'false';
  | - metadata:
  |   - name: D
  |     type: string
- |   - name: d AND false
+ |   - name: COLUMN_1
  |     type: boolean
  |   rows:
  |   - ['false', false]
diff --git a/test/sql/collation.result b/test/sql/collation.result
index 4e4c27ef0..bfc89e1b8 100644
--- a/test/sql/collation.result
+++ b/test/sql/collation.result
@@ -111,7 +111,7 @@ box.execute([[SELECT descriptor, upper(letter), letter FROM tu where UPPER(lette
 - metadata:
   - name: DESCRIPTOR
     type: string
-  - name: upper(letter)
+  - name: COLUMN_1
     type: string
   - name: LETTER
     type: string
@@ -124,7 +124,7 @@ box.execute([[SELECT descriptor, upper(letter COLLATE "GERMAN"), letter FROM tu
 - metadata:
   - name: DESCRIPTOR
     type: string
-  - name: upper(letter COLLATE "GERMAN")
+  - name: COLUMN_1
     type: string
   - name: LETTER
     type: string
@@ -335,14 +335,14 @@ box.execute("SELECT a FROM t UNION SELECT c FROM t;")
 box.execute("SELECT c COLLATE \"binary\" FROM t UNION SELECT a FROM t;")
 ---
 - metadata:
-  - name: c COLLATE "binary"
+  - name: COLUMN_1
     type: string
   rows: []
 ...
 box.execute("SELECT b COLLATE \"unicode\" FROM t UNION SELECT a FROM t;")
 ---
 - metadata:
-  - name: b COLLATE "unicode"
+  - name: COLUMN_1
     type: string
   rows: []
 ...
@@ -1128,7 +1128,7 @@ box.execute("INSERT INTO jj VALUES (1,'A'), (2,'a')")
 box.execute("SELECT DISTINCT trim(s2) FROM jj;")
 ---
 - metadata:
-  - name: trim(s2)
+  - name: COLUMN_1
     type: string
   rows:
   - ['A']
@@ -1140,7 +1140,7 @@ box.execute("INSERT INTO jj VALUES (3, 'aS'), (4, 'AS');")
 box.execute("SELECT DISTINCT replace(s2, 'S', 's') FROM jj;")
 ---
 - metadata:
-  - name: replace(s2, 'S', 's')
+  - name: COLUMN_1
     type: string
   rows:
   - ['A']
@@ -1149,7 +1149,7 @@ box.execute("SELECT DISTINCT replace(s2, 'S', 's') FROM jj;")
 box.execute("SELECT DISTINCT substr(s2, 1, 1) FROM jj;")
 ---
 - metadata:
-  - name: substr(s2, 1, 1)
+  - name: COLUMN_1
     type: string
   rows:
   - ['A']
diff --git a/test/sql/errinj.result b/test/sql/errinj.result
index 68c001f28..f19203bc6 100644
--- a/test/sql/errinj.result
+++ b/test/sql/errinj.result
@@ -120,7 +120,7 @@ insert_res
 select_res
 ---
 - metadata:
-  - name: '1'
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
diff --git a/test/sql/foreign-keys.result b/test/sql/foreign-keys.result
index f1d973443..33689a06e 100644
--- a/test/sql/foreign-keys.result
+++ b/test/sql/foreign-keys.result
@@ -357,7 +357,7 @@ box.execute('ALTER TABLE tc ADD CONSTRAINT fk1 FOREIGN KEY (id) REFERENCES tp(id
 box.execute('SELECT row_count();')
 ---
 - metadata:
-  - name: row_count()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -374,7 +374,7 @@ box.execute('ALTER TABLE tc DROP CONSTRAINT fk1;')
 box.execute('SELECT row_count();')
 ---
 - metadata:
-  - name: row_count()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
diff --git a/test/sql/full_metadata.result b/test/sql/full_metadata.result
index 5a93c41ec..25bac6d86 100644
--- a/test/sql/full_metadata.result
+++ b/test/sql/full_metadata.result
@@ -57,7 +57,7 @@ execute("SELECT 'aSd' COLLATE \"unicode_ci\";")
  | - metadata:
  |   - type: string
  |     span: '''aSd'' COLLATE "unicode_ci"'
- |     name: '''aSd'' COLLATE "unicode_ci"'
+ |     name: COLUMN_1
  |     collation: unicode_ci
  |   rows:
  |   - ['aSd']
@@ -78,7 +78,7 @@ execute("SELECT c COLLATE \"unicode\" FROM t;")
  | - metadata:
  |   - type: string
  |     span: c COLLATE "unicode"
- |     name: c COLLATE "unicode"
+ |     name: COLUMN_1
  |     collation: unicode
  |   rows:
  |   - ['aSd']
@@ -165,7 +165,7 @@ execute("SELECT *, id + 1 AS x, a AS y, c || 'abc' FROM t;")
  |     is_nullable: false
  |   - type: string
  |     span: c || 'abc'
- |     name: c || 'abc'
+ |     name: COLUMN_1
  |   rows:
  |   - [1, 1, 'aSd', 2, 1, 'aSdabc']
  | ...
@@ -185,8 +185,8 @@ execute("SELECT * FROM v;")
  |     name: Y
  |     is_nullable: false
  |   - type: string
- |     span: c || 'abc'
- |     name: c || 'abc'
+ |     span: COLUMN_1
+ |     name: COLUMN_1
  |   rows:
  |   - [2, 1, 'aSdabc']
  | ...
diff --git a/test/sql/func-recreate.result b/test/sql/func-recreate.result
index 3709df787..5fd2b79c0 100644
--- a/test/sql/func-recreate.result
+++ b/test/sql/func-recreate.result
@@ -48,7 +48,7 @@ test_run:cmd("setopt delimiter ''");
 ch:get()
 ---
 - metadata:
-  - name: WAITFOR(0.2)
+  - name: COLUMN_1
     type: number
   rows:
   - [0.2]
diff --git a/test/sql/gh-3199-no-mem-leaks.result b/test/sql/gh-3199-no-mem-leaks.result
index d8590779a..6ce8df436 100644
--- a/test/sql/gh-3199-no-mem-leaks.result
+++ b/test/sql/gh-3199-no-mem-leaks.result
@@ -32,7 +32,7 @@ box.execute('SELECT x, y, x + y FROM test ORDER BY y')
     type: integer
   - name: Y
     type: integer
-  - name: x + y
+  - name: COLUMN_1
     type: integer
   rows:
   - [1, 1, 2]
@@ -49,7 +49,7 @@ box.execute('SELECT x, y, x + y FROM test ORDER BY y')
     type: integer
   - name: Y
     type: integer
-  - name: x + y
+  - name: COLUMN_1
     type: integer
   rows:
   - [1, 1, 2]
@@ -62,7 +62,7 @@ box.execute('SELECT x, y, x + y FROM test ORDER BY y')
     type: integer
   - name: Y
     type: integer
-  - name: x + y
+  - name: COLUMN_1
     type: integer
   rows:
   - [1, 1, 2]
@@ -75,7 +75,7 @@ box.execute('SELECT x, y, x + y FROM test ORDER BY y')
     type: integer
   - name: Y
     type: integer
-  - name: x + y
+  - name: COLUMN_1
     type: integer
   rows:
   - [1, 1, 2]
@@ -88,7 +88,7 @@ box.execute('SELECT x, y, x + y FROM test ORDER BY y')
     type: integer
   - name: Y
     type: integer
-  - name: x + y
+  - name: COLUMN_1
     type: integer
   rows:
   - [1, 1, 2]
@@ -115,7 +115,7 @@ box.execute('SELECT a, id + 2, b FROM test2 WHERE b < id * 2 ORDER BY a ')
 - metadata:
   - name: A
     type: string
-  - name: id + 2
+  - name: COLUMN_1
     type: integer
   - name: B
     type: integer
@@ -134,7 +134,7 @@ box.execute('SELECT a, id + 2 * b, a FROM test2 WHERE b < id * 2 ORDER BY a ')
 - metadata:
   - name: A
     type: string
-  - name: id + 2 * b
+  - name: COLUMN_1
     type: integer
   - name: A
     type: string
@@ -149,7 +149,7 @@ box.execute('SELECT a, id + 2 * b, a FROM test2 WHERE b < id * 2 ORDER BY a ')
 - metadata:
   - name: A
     type: string
-  - name: id + 2 * b
+  - name: COLUMN_1
     type: integer
   - name: A
     type: string
@@ -164,7 +164,7 @@ box.execute('SELECT a, id + 2 * b, a FROM test2 WHERE b < id * 2 ORDER BY a ')
 - metadata:
   - name: A
     type: string
-  - name: id + 2 * b
+  - name: COLUMN_1
     type: integer
   - name: A
     type: string
@@ -183,7 +183,7 @@ box.execute('SELECT x, y + 3 * b, b FROM test2, test WHERE b = x')
 - metadata:
   - name: X
     type: integer
-  - name: y + 3 * b
+  - name: COLUMN_1
     type: integer
   - name: B
     type: integer
@@ -196,7 +196,7 @@ box.execute('SELECT x, y + 3 * b, b FROM test2, test WHERE b = x')
 - metadata:
   - name: X
     type: integer
-  - name: y + 3 * b
+  - name: COLUMN_1
     type: integer
   - name: B
     type: integer
@@ -209,7 +209,7 @@ box.execute('SELECT x, y + 3 * b, b FROM test2, test WHERE b = x')
 - metadata:
   - name: X
     type: integer
-  - name: y + 3 * b
+  - name: COLUMN_1
     type: integer
   - name: B
     type: integer
diff --git a/test/sql/gh-3888-values-blob-assert.result b/test/sql/gh-3888-values-blob-assert.result
index 0a1af28f2..669f2eb2f 100644
--- a/test/sql/gh-3888-values-blob-assert.result
+++ b/test/sql/gh-3888-values-blob-assert.result
@@ -51,7 +51,7 @@ box.execute('SELECT TheColumnName')
 box.execute('VALUES(-0.5e-2)')
 ---
 - metadata:
-  - name: column1
+  - name: COLUMN_1
     type: double
   rows:
   - [-0.005]
@@ -59,7 +59,7 @@ box.execute('VALUES(-0.5e-2)')
 box.execute('SELECT X\'507265766564\'')
 ---
 - metadata:
-  - name: X'507265766564'
+  - name: COLUMN_1
     type: varbinary
   rows:
   - ['Preved']
@@ -68,7 +68,7 @@ box.execute('SELECT X\'507265766564\'')
 box.execute('SELECT 3.14')
 ---
 - metadata:
-  - name: '3.14'
+  - name: COLUMN_1
     type: double
   rows:
   - [3.14]
@@ -76,7 +76,7 @@ box.execute('SELECT 3.14')
 box.execute('SELECT X\'4D6564766564\'')
 ---
 - metadata:
-  - name: X'4D6564766564'
+  - name: COLUMN_1
     type: varbinary
   rows:
   - ['Medved']
diff --git a/test/sql/gh-4697-scalar-bool-sort-cmp.result b/test/sql/gh-4697-scalar-bool-sort-cmp.result
index 2423cd894..6f7fbd62b 100644
--- a/test/sql/gh-4697-scalar-bool-sort-cmp.result
+++ b/test/sql/gh-4697-scalar-bool-sort-cmp.result
@@ -30,7 +30,7 @@ SELECT s2, typeof(s2) FROM test ORDER BY s2;
  | - metadata:
  |   - name: S2
  |     type: scalar
- |   - name: typeof(s2)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - [null, 'boolean']
@@ -43,7 +43,7 @@ SELECT s3, typeof(s3) FROM test ORDER BY s3;
  | - metadata:
  |   - name: S3
  |     type: scalar
- |   - name: typeof(s3)
+ |   - name: COLUMN_1
  |     type: string
  |   rows:
  |   - [null, 'boolean']
diff --git a/test/sql/icu-upper-lower.result b/test/sql/icu-upper-lower.result
index f7b9dfa38..3ecc07d94 100644
--- a/test/sql/icu-upper-lower.result
+++ b/test/sql/icu-upper-lower.result
@@ -23,11 +23,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Zəfər, jaketini də, papağını da götür, bu axşam hava çox soyuq
-      olacaq. ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Zəfər, jaketini də, papağını da götür, bu axşam hava çox soyuq
-      olacaq. ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     zəfər, jaketini də, papağını da götür, bu axşam hava çox soyuq olacaq. ',
@@ -38,9 +36,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     The quick brown fox jumps over the lazy dog. ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     The quick brown fox jumps over the lazy dog. ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     the quick brown fox jumps over the lazy dog. ', '     THE QUICK BROWN FOX
@@ -52,9 +50,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     The quick brown fox jumps over the lazy dog. ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     The quick brown fox jumps over the lazy dog. ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     the quick brown fox jumps over the lazy dog. ', '     THE QUICK BROWN FOX
@@ -66,11 +64,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Բել դղյակի ձախ ժամն օֆ ազգությանը ցպահանջ չճշտած վնաս էր եւ
-      փառք ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Բել դղյակի ձախ ժամն օֆ ազգությանը ցպահանջ չճշտած վնաս էր եւ
-      փառք ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     բել դղյակի ձախ ժամն օֆ ազգությանը ցպահանջ չճշտած վնաս էր եւ փառք ', '     ԲԵԼ
@@ -82,11 +78,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     У Іўі худы жвавы чорт у зялёнай камізэльцы пабег пад’есці фаршу
-      з юшкай ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     У Іўі худы жвавы чорт у зялёнай камізэльцы пабег пад’есці фаршу
-      з юшкай ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     у іўі худы жвавы чорт у зялёнай камізэльцы пабег пад’есці фаршу з юшкай ',
@@ -98,11 +92,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός
-      ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός
-      ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός ', '     ΤΆΧΙΣΤΗ
@@ -114,11 +106,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Chuaigh bé mhórshách le dlúthspád fíorfhinn trí hata mo dhea-phorcáin
-      bhig ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Chuaigh bé mhórshách le dlúthspád fíorfhinn trí hata mo dhea-phorcáin
-      bhig ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     chuaigh bé mhórshách le dlúthspád fíorfhinn trí hata mo dhea-phorcáin bhig ',
@@ -130,9 +120,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Quiere la boca exhausta vid, kiwi, piña y fugaz jamón ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Quiere la boca exhausta vid, kiwi, piña y fugaz jamón ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     quiere la boca exhausta vid, kiwi, piña y fugaz jamón ', '     QUIERE LA
@@ -144,9 +134,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     키스의 고유조건은 입술끼리 만나야 하고 특별한 기술은 필요치 않다 ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     키스의 고유조건은 입술끼리 만나야 하고 특별한 기술은 필요치 않다 ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     키스의 고유조건은 입술끼리 만나야 하고 특별한 기술은 필요치 않다 ', '     키스의 고유조건은 입술끼리 만나야 하고 특별한
@@ -158,9 +148,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Glāžšķūņa rūķīši dzērumā čiepj Baha koncertflīģeļu vākus ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Glāžšķūņa rūķīši dzērumā čiepj Baha koncertflīģeļu vākus ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     glāžšķūņa rūķīši dzērumā čiepj baha koncertflīģeļu vākus ', '     GLĀŽŠĶŪŅA
@@ -172,11 +162,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Zwölf große Boxkämpfer jagen Viktor quer über den Sylter Deich
-      ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Zwölf große Boxkämpfer jagen Viktor quer über den Sylter Deich
-      ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     zwölf große boxkämpfer jagen viktor quer über den sylter deich ', '     ZWÖLF
@@ -188,9 +176,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Pchnąć w tę łódź jeża lub ośm skrzyń fig. ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Pchnąć w tę łódź jeża lub ośm skrzyń fig. ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     pchnąć w tę łódź jeża lub ośm skrzyń fig. ', '     PCHNĄĆ W TĘ ŁÓDŹ JEŻA
@@ -202,9 +190,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Чуєш їх, доцю, га? Кумедна ж ти, прощайся без ґольфів! ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Чуєш їх, доцю, га? Кумедна ж ти, прощайся без ґольфів! ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     чуєш їх, доцю, га? кумедна ж ти, прощайся без ґольфів! ', '     ЧУЄШ ЇХ,
@@ -216,9 +204,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Příliš žluťoučký kůň úpěl ďábelské ódy ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Příliš žluťoučký kůň úpěl ďábelské ódy ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     příliš žluťoučký kůň úpěl ďábelské ódy ', '     PŘÍLIŠ ŽLUŤOUČKÝ KŮŇ ÚPĚL
@@ -230,11 +218,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     Laŭ Ludoviko Zamenhof bongustas freŝa ĉeĥa manĝaĵo kun spicoj
-      ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     Laŭ Ludoviko Zamenhof bongustas freŝa ĉeĥa manĝaĵo kun spicoj
-      ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     laŭ ludoviko zamenhof bongustas freŝa ĉeĥa manĝaĵo kun spicoj ', '     LAŬ
@@ -246,9 +232,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: lower('     いろはにほへと ちりぬるを わかよたれそ つねならむ うゐのおくやま けふこえて あさきゆめみし ゑひもせす ')
+  - name: COLUMN_1
     type: string
-  - name: upper('     いろはにほへと ちりぬるを わかよたれそ つねならむ うゐのおくやま けふこえて あさきゆめみし ゑひもせす ')
+  - name: COLUMN_2
     type: string
   rows:
   - ['     いろはにほへと ちりぬるを わかよたれそ つねならむ うゐのおくやま けふこえて あさきゆめみし ゑひもせす ', '     いろはにほへと
@@ -260,9 +246,9 @@ upper_lower_test([[
 ]]);
 ---
 - metadata:
-  - name: 'lower(''     Pijamalı hasta yağız şoföre çabucak güvendi. EXTRA: İ '')'
+  - name: COLUMN_1
     type: string
-  - name: 'upper(''     Pijamalı hasta yağız şoföre çabucak güvendi. EXTRA: İ '')'
+  - name: COLUMN_2
     type: string
   rows:
   - ['     pijamalı hasta yağız şoföre çabucak güvendi. extra: i̇ ', '     PIJAMALI
diff --git a/test/sql/integer-overflow.result b/test/sql/integer-overflow.result
index 6269cb547..a56fb2412 100644
--- a/test/sql/integer-overflow.result
+++ b/test/sql/integer-overflow.result
@@ -19,7 +19,7 @@ box.execute('SELECT (2147483647 * 2147483647 * 2147483647);')
 box.execute('SELECT (-9223372036854775808 / -1);')
 ---
 - metadata:
-  - name: (-9223372036854775808 / -1)
+  - name: COLUMN_1
     type: integer
   rows:
   - [9223372036854775808]
@@ -32,7 +32,7 @@ box.execute('SELECT (-9223372036854775808 - 1);')
 box.execute('SELECT (9223372036854775807 + 1);')
 ---
 - metadata:
-  - name: (9223372036854775807 + 1)
+  - name: COLUMN_1
     type: integer
   rows:
   - [9223372036854775808]
@@ -50,7 +50,7 @@ box.execute('SELECT 18446744073709551615 * 2;')
 box.execute('SELECT (-9223372036854775807 * (-2));')
 ---
 - metadata:
-  - name: (-9223372036854775807 * (-2))
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551614]
@@ -60,7 +60,7 @@ box.execute('SELECT (-9223372036854775807 * (-2));')
 box.execute('SELECT 9223372036854775808;')
 ---
 - metadata:
-  - name: '9223372036854775808'
+  - name: COLUMN_1
     type: integer
   rows:
   - [9223372036854775808]
@@ -74,7 +74,7 @@ box.execute('SELECT -9223372036854775809;')
 box.execute('SELECT 9223372036854775808 - 1;')
 ---
 - metadata:
-  - name: 9223372036854775808 - 1
+  - name: COLUMN_1
     type: integer
   rows:
   - [9223372036854775807]
@@ -82,7 +82,7 @@ box.execute('SELECT 9223372036854775808 - 1;')
 box.execute('SELECT 18446744073709551615;')
 ---
 - metadata:
-  - name: '18446744073709551615'
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551615]
@@ -98,7 +98,7 @@ box.execute('SELECT 18446744073709551616;')
 box.execute('SELECT CAST(\'9223372036854775808\' AS INTEGER);')
 ---
 - metadata:
-  - name: CAST('9223372036854775808' AS INTEGER)
+  - name: COLUMN_1
     type: integer
   rows:
   - [9223372036854775808]
diff --git a/test/sql/iproto.result b/test/sql/iproto.result
index 44ba499a0..ee1047fc1 100644
--- a/test/sql/iproto.result
+++ b/test/sql/iproto.result
@@ -372,11 +372,11 @@ parameters[3] = 33
 cn:execute('select $2, $1, $3', parameters)
 ---
 - metadata:
-  - name: $2
+  - name: COLUMN_1
     type: integer
-  - name: $1
+  - name: COLUMN_2
     type: integer
-  - name: $3
+  - name: COLUMN_3
     type: integer
   rows:
   - [22, 11, 33]
@@ -736,7 +736,7 @@ res.metadata
 cn:execute("SELECT zeroblob(1);")
 ---
 - metadata:
-  - name: zeroblob(1)
+  - name: COLUMN_1
     type: varbinary
   rows:
   - ["\0"]
@@ -749,7 +749,7 @@ res = cn:execute("SELECT randomblob(1);")
 ...
 res.metadata
 ---
-- - name: randomblob(1)
+- - name: COLUMN_1
     type: varbinary
 ...
 -- Type set during compilation stage, and since min/max are accept
@@ -759,7 +759,7 @@ res.metadata
 cn:execute("SELECT LEAST(1, 2, 3);")
 ---
 - metadata:
-  - name: LEAST(1, 2, 3)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [1]
@@ -767,7 +767,7 @@ cn:execute("SELECT LEAST(1, 2, 3);")
 cn:execute("SELECT GREATEST(1, 2, 3);")
 ---
 - metadata:
-  - name: GREATEST(1, 2, 3)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [3]
@@ -803,7 +803,7 @@ s = box.prepare([[ SELECT ?; ]])
 s:execute({42})
 ---
 - metadata:
-  - name: '?'
+  - name: COLUMN_1
     type: integer
   rows:
   - [42]
@@ -811,7 +811,7 @@ s:execute({42})
 box.execute('SELECT 1;')
 ---
 - metadata:
-  - name: '1'
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
diff --git a/test/sql/max-on-index.result b/test/sql/max-on-index.result
index 1cd488f85..a90f30993 100644
--- a/test/sql/max-on-index.result
+++ b/test/sql/max-on-index.result
@@ -48,7 +48,7 @@ box.execute("INSERT INTO test2 VALUES(1, 2)");
 box.execute("SELECT MAX(f1) FROM test1")
 ---
 - metadata:
-  - name: MAX(f1)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [4]
@@ -56,7 +56,7 @@ box.execute("SELECT MAX(f1) FROM test1")
 box.execute("SELECT MAX(f2) FROM test1")
 ---
 - metadata:
-  - name: MAX(f2)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [3]
@@ -64,7 +64,7 @@ box.execute("SELECT MAX(f2) FROM test1")
 box.execute("SELECT MAX(f1) FROM test2")
 ---
 - metadata:
-  - name: MAX(f1)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [1]
diff --git a/test/sql/misc.result b/test/sql/misc.result
index 0190a5897..6af11bfba 100644
--- a/test/sql/misc.result
+++ b/test/sql/misc.result
@@ -11,7 +11,7 @@ _ = box.space._session_settings:update('sql_default_engine', {{'=', 2, engine}})
 box.execute('select 1;')
 ---
 - metadata:
-  - name: '1'
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -78,7 +78,7 @@ box.execute('CREATE TABLE test (id INTEGER PRIMARY KEY, b TEXT CONSTRAINT c1 COL
 box.execute('SELECT 1;')
 ---
 - metadata:
-  - name: '1'
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -86,7 +86,7 @@ box.execute('SELECT 1;')
 box.execute('SELECT 1.5;')
 ---
 - metadata:
-  - name: '1.5'
+  - name: COLUMN_1
     type: double
   rows:
   - [1.5]
@@ -94,7 +94,7 @@ box.execute('SELECT 1.5;')
 box.execute('SELECT 1.0;')
 ---
 - metadata:
-  - name: '1.0'
+  - name: COLUMN_1
     type: double
   rows:
   - [1]
@@ -102,7 +102,7 @@ box.execute('SELECT 1.0;')
 box.execute('SELECT \'abc\';')
 ---
 - metadata:
-  - name: '''abc'''
+  - name: COLUMN_1
     type: string
   rows:
   - ['abc']
@@ -110,7 +110,7 @@ box.execute('SELECT \'abc\';')
 box.execute('SELECT X\'4D6564766564\'')
 ---
 - metadata:
-  - name: X'4D6564766564'
+  - name: COLUMN_1
     type: varbinary
   rows:
   - ['Medved']
diff --git a/test/sql/persistency.result b/test/sql/persistency.result
index 6d14d4c4e..95dde5714 100644
--- a/test/sql/persistency.result
+++ b/test/sql/persistency.result
@@ -41,9 +41,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -57,9 +57,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar LIMIT 2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -72,9 +72,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo=2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['bar', 2, 42, 'awesome']
@@ -86,9 +86,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo>2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foobar', 1000, 42, 'awesome']
@@ -100,9 +100,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo>=2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['bar', 2, 42, 'awesome']
@@ -115,9 +115,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo=10000")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows: []
 ...
@@ -128,9 +128,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo>10000")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows: []
 ...
@@ -141,9 +141,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -155,9 +155,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<2.001")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -170,9 +170,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<=2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -185,9 +185,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<100")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -200,9 +200,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE bar='foo'")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -210,7 +210,7 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE bar='foo'")
 box.execute("SELECT count(*) FROM foobar")
 ---
 - metadata:
-  - name: count(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -218,7 +218,7 @@ box.execute("SELECT count(*) FROM foobar")
 box.execute("SELECT count(*) FROM foobar WHERE bar='foo'")
 ---
 - metadata:
-  - name: count(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -230,9 +230,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar ORDER BY bar")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['bar', 2, 42, 'awesome']
@@ -246,9 +246,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar ORDER BY bar DESC")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foobar', 1000, 42, 'awesome']
@@ -263,7 +263,7 @@ box.execute("REPLACE INTO foobar VALUES (1, 'cacodaemon')")
 box.execute("SELECT COUNT(*) FROM foobar WHERE foo=1")
 ---
 - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -271,7 +271,7 @@ box.execute("SELECT COUNT(*) FROM foobar WHERE foo=1")
 box.execute("SELECT COUNT(*) FROM foobar WHERE bar='cacodaemon'")
 ---
 - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -283,7 +283,7 @@ box.execute("DELETE FROM foobar WHERE bar='cacodaemon'")
 box.execute("SELECT COUNT(*) FROM foobar WHERE bar='cacodaemon'")
 ---
 - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
diff --git a/test/sql/prepared.result b/test/sql/prepared.result
index 666f6e1d3..0db2cc03f 100644
--- a/test/sql/prepared.result
+++ b/test/sql/prepared.result
@@ -425,13 +425,13 @@ s = prepare("SELECT count(*), count(a - 3), max(b), abs(id) FROM test WHERE b =
 execute(s.stmt_id)
  | ---
  | - metadata:
- |   - name: count(*)
+ |   - name: COLUMN_1
  |     type: integer
- |   - name: count(a - 3)
+ |   - name: COLUMN_2
  |     type: integer
- |   - name: max(b)
+ |   - name: COLUMN_3
  |     type: scalar
- |   - name: abs(id)
+ |   - name: COLUMN_4
  |     type: number
  |   rows:
  |   - [1, 1, '3', 1]
@@ -439,13 +439,13 @@ execute(s.stmt_id)
 execute(s.stmt_id)
  | ---
  | - metadata:
- |   - name: count(*)
+ |   - name: COLUMN_1
  |     type: integer
- |   - name: count(a - 3)
+ |   - name: COLUMN_2
  |     type: integer
- |   - name: max(b)
+ |   - name: COLUMN_3
  |     type: scalar
- |   - name: abs(id)
+ |   - name: COLUMN_4
  |     type: number
  |   rows:
  |   - [1, 1, '3', 1]
@@ -480,7 +480,7 @@ res = execute(s.stmt_id)
  | ...
 res.metadata
  | ---
- | - - name: group_concat(TRIM(TRAILING FROM t),x'0a')
+ | - - name: COLUMN_13
  |     type: string
  | ...
 unprepare(s.stmt_id)
@@ -838,11 +838,11 @@ s = prepare('SELECT :a, :b, :c');
 execute(s.stmt_id, {{[':a'] = 1}, {[':b'] = 2}, {[':c'] = 3}});
  | ---
  | - metadata:
- |   - name: :a
+ |   - name: COLUMN_1
  |     type: integer
- |   - name: :b
+ |   - name: COLUMN_2
  |     type: integer
- |   - name: :c
+ |   - name: COLUMN_3
  |     type: integer
  |   rows:
  |   - [1, 2, 3]
@@ -850,11 +850,11 @@ execute(s.stmt_id, {{[':a'] = 1}, {[':b'] = 2}, {[':c'] = 3}});
 execute(s.stmt_id, {{[':a'] = 1}, {[':b'] = 2}});
  | ---
  | - metadata:
- |   - name: :a
+ |   - name: COLUMN_1
  |     type: integer
- |   - name: :b
+ |   - name: COLUMN_2
  |     type: integer
- |   - name: :c
+ |   - name: COLUMN_3
  |     type: boolean
  |   rows:
  |   - [1, 2, null]
@@ -862,11 +862,11 @@ execute(s.stmt_id, {{[':a'] = 1}, {[':b'] = 2}});
 execute(s.stmt_id);
  | ---
  | - metadata:
- |   - name: :a
+ |   - name: COLUMN_1
  |     type: boolean
- |   - name: :b
+ |   - name: COLUMN_2
  |     type: boolean
- |   - name: :c
+ |   - name: COLUMN_3
  |     type: boolean
  |   rows:
  |   - [null, null, null]
diff --git a/test/sql/row-count.result b/test/sql/row-count.result
index 02acd79b5..7591d1630 100644
--- a/test/sql/row-count.result
+++ b/test/sql/row-count.result
@@ -16,7 +16,7 @@ box.execute("CREATE TABLE t1 (s1 VARCHAR(10) PRIMARY KEY);")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -24,7 +24,7 @@ box.execute("SELECT ROW_COUNT();")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -36,7 +36,7 @@ box.execute("CREATE TABLE t2 (s1 VARCHAR(10) PRIMARY KEY, s2 VARCHAR(10) REFEREN
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -52,7 +52,7 @@ box.execute("INSERT INTO t3 VALUES (0, 0, 0);")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -64,7 +64,7 @@ box.execute("CREATE TRIGGER x AFTER DELETE ON t1 FOR EACH ROW BEGIN UPDATE t3 SE
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -76,7 +76,7 @@ box.execute("INSERT INTO t1 VALUES ('a');")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -88,7 +88,7 @@ box.execute("INSERT INTO t2 VALUES ('a','a');")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -100,7 +100,7 @@ box.execute("INSERT INTO t1 VALUES ('b'), ('c'), ('d');")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -113,7 +113,7 @@ box.execute("REPLACE INTO t2 VALUES('a', 'c');")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [2]
@@ -125,7 +125,7 @@ box.execute("DELETE FROM t1;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [4]
@@ -141,7 +141,7 @@ box.execute("TRUNCATE TABLE t3;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -157,7 +157,7 @@ box.execute("UPDATE t3 SET i2 = 666;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -172,7 +172,7 @@ box.execute("DELETE FROM t3 WHERE 0 = 0;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -188,7 +188,7 @@ box.execute("DELETE FROM t3")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -222,7 +222,7 @@ box.execute("DELETE FROM tt1 WHERE id = 2;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -252,7 +252,7 @@ box.execute("START TRANSACTION;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -264,7 +264,7 @@ box.execute("COMMIT;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -277,7 +277,7 @@ box.execute("COMMIT;")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -286,7 +286,7 @@ box.execute("SELECT ROW_COUNT();")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -308,7 +308,7 @@ box.execute("EXPLAIN QUERY PLAN INSERT INTO t1 VALUES ('b'), ('c'), ('d');")
 box.execute("SELECT ROW_COUNT();")
 ---
 - metadata:
-  - name: ROW_COUNT()
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
diff --git a/test/sql/transition.result b/test/sql/transition.result
index c14055b4e..8680e3cec 100644
--- a/test/sql/transition.result
+++ b/test/sql/transition.result
@@ -38,9 +38,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -54,9 +54,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar LIMIT 2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -69,9 +69,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo=2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['bar', 2, 42, 'awesome']
@@ -83,9 +83,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo>2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foobar', 1000, 42, 'awesome']
@@ -97,9 +97,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo>=2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['bar', 2, 42, 'awesome']
@@ -112,9 +112,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo=10000")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows: []
 ...
@@ -125,9 +125,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo>10000")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows: []
 ...
@@ -138,9 +138,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -152,9 +152,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<2.001")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -167,9 +167,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<=2")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -182,9 +182,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE foo<100")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -197,9 +197,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE bar='foo'")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foo', 1, 42, 'awesome']
@@ -207,7 +207,7 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar WHERE bar='foo'")
 box.execute("SELECT count(*) FROM foobar")
 ---
 - metadata:
-  - name: count(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -215,7 +215,7 @@ box.execute("SELECT count(*) FROM foobar")
 box.execute("SELECT count(*) FROM foobar WHERE bar='foo'")
 ---
 - metadata:
-  - name: count(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -227,9 +227,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar ORDER BY bar")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['bar', 2, 42, 'awesome']
@@ -243,9 +243,9 @@ box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar ORDER BY bar DESC")
     type: string
   - name: FOO
     type: integer
-  - name: '42'
+  - name: COLUMN_1
     type: integer
-  - name: '''awesome'''
+  - name: COLUMN_2
     type: string
   rows:
   - ['foobar', 1000, 42, 'awesome']
@@ -260,7 +260,7 @@ box.execute("REPLACE INTO foobar VALUES (1, 'cacodaemon')")
 box.execute("SELECT COUNT(*) FROM foobar WHERE foo=1")
 ---
 - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -268,7 +268,7 @@ box.execute("SELECT COUNT(*) FROM foobar WHERE foo=1")
 box.execute("SELECT COUNT(*) FROM foobar WHERE bar='cacodaemon'")
 ---
 - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -280,7 +280,7 @@ box.execute("DELETE FROM foobar WHERE bar='cacodaemon'")
 box.execute("SELECT COUNT(*) FROM foobar WHERE bar='cacodaemon'")
 ---
 - metadata:
-  - name: COUNT(*)
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
diff --git a/test/sql/types.result b/test/sql/types.result
index 54aff460e..8204b22bd 100644
--- a/test/sql/types.result
+++ b/test/sql/types.result
@@ -54,8 +54,8 @@ box.execute("CREATE VIEW v1 AS SELECT b + a, b - a FROM t1;")
 ...
 box.space.V1:format()
 ---
-- [{'type': 'number', 'nullable_action': 'none', 'name': 'b + a', 'is_nullable': true},
-  {'type': 'number', 'nullable_action': 'none', 'name': 'b - a', 'is_nullable': true}]
+- [{'type': 'number', 'nullable_action': 'none', 'name': 'COLUMN_1', 'is_nullable': true},
+  {'type': 'number', 'nullable_action': 'none', 'name': 'COLUMN_2', 'is_nullable': true}]
 ...
 -- gh-2494: index's part also features correct declared type.
 --
@@ -197,7 +197,7 @@ box.execute("SELECT randomblob(5) || 'x';")
 box.execute("VALUES (TYPEOF(randomblob(5) || zeroblob(5)));")
 ---
 - metadata:
-  - name: column1
+  - name: COLUMN_1
     type: string
   rows:
   - ['varbinary']
@@ -230,7 +230,7 @@ box.execute("SELECT * FROM t1 WHERE 'blob' LIKE x'0000';")
 box.execute("SELECT s LIKE NULL FROM t1;")
 ---
 - metadata:
-  - name: s LIKE NULL
+  - name: COLUMN_1
     type: integer
   rows:
   - [null]
@@ -256,7 +256,7 @@ box.execute("SELECT * FROM t1 WHERE 'int' LIKE 4;")
 box.execute("SELECT NULL LIKE s FROM t1;")
 ---
 - metadata:
-  - name: NULL LIKE s
+  - name: COLUMN_1
     type: integer
   rows:
   - [null]
@@ -295,7 +295,7 @@ box.space.T1:drop()
 box.execute('SELECT 1 + 1;')
 ---
 - metadata:
-  - name: 1 + 1
+  - name: COLUMN_1
     type: integer
   rows:
   - [2]
@@ -303,7 +303,7 @@ box.execute('SELECT 1 + 1;')
 box.execute('SELECT 1 + 1.1;')
 ---
 - metadata:
-  - name: 1 + 1.1
+  - name: COLUMN_1
     type: double
   rows:
   - [2.1]
@@ -311,7 +311,7 @@ box.execute('SELECT 1 + 1.1;')
 box.execute('SELECT \'9223372036854\' + 1;')
 ---
 - metadata:
-  - name: '''9223372036854'' + 1'
+  - name: COLUMN_1
     type: integer
   rows:
   - [9223372036855]
@@ -320,7 +320,7 @@ box.execute('SELECT \'9223372036854\' + 1;')
 box.execute('SELECT ?', {true})
 ---
 - metadata:
-  - name: '?'
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -481,7 +481,7 @@ s:drop()
 box.execute("SELECT 18446744073709551615 > 18446744073709551614;")
 ---
 - metadata:
-  - name: 18446744073709551615 > 18446744073709551614
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -489,7 +489,7 @@ box.execute("SELECT 18446744073709551615 > 18446744073709551614;")
 box.execute("SELECT 18446744073709551615 > -9223372036854775808;")
 ---
 - metadata:
-  - name: 18446744073709551615 > -9223372036854775808
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -497,7 +497,7 @@ box.execute("SELECT 18446744073709551615 > -9223372036854775808;")
 box.execute("SELECT -1 < 18446744073709551615;")
 ---
 - metadata:
-  - name: -1 < 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -505,7 +505,7 @@ box.execute("SELECT -1 < 18446744073709551615;")
 box.execute("SELECT 1.5 < 18446744073709551615")
 ---
 - metadata:
-  - name: 1.5 < 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -513,7 +513,7 @@ box.execute("SELECT 1.5 < 18446744073709551615")
 box.execute("SELECT 1.5 > 18446744073709551615")
 ---
 - metadata:
-  - name: 1.5 > 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [false]
@@ -521,7 +521,7 @@ box.execute("SELECT 1.5 > 18446744073709551615")
 box.execute("SELECT 18446744073709551615 > 1.5")
 ---
 - metadata:
-  - name: 18446744073709551615 > 1.5
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -529,7 +529,7 @@ box.execute("SELECT 18446744073709551615 > 1.5")
 box.execute("SELECT 18446744073709551615 < 1.5")
 ---
 - metadata:
-  - name: 18446744073709551615 < 1.5
+  - name: COLUMN_1
     type: boolean
   rows:
   - [false]
@@ -537,7 +537,7 @@ box.execute("SELECT 18446744073709551615 < 1.5")
 box.execute("SELECT 18446744073709551615 = 18446744073709551615;")
 ---
 - metadata:
-  - name: 18446744073709551615 = 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -545,7 +545,7 @@ box.execute("SELECT 18446744073709551615 = 18446744073709551615;")
 box.execute("SELECT 18446744073709551615 > -9223372036854775808;")
 ---
 - metadata:
-  - name: 18446744073709551615 > -9223372036854775808
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -553,7 +553,7 @@ box.execute("SELECT 18446744073709551615 > -9223372036854775808;")
 box.execute("SELECT 18446744073709551615 < -9223372036854775808;")
 ---
 - metadata:
-  - name: 18446744073709551615 < -9223372036854775808
+  - name: COLUMN_1
     type: boolean
   rows:
   - [false]
@@ -561,7 +561,7 @@ box.execute("SELECT 18446744073709551615 < -9223372036854775808;")
 box.execute("SELECT -1 < 18446744073709551615;")
 ---
 - metadata:
-  - name: -1 < 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -569,7 +569,7 @@ box.execute("SELECT -1 < 18446744073709551615;")
 box.execute("SELECT -1 > 18446744073709551615;")
 ---
 - metadata:
-  - name: -1 > 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [false]
@@ -577,7 +577,7 @@ box.execute("SELECT -1 > 18446744073709551615;")
 box.execute("SELECT 18446744073709551610 - 18446744073709551615;")
 ---
 - metadata:
-  - name: 18446744073709551610 - 18446744073709551615
+  - name: COLUMN_1
     type: integer
   rows:
   - [-5]
@@ -585,7 +585,7 @@ box.execute("SELECT 18446744073709551610 - 18446744073709551615;")
 box.execute("SELECT 18446744073709551615 = null;")
 ---
 - metadata:
-  - name: 18446744073709551615 = null
+  - name: COLUMN_1
     type: boolean
   rows:
   - [null]
@@ -593,7 +593,7 @@ box.execute("SELECT 18446744073709551615 = null;")
 box.execute("SELECT 18446744073709551615 = 18446744073709551615.0;")
 ---
 - metadata:
-  - name: 18446744073709551615 = 18446744073709551615.0
+  - name: COLUMN_1
     type: boolean
   rows:
   - [false]
@@ -601,7 +601,7 @@ box.execute("SELECT 18446744073709551615 = 18446744073709551615.0;")
 box.execute("SELECT 18446744073709551615.0 > 18446744073709551615")
 ---
 - metadata:
-  - name: 18446744073709551615.0 > 18446744073709551615
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -609,7 +609,7 @@ box.execute("SELECT 18446744073709551615.0 > 18446744073709551615")
 box.execute("SELECT 18446744073709551615 IN ('18446744073709551615', 18446744073709551615.0)")
 ---
 - metadata:
-  - name: 18446744073709551615 IN ('18446744073709551615', 18446744073709551615.0)
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -617,7 +617,7 @@ box.execute("SELECT 18446744073709551615 IN ('18446744073709551615', 18446744073
 box.execute("SELECT 1 LIMIT 18446744073709551615;")
 ---
 - metadata:
-  - name: '1'
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -625,7 +625,7 @@ box.execute("SELECT 1 LIMIT 18446744073709551615;")
 box.execute("SELECT 1 LIMIT 1 OFFSET 18446744073709551614;")
 ---
 - metadata:
-  - name: '1'
+  - name: COLUMN_1
     type: integer
   rows: []
 ...
@@ -637,7 +637,7 @@ box.execute("SELECT CAST('18446744073' || '709551616' AS INTEGER);")
 box.execute("SELECT CAST('18446744073' || '709551615' AS INTEGER);")
 ---
 - metadata:
-  - name: CAST('18446744073' || '709551615' AS INTEGER)
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551615]
@@ -645,7 +645,7 @@ box.execute("SELECT CAST('18446744073' || '709551615' AS INTEGER);")
 box.execute("SELECT 18446744073709551610 + 5;")
 ---
 - metadata:
-  - name: 18446744073709551610 + 5
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551615]
@@ -653,7 +653,7 @@ box.execute("SELECT 18446744073709551610 + 5;")
 box.execute("SELECT 18446744073709551615 * 1;")
 ---
 - metadata:
-  - name: 18446744073709551615 * 1
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551615]
@@ -661,7 +661,7 @@ box.execute("SELECT 18446744073709551615 * 1;")
 box.execute("SELECT 1 / 18446744073709551615;")
 ---
 - metadata:
-  - name: 1 / 18446744073709551615
+  - name: COLUMN_1
     type: integer
   rows:
   - [0]
@@ -669,7 +669,7 @@ box.execute("SELECT 1 / 18446744073709551615;")
 box.execute("SELECT 18446744073709551615 / 18446744073709551615;")
 ---
 - metadata:
-  - name: 18446744073709551615 / 18446744073709551615
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -677,7 +677,7 @@ box.execute("SELECT 18446744073709551615 / 18446744073709551615;")
 box.execute("SELECT 18446744073709551615 / -9223372036854775808;")
 ---
 - metadata:
-  - name: 18446744073709551615 / -9223372036854775808
+  - name: COLUMN_1
     type: integer
   rows:
   - [-1]
@@ -771,7 +771,7 @@ box.execute("INSERT INTO t VALUES (2, -1);")
 box.execute("SELECT sum(i) FROM t;")
 ---
 - metadata:
-  - name: sum(i)
+  - name: COLUMN_1
     type: number
   rows:
   - [18446744073709551613]
@@ -779,7 +779,7 @@ box.execute("SELECT sum(i) FROM t;")
 box.execute("SELECT avg(i) FROM t;")
 ---
 - metadata:
-  - name: avg(i)
+  - name: COLUMN_1
     type: number
   rows:
   - [6148914691236516864]
@@ -787,7 +787,7 @@ box.execute("SELECT avg(i) FROM t;")
 box.execute("SELECT total(i) FROM t;")
 ---
 - metadata:
-  - name: total(i)
+  - name: COLUMN_1
     type: number
   rows:
   - [1.844674407371e+19]
@@ -795,7 +795,7 @@ box.execute("SELECT total(i) FROM t;")
 box.execute("SELECT min(i) FROM t;")
 ---
 - metadata:
-  - name: min(i)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [-1]
@@ -803,7 +803,7 @@ box.execute("SELECT min(i) FROM t;")
 box.execute("SELECT max(i) FROM t;")
 ---
 - metadata:
-  - name: max(i)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [18446744073709551613]
@@ -811,7 +811,7 @@ box.execute("SELECT max(i) FROM t;")
 box.execute("SELECT count(i) FROM t;")
 ---
 - metadata:
-  - name: count(i)
+  - name: COLUMN_1
     type: integer
   rows:
   - [3]
@@ -819,7 +819,7 @@ box.execute("SELECT count(i) FROM t;")
 box.execute("SELECT group_concat(i) FROM t;")
 ---
 - metadata:
-  - name: group_concat(i)
+  - name: COLUMN_1
     type: string
   rows:
   - ['1,-1,18446744073709551613']
@@ -831,7 +831,7 @@ box.execute("DELETE FROM t WHERE i < 18446744073709551613;")
 box.execute("SELECT lower(i) FROM t;")
 ---
 - metadata:
-  - name: lower(i)
+  - name: COLUMN_1
     type: string
   rows:
   - ['18446744073709551613']
@@ -839,7 +839,7 @@ box.execute("SELECT lower(i) FROM t;")
 box.execute("SELECT upper(i) FROM t;")
 ---
 - metadata:
-  - name: upper(i)
+  - name: COLUMN_1
     type: string
   rows:
   - ['18446744073709551613']
@@ -847,7 +847,7 @@ box.execute("SELECT upper(i) FROM t;")
 box.execute("SELECT abs(i) FROM t;")
 ---
 - metadata:
-  - name: abs(i)
+  - name: COLUMN_1
     type: number
   rows:
   - [18446744073709551613]
@@ -855,7 +855,7 @@ box.execute("SELECT abs(i) FROM t;")
 box.execute("SELECT typeof(i) FROM t;")
 ---
 - metadata:
-  - name: typeof(i)
+  - name: COLUMN_1
     type: string
   rows:
   - ['integer']
@@ -863,7 +863,7 @@ box.execute("SELECT typeof(i) FROM t;")
 box.execute("SELECT quote(i) FROM t;")
 ---
 - metadata:
-  - name: quote(i)
+  - name: COLUMN_1
     type: string
   rows:
   - [18446744073709551613]
@@ -871,7 +871,7 @@ box.execute("SELECT quote(i) FROM t;")
 box.execute("SELECT LEAST(-1, i) FROM t;")
 ---
 - metadata:
-  - name: LEAST(-1, i)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [-1]
@@ -879,7 +879,7 @@ box.execute("SELECT LEAST(-1, i) FROM t;")
 box.execute("SELECT quote(i) FROM t;")
 ---
 - metadata:
-  - name: quote(i)
+  - name: COLUMN_1
     type: string
   rows:
   - [18446744073709551613]
@@ -1012,7 +1012,7 @@ box.space.T1:drop()
 box.execute("SELECT CAST(18446744073709551615 AS NUMBER);")
 ---
 - metadata:
-  - name: CAST(18446744073709551615 AS NUMBER)
+  - name: COLUMN_1
     type: number
   rows:
   - [18446744073709551615]
@@ -1020,7 +1020,7 @@ box.execute("SELECT CAST(18446744073709551615 AS NUMBER);")
 box.execute("SELECT CAST(18446744073709551615 AS TEXT);")
 ---
 - metadata:
-  - name: CAST(18446744073709551615 AS TEXT)
+  - name: COLUMN_1
     type: string
   rows:
   - ['18446744073709551615']
@@ -1028,7 +1028,7 @@ box.execute("SELECT CAST(18446744073709551615 AS TEXT);")
 box.execute("SELECT CAST(18446744073709551615 AS SCALAR);")
 ---
 - metadata:
-  - name: CAST(18446744073709551615 AS SCALAR)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [18446744073709551615]
@@ -1036,7 +1036,7 @@ box.execute("SELECT CAST(18446744073709551615 AS SCALAR);")
 box.execute("SELECT CAST(18446744073709551615 AS BOOLEAN);")
 ---
 - metadata:
-  - name: CAST(18446744073709551615 AS BOOLEAN)
+  - name: COLUMN_1
     type: boolean
   rows:
   - [true]
@@ -1044,7 +1044,7 @@ box.execute("SELECT CAST(18446744073709551615 AS BOOLEAN);")
 box.execute("SELECT CAST('18446744073709551615' AS INTEGER);")
 ---
 - metadata:
-  - name: CAST('18446744073709551615' AS INTEGER)
+  - name: COLUMN_1
     type: integer
   rows:
   - [18446744073709551615]
@@ -1077,7 +1077,7 @@ box.execute("SELECT id FROM t1;")
 box.execute("SELECT CAST(123 AS UNSIGNED);")
 ---
 - metadata:
-  - name: CAST(123 AS UNSIGNED)
+  - name: COLUMN_1
     type: unsigned
   rows:
   - [123]
@@ -1090,7 +1090,7 @@ box.execute("SELECT CAST(-123 AS UNSIGNED);")
 box.execute("SELECT CAST(1.5 AS UNSIGNED);")
 ---
 - metadata:
-  - name: CAST(1.5 AS UNSIGNED)
+  - name: COLUMN_1
     type: unsigned
   rows:
   - [1]
@@ -1098,7 +1098,7 @@ box.execute("SELECT CAST(1.5 AS UNSIGNED);")
 box.execute("SELECT CAST(-1.5 AS UNSIGNED);")
 ---
 - metadata:
-  - name: CAST(-1.5 AS UNSIGNED)
+  - name: COLUMN_1
     type: unsigned
   rows:
   - [-1]
@@ -1106,7 +1106,7 @@ box.execute("SELECT CAST(-1.5 AS UNSIGNED);")
 box.execute("SELECT CAST(true AS UNSIGNED);")
 ---
 - metadata:
-  - name: CAST(true AS UNSIGNED)
+  - name: COLUMN_1
     type: unsigned
   rows:
   - [1]
@@ -1114,7 +1114,7 @@ box.execute("SELECT CAST(true AS UNSIGNED);")
 box.execute("SELECT CAST('123' AS UNSIGNED);")
 ---
 - metadata:
-  - name: CAST('123' AS UNSIGNED)
+  - name: COLUMN_1
     type: unsigned
   rows:
   - [123]
@@ -1146,7 +1146,7 @@ box.space.T:drop()
 box.execute("SELECT CASE 1 WHEN 1 THEN x'0000000000' WHEN 2 THEN 'str' END")
 ---
 - metadata:
-  - name: CASE 1 WHEN 1 THEN x'0000000000' WHEN 2 THEN 'str' END
+  - name: COLUMN_1
     type: scalar
   rows:
   - ["\0\0\0\0\0"]
@@ -1154,7 +1154,7 @@ box.execute("SELECT CASE 1 WHEN 1 THEN x'0000000000' WHEN 2 THEN 'str' END")
 box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 END")
 ---
 - metadata:
-  - name: CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 END
+  - name: COLUMN_1
     type: integer
   rows:
   - [666]
@@ -1162,7 +1162,7 @@ box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 END")
 box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 ELSE 321 END")
 ---
 - metadata:
-  - name: CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 ELSE 321 END
+  - name: COLUMN_1
     type: integer
   rows:
   - [666]
@@ -1170,7 +1170,7 @@ box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 ELSE 321 END")
 box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 ELSE 'asd' END")
 ---
 - metadata:
-  - name: CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 ELSE 'asd' END
+  - name: COLUMN_1
     type: scalar
   rows:
   - [666]
@@ -1178,8 +1178,7 @@ box.execute("SELECT CASE 1 WHEN 1 THEN 666 WHEN 2 THEN 123 ELSE 'asd' END")
 box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4 WHEN 'e' THEN 5 WHEN 'f' THEN 6 END;")
 ---
 - metadata:
-  - name: CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4
-      WHEN 'e' THEN 5 WHEN 'f' THEN 6 END
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -1187,8 +1186,7 @@ box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHE
 box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4 WHEN 'e' THEN 5 WHEN 'f' THEN 'asd' END;")
 ---
 - metadata:
-  - name: CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4
-      WHEN 'e' THEN 5 WHEN 'f' THEN 'asd' END
+  - name: COLUMN_1
     type: scalar
   rows:
   - [1]
@@ -1196,8 +1194,7 @@ box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHE
 box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4 WHEN 'e' THEN 5 WHEN 'f' THEN 6 ELSE 'asd' END;")
 ---
 - metadata:
-  - name: CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4
-      WHEN 'e' THEN 5 WHEN 'f' THEN 6 ELSE 'asd' END
+  - name: COLUMN_1
     type: scalar
   rows:
   - [1]
@@ -1205,8 +1202,7 @@ box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHE
 box.execute("SELECT CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4 WHEN 'e' THEN 5 WHEN 'f' THEN 6 ELSE 7 END;")
 ---
 - metadata:
-  - name: CASE 'a' WHEN 'a' THEN 1 WHEN 'b' THEN 2 WHEN 'c' THEN 3 WHEN 'd' THEN 4
-      WHEN 'e' THEN 5 WHEN 'f' THEN 6 ELSE 7 END
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -1284,7 +1280,7 @@ box.execute("SELECT total(v) FROM t;")
 box.execute("SELECT min(v) FROM t;")
 ---
 - metadata:
-  - name: min(v)
+  - name: COLUMN_1
     type: scalar
   rows:
   - ['abc']
@@ -1292,7 +1288,7 @@ box.execute("SELECT min(v) FROM t;")
 box.execute("SELECT max(v) FROM t;")
 ---
 - metadata:
-  - name: max(v)
+  - name: COLUMN_1
     type: scalar
   rows:
   - ['abc']
@@ -1300,7 +1296,7 @@ box.execute("SELECT max(v) FROM t;")
 box.execute("SELECT count(v) FROM t;")
 ---
 - metadata:
-  - name: count(v)
+  - name: COLUMN_1
     type: integer
   rows:
   - [1]
@@ -1308,7 +1304,7 @@ box.execute("SELECT count(v) FROM t;")
 box.execute("SELECT group_concat(v) FROM t;")
 ---
 - metadata:
-  - name: group_concat(v)
+  - name: COLUMN_1
     type: string
   rows:
   - ['abc']
@@ -1331,7 +1327,7 @@ box.execute("SELECT abs(v) FROM t;")
 box.execute("SELECT typeof(v) FROM t;")
 ---
 - metadata:
-  - name: typeof(v)
+  - name: COLUMN_1
     type: string
   rows:
   - ['varbinary']
@@ -1339,7 +1335,7 @@ box.execute("SELECT typeof(v) FROM t;")
 box.execute("SELECT quote(v) FROM t;")
 ---
 - metadata:
-  - name: quote(v)
+  - name: COLUMN_1
     type: string
   rows:
   - ['X''616263''']
@@ -1347,7 +1343,7 @@ box.execute("SELECT quote(v) FROM t;")
 box.execute("SELECT LEAST(v, x'') FROM t;")
 ---
 - metadata:
-  - name: LEAST(v, x'')
+  - name: COLUMN_1
     type: scalar
   rows:
   - ['']
@@ -1467,7 +1463,7 @@ box.execute("SELECT CAST(true AS VARBINARY);")
 box.execute("SELECT CAST('asd' AS VARBINARY);")
 ---
 - metadata:
-  - name: CAST('asd' AS VARBINARY)
+  - name: COLUMN_1
     type: varbinary
   rows:
   - ['asd']
@@ -1475,7 +1471,7 @@ box.execute("SELECT CAST('asd' AS VARBINARY);")
 box.execute("SELECT CAST(x'' AS VARBINARY);")
 ---
 - metadata:
-  - name: CAST(x'' AS VARBINARY)
+  - name: COLUMN_1
     type: varbinary
   rows:
   - ['']
@@ -1494,9 +1490,9 @@ box.execute("INSERT INTO t VALUES (1, 1, 1), (2, NULL, NULL);")
 box.execute("SELECT typeof(a), typeof(s) FROM t;")
 ---
 - metadata:
-  - name: typeof(a)
+  - name: COLUMN_1
     type: string
-  - name: typeof(s)
+  - name: COLUMN_2
     type: string
   rows:
   - ['integer', 'integer']
@@ -1513,7 +1509,7 @@ box.execute('INSERT INTO t1 VALUES (1, NULL, NULL);')
 box.execute('SELECT typeof(a & b) FROM t1;')
 ---
 - metadata:
-  - name: typeof(a & b)
+  - name: COLUMN_1
     type: string
   rows:
   - ['integer']
@@ -1521,11 +1517,11 @@ box.execute('SELECT typeof(a & b) FROM t1;')
 box.execute('SELECT typeof(a), typeof(b), typeof(a & b) FROM t1')
 ---
 - metadata:
-  - name: typeof(a)
+  - name: COLUMN_1
     type: string
-  - name: typeof(b)
+  - name: COLUMN_2
     type: string
-  - name: typeof(a & b)
+  - name: COLUMN_3
     type: string
   rows:
   - ['integer', 'integer', 'integer']
@@ -1533,7 +1529,7 @@ box.execute('SELECT typeof(a), typeof(b), typeof(a & b) FROM t1')
 box.execute("SELECT typeof(CAST(0 AS UNSIGNED));")
 ---
 - metadata:
-  - name: typeof(CAST(0 AS UNSIGNED))
+  - name: COLUMN_1
     type: string
   rows:
   - ['unsigned']
@@ -1693,7 +1689,7 @@ box.execute('DROP TABLE t1;')
 box.execute("SELECT 1.0;")
 ---
 - metadata:
-  - name: '1.0'
+  - name: COLUMN_1
     type: double
   rows:
   - [1]
@@ -1701,7 +1697,7 @@ box.execute("SELECT 1.0;")
 box.execute("SELECT .01;")
 ---
 - metadata:
-  - name: '.01'
+  - name: COLUMN_1
     type: double
   rows:
   - [0.01]
@@ -1709,7 +1705,7 @@ box.execute("SELECT .01;")
 box.execute("SELECT CAST(1 AS DOUBLE);")
 ---
 - metadata:
-  - name: CAST(1 AS DOUBLE)
+  - name: COLUMN_1
     type: double
   rows:
   - [1]
@@ -1717,7 +1713,7 @@ box.execute("SELECT CAST(1 AS DOUBLE);")
 box.execute("SELECT CAST(1.123 AS DOUBLE);")
 ---
 - metadata:
-  - name: CAST(1.123 AS DOUBLE)
+  - name: COLUMN_1
     type: double
   rows:
   - [1.123]
@@ -1735,7 +1731,7 @@ box.execute("SELECT CAST('asd' AS DOUBLE);")
 box.execute("SELECT CAST('1' AS DOUBLE);")
 ---
 - metadata:
-  - name: CAST('1' AS DOUBLE)
+  - name: COLUMN_1
     type: double
   rows:
   - [1]
@@ -1743,7 +1739,7 @@ box.execute("SELECT CAST('1' AS DOUBLE);")
 box.execute("SELECT CAST('1.123' AS DOUBLE);")
 ---
 - metadata:
-  - name: CAST('1.123' AS DOUBLE)
+  - name: COLUMN_1
     type: double
   rows:
   - [1.123]
@@ -1761,7 +1757,7 @@ box.execute("SELECT CAST(x'35' AS DOUBLE);")
 box.execute("SELECT CAST(CAST(x'35' AS STRING) AS DOUBLE);")
 ---
 - metadata:
-  - name: CAST(CAST(x'35' AS STRING) AS DOUBLE)
+  - name: COLUMN_1
     type: double
   rows:
   - [5]
@@ -1795,7 +1791,7 @@ box.execute('SELECT * FROM t;')
 box.execute('SELECT d / 100 FROM t;')
 ---
 - metadata:
-  - name: d / 100
+  - name: COLUMN_1
     type: double
   rows:
   - [0.1]
@@ -1828,7 +1824,7 @@ box.execute('SELECT * from t WHERE d = 3.3;')
 box.execute("SELECT sum(d) FROM t;")
 ---
 - metadata:
-  - name: sum(d)
+  - name: COLUMN_1
     type: number
   rows:
   - [18000000000000000000]
@@ -1836,7 +1832,7 @@ box.execute("SELECT sum(d) FROM t;")
 box.execute("SELECT avg(d) FROM t;")
 ---
 - metadata:
-  - name: avg(d)
+  - name: COLUMN_1
     type: number
   rows:
   - [4500000000000000000]
@@ -1844,7 +1840,7 @@ box.execute("SELECT avg(d) FROM t;")
 box.execute("SELECT total(d) FROM t;")
 ---
 - metadata:
-  - name: total(d)
+  - name: COLUMN_1
     type: number
   rows:
   - [18000000000000000000]
@@ -1852,7 +1848,7 @@ box.execute("SELECT total(d) FROM t;")
 box.execute("SELECT min(d) FROM t;")
 ---
 - metadata:
-  - name: min(d)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [-2]
@@ -1860,7 +1856,7 @@ box.execute("SELECT min(d) FROM t;")
 box.execute("SELECT max(d) FROM t;")
 ---
 - metadata:
-  - name: max(d)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [18000000000000000000]
@@ -1868,7 +1864,7 @@ box.execute("SELECT max(d) FROM t;")
 box.execute("SELECT count(d) FROM t;")
 ---
 - metadata:
-  - name: count(d)
+  - name: COLUMN_1
     type: integer
   rows:
   - [4]
@@ -1876,7 +1872,7 @@ box.execute("SELECT count(d) FROM t;")
 box.execute("SELECT group_concat(d) FROM t;")
 ---
 - metadata:
-  - name: group_concat(d)
+  - name: COLUMN_1
     type: string
   rows:
   - ['10.0,-2.0,3.3,1.8e+19']
@@ -1884,7 +1880,7 @@ box.execute("SELECT group_concat(d) FROM t;")
 box.execute("SELECT lower(d) FROM t;")
 ---
 - metadata:
-  - name: lower(d)
+  - name: COLUMN_1
     type: string
   rows:
   - ['10.0']
@@ -1895,7 +1891,7 @@ box.execute("SELECT lower(d) FROM t;")
 box.execute("SELECT upper(d) FROM t;")
 ---
 - metadata:
-  - name: upper(d)
+  - name: COLUMN_1
     type: string
   rows:
   - ['10.0']
@@ -1906,7 +1902,7 @@ box.execute("SELECT upper(d) FROM t;")
 box.execute("SELECT abs(d) FROM t;")
 ---
 - metadata:
-  - name: abs(d)
+  - name: COLUMN_1
     type: number
   rows:
   - [10]
@@ -1917,7 +1913,7 @@ box.execute("SELECT abs(d) FROM t;")
 box.execute("SELECT typeof(d) FROM t;")
 ---
 - metadata:
-  - name: typeof(d)
+  - name: COLUMN_1
     type: string
   rows:
   - ['double']
@@ -1928,7 +1924,7 @@ box.execute("SELECT typeof(d) FROM t;")
 box.execute("SELECT quote(d) FROM t;")
 ---
 - metadata:
-  - name: quote(d)
+  - name: COLUMN_1
     type: string
   rows:
   - ['10.0']
@@ -1939,7 +1935,7 @@ box.execute("SELECT quote(d) FROM t;")
 box.execute("SELECT LEAST(d, 0) FROM t;")
 ---
 - metadata:
-  - name: LEAST(d, 0)
+  - name: COLUMN_1
     type: scalar
   rows:
   - [0]
@@ -2081,9 +2077,9 @@ box.execute("DROP TABLE t4;")
 box.execute("SELECT 1.0, typeof(1.0);")
 ---
 - metadata:
-  - name: '1.0'
+  - name: COLUMN_1
     type: double
-  - name: typeof(1.0)
+  - name: COLUMN_2
     type: string
   rows:
   - [1, 'double']
@@ -2091,9 +2087,9 @@ box.execute("SELECT 1.0, typeof(1.0);")
 box.execute("SELECT CAST(2 AS DOUBLE), typeof(CAST(2 AS DOUBLE));")
 ---
 - metadata:
-  - name: CAST(2 AS DOUBLE)
+  - name: COLUMN_1
     type: double
-  - name: typeof(CAST(2 AS DOUBLE))
+  - name: COLUMN_2
     type: string
   rows:
   - [2, 'double']
@@ -2101,9 +2097,9 @@ box.execute("SELECT CAST(2 AS DOUBLE), typeof(CAST(2 AS DOUBLE));")
 box.execute("SELECT 3e3, typeof(3e3);")
 ---
 - metadata:
-  - name: '3e3'
+  - name: COLUMN_1
     type: double
-  - name: typeof(3e3)
+  - name: COLUMN_2
     type: string
   rows:
   - [3000, 'double']
@@ -2121,7 +2117,7 @@ box.execute("SELECT d, TYPEOF(d) FROM t5;")
 - metadata:
   - name: D
     type: double
-  - name: TYPEOF(d)
+  - name: COLUMN_1
     type: string
   rows:
   - [4, 'double']

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Tarantool-patches] [PATCH v3 2/2] sql: print span more properly
  2020-06-23 23:12       ` Vladislav Shpilevoy
@ 2020-07-02 15:55         ` Roman Khabibov
  2020-07-02 19:06           ` Nikita Pettik
  0 siblings, 1 reply; 20+ messages in thread
From: Roman Khabibov @ 2020-07-02 15:55 UTC (permalink / raw)
  To: Nikita Pettik; +Cc: tarantool-patches, Vladislav Shpilevoy

Hi! Thanks for the review.
Nikita, could you, please, see it?

> On Jun 24, 2020, at 02:12, Vladislav Shpilevoy <v.shpilevoy@tarantool.org> wrote:
> 
> Thanks for the patch!
> 
> This commit LGTM and can be pushed out of order. You can send it to
> Nikita in a separate branch in a new thread, I think. If you want it
> in earlier than this branch.

commit 623e0ebb8ac53dd1a0c17f45315b15b720cf71ba
Author: Roman Khabibov <roman.habibov@tarantool.org>
Date:   Wed Jun 10 15:03:45 2020 +0300

    sql: print span more properly

    There were several cases where instead of the correct column
    span, the column name was printed. Fix this bug.

    Follow up #4407

diff --git a/src/box/sql/select.c b/src/box/sql/select.c
index 7a56136..2955753 100644
--- a/src/box/sql/select.c
+++ b/src/box/sql/select.c
@@ -1849,7 +1849,7 @@ generate_column_metadata(struct Parse *pParse, struct SrcList *pTabList,
                 if (space->sequence != NULL &&
                     space->sequence_fieldno == (uint32_t) iCol)
                     vdbe_metadata_set_col_autoincrement(v, i);
-                if (colname != NULL)
+                if (span != NULL)
                     vdbe_metadata_set_col_span(v, i, span);
             }
         } else {
diff --git a/test/sql/full_metadata.result b/test/sql/full_metadata.result
index 25bac6d..dc1e911 100644
--- a/test/sql/full_metadata.result
+++ b/test/sql/full_metadata.result
@@ -65,7 +65,7 @@ execute("SELECT 'aSd' COLLATE \"unicode_ci\";")
 execute("SELECT c FROM t;")
  | ---
  | - metadata:
- |   - span: C
+ |   - span: c
  |     type: string
  |     is_nullable: true
  |     name: C
@@ -89,16 +89,16 @@ execute("SELECT c COLLATE \"unicode\" FROM t;")
 execute("SELECT id, a, c FROM t;")
  | ---
  | - metadata:
- |   - span: ID
+ |   - span: id
  |     type: integer
  |     is_autoincrement: true
  |     name: ID
  |     is_nullable: false
  |   - type: integer
- |     span: A
+ |     span: a
  |     name: A
  |     is_nullable: false
- |   - span: C
+ |   - span: c
  |     type: string
  |     is_nullable: true
  |     name: C

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Tarantool-patches] [PATCH v3 2/2] sql: print span more properly
  2020-07-02 15:55         ` Roman Khabibov
@ 2020-07-02 19:06           ` Nikita Pettik
  0 siblings, 0 replies; 20+ messages in thread
From: Nikita Pettik @ 2020-07-02 19:06 UTC (permalink / raw)
  To: Roman Khabibov; +Cc: tarantool-patches, Vladislav Shpilevoy

On 02 Jul 18:55, Roman Khabibov wrote:
> Hi! Thanks for the review.
> Nikita, could you, please, see it?
> 
> > On Jun 24, 2020, at 02:12, Vladislav Shpilevoy <v.shpilevoy@tarantool.org> wrote:
> > 
> > Thanks for the patch!
> > 
> > This commit LGTM and can be pushed out of order. You can send it to
> > Nikita in a separate branch in a new thread, I think. If you want it
> > in earlier than this branch.

Yes. Better start a new thread and bump patch version.
 
> commit 623e0ebb8ac53dd1a0c17f45315b15b720cf71ba
> Author: Roman Khabibov <roman.habibov@tarantool.org>
> Date:   Wed Jun 10 15:03:45 2020 +0300
> 
>     sql: print span more properly
> 
>     There were several cases where instead of the correct column
>     span, the column name was printed. Fix this bug.
> 
>     Follow up #4407
> 
> diff --git a/src/box/sql/select.c b/src/box/sql/select.c
> index 7a56136..2955753 100644
> --- a/src/box/sql/select.c
> +++ b/src/box/sql/select.c
> @@ -1849,7 +1849,7 @@ generate_column_metadata(struct Parse *pParse, struct SrcList *pTabList,
>                  if (space->sequence != NULL &&
>                      space->sequence_fieldno == (uint32_t) iCol)
>                      vdbe_metadata_set_col_autoincrement(v, i);
> -                if (colname != NULL)
> +                if (span != NULL)
>                      vdbe_metadata_set_col_span(v, i, span);
>              }
>          } else {
> diff --git a/test/sql/full_metadata.result b/test/sql/full_metadata.result
> index 25bac6d..dc1e911 100644
> --- a/test/sql/full_metadata.result
> +++ b/test/sql/full_metadata.result
> @@ -65,7 +65,7 @@ execute("SELECT 'aSd' COLLATE \"unicode_ci\";")
>  execute("SELECT c FROM t;")
>   | ---
>   | - metadata:
> - |   - span: C
> + |   - span: c
>   |     type: string
>   |     is_nullable: true
>   |     name: C
> @@ -89,16 +89,16 @@ execute("SELECT c COLLATE \"unicode\" FROM t;")
>  execute("SELECT id, a, c FROM t;")
>   | ---
>   | - metadata:
> - |   - span: ID
> + |   - span: id
>   |     type: integer
>   |     is_autoincrement: true
>   |     name: ID
>   |     is_nullable: false
>   |   - type: integer
> - |     span: A
> + |     span: a
>   |     name: A
>   |     is_nullable: false
> - |   - span: C
> + |   - span: c
>   |     type: string
>   |     is_nullable: true
>   |     name: C
> 

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2020-07-02 19:06 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-11 15:18 [Tarantool-patches] [PATCH v3 0/2] Use-unify-pattern-for-column-names Roman Khabibov
2020-06-11 15:18 ` [Tarantool-patches] [PATCH v3 1/2] sql: use unify pattern for column names Roman Khabibov
2020-06-15 21:59   ` Vladislav Shpilevoy
2020-06-22 21:14     ` roman
2020-06-23 23:12       ` Vladislav Shpilevoy
2020-06-25 14:35         ` Roman Khabibov
2020-06-25 21:25           ` Vladislav Shpilevoy
2020-06-27 11:50             ` Roman Khabibov
2020-06-29 20:08               ` Vladislav Shpilevoy
2020-06-29 23:46                 ` Roman Khabibov
2020-06-30 21:23                   ` Vladislav Shpilevoy
2020-07-01 12:45                     ` Roman Khabibov
2020-07-01 21:25                       ` Vladislav Shpilevoy
2020-07-02 15:55                         ` Roman Khabibov
2020-06-11 15:18 ` [Tarantool-patches] [PATCH v3 2/2] sql: print span more properly Roman Khabibov
2020-06-15 22:18   ` Vladislav Shpilevoy
2020-06-22 21:14     ` roman
2020-06-23 23:12       ` Vladislav Shpilevoy
2020-07-02 15:55         ` Roman Khabibov
2020-07-02 19:06           ` Nikita Pettik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox