Tarantool development patches archive
 help / color / mirror / Atom feed
* [Tarantool-patches] [PATCH v2 0/4] sql: fix description of type mismatch errors
@ 2021-07-13  7:03 Mergen Imeev via Tarantool-patches
  2021-07-13  7:03 ` [Tarantool-patches] [PATCH v2 1/4] sql: truncate values in type mismatch error Mergen Imeev via Tarantool-patches
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Mergen Imeev via Tarantool-patches @ 2021-07-13  7:03 UTC (permalink / raw)
  To: tsafin; +Cc: tarantool-patches

After this patch-set value and its type always will be printed in description of
type mismatch errors. Currently, in some cases type of value is printed instead
of value.

https://github.com/tarantool/tarantool/issues/6176
https://github.com/tarantool/tarantool/tree/imeevma/gh-6176-fix-type-mismatch-error

Changes in v2:
 - STRING and UUID value now printed in single quotes.
 - Description of type mismatch errors now contain both type and value.

Mergen Imeev (4):
  sql: truncate values in type mismatch error
  sql: properly show values in type mismatch error
  sql: use proper type names in error descriptions
  sql: make type mismatch errors more informative

 .../gh-6176-type-mistmatch-description.md     |    4 +
 src/box/sql/func.c                            |   25 +-
 src/box/sql/mem.c                             |   65 +-
 src/box/sql/mem.h                             |    6 +-
 src/box/sql/vdbe.c                            |   19 +-
 test/sql-tap/autoinc.test.lua                 |    4 +-
 test/sql-tap/cast.test.lua                    |   20 +-
 test/sql-tap/func.test.lua                    |    8 +-
 ...-4766-wrong-cast-from-blob-to-int.test.lua |    9 +-
 .../gh-5913-segfault-on-select-uuid.test.lua  |    4 +-
 test/sql-tap/index1.test.lua                  |    4 +-
 test/sql-tap/numcast.test.lua                 |    4 +-
 test/sql-tap/position.test.lua                |   16 +-
 test/sql-tap/select1.test.lua                 |    6 +-
 test/sql-tap/select5.test.lua                 |    2 +-
 test/sql-tap/sql-errors.test.lua              |  114 +-
 test/sql-tap/tkt-80e031a00f.test.lua          |    8 +-
 test/sql-tap/tkt-9a8b09f8e6.test.lua          |   20 +-
 test/sql-tap/uuid.test.lua                    |  126 +-
 test/sql/boolean.result                       | 1534 ++++++++---------
 test/sql/integer-overflow.result              |    4 +-
 test/sql/persistency.result                   |    2 +-
 test/sql/types.result                         |  178 +-
 23 files changed, 1144 insertions(+), 1038 deletions(-)
 create mode 100644 changelogs/unreleased/gh-6176-type-mistmatch-description.md

-- 
2.25.1


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

* [Tarantool-patches] [PATCH v2 1/4] sql: truncate values in type mismatch error
  2021-07-13  7:03 [Tarantool-patches] [PATCH v2 0/4] sql: fix description of type mismatch errors Mergen Imeev via Tarantool-patches
@ 2021-07-13  7:03 ` Mergen Imeev via Tarantool-patches
  2021-07-13  8:51   ` Timur Safin via Tarantool-patches
  2021-07-13  7:03 ` [Tarantool-patches] [PATCH v2 2/4] sql: properly show " Mergen Imeev via Tarantool-patches
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: Mergen Imeev via Tarantool-patches @ 2021-07-13  7:03 UTC (permalink / raw)
  To: tsafin; +Cc: tarantool-patches

STRING, MAP, and ARRAY values that are too long can make the type
mismatch error description less descriptive than necessary. This patch
truncates values that are too long and adds "..." to indicate that the
value has been truncated.

Part of #6176
---
 src/box/sql/mem.c                             | 18 ++++---
 src/box/sql/mem.h                             |  3 +-
 ...-4766-wrong-cast-from-blob-to-int.test.lua |  7 +--
 test/sql-tap/sql-errors.test.lua              | 47 ++++++++++++++++++-
 test/sql/types.result                         |  6 +--
 5 files changed, 62 insertions(+), 19 deletions(-)

diff --git a/src/box/sql/mem.c b/src/box/sql/mem.c
index 2595e2fd4..05f053c55 100644
--- a/src/box/sql/mem.c
+++ b/src/box/sql/mem.c
@@ -57,6 +57,7 @@ sqlVdbeMemGrow(struct Mem *pMem, int n, int preserve);
 
 enum {
 	BUF_SIZE = 32,
+	STR_VALUE_MAX_LEN = 128,
 };
 
 bool
@@ -72,26 +73,31 @@ mem_is_field_compatible(const struct Mem *mem, enum field_type type)
 const char *
 mem_str(const struct Mem *mem)
 {
-	char buf[BUF_SIZE];
+	char buf[STR_VALUE_MAX_LEN];
 	switch (mem->type) {
 	case MEM_TYPE_NULL:
 		return "NULL";
 	case MEM_TYPE_STR:
-		if ((mem->flags & MEM_Term) != 0)
-			return mem->z;
+		if (mem->n > STR_VALUE_MAX_LEN)
+			return tt_sprintf("%.*s...", STR_VALUE_MAX_LEN, mem->z);
 		return tt_cstr(mem->z, mem->n);
 	case MEM_TYPE_INT:
 		return tt_sprintf("%lld", mem->u.i);
 	case MEM_TYPE_UINT:
 		return tt_sprintf("%llu", mem->u.u);
 	case MEM_TYPE_DOUBLE:
-		sql_snprintf(BUF_SIZE, &buf[0], "%!.15g", mem->u.r);
+		sql_snprintf(STR_VALUE_MAX_LEN, buf, "%!.15g", mem->u.r);
 		return tt_sprintf("%s", buf);
 	case MEM_TYPE_BIN:
 		return "varbinary";
 	case MEM_TYPE_MAP:
-	case MEM_TYPE_ARRAY:
-		return mp_str(mem->z);
+	case MEM_TYPE_ARRAY: {
+		const char *str = mp_str(mem->z);
+		if (strlen(str) <= STR_VALUE_MAX_LEN)
+			return str;
+		memcpy(buf, str, STR_VALUE_MAX_LEN);
+		return tt_sprintf("%.*s...", STR_VALUE_MAX_LEN, buf);
+	}
 	case MEM_TYPE_UUID:
 		return tt_uuid_str(&mem->u.uuid);
 	case MEM_TYPE_BOOL:
diff --git a/src/box/sql/mem.h b/src/box/sql/mem.h
index b3cd5c545..0bbc63e68 100644
--- a/src/box/sql/mem.h
+++ b/src/box/sql/mem.h
@@ -264,7 +264,8 @@ mem_is_field_compatible(const struct Mem *mem, enum field_type type);
 
 /**
  * Return a string that represent content of MEM. String is either allocated
- * using static_alloc() of just a static variable.
+ * using static_alloc() of just a static variable. This function should only be
+ * used for debugging or displaying MEM values in errors.
  */
 const char *
 mem_str(const struct Mem *mem);
diff --git a/test/sql-tap/gh-4766-wrong-cast-from-blob-to-int.test.lua b/test/sql-tap/gh-4766-wrong-cast-from-blob-to-int.test.lua
index da8c2dcd6..28cf50184 100755
--- a/test/sql-tap/gh-4766-wrong-cast-from-blob-to-int.test.lua
+++ b/test/sql-tap/gh-4766-wrong-cast-from-blob-to-int.test.lua
@@ -34,12 +34,7 @@ test:do_catchsql_test(
     "SELECT CAST('" .. long_str .. "1234'" .. " AS INTEGER);", {
         1, "Type mismatch: can not convert 000000000000000000000000000000000" ..
         "0000000000000000000000000000000000000000000000000000000000000000000" ..
-        "0000000000000000000000000000000000000000000000000000000000000000000" ..
-        "0000000000000000000000000000000000000000000000000000000000000000000" ..
-        "0000000000000000000000000000000000000000000000000000000000000000000" ..
-        "0000000000000000000000000000000000000000000000000000000000000000000" ..
-        "0000000000000000000000000000000000000000000000000000000000000000000" ..
-        "000000000000000000000000000000000000000000000"
+        "0000000000000000000000000000... to integer"
     })
 
 test:finish_test()
diff --git a/test/sql-tap/sql-errors.test.lua b/test/sql-tap/sql-errors.test.lua
index 469193a2b..96ee683eb 100755
--- a/test/sql-tap/sql-errors.test.lua
+++ b/test/sql-tap/sql-errors.test.lua
@@ -1,6 +1,6 @@
 #!/usr/bin/env tarantool
 local test = require("sqltester")
-test:plan(72)
+test:plan(76)
 
 test:execsql([[
 	CREATE TABLE t0 (i INT PRIMARY KEY, a INT);
@@ -780,4 +780,49 @@ test:do_catchsql_test(
 		-- </sql-errors-2.9>
 	})
 
+--
+-- gh-6176: Make sure that type mismatch error description with too long STRING,
+-- MAP or ARRAY is printed correctly.
+--
+local str1 = string.rep('a', 200)
+local str2 = string.rep('ы', 200)
+
+test:do_catchsql_test(
+	"sql-errors-3.1",
+	"SELECT CAST('"..str1.."'AS UNSIGNED);", {
+		1, "Type mismatch: can not convert aaaaaaaaaaaaaaaaaaaaaaaaaa"..
+		"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"..
+		"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa... to unsigned"
+	})
+
+test:do_catchsql_test(
+	"sql-errors-3.2",
+	"SELECT CAST('"..str2.."'AS UNSIGNED);", {
+		1, "Type mismatch: can not convert ыыыыыыыыыыыыыыыыыыыыыыыыыы"..
+		"ыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыы... to unsigned"
+	})
+
+local format = {{'I', 'integer'}, {'A', 'array'}, {'M', 'map'}}
+local s = box.schema.space.create('TEST', {format=format})
+s:create_index('I')
+s:insert({1, {str1}, {a = 1, b = str1}})
+
+test:do_catchsql_test(
+	"sql-errors-3.3",
+	"SELECT CAST(a AS UNSIGNED) from test;", {
+		1, 'Type mismatch: can not convert ["aaaaaaaaaaaaaaaaaaaaaaaa'..
+		'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'..
+		'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa... to unsigned'
+	})
+
+test:do_catchsql_test(
+	"sql-errors-3.4",
+	"SELECT CAST(m AS UNSIGNED) from test;", {
+		1, 'Type mismatch: can not convert {"a": 1, "b": "aaaaaaaaaaa'..
+		'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'..
+		'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa... to unsigned'
+	})
+
+test:execsql('DROP TABLE test;')
+
 test:finish_test()
diff --git a/test/sql/types.result b/test/sql/types.result
index 687ca3b15..a46967158 100644
--- a/test/sql/types.result
+++ b/test/sql/types.result
@@ -1651,11 +1651,7 @@ box.execute('INSERT INTO t1(a) SELECT a FROM t2;')
 - null
 - 'Type mismatch: can not convert [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
   15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
-  35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
-  55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
-  75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
-  95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
-  112, 113, 114, 115, 116, 117, 11'
+  ... to scalar'
 ...
 s:drop()
 ---
-- 
2.25.1


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

* [Tarantool-patches] [PATCH v2 2/4] sql: properly show values in type mismatch error
  2021-07-13  7:03 [Tarantool-patches] [PATCH v2 0/4] sql: fix description of type mismatch errors Mergen Imeev via Tarantool-patches
  2021-07-13  7:03 ` [Tarantool-patches] [PATCH v2 1/4] sql: truncate values in type mismatch error Mergen Imeev via Tarantool-patches
@ 2021-07-13  7:03 ` Mergen Imeev via Tarantool-patches
  2021-07-13  8:51   ` Timur Safin via Tarantool-patches
  2021-07-13  7:03 ` [Tarantool-patches] [PATCH v2 3/4] sql: use proper type names in error descriptions Mergen Imeev via Tarantool-patches
  2021-07-13  7:04 ` [Tarantool-patches] [PATCH v2 4/4] sql: make type mismatch errors more informative Mergen Imeev via Tarantool-patches
  3 siblings, 1 reply; 11+ messages in thread
From: Mergen Imeev via Tarantool-patches @ 2021-07-13  7:03 UTC (permalink / raw)
  To: tsafin; +Cc: tarantool-patches

Currently, some values are displayed improperly in the type mismatch
error description. For VARBINARY, the word "varbinary" is printed
instead of the value. STRING values are printed without quotes, which
can be confusing in some cases, such as when it consists of spaces.

This patch introduces the following changes:
1) VARBINARY value will be printed as x'<value in hexadecimal format>'.
2) STRING value will be printed in single quotes.
3) UUID value will be printed in single quotes.

UUID value does not need to be enclosed in single quotes, since there
are no literals for UUIDs, but it looks more convenient.

Part of #6176
---
 src/box/sql/mem.c                             |  21 +-
 test/sql-tap/autoinc.test.lua                 |   4 +-
 test/sql-tap/cast.test.lua                    |  20 +-
 test/sql-tap/func.test.lua                    |   8 +-
 ...-4766-wrong-cast-from-blob-to-int.test.lua |   4 +-
 .../gh-5913-segfault-on-select-uuid.test.lua  |   4 +-
 test/sql-tap/index1.test.lua                  |   4 +-
 test/sql-tap/select1.test.lua                 |   4 +-
 test/sql-tap/select5.test.lua                 |   2 +-
 test/sql-tap/sql-errors.test.lua              |  65 +++-
 test/sql-tap/tkt-80e031a00f.test.lua          |   8 +-
 test/sql-tap/tkt-9a8b09f8e6.test.lua          |  20 +-
 test/sql-tap/uuid.test.lua                    |  78 ++---
 test/sql/boolean.result                       | 280 +++++++++---------
 test/sql/integer-overflow.result              |   2 +-
 test/sql/persistency.result                   |   2 +-
 test/sql/types.result                         |  58 ++--
 17 files changed, 317 insertions(+), 267 deletions(-)

diff --git a/src/box/sql/mem.c b/src/box/sql/mem.c
index 05f053c55..3bbff9897 100644
--- a/src/box/sql/mem.c
+++ b/src/box/sql/mem.c
@@ -79,8 +79,8 @@ mem_str(const struct Mem *mem)
 		return "NULL";
 	case MEM_TYPE_STR:
 		if (mem->n > STR_VALUE_MAX_LEN)
-			return tt_sprintf("%.*s...", STR_VALUE_MAX_LEN, mem->z);
-		return tt_cstr(mem->z, mem->n);
+			return tt_sprintf("'%.*s...", STR_VALUE_MAX_LEN, mem->z);
+		return tt_sprintf("'%.*s'", mem->n, mem->z);
 	case MEM_TYPE_INT:
 		return tt_sprintf("%lld", mem->u.i);
 	case MEM_TYPE_UINT:
@@ -88,8 +88,18 @@ mem_str(const struct Mem *mem)
 	case MEM_TYPE_DOUBLE:
 		sql_snprintf(STR_VALUE_MAX_LEN, buf, "%!.15g", mem->u.r);
 		return tt_sprintf("%s", buf);
-	case MEM_TYPE_BIN:
-		return "varbinary";
+	case MEM_TYPE_BIN: {
+		int len = MIN(mem->n, STR_VALUE_MAX_LEN / 2);
+		for (int i = 0; i < len; ++i) {
+			int n = (mem->z[i] & 0xF0) >> 4;
+			buf[2 * i] = n < 10 ? ('0' + n) : ('A' + n - 10);
+			n = (mem->z[i] & 0x0F);
+			buf[2 * i + 1] = n < 10 ? ('0' + n) : ('A' + n - 10);
+		}
+		if (mem->n > len)
+			return tt_sprintf("x'%.*s...", len * 2, buf);
+		return tt_sprintf("x'%.*s'", len * 2, buf);
+	}
 	case MEM_TYPE_MAP:
 	case MEM_TYPE_ARRAY: {
 		const char *str = mp_str(mem->z);
@@ -99,7 +109,8 @@ mem_str(const struct Mem *mem)
 		return tt_sprintf("%.*s...", STR_VALUE_MAX_LEN, buf);
 	}
 	case MEM_TYPE_UUID:
-		return tt_uuid_str(&mem->u.uuid);
+		tt_uuid_to_string(&mem->u.uuid, buf);
+		return tt_sprintf("'%s'", buf);
 	case MEM_TYPE_BOOL:
 		return mem->u.b ? "TRUE" : "FALSE";
 	default:
diff --git a/test/sql-tap/autoinc.test.lua b/test/sql-tap/autoinc.test.lua
index aa457b502..83d983fe1 100755
--- a/test/sql-tap/autoinc.test.lua
+++ b/test/sql-tap/autoinc.test.lua
@@ -616,7 +616,7 @@ test:do_catchsql_test(
             INSERT INTO t2 VALUES('asd');
     ]], {
         -- <autoinc-10.2>
-        1, "Type mismatch: can not convert asd to integer"
+        1, "Type mismatch: can not convert 'asd' to integer"
         -- </autoinc-10.2>
     })
 
@@ -809,7 +809,7 @@ test:do_catchsql_test(
         INSERT INTO t1 SELECT s2, s2 FROM t1;
     ]], {
         -- <autoinc-gh-3670>
-        1, "Type mismatch: can not convert a to integer"
+        1, "Type mismatch: can not convert 'a' to integer"
         -- </autoinc-gh-3670>
     })
 
diff --git a/test/sql-tap/cast.test.lua b/test/sql-tap/cast.test.lua
index 7de4b79df..e2a227127 100755
--- a/test/sql-tap/cast.test.lua
+++ b/test/sql-tap/cast.test.lua
@@ -70,7 +70,7 @@ test:do_catchsql_test(
         SELECT CAST(x'616263' AS NUMBER)
     ]], {
         -- <cast-1.5>
-        1, 'Type mismatch: can not convert varbinary to number'
+        1, "Type mismatch: can not convert x'616263' to number"
         -- </cast-1.5>
     })
 
@@ -100,7 +100,7 @@ test:do_catchsql_test(
         SELECT CAST(x'616263' AS integer)
     ]], {
         -- <cast-1.9>
-        1, 'Type mismatch: can not convert varbinary to integer'
+        1, "Type mismatch: can not convert x'616263' to integer"
         -- </cast-1.9>
     })
 
@@ -450,7 +450,7 @@ test:do_catchsql_test(
         SELECT CAST('123abc' AS NUMBER)
     ]], {
         -- <cast-1.45>
-        1, 'Type mismatch: can not convert 123abc to number'
+        1, "Type mismatch: can not convert '123abc' to number"
         -- </cast-1.45>
     })
 
@@ -470,7 +470,7 @@ test:do_catchsql_test(
         SELECT CAST('123abc' AS integer)
     ]], {
         -- <cast-1.49>
-        1, 'Type mismatch: can not convert 123abc to integer'
+        1, "Type mismatch: can not convert '123abc' to integer"
         -- </cast-1.49>
     })
 
@@ -480,7 +480,7 @@ test:do_catchsql_test(
         SELECT CAST('123.5abc' AS NUMBER)
     ]], {
         -- <cast-1.51>
-        1, 'Type mismatch: can not convert 123.5abc to number'
+        1, "Type mismatch: can not convert '123.5abc' to number"
         -- </cast-1.51>
     })
 
@@ -490,7 +490,7 @@ test:do_catchsql_test(
         SELECT CAST('123.5abc' AS integer)
     ]], {
         -- <cast-1.53>
-        1, 'Type mismatch: can not convert 123.5abc to integer'
+        1, "Type mismatch: can not convert '123.5abc' to integer"
         -- </cast-1.53>
     })
 
@@ -561,7 +561,7 @@ test:do_catchsql_test(
         SELECT CAST('abc' AS NUMBER)
     ]], {
         -- <case-1.66>
-        1, 'Type mismatch: can not convert abc to number'
+        1, "Type mismatch: can not convert 'abc' to number"
         -- </case-1.66>
     })
 
@@ -835,7 +835,7 @@ test:do_test(
         ]]
     end, {
         -- <cast-4.1>
-        1, 'Type mismatch: can not convert abc to integer'
+        1, "Type mismatch: can not convert 'abc' to integer"
         -- </cast-4.1>
     })
 
@@ -847,7 +847,7 @@ test:do_test(
         ]]
     end, {
         -- <cast-4.2>
-        1, 'Type mismatch: can not convert abc to integer'
+        1, "Type mismatch: can not convert 'abc' to integer"
         -- </cast-4.2>
     })
 
@@ -859,7 +859,7 @@ test:do_test(
         ]]
     end, {
         -- <cast-4.4>
-        1, 'Type mismatch: can not convert abc to number'
+        1, "Type mismatch: can not convert 'abc' to number"
         -- </cast-4.4>
     })
 
diff --git a/test/sql-tap/func.test.lua b/test/sql-tap/func.test.lua
index 5e259f7ef..ae6bc9ddd 100755
--- a/test/sql-tap/func.test.lua
+++ b/test/sql-tap/func.test.lua
@@ -2931,7 +2931,7 @@ test:do_catchsql_test(
         SELECT ROUND(X'FF')
     ]], {
         -- <func-76.1>
-        1, "Type mismatch: can not convert varbinary to numeric"
+        1, "Type mismatch: can not convert x'FF' to numeric"
         -- </func-76.1>
     })
 
@@ -2941,7 +2941,7 @@ test:do_catchsql_test(
         SELECT RANDOMBLOB(X'FF')
     ]], {
         -- <func-76.2>
-        1, "Type mismatch: can not convert varbinary to numeric"
+        1, "Type mismatch: can not convert x'FF' to numeric"
         -- </func-76.2>
     })
 
@@ -2951,7 +2951,7 @@ test:do_catchsql_test(
         SELECT SOUNDEX(X'FF')
     ]], {
         -- <func-76.3>
-        1, "Type mismatch: can not convert varbinary to text"
+        1, "Type mismatch: can not convert x'FF' to text"
         -- </func-76.3>
     })
 
@@ -2961,7 +2961,7 @@ test:do_catchsql_test(
         SELECT SUM(X'FF')
     ]], {
         -- <func-76.4>
-        1, "Type mismatch: can not convert varbinary to number"
+        1, "Type mismatch: can not convert x'FF' to number"
         -- </func-76.4>
     })
 
diff --git a/test/sql-tap/gh-4766-wrong-cast-from-blob-to-int.test.lua b/test/sql-tap/gh-4766-wrong-cast-from-blob-to-int.test.lua
index 28cf50184..b595f99b0 100755
--- a/test/sql-tap/gh-4766-wrong-cast-from-blob-to-int.test.lua
+++ b/test/sql-tap/gh-4766-wrong-cast-from-blob-to-int.test.lua
@@ -32,9 +32,9 @@ test:do_execsql_test(
 test:do_catchsql_test(
     "gh-4766-3",
     "SELECT CAST('" .. long_str .. "1234'" .. " AS INTEGER);", {
-        1, "Type mismatch: can not convert 000000000000000000000000000000000" ..
+        1, "Type mismatch: can not convert '00000000000000000000000000000000" ..
         "0000000000000000000000000000000000000000000000000000000000000000000" ..
-        "0000000000000000000000000000... to integer"
+        "00000000000000000000000000000... to integer"
     })
 
 test:finish_test()
diff --git a/test/sql-tap/gh-5913-segfault-on-select-uuid.test.lua b/test/sql-tap/gh-5913-segfault-on-select-uuid.test.lua
index 7dcebe5d3..59a76000a 100755
--- a/test/sql-tap/gh-5913-segfault-on-select-uuid.test.lua
+++ b/test/sql-tap/gh-5913-segfault-on-select-uuid.test.lua
@@ -40,7 +40,7 @@ test:do_catchsql_test(
     [[
         INSERT INTO t1 SELECT i, NULL, d FROM t;
     ]], {
-        1, "Type mismatch: can not convert varbinary to decimal"
+        1, "Type mismatch: can not convert x'C70501030111111C' to decimal"
     })
 
 --
@@ -77,7 +77,7 @@ test:do_catchsql_test(
     [[
         UPDATE td SET d = d;
     ]], {
-        1, "Type mismatch: can not convert varbinary to decimal"
+        1, "Type mismatch: can not convert x'C70501030111111C' to decimal"
     })
 
 test:finish_test()
diff --git a/test/sql-tap/index1.test.lua b/test/sql-tap/index1.test.lua
index a4d33152b..e03e284aa 100755
--- a/test/sql-tap/index1.test.lua
+++ b/test/sql-tap/index1.test.lua
@@ -778,7 +778,7 @@ test:do_catchsql_test(
         SELECT c FROM t6 WHERE a>123;
     ]], {
         -- <index-14.6>
-        1, "Type mismatch: can not convert  to numeric"
+        1, "Type mismatch: can not convert '' to numeric"
         -- </index-14.6>
     })
 
@@ -788,7 +788,7 @@ test:do_catchsql_test(
         SELECT c FROM t6 WHERE a>=123;
     ]], {
         -- <index-14.7>
-        1, "Type mismatch: can not convert  to numeric"
+        1, "Type mismatch: can not convert '' to numeric"
         -- </index-14.7>
     })
 
diff --git a/test/sql-tap/select1.test.lua b/test/sql-tap/select1.test.lua
index 36206ca2a..1a7a4ee82 100755
--- a/test/sql-tap/select1.test.lua
+++ b/test/sql-tap/select1.test.lua
@@ -320,7 +320,7 @@ test:do_catchsql_test(
         SELECT count(*),count(a),count(b) FROM t4 WHERE b=5
     ]], {
         -- <select1-2.5.3>
-        1, "Type mismatch: can not convert This is a string that is too big to fit inside a NBFS buffer to numeric"
+        1, "Type mismatch: can not convert 'This is a string that is too big to fit inside a NBFS buffer' to numeric"
         -- </select1-2.5.3>
     })
 
@@ -515,7 +515,7 @@ test:do_catchsql_test(
         SELECT sum(a) FROM t3
     ]], {
         -- <select1-2.17.1>
-        1, "Type mismatch: can not convert abc to number"
+        1, "Type mismatch: can not convert 'abc' to number"
         -- </select1-2.17.1>
     })
 
diff --git a/test/sql-tap/select5.test.lua b/test/sql-tap/select5.test.lua
index 5882102c9..bb9951025 100755
--- a/test/sql-tap/select5.test.lua
+++ b/test/sql-tap/select5.test.lua
@@ -558,7 +558,7 @@ test:do_catchsql_test(
             SELECT 1 FROM jj HAVING avg(s2) = 1 AND avg(s2) = 0;
     ]], {
     -- <select5-9.13.2>
-    1, "Type mismatch: can not convert A to number"
+    1, "Type mismatch: can not convert 'A' to number"
     -- </select5-9.13.2>
 })
 
diff --git a/test/sql-tap/sql-errors.test.lua b/test/sql-tap/sql-errors.test.lua
index 96ee683eb..52276c27b 100755
--- a/test/sql-tap/sql-errors.test.lua
+++ b/test/sql-tap/sql-errors.test.lua
@@ -1,6 +1,6 @@
 #!/usr/bin/env tarantool
 local test = require("sqltester")
-test:plan(76)
+test:plan(80)
 
 test:execsql([[
 	CREATE TABLE t0 (i INT PRIMARY KEY, a INT);
@@ -687,7 +687,7 @@ test:do_catchsql_test(
 		-- </sql-errors-1.63>
 	})
 
--- gh-4356: Make sure that 'varbinary' is printed instead of the
+-- gh-4356: Make sure that varbinary is printed in hex instead of the
 -- binary data itself (since binary data can contain unprintable symbols).
 --
 test:do_catchsql_test(
@@ -696,7 +696,7 @@ test:do_catchsql_test(
 		SELECT X'ff' + 1;
 	]], {
 		-- <sql-errors-2.1>
-		1, "Type mismatch: can not convert varbinary to numeric"
+		1, "Type mismatch: can not convert x'FF' to numeric"
 		-- </sql-errors-2.1>
 	})
 
@@ -706,7 +706,7 @@ test:do_catchsql_test(
 		SELECT X'ff' - 1;
 	]], {
 		-- <sql-errors-2.2>
-		1, "Type mismatch: can not convert varbinary to numeric"
+		1, "Type mismatch: can not convert x'FF' to numeric"
 		-- </sql-errors-2.2>
 	})
 
@@ -716,7 +716,7 @@ test:do_catchsql_test(
 		SELECT X'ff' * 1;
 	]], {
 		-- <sql-errors-2.3>
-		1, "Type mismatch: can not convert varbinary to numeric"
+		1, "Type mismatch: can not convert x'FF' to numeric"
 		-- </sql-errors-2.3>
 	})
 
@@ -726,7 +726,7 @@ test:do_catchsql_test(
 		SELECT X'ff' / 1;
 	]], {
 		-- <sql-errors-2.4>
-		1, "Type mismatch: can not convert varbinary to numeric"
+		1, "Type mismatch: can not convert x'FF' to numeric"
 		-- </sql-errors-2.4>
 	})
 
@@ -736,7 +736,7 @@ test:do_catchsql_test(
 		SELECT X'ff' AND true;
 	]], {
 		-- <sql-errors-2.5>
-		1, "Type mismatch: can not convert varbinary to boolean"
+		1, "Type mismatch: can not convert x'FF' to boolean"
 		-- </sql-errors-2.5>
 	})
 
@@ -746,7 +746,7 @@ test:do_catchsql_test(
 		SELECT X'ff' OR false;
 	]], {
 		-- <sql-errors-2.6>
-		1, "Type mismatch: can not convert varbinary to boolean"
+		1, "Type mismatch: can not convert x'FF' to boolean"
 		-- </sql-errors-2.6>
 	})
 
@@ -756,7 +756,7 @@ test:do_catchsql_test(
 		SELECT false OR X'ff';
 	]], {
 		-- <sql-errors-2.7>
-		1, "Type mismatch: can not convert varbinary to boolean"
+		1, "Type mismatch: can not convert x'FF' to boolean"
 		-- </sql-errors-2.7>
 	})
 
@@ -790,16 +790,16 @@ local str2 = string.rep('ы', 200)
 test:do_catchsql_test(
 	"sql-errors-3.1",
 	"SELECT CAST('"..str1.."'AS UNSIGNED);", {
-		1, "Type mismatch: can not convert aaaaaaaaaaaaaaaaaaaaaaaaaa"..
+		1, "Type mismatch: can not convert 'aaaaaaaaaaaaaaaaaaaaaaaaa"..
 		"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"..
-		"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa... to unsigned"
+		"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa... to unsigned"
 	})
 
 test:do_catchsql_test(
 	"sql-errors-3.2",
 	"SELECT CAST('"..str2.."'AS UNSIGNED);", {
-		1, "Type mismatch: can not convert ыыыыыыыыыыыыыыыыыыыыыыыыыы"..
-		"ыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыы... to unsigned"
+		1, "Type mismatch: can not convert 'ыыыыыыыыыыыыыыыыыыыыыыыыы"..
+		"ыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыы... to unsigned"
 	})
 
 local format = {{'I', 'integer'}, {'A', 'array'}, {'M', 'map'}}
@@ -825,4 +825,43 @@ test:do_catchsql_test(
 
 test:execsql('DROP TABLE test;')
 
+--
+-- gh-6176: Make sure that STRING, VARBINARY and UUID values properly printed
+-- in type mismatch error description.
+--
+test:do_catchsql_test(
+	"sql-errors-3.5",
+	[[
+		SELECT CAST(x'F1' AS UNSIGNED);
+	]], {
+		1, "Type mismatch: can not convert x'F1' to unsigned"
+	})
+
+test:do_catchsql_test(
+	"sql-errors-3.6",
+	[[
+		SELECT CAST('F1' AS UNSIGNED);
+	]], {
+		1, "Type mismatch: can not convert 'F1' to unsigned"
+	})
+
+test:do_catchsql_test(
+	"sql-errors-3.7",
+	[[
+		SELECT CAST(CAST('11111111-1111-1111-1111-111111111111' AS UUID) AS UNSIGNED);
+	]], {
+		1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to unsigned"
+	})
+
+local bin = ''
+for i = 1,99 do bin = bin .. string.format("%02x", i) end
+
+test:do_catchsql_test(
+	"sql-errors-3.8",
+	"SELECT CAST(x'"..bin.."'AS UNSIGNED);", {
+		1, "Type mismatch: can not convert x'0102030405060708090A0B0C"..
+		"0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A"..
+		"2B2C2D2E2F303132333435363738393A3B3C3D3E3F40... to unsigned"
+	})
+
 test:finish_test()
diff --git a/test/sql-tap/tkt-80e031a00f.test.lua b/test/sql-tap/tkt-80e031a00f.test.lua
index 82769587b..b5bdf038f 100755
--- a/test/sql-tap/tkt-80e031a00f.test.lua
+++ b/test/sql-tap/tkt-80e031a00f.test.lua
@@ -346,7 +346,7 @@ test:do_catchsql_test(
         SELECT 'hello' IN t1
     ]], {
         -- <tkt-80e031a00f.27>
-        1, 'Type mismatch: can not convert hello to integer'
+        1, "Type mismatch: can not convert 'hello' to integer"
         -- </tkt-80e031a00f.27>
     })
 
@@ -356,7 +356,7 @@ test:do_catchsql_test(
         SELECT 'hello' NOT IN t1
     ]], {
         -- <tkt-80e031a00f.28>
-        1, 'Type mismatch: can not convert hello to integer'
+        1, "Type mismatch: can not convert 'hello' to integer"
         -- </tkt-80e031a00f.28>
     })
 
@@ -386,7 +386,7 @@ test:do_catchsql_test(
         SELECT x'303132' IN t1
     ]], {
         -- <tkt-80e031a00f.31>
-        1, 'Type mismatch: can not convert varbinary to integer'
+        1, "Type mismatch: can not convert x'303132' to integer"
         -- </tkt-80e031a00f.31>
     })
 
@@ -396,7 +396,7 @@ test:do_catchsql_test(
         SELECT x'303132' NOT IN t1
     ]], {
         -- <tkt-80e031a00f.32>
-        1, 'Type mismatch: can not convert varbinary to integer'
+        1, "Type mismatch: can not convert x'303132' to integer"
         -- </tkt-80e031a00f.32>
     })
 
diff --git a/test/sql-tap/tkt-9a8b09f8e6.test.lua b/test/sql-tap/tkt-9a8b09f8e6.test.lua
index 67d6a1ccd..53dfafebf 100755
--- a/test/sql-tap/tkt-9a8b09f8e6.test.lua
+++ b/test/sql-tap/tkt-9a8b09f8e6.test.lua
@@ -245,7 +245,7 @@ test:do_catchsql_test(
         SELECT x FROM t3 WHERE x IN ('1');
     ]], {
         -- <4.3>
-        1, "Type mismatch: can not convert 1 to number"
+        1, "Type mismatch: can not convert '1' to number"
         -- </4.3>
     })
 
@@ -255,7 +255,7 @@ test:do_catchsql_test(
         SELECT x FROM t3 WHERE x IN ('1.0');
     ]], {
         -- <4.4>
-        1, "Type mismatch: can not convert 1.0 to number"
+        1, "Type mismatch: can not convert '1.0' to number"
         -- </4.4>
     })
 
@@ -285,7 +285,7 @@ test:do_catchsql_test(
         SELECT x FROM t3 WHERE '1' IN (x);
     ]], {
         -- <4.7>
-        1, "Type mismatch: can not convert 1 to number"
+        1, "Type mismatch: can not convert '1' to number"
         -- </4.7>
     })
 
@@ -295,7 +295,7 @@ test:do_catchsql_test(
         SELECT x FROM t3 WHERE '1.0' IN (x);
     ]], {
         -- <4.8>
-        1, "Type mismatch: can not convert 1.0 to number"
+        1, "Type mismatch: can not convert '1.0' to number"
         -- </4.8>
     })
 
@@ -325,7 +325,7 @@ test:do_catchsql_test(
         SELECT x FROM t4 WHERE x IN ('1');
     ]], {
         -- <5.3>
-        1, "Type mismatch: can not convert 1 to number"
+        1, "Type mismatch: can not convert '1' to number"
         -- </5.3>
     })
 
@@ -335,7 +335,7 @@ test:do_catchsql_test(
         SELECT x FROM t4 WHERE x IN ('1.0');
     ]], {
         -- <5.4>
-        1, "Type mismatch: can not convert 1.0 to number"
+        1, "Type mismatch: can not convert '1.0' to number"
         -- </5.4>
     })
 
@@ -355,7 +355,7 @@ test:do_catchsql_test(
         SELECT x FROM t4 WHERE x IN ('1.11');
     ]], {
         -- <5.6>
-        1, "Type mismatch: can not convert 1.11 to number"
+        1, "Type mismatch: can not convert '1.11' to number"
         -- </5.6>
     })
 
@@ -385,7 +385,7 @@ test:do_catchsql_test(
         SELECT x FROM t4 WHERE '1' IN (x);
     ]], {
         -- <5.9>
-        1, "Type mismatch: can not convert 1 to number"
+        1, "Type mismatch: can not convert '1' to number"
         -- </5.9>
     })
 
@@ -395,7 +395,7 @@ test:do_catchsql_test(
         SELECT x FROM t4 WHERE '1.0' IN (x);
     ]], {
         -- <5.10>
-        1, "Type mismatch: can not convert 1.0 to number"
+        1, "Type mismatch: can not convert '1.0' to number"
         -- </5.10>
     })
 
@@ -415,7 +415,7 @@ test:do_catchsql_test(
         SELECT x FROM t4 WHERE '1.11' IN (x);
     ]], {
         -- <5.12>
-        1, "Type mismatch: can not convert 1.11 to number"
+        1, "Type mismatch: can not convert '1.11' to number"
         -- </5.12>
     })
 
diff --git a/test/sql-tap/uuid.test.lua b/test/sql-tap/uuid.test.lua
index 77ba06c2d..1fc99916a 100755
--- a/test/sql-tap/uuid.test.lua
+++ b/test/sql-tap/uuid.test.lua
@@ -237,7 +237,7 @@ test:do_catchsql_test(
     [[
         SELECT AVG(u) from t2;
     ]], {
-        1, "Type mismatch: can not convert 11111111-1111-1111-1111-111111111111 to number"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to number"
     })
 
 test:do_execsql_test(
@@ -421,7 +421,7 @@ test:do_catchsql_test(
     [[
         SELECT ROUND(u) from t2;
     ]], {
-        1, "Type mismatch: can not convert 11111111-1111-1111-1111-111111111111 to numeric"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to numeric"
     })
 
 test:do_execsql_test(
@@ -445,7 +445,7 @@ test:do_catchsql_test(
     [[
         SELECT SUM(u) from t2;
     ]], {
-        1, "Type mismatch: can not convert 11111111-1111-1111-1111-111111111111 to number"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to number"
     })
 
 test:do_catchsql_test(
@@ -453,7 +453,7 @@ test:do_catchsql_test(
     [[
         SELECT TOTAL(u) from t2;
     ]], {
-        1, "Type mismatch: can not convert 11111111-1111-1111-1111-111111111111 to number"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to number"
     })
 
 test:do_execsql_test(
@@ -564,7 +564,7 @@ test:do_catchsql_test(
     [[
         SELECT cast(u AS UNSIGNED) FROM t2;
     ]], {
-        1, "Type mismatch: can not convert 11111111-1111-1111-1111-111111111111 to unsigned"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to unsigned"
     })
 
 test:do_execsql_test(
@@ -582,7 +582,7 @@ test:do_catchsql_test(
     [[
         SELECT cast(u AS NUMBER) FROM t2;
     ]], {
-        1, "Type mismatch: can not convert 11111111-1111-1111-1111-111111111111 to number"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to number"
     })
 
 test:do_catchsql_test(
@@ -590,7 +590,7 @@ test:do_catchsql_test(
     [[
         SELECT cast(u AS DOUBLE) FROM t2;
     ]], {
-        1, "Type mismatch: can not convert 11111111-1111-1111-1111-111111111111 to double"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to double"
     })
 
 test:do_catchsql_test(
@@ -598,7 +598,7 @@ test:do_catchsql_test(
     [[
         SELECT cast(u AS INTEGER) FROM t2;
     ]], {
-        1, "Type mismatch: can not convert 11111111-1111-1111-1111-111111111111 to integer"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to integer"
     })
 
 test:do_catchsql_test(
@@ -606,7 +606,7 @@ test:do_catchsql_test(
     [[
         SELECT cast(u AS BOOLEAN) FROM t2;
     ]], {
-        1, "Type mismatch: can not convert 11111111-1111-1111-1111-111111111111 to boolean"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to boolean"
     })
 
 test:do_execsql_test(
@@ -657,7 +657,7 @@ test:do_catchsql_test(
     [[
         SELECT cast('1' AS UUID);
     ]], {
-        1, "Type mismatch: can not convert 1 to uuid"
+        1, "Type mismatch: can not convert '1' to uuid"
     })
 
 test:do_catchsql_test(
@@ -695,9 +695,9 @@ test:do_execsql_test(
 test:do_catchsql_test(
     "uuid-7.2.8",
     [[
-        SELECT cast(randomblob(10) as UUID) FROM t2 LIMIT 1;
+        SELECT cast(x'1234567890abcdef' as UUID) FROM t2 LIMIT 1;
     ]], {
-        1, "Type mismatch: can not convert varbinary to uuid"
+        1, "Type mismatch: can not convert x'1234567890ABCDEF' to uuid"
     })
 
 test:execsql([[
@@ -719,7 +719,7 @@ test:do_catchsql_test(
     [[
         INSERT INTO tu(u) SELECT u FROM t2;
     ]], {
-        1, "Type mismatch: can not convert 11111111-1111-1111-1111-111111111111 to unsigned"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to unsigned"
     })
 
 test:do_execsql_test(
@@ -738,7 +738,7 @@ test:do_catchsql_test(
     [[
         INSERT INTO tn(n) SELECT u FROM t2;
     ]], {
-        1, "Type mismatch: can not convert 11111111-1111-1111-1111-111111111111 to number"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to number"
     })
 
 test:do_catchsql_test(
@@ -746,7 +746,7 @@ test:do_catchsql_test(
     [[
         INSERT INTO td(d) SELECT u FROM t2;
     ]], {
-        1, "Type mismatch: can not convert 11111111-1111-1111-1111-111111111111 to double"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to double"
     })
 
 test:do_catchsql_test(
@@ -754,7 +754,7 @@ test:do_catchsql_test(
     [[
         INSERT INTO ti(i) SELECT u FROM t2;
     ]], {
-        1, "Type mismatch: can not convert 11111111-1111-1111-1111-111111111111 to integer"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to integer"
     })
 
 test:do_catchsql_test(
@@ -762,7 +762,7 @@ test:do_catchsql_test(
     [[
         INSERT INTO tb(b) SELECT u FROM t2;
     ]], {
-        1, "Type mismatch: can not convert 11111111-1111-1111-1111-111111111111 to boolean"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to boolean"
     })
 
 test:do_execsql_test(
@@ -817,7 +817,7 @@ test:do_catchsql_test(
     [[
         INSERT INTO tsu VALUES ('3_string_wrong', '1');
     ]], {
-        1, "Type mismatch: can not convert 1 to uuid"
+        1, "Type mismatch: can not convert '1' to uuid"
     })
 
 test:do_catchsql_test(
@@ -856,9 +856,9 @@ test:do_execsql_test(
 test:do_catchsql_test(
     "uuid-8.2.8",
     [[
-        INSERT INTO tsu VALUES ('8_varbinary', randomblob(10));
+        INSERT INTO tsu VALUES ('8_varbinary', x'1234567890abcdef');
     ]], {
-        1, "Type mismatch: can not convert varbinary to uuid"
+        1, "Type mismatch: can not convert x'1234567890ABCDEF' to uuid"
     })
 
 test:execsql([[
@@ -971,7 +971,7 @@ test:do_catchsql_test(
     [[
         SELECT -u FROM t2;
     ]], {
-        1, "Type mismatch: can not convert 11111111-1111-1111-1111-111111111111 to numeric"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to numeric"
     })
 
 test:do_catchsql_test(
@@ -979,7 +979,7 @@ test:do_catchsql_test(
     [[
         SELECT u + 1 FROM t2;
     ]], {
-        1, "Type mismatch: can not convert 11111111-1111-1111-1111-111111111111 to numeric"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to numeric"
     })
 
 test:do_catchsql_test(
@@ -987,7 +987,7 @@ test:do_catchsql_test(
     [[
         SELECT u - 1 FROM t2;
     ]], {
-        1, "Type mismatch: can not convert 11111111-1111-1111-1111-111111111111 to numeric"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to numeric"
     })
 
 test:do_catchsql_test(
@@ -995,7 +995,7 @@ test:do_catchsql_test(
     [[
         SELECT u * 1 FROM t2;
     ]], {
-        1, "Type mismatch: can not convert 11111111-1111-1111-1111-111111111111 to numeric"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to numeric"
     })
 
 test:do_catchsql_test(
@@ -1003,7 +1003,7 @@ test:do_catchsql_test(
     [[
         SELECT u / 1 FROM t2;
     ]], {
-        1, "Type mismatch: can not convert 11111111-1111-1111-1111-111111111111 to numeric"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to numeric"
     })
 
 test:do_catchsql_test(
@@ -1011,7 +1011,7 @@ test:do_catchsql_test(
     [[
         SELECT u % 1 FROM t2;
     ]], {
-        1, "Type mismatch: can not convert 11111111-1111-1111-1111-111111111111 to numeric"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to numeric"
     })
 
 -- Check that bitwise operations work with UUIDs as intended.
@@ -1020,7 +1020,7 @@ test:do_catchsql_test(
     [[
         SELECT ~u FROM t2;
     ]], {
-        1, "Type mismatch: can not convert 11111111-1111-1111-1111-111111111111 to integer"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to integer"
     })
 
 test:do_catchsql_test(
@@ -1028,7 +1028,7 @@ test:do_catchsql_test(
     [[
         SELECT u >> 1 FROM t2;
     ]], {
-        1, "Type mismatch: can not convert 11111111-1111-1111-1111-111111111111 to integer"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to integer"
     })
 
 test:do_catchsql_test(
@@ -1036,7 +1036,7 @@ test:do_catchsql_test(
     [[
         SELECT u << 1 FROM t2;
     ]], {
-        1, "Type mismatch: can not convert 11111111-1111-1111-1111-111111111111 to integer"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to integer"
     })
 
 test:do_catchsql_test(
@@ -1044,7 +1044,7 @@ test:do_catchsql_test(
     [[
         SELECT u | 1 FROM t2;
     ]], {
-        1, "Type mismatch: can not convert 11111111-1111-1111-1111-111111111111 to integer"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to integer"
     })
 
 test:do_catchsql_test(
@@ -1052,7 +1052,7 @@ test:do_catchsql_test(
     [[
         SELECT u & 1 FROM t2;
     ]], {
-        1, "Type mismatch: can not convert 11111111-1111-1111-1111-111111111111 to integer"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to integer"
     })
 
 -- Check that logical operations work with UUIDs as intended.
@@ -1061,7 +1061,7 @@ test:do_catchsql_test(
     [[
         SELECT NOT u FROM t2;
     ]], {
-        1, "Type mismatch: can not convert 11111111-1111-1111-1111-111111111111 to boolean"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to boolean"
     })
 
 test:do_catchsql_test(
@@ -1069,7 +1069,7 @@ test:do_catchsql_test(
     [[
         SELECT u AND true FROM t2;
     ]], {
-        1, "Type mismatch: can not convert 11111111-1111-1111-1111-111111111111 to boolean"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to boolean"
     })
 
 test:do_catchsql_test(
@@ -1077,7 +1077,7 @@ test:do_catchsql_test(
     [[
         SELECT u OR true FROM t2;
     ]], {
-        1, "Type mismatch: can not convert 11111111-1111-1111-1111-111111111111 to boolean"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to boolean"
     })
 
 test:do_catchsql_test(
@@ -1085,7 +1085,7 @@ test:do_catchsql_test(
     [[
         SELECT true AND u FROM t2;
     ]], {
-        1, "Type mismatch: can not convert 11111111-1111-1111-1111-111111111111 to boolean"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to boolean"
     })
 
 test:do_catchsql_test(
@@ -1093,7 +1093,7 @@ test:do_catchsql_test(
     [[
         SELECT true OR u FROM t2;
     ]], {
-        1, "Type mismatch: can not convert 11111111-1111-1111-1111-111111111111 to boolean"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to boolean"
     })
 
 -- Check that comparison with UUID works as intended.
@@ -1296,7 +1296,7 @@ test:do_catchsql_test(
     [[
         SELECT uuid('asd');
     ]], {
-        1, "Type mismatch: can not convert asd to integer"
+        1, "Type mismatch: can not convert 'asd' to integer"
     })
 
 test:do_catchsql_test(
@@ -1322,7 +1322,7 @@ test:do_catchsql_test(
     [[
         SELECT CAST('11111111-1111-1111-1111-111111111111111222222222' AS UUID);
     ]], {
-        1, "Type mismatch: can not convert 11111111-1111-1111-1111-111111111111111222222222 to uuid"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111111222222222' to uuid"
     })
 
 test:do_catchsql_test(
@@ -1330,7 +1330,7 @@ test:do_catchsql_test(
     [[
         SELECT CAST('11111111-1111-1111-1111-11111' AS UUID);
     ]], {
-        1, "Type mismatch: can not convert 11111111-1111-1111-1111-11111 to uuid"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-11111' to uuid"
     })
 
 test:execsql([[
diff --git a/test/sql/boolean.result b/test/sql/boolean.result
index 177a39fb9..dbd31fbb5 100644
--- a/test/sql/boolean.result
+++ b/test/sql/boolean.result
@@ -5092,7 +5092,7 @@ INSERT INTO t9 VALUES ('AsdF');
 SELECT true AND 'abc';
  | ---
  | - null
- | - 'Type mismatch: can not convert abc to boolean'
+ | - 'Type mismatch: can not convert ''abc'' to boolean'
  | ...
 SELECT false AND 'abc';
  | ---
@@ -5105,17 +5105,17 @@ SELECT false AND 'abc';
 SELECT true OR 'abc';
  | ---
  | - null
- | - 'Type mismatch: can not convert abc to boolean'
+ | - 'Type mismatch: can not convert ''abc'' to boolean'
  | ...
 SELECT false OR 'abc';
  | ---
  | - null
- | - 'Type mismatch: can not convert abc to boolean'
+ | - 'Type mismatch: can not convert ''abc'' to boolean'
  | ...
 SELECT 'abc' AND true;
  | ---
  | - null
- | - 'Type mismatch: can not convert abc to boolean'
+ | - 'Type mismatch: can not convert ''abc'' to boolean'
  | ...
 SELECT 'abc' AND false;
  | ---
@@ -5128,59 +5128,59 @@ SELECT 'abc' AND false;
 SELECT 'abc' OR true;
  | ---
  | - null
- | - 'Type mismatch: can not convert abc to boolean'
+ | - 'Type mismatch: can not convert ''abc'' to boolean'
  | ...
 SELECT 'abc' OR false;
  | ---
  | - null
- | - 'Type mismatch: can not convert abc to boolean'
+ | - 'Type mismatch: can not convert ''abc'' to boolean'
  | ...
 
 SELECT a1, a1 AND 'abc' FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert abc to boolean'
+ | - 'Type mismatch: can not convert ''abc'' to boolean'
  | ...
 SELECT a1, a1 OR 'abc' FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert abc to boolean'
+ | - 'Type mismatch: can not convert ''abc'' to boolean'
  | ...
 SELECT a1, 'abc' AND a1 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert abc to boolean'
+ | - 'Type mismatch: can not convert ''abc'' to boolean'
  | ...
 SELECT a1, 'abc' OR a1 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert abc to boolean'
+ | - 'Type mismatch: can not convert ''abc'' to boolean'
  | ...
 SELECT a2, a2 AND 'abc' FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert abc to boolean'
+ | - 'Type mismatch: can not convert ''abc'' to boolean'
  | ...
 SELECT a2, a2 OR 'abc' FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert abc to boolean'
+ | - 'Type mismatch: can not convert ''abc'' to boolean'
  | ...
 SELECT a2, 'abc' AND a2 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert abc to boolean'
+ | - 'Type mismatch: can not convert ''abc'' to boolean'
  | ...
 SELECT a2, 'abc' OR a2 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert abc to boolean'
+ | - 'Type mismatch: can not convert ''abc'' to boolean'
  | ...
 
 SELECT d, true AND d FROM t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert AsdF to boolean'
+ | - 'Type mismatch: can not convert ''AsdF'' to boolean'
  | ...
 SELECT d, false AND d FROM t9;
  | ---
@@ -5195,17 +5195,17 @@ SELECT d, false AND d FROM t9;
 SELECT d, true OR d FROM t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert AsdF to boolean'
+ | - 'Type mismatch: can not convert ''AsdF'' to boolean'
  | ...
 SELECT d, false OR d FROM t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert AsdF to boolean'
+ | - 'Type mismatch: can not convert ''AsdF'' to boolean'
  | ...
 SELECT d, d AND true FROM t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert AsdF to boolean'
+ | - 'Type mismatch: can not convert ''AsdF'' to boolean'
  | ...
 SELECT d, d AND false FROM t9;
  | ---
@@ -5220,53 +5220,53 @@ SELECT d, d AND false FROM t9;
 SELECT d, d OR true FROM t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert AsdF to boolean'
+ | - 'Type mismatch: can not convert ''AsdF'' to boolean'
  | ...
 SELECT d, d OR false FROM t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert AsdF to boolean'
+ | - 'Type mismatch: can not convert ''AsdF'' to boolean'
  | ...
 
 SELECT a1, d, a1 AND d FROM t6, t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert AsdF to boolean'
+ | - 'Type mismatch: can not convert ''AsdF'' to boolean'
  | ...
 SELECT a1, d, a1 OR d FROM t6, t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert AsdF to boolean'
+ | - 'Type mismatch: can not convert ''AsdF'' to boolean'
  | ...
 SELECT a1, d, d AND a1 FROM t6, t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert AsdF to boolean'
+ | - 'Type mismatch: can not convert ''AsdF'' to boolean'
  | ...
 SELECT a1, d, d OR a1 FROM t6, t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert AsdF to boolean'
+ | - 'Type mismatch: can not convert ''AsdF'' to boolean'
  | ...
 SELECT a2, d, a2 AND d FROM t6, t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert AsdF to boolean'
+ | - 'Type mismatch: can not convert ''AsdF'' to boolean'
  | ...
 SELECT a2, d, a2 OR d FROM t6, t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert AsdF to boolean'
+ | - 'Type mismatch: can not convert ''AsdF'' to boolean'
  | ...
 SELECT a2, d, d AND a2 FROM t6, t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert AsdF to boolean'
+ | - 'Type mismatch: can not convert ''AsdF'' to boolean'
  | ...
 SELECT a2, d, d OR a2 FROM t6, t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert AsdF to boolean'
+ | - 'Type mismatch: can not convert ''AsdF'' to boolean'
  | ...
 
 SELECT true > 'abc';
@@ -5467,7 +5467,7 @@ INSERT INTO t9 VALUES ('TRUE'), ('true'), ('FALSE'), ('false');
 SELECT true AND 'TRUE';
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to boolean'
+ | - 'Type mismatch: can not convert ''TRUE'' to boolean'
  | ...
 SELECT false AND 'TRUE';
  | ---
@@ -5480,17 +5480,17 @@ SELECT false AND 'TRUE';
 SELECT true OR 'TRUE';
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to boolean'
+ | - 'Type mismatch: can not convert ''TRUE'' to boolean'
  | ...
 SELECT false OR 'TRUE';
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to boolean'
+ | - 'Type mismatch: can not convert ''TRUE'' to boolean'
  | ...
 SELECT 'TRUE' AND true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to boolean'
+ | - 'Type mismatch: can not convert ''TRUE'' to boolean'
  | ...
 SELECT 'TRUE' AND false;
  | ---
@@ -5503,59 +5503,59 @@ SELECT 'TRUE' AND false;
 SELECT 'TRUE' OR true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to boolean'
+ | - 'Type mismatch: can not convert ''TRUE'' to boolean'
  | ...
 SELECT 'TRUE' OR false;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to boolean'
+ | - 'Type mismatch: can not convert ''TRUE'' to boolean'
  | ...
 
 SELECT a1, a1 AND 'TRUE' FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to boolean'
+ | - 'Type mismatch: can not convert ''TRUE'' to boolean'
  | ...
 SELECT a1, a1 OR 'TRUE' FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to boolean'
+ | - 'Type mismatch: can not convert ''TRUE'' to boolean'
  | ...
 SELECT a1, 'TRUE' AND a1 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to boolean'
+ | - 'Type mismatch: can not convert ''TRUE'' to boolean'
  | ...
 SELECT a1, 'TRUE' OR a1 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to boolean'
+ | - 'Type mismatch: can not convert ''TRUE'' to boolean'
  | ...
 SELECT a2, a2 AND 'TRUE' FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to boolean'
+ | - 'Type mismatch: can not convert ''TRUE'' to boolean'
  | ...
 SELECT a2, a2 OR 'TRUE' FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to boolean'
+ | - 'Type mismatch: can not convert ''TRUE'' to boolean'
  | ...
 SELECT a2, 'TRUE' AND a2 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to boolean'
+ | - 'Type mismatch: can not convert ''TRUE'' to boolean'
  | ...
 SELECT a2, 'TRUE' OR a2 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to boolean'
+ | - 'Type mismatch: can not convert ''TRUE'' to boolean'
  | ...
 
 SELECT d, true AND d FROM t9 WHERE d = 'TRUE';
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to boolean'
+ | - 'Type mismatch: can not convert ''TRUE'' to boolean'
  | ...
 SELECT d, false AND d FROM t9 WHERE d = 'TRUE';
  | ---
@@ -5570,17 +5570,17 @@ SELECT d, false AND d FROM t9 WHERE d = 'TRUE';
 SELECT d, true OR d FROM t9 WHERE d = 'TRUE';
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to boolean'
+ | - 'Type mismatch: can not convert ''TRUE'' to boolean'
  | ...
 SELECT d, false OR d FROM t9 WHERE d = 'TRUE';
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to boolean'
+ | - 'Type mismatch: can not convert ''TRUE'' to boolean'
  | ...
 SELECT d, d AND true FROM t9 WHERE d = 'TRUE';
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to boolean'
+ | - 'Type mismatch: can not convert ''TRUE'' to boolean'
  | ...
 SELECT d, d AND false FROM t9 WHERE d = 'TRUE';
  | ---
@@ -5595,59 +5595,59 @@ SELECT d, d AND false FROM t9 WHERE d = 'TRUE';
 SELECT d, d OR true FROM t9 WHERE d = 'TRUE';
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to boolean'
+ | - 'Type mismatch: can not convert ''TRUE'' to boolean'
  | ...
 SELECT d, d OR false FROM t9 WHERE d = 'TRUE';
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to boolean'
+ | - 'Type mismatch: can not convert ''TRUE'' to boolean'
  | ...
 
 SELECT a1, d, a1 AND d FROM t6, t9 WHERE d = 'TRUE';
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to boolean'
+ | - 'Type mismatch: can not convert ''TRUE'' to boolean'
  | ...
 SELECT a1, d, a1 OR d FROM t6, t9 WHERE d = 'TRUE';
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to boolean'
+ | - 'Type mismatch: can not convert ''TRUE'' to boolean'
  | ...
 SELECT a1, d, d AND a1 FROM t6, t9 WHERE d = 'TRUE';
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to boolean'
+ | - 'Type mismatch: can not convert ''TRUE'' to boolean'
  | ...
 SELECT a1, d, d OR a1 FROM t6, t9 WHERE d = 'TRUE';
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to boolean'
+ | - 'Type mismatch: can not convert ''TRUE'' to boolean'
  | ...
 SELECT a2, d, a2 AND d FROM t6, t9 WHERE d = 'TRUE';
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to boolean'
+ | - 'Type mismatch: can not convert ''TRUE'' to boolean'
  | ...
 SELECT a2, d, a2 OR d FROM t6, t9 WHERE d = 'TRUE';
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to boolean'
+ | - 'Type mismatch: can not convert ''TRUE'' to boolean'
  | ...
 SELECT a2, d, d AND a2 FROM t6, t9 WHERE d = 'TRUE';
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to boolean'
+ | - 'Type mismatch: can not convert ''TRUE'' to boolean'
  | ...
 SELECT a2, d, d OR a2 FROM t6, t9 WHERE d = 'TRUE';
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to boolean'
+ | - 'Type mismatch: can not convert ''TRUE'' to boolean'
  | ...
 
 SELECT true AND 'true';
  | ---
  | - null
- | - 'Type mismatch: can not convert true to boolean'
+ | - 'Type mismatch: can not convert ''true'' to boolean'
  | ...
 SELECT false AND 'true';
  | ---
@@ -5660,17 +5660,17 @@ SELECT false AND 'true';
 SELECT true OR 'true';
  | ---
  | - null
- | - 'Type mismatch: can not convert true to boolean'
+ | - 'Type mismatch: can not convert ''true'' to boolean'
  | ...
 SELECT false OR 'true';
  | ---
  | - null
- | - 'Type mismatch: can not convert true to boolean'
+ | - 'Type mismatch: can not convert ''true'' to boolean'
  | ...
 SELECT 'true' AND true;
  | ---
  | - null
- | - 'Type mismatch: can not convert true to boolean'
+ | - 'Type mismatch: can not convert ''true'' to boolean'
  | ...
 SELECT 'true' AND false;
  | ---
@@ -5683,59 +5683,59 @@ SELECT 'true' AND false;
 SELECT 'true' OR true;
  | ---
  | - null
- | - 'Type mismatch: can not convert true to boolean'
+ | - 'Type mismatch: can not convert ''true'' to boolean'
  | ...
 SELECT 'true' OR false;
  | ---
  | - null
- | - 'Type mismatch: can not convert true to boolean'
+ | - 'Type mismatch: can not convert ''true'' to boolean'
  | ...
 
 SELECT a1, a1 AND 'true' FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert true to boolean'
+ | - 'Type mismatch: can not convert ''true'' to boolean'
  | ...
 SELECT a1, a1 OR 'true' FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert true to boolean'
+ | - 'Type mismatch: can not convert ''true'' to boolean'
  | ...
 SELECT a1, 'true' AND a1 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert true to boolean'
+ | - 'Type mismatch: can not convert ''true'' to boolean'
  | ...
 SELECT a1, 'true' OR a1 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert true to boolean'
+ | - 'Type mismatch: can not convert ''true'' to boolean'
  | ...
 SELECT a2, a2 AND 'true' FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert true to boolean'
+ | - 'Type mismatch: can not convert ''true'' to boolean'
  | ...
 SELECT a2, a2 OR 'true' FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert true to boolean'
+ | - 'Type mismatch: can not convert ''true'' to boolean'
  | ...
 SELECT a2, 'true' AND a2 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert true to boolean'
+ | - 'Type mismatch: can not convert ''true'' to boolean'
  | ...
 SELECT a2, 'true' OR a2 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert true to boolean'
+ | - 'Type mismatch: can not convert ''true'' to boolean'
  | ...
 
 SELECT d, true AND d FROM t9 WHERE d = 'true';
  | ---
  | - null
- | - 'Type mismatch: can not convert true to boolean'
+ | - 'Type mismatch: can not convert ''true'' to boolean'
  | ...
 SELECT d, false AND d FROM t9 WHERE d = 'true';
  | ---
@@ -5750,17 +5750,17 @@ SELECT d, false AND d FROM t9 WHERE d = 'true';
 SELECT d, true OR d FROM t9 WHERE d = 'true';
  | ---
  | - null
- | - 'Type mismatch: can not convert true to boolean'
+ | - 'Type mismatch: can not convert ''true'' to boolean'
  | ...
 SELECT d, false OR d FROM t9 WHERE d = 'true';
  | ---
  | - null
- | - 'Type mismatch: can not convert true to boolean'
+ | - 'Type mismatch: can not convert ''true'' to boolean'
  | ...
 SELECT d, d AND true FROM t9 WHERE d = 'true';
  | ---
  | - null
- | - 'Type mismatch: can not convert true to boolean'
+ | - 'Type mismatch: can not convert ''true'' to boolean'
  | ...
 SELECT d, d AND false FROM t9 WHERE d = 'true';
  | ---
@@ -5775,59 +5775,59 @@ SELECT d, d AND false FROM t9 WHERE d = 'true';
 SELECT d, d OR true FROM t9 WHERE d = 'true';
  | ---
  | - null
- | - 'Type mismatch: can not convert true to boolean'
+ | - 'Type mismatch: can not convert ''true'' to boolean'
  | ...
 SELECT d, d OR false FROM t9 WHERE d = 'true';
  | ---
  | - null
- | - 'Type mismatch: can not convert true to boolean'
+ | - 'Type mismatch: can not convert ''true'' to boolean'
  | ...
 
 SELECT a1, d, a1 AND d FROM t6, t9 WHERE d = 'true';
  | ---
  | - null
- | - 'Type mismatch: can not convert true to boolean'
+ | - 'Type mismatch: can not convert ''true'' to boolean'
  | ...
 SELECT a1, d, a1 OR d FROM t6, t9 WHERE d = 'true';
  | ---
  | - null
- | - 'Type mismatch: can not convert true to boolean'
+ | - 'Type mismatch: can not convert ''true'' to boolean'
  | ...
 SELECT a1, d, d AND a1 FROM t6, t9 WHERE d = 'true';
  | ---
  | - null
- | - 'Type mismatch: can not convert true to boolean'
+ | - 'Type mismatch: can not convert ''true'' to boolean'
  | ...
 SELECT a1, d, d OR a1 FROM t6, t9 WHERE d = 'true';
  | ---
  | - null
- | - 'Type mismatch: can not convert true to boolean'
+ | - 'Type mismatch: can not convert ''true'' to boolean'
  | ...
 SELECT a2, d, a2 AND d FROM t6, t9 WHERE d = 'true';
  | ---
  | - null
- | - 'Type mismatch: can not convert true to boolean'
+ | - 'Type mismatch: can not convert ''true'' to boolean'
  | ...
 SELECT a2, d, a2 OR d FROM t6, t9 WHERE d = 'true';
  | ---
  | - null
- | - 'Type mismatch: can not convert true to boolean'
+ | - 'Type mismatch: can not convert ''true'' to boolean'
  | ...
 SELECT a2, d, d AND a2 FROM t6, t9 WHERE d = 'true';
  | ---
  | - null
- | - 'Type mismatch: can not convert true to boolean'
+ | - 'Type mismatch: can not convert ''true'' to boolean'
  | ...
 SELECT a2, d, d OR a2 FROM t6, t9 WHERE d = 'true';
  | ---
  | - null
- | - 'Type mismatch: can not convert true to boolean'
+ | - 'Type mismatch: can not convert ''true'' to boolean'
  | ...
 
 SELECT true AND 'FALSE';
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to boolean'
+ | - 'Type mismatch: can not convert ''FALSE'' to boolean'
  | ...
 SELECT false AND 'FALSE';
  | ---
@@ -5840,17 +5840,17 @@ SELECT false AND 'FALSE';
 SELECT true OR 'FALSE';
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to boolean'
+ | - 'Type mismatch: can not convert ''FALSE'' to boolean'
  | ...
 SELECT false OR 'FALSE';
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to boolean'
+ | - 'Type mismatch: can not convert ''FALSE'' to boolean'
  | ...
 SELECT 'FALSE' AND true;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to boolean'
+ | - 'Type mismatch: can not convert ''FALSE'' to boolean'
  | ...
 SELECT 'FALSE' AND false;
  | ---
@@ -5863,59 +5863,59 @@ SELECT 'FALSE' AND false;
 SELECT 'FALSE' OR true;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to boolean'
+ | - 'Type mismatch: can not convert ''FALSE'' to boolean'
  | ...
 SELECT 'FALSE' OR false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to boolean'
+ | - 'Type mismatch: can not convert ''FALSE'' to boolean'
  | ...
 
 SELECT a1, a1 AND 'FALSE' FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to boolean'
+ | - 'Type mismatch: can not convert ''FALSE'' to boolean'
  | ...
 SELECT a1, a1 OR 'FALSE' FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to boolean'
+ | - 'Type mismatch: can not convert ''FALSE'' to boolean'
  | ...
 SELECT a1, 'FALSE' AND a1 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to boolean'
+ | - 'Type mismatch: can not convert ''FALSE'' to boolean'
  | ...
 SELECT a1, 'FALSE' OR a1 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to boolean'
+ | - 'Type mismatch: can not convert ''FALSE'' to boolean'
  | ...
 SELECT a2, a2 AND 'FALSE' FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to boolean'
+ | - 'Type mismatch: can not convert ''FALSE'' to boolean'
  | ...
 SELECT a2, a2 OR 'FALSE' FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to boolean'
+ | - 'Type mismatch: can not convert ''FALSE'' to boolean'
  | ...
 SELECT a2, 'FALSE' AND a2 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to boolean'
+ | - 'Type mismatch: can not convert ''FALSE'' to boolean'
  | ...
 SELECT a2, 'FALSE' OR a2 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to boolean'
+ | - 'Type mismatch: can not convert ''FALSE'' to boolean'
  | ...
 
 SELECT d, true AND d FROM t9 WHERE d = 'FALSE';
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to boolean'
+ | - 'Type mismatch: can not convert ''FALSE'' to boolean'
  | ...
 SELECT d, false AND d FROM t9 WHERE d = 'FALSE';
  | ---
@@ -5930,17 +5930,17 @@ SELECT d, false AND d FROM t9 WHERE d = 'FALSE';
 SELECT d, true OR d FROM t9 WHERE d = 'FALSE';
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to boolean'
+ | - 'Type mismatch: can not convert ''FALSE'' to boolean'
  | ...
 SELECT d, false OR d FROM t9 WHERE d = 'FALSE';
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to boolean'
+ | - 'Type mismatch: can not convert ''FALSE'' to boolean'
  | ...
 SELECT d, d AND true FROM t9 WHERE d = 'FALSE';
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to boolean'
+ | - 'Type mismatch: can not convert ''FALSE'' to boolean'
  | ...
 SELECT d, d AND false FROM t9 WHERE d = 'FALSE';
  | ---
@@ -5955,59 +5955,59 @@ SELECT d, d AND false FROM t9 WHERE d = 'FALSE';
 SELECT d, d OR true FROM t9 WHERE d = 'FALSE';
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to boolean'
+ | - 'Type mismatch: can not convert ''FALSE'' to boolean'
  | ...
 SELECT d, d OR false FROM t9 WHERE d = 'FALSE';
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to boolean'
+ | - 'Type mismatch: can not convert ''FALSE'' to boolean'
  | ...
 
 SELECT a1, d, a1 AND d FROM t6, t9 WHERE d = 'FALSE';
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to boolean'
+ | - 'Type mismatch: can not convert ''FALSE'' to boolean'
  | ...
 SELECT a1, d, a1 OR d FROM t6, t9 WHERE d = 'FALSE';
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to boolean'
+ | - 'Type mismatch: can not convert ''FALSE'' to boolean'
  | ...
 SELECT a1, d, d AND a1 FROM t6, t9 WHERE d = 'FALSE';
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to boolean'
+ | - 'Type mismatch: can not convert ''FALSE'' to boolean'
  | ...
 SELECT a1, d, d OR a1 FROM t6, t9 WHERE d = 'FALSE';
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to boolean'
+ | - 'Type mismatch: can not convert ''FALSE'' to boolean'
  | ...
 SELECT a2, d, a2 AND d FROM t6, t9 WHERE d = 'FALSE';
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to boolean'
+ | - 'Type mismatch: can not convert ''FALSE'' to boolean'
  | ...
 SELECT a2, d, a2 OR d FROM t6, t9 WHERE d = 'FALSE';
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to boolean'
+ | - 'Type mismatch: can not convert ''FALSE'' to boolean'
  | ...
 SELECT a2, d, d AND a2 FROM t6, t9 WHERE d = 'FALSE';
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to boolean'
+ | - 'Type mismatch: can not convert ''FALSE'' to boolean'
  | ...
 SELECT a2, d, d OR a2 FROM t6, t9 WHERE d = 'FALSE';
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to boolean'
+ | - 'Type mismatch: can not convert ''FALSE'' to boolean'
  | ...
 
 SELECT true AND 'false';
  | ---
  | - null
- | - 'Type mismatch: can not convert false to boolean'
+ | - 'Type mismatch: can not convert ''false'' to boolean'
  | ...
 SELECT false AND 'false';
  | ---
@@ -6020,17 +6020,17 @@ SELECT false AND 'false';
 SELECT true OR 'false';
  | ---
  | - null
- | - 'Type mismatch: can not convert false to boolean'
+ | - 'Type mismatch: can not convert ''false'' to boolean'
  | ...
 SELECT false OR 'false';
  | ---
  | - null
- | - 'Type mismatch: can not convert false to boolean'
+ | - 'Type mismatch: can not convert ''false'' to boolean'
  | ...
 SELECT 'false' AND true;
  | ---
  | - null
- | - 'Type mismatch: can not convert false to boolean'
+ | - 'Type mismatch: can not convert ''false'' to boolean'
  | ...
 SELECT 'false' AND false;
  | ---
@@ -6043,59 +6043,59 @@ SELECT 'false' AND false;
 SELECT 'false' OR true;
  | ---
  | - null
- | - 'Type mismatch: can not convert false to boolean'
+ | - 'Type mismatch: can not convert ''false'' to boolean'
  | ...
 SELECT 'false' OR false;
  | ---
  | - null
- | - 'Type mismatch: can not convert false to boolean'
+ | - 'Type mismatch: can not convert ''false'' to boolean'
  | ...
 
 SELECT a1, a1 AND 'false' FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert false to boolean'
+ | - 'Type mismatch: can not convert ''false'' to boolean'
  | ...
 SELECT a1, a1 OR 'false' FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert false to boolean'
+ | - 'Type mismatch: can not convert ''false'' to boolean'
  | ...
 SELECT a1, 'false' AND a1 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert false to boolean'
+ | - 'Type mismatch: can not convert ''false'' to boolean'
  | ...
 SELECT a1, 'false' OR a1 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert false to boolean'
+ | - 'Type mismatch: can not convert ''false'' to boolean'
  | ...
 SELECT a2, a2 AND 'false' FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert false to boolean'
+ | - 'Type mismatch: can not convert ''false'' to boolean'
  | ...
 SELECT a2, a2 OR 'false' FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert false to boolean'
+ | - 'Type mismatch: can not convert ''false'' to boolean'
  | ...
 SELECT a2, 'false' AND a2 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert false to boolean'
+ | - 'Type mismatch: can not convert ''false'' to boolean'
  | ...
 SELECT a2, 'false' OR a2 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert false to boolean'
+ | - 'Type mismatch: can not convert ''false'' to boolean'
  | ...
 
 SELECT d, true AND d FROM t9 WHERE d = 'false';
  | ---
  | - null
- | - 'Type mismatch: can not convert false to boolean'
+ | - 'Type mismatch: can not convert ''false'' to boolean'
  | ...
 SELECT d, false AND d FROM t9 WHERE d = 'false';
  | ---
@@ -6110,17 +6110,17 @@ SELECT d, false AND d FROM t9 WHERE d = 'false';
 SELECT d, true OR d FROM t9 WHERE d = 'false';
  | ---
  | - null
- | - 'Type mismatch: can not convert false to boolean'
+ | - 'Type mismatch: can not convert ''false'' to boolean'
  | ...
 SELECT d, false OR d FROM t9 WHERE d = 'false';
  | ---
  | - null
- | - 'Type mismatch: can not convert false to boolean'
+ | - 'Type mismatch: can not convert ''false'' to boolean'
  | ...
 SELECT d, d AND true FROM t9 WHERE d = 'false';
  | ---
  | - null
- | - 'Type mismatch: can not convert false to boolean'
+ | - 'Type mismatch: can not convert ''false'' to boolean'
  | ...
 SELECT d, d AND false FROM t9 WHERE d = 'false';
  | ---
@@ -6135,53 +6135,53 @@ SELECT d, d AND false FROM t9 WHERE d = 'false';
 SELECT d, d OR true FROM t9 WHERE d = 'false';
  | ---
  | - null
- | - 'Type mismatch: can not convert false to boolean'
+ | - 'Type mismatch: can not convert ''false'' to boolean'
  | ...
 SELECT d, d OR false FROM t9 WHERE d = 'false';
  | ---
  | - null
- | - 'Type mismatch: can not convert false to boolean'
+ | - 'Type mismatch: can not convert ''false'' to boolean'
  | ...
 
 SELECT a1, d, a1 AND d FROM t6, t9 WHERE d = 'false';
  | ---
  | - null
- | - 'Type mismatch: can not convert false to boolean'
+ | - 'Type mismatch: can not convert ''false'' to boolean'
  | ...
 SELECT a1, d, a1 OR d FROM t6, t9 WHERE d = 'false';
  | ---
  | - null
- | - 'Type mismatch: can not convert false to boolean'
+ | - 'Type mismatch: can not convert ''false'' to boolean'
  | ...
 SELECT a1, d, d AND a1 FROM t6, t9 WHERE d = 'false';
  | ---
  | - null
- | - 'Type mismatch: can not convert false to boolean'
+ | - 'Type mismatch: can not convert ''false'' to boolean'
  | ...
 SELECT a1, d, d OR a1 FROM t6, t9 WHERE d = 'false';
  | ---
  | - null
- | - 'Type mismatch: can not convert false to boolean'
+ | - 'Type mismatch: can not convert ''false'' to boolean'
  | ...
 SELECT a2, d, a2 AND d FROM t6, t9 WHERE d = 'false';
  | ---
  | - null
- | - 'Type mismatch: can not convert false to boolean'
+ | - 'Type mismatch: can not convert ''false'' to boolean'
  | ...
 SELECT a2, d, a2 OR d FROM t6, t9 WHERE d = 'false';
  | ---
  | - null
- | - 'Type mismatch: can not convert false to boolean'
+ | - 'Type mismatch: can not convert ''false'' to boolean'
  | ...
 SELECT a2, d, d AND a2 FROM t6, t9 WHERE d = 'false';
  | ---
  | - null
- | - 'Type mismatch: can not convert false to boolean'
+ | - 'Type mismatch: can not convert ''false'' to boolean'
  | ...
 SELECT a2, d, d OR a2 FROM t6, t9 WHERE d = 'false';
  | ---
  | - null
- | - 'Type mismatch: can not convert false to boolean'
+ | - 'Type mismatch: can not convert ''false'' to boolean'
  | ...
 
 -- Cleaning.
diff --git a/test/sql/integer-overflow.result b/test/sql/integer-overflow.result
index a56fb2412..c5de00fd5 100644
--- a/test/sql/integer-overflow.result
+++ b/test/sql/integer-overflow.result
@@ -106,7 +106,7 @@ box.execute('SELECT CAST(\'9223372036854775808\' AS INTEGER);')
 box.execute('SELECT CAST(\'18446744073709551616\' AS INTEGER);')
 ---
 - null
-- 'Type mismatch: can not convert 18446744073709551616 to integer'
+- 'Type mismatch: can not convert ''18446744073709551616'' to integer'
 ...
 -- Due to inexact represantation of large integers in terms of
 -- floating point numbers, numerics with value < UINT64_MAX
diff --git a/test/sql/persistency.result b/test/sql/persistency.result
index 0e259edef..fab94301d 100644
--- a/test/sql/persistency.result
+++ b/test/sql/persistency.result
@@ -371,7 +371,7 @@ box.execute("SELECT \"name\", \"opts\" FROM \"_trigger\"");
 box.execute("INSERT INTO foobar VALUES ('foobar trigger test', 8888)")
 ---
 - null
-- 'Type mismatch: can not convert foobar trigger test to integer'
+- 'Type mismatch: can not convert ''foobar trigger test'' to integer'
 ...
 box.execute("SELECT * FROM barfoo WHERE foo = 9999");
 ---
diff --git a/test/sql/types.result b/test/sql/types.result
index a46967158..219559619 100644
--- a/test/sql/types.result
+++ b/test/sql/types.result
@@ -270,7 +270,7 @@ box.space.T1:drop()
 box.execute("SELECT CAST('1.123' AS INTEGER);")
 ---
 - null
-- 'Type mismatch: can not convert 1.123 to integer'
+- 'Type mismatch: can not convert ''1.123'' to integer'
 ...
 box.execute("CREATE TABLE t1 (f TEXT PRIMARY KEY);")
 ---
@@ -283,7 +283,7 @@ box.execute("INSERT INTO t1 VALUES('0.0'), ('1.5'), ('3.9312453');")
 box.execute("SELECT CAST(f AS INTEGER) FROM t1;")
 ---
 - null
-- 'Type mismatch: can not convert 0.0 to integer'
+- 'Type mismatch: can not convert ''0.0'' to integer'
 ...
 box.space.T1:drop()
 ---
@@ -339,12 +339,12 @@ box.execute("INSERT INTO tboolean VALUES (TRUE);")
 box.execute("SELECT * FROM tboolean WHERE s1 = x'44';")
 ---
 - null
-- 'Type mismatch: can not convert varbinary to boolean'
+- 'Type mismatch: can not convert x''44'' to boolean'
 ...
 box.execute("SELECT * FROM tboolean WHERE s1 = 'abc';")
 ---
 - null
-- 'Type mismatch: can not convert abc to boolean'
+- 'Type mismatch: can not convert ''abc'' to boolean'
 ...
 box.execute("SELECT * FROM tboolean WHERE s1 = 1;")
 ---
@@ -632,7 +632,7 @@ box.execute("SELECT 1 LIMIT 1 OFFSET 18446744073709551614;")
 box.execute("SELECT CAST('18446744073' || '709551616' AS INTEGER);")
 ---
 - null
-- 'Type mismatch: can not convert 18446744073709551616 to integer'
+- 'Type mismatch: can not convert ''18446744073709551616'' to integer'
 ...
 box.execute("SELECT CAST('18446744073' || '709551615' AS INTEGER);")
 ---
@@ -1122,7 +1122,7 @@ box.execute("SELECT CAST('123' AS UNSIGNED);")
 box.execute("SELECT CAST('-123' AS UNSIGNED);")
 ---
 - null
-- 'Type mismatch: can not convert -123 to unsigned'
+- 'Type mismatch: can not convert ''-123'' to unsigned'
 ...
 box.space.T1:drop()
 ---
@@ -1231,7 +1231,7 @@ box.execute("INSERT INTO t VALUES(1, true);")
 box.execute("INSERT INTO t VALUES(1, 'asd');")
 ---
 - null
-- 'Type mismatch: can not convert asd to varbinary'
+- 'Type mismatch: can not convert ''asd'' to varbinary'
 ...
 box.execute("INSERT INTO t VALUES(1, x'616263');")
 ---
@@ -1265,17 +1265,17 @@ box.execute("SELECT * FROM t WHERE v = x'616263'")
 box.execute("SELECT sum(v) FROM t;")
 ---
 - null
-- 'Type mismatch: can not convert varbinary to number'
+- 'Type mismatch: can not convert x''616263'' to number'
 ...
 box.execute("SELECT avg(v) FROM t;")
 ---
 - null
-- 'Type mismatch: can not convert varbinary to number'
+- 'Type mismatch: can not convert x''616263'' to number'
 ...
 box.execute("SELECT total(v) FROM t;")
 ---
 - null
-- 'Type mismatch: can not convert varbinary to number'
+- 'Type mismatch: can not convert x''616263'' to number'
 ...
 box.execute("SELECT min(v) FROM t;")
 ---
@@ -1722,7 +1722,7 @@ box.execute("SELECT CAST(true AS DOUBLE);")
 box.execute("SELECT CAST('asd' AS DOUBLE);")
 ---
 - null
-- 'Type mismatch: can not convert asd to double'
+- 'Type mismatch: can not convert ''asd'' to double'
 ...
 box.execute("SELECT CAST('1' AS DOUBLE);")
 ---
@@ -1743,12 +1743,12 @@ box.execute("SELECT CAST('1.123' AS DOUBLE);")
 box.execute("SELECT CAST(x'' AS DOUBLE);")
 ---
 - null
-- 'Type mismatch: can not convert varbinary to double'
+- 'Type mismatch: can not convert x'''' to double'
 ...
 box.execute("SELECT CAST(x'35' AS DOUBLE);")
 ---
 - null
-- 'Type mismatch: can not convert varbinary to double'
+- 'Type mismatch: can not convert x''35'' to double'
 ...
 box.execute("SELECT CAST(CAST(x'35' AS STRING) AS DOUBLE);")
 ---
@@ -2209,12 +2209,12 @@ box.execute([[INSERT INTO ti(i) VALUES (true);]])
 box.execute([[INSERT INTO ti(i) VALUES ('33');]])
 ---
 - null
-- 'Type mismatch: can not convert 33 to integer'
+- 'Type mismatch: can not convert ''33'' to integer'
 ...
 box.execute([[INSERT INTO ti(i) VALUES (X'3434');]])
 ---
 - null
-- 'Type mismatch: can not convert varbinary to integer'
+- 'Type mismatch: can not convert x''3434'' to integer'
 ...
 box.execute([[SELECT * FROM ti;]])
 ---
@@ -2259,12 +2259,12 @@ box.execute([[INSERT INTO td(d) VALUES (true);]])
 box.execute([[INSERT INTO td(d) VALUES ('33');]])
 ---
 - null
-- 'Type mismatch: can not convert 33 to double'
+- 'Type mismatch: can not convert ''33'' to double'
 ...
 box.execute([[INSERT INTO td(d) VALUES (X'3434');]])
 ---
 - null
-- 'Type mismatch: can not convert varbinary to double'
+- 'Type mismatch: can not convert x''3434'' to double'
 ...
 box.execute([[SELECT * FROM td;]])
 ---
@@ -2303,12 +2303,12 @@ box.execute([[INSERT INTO tb(b) VALUES (true);]])
 box.execute([[INSERT INTO tb(b) VALUES ('33');]])
 ---
 - null
-- 'Type mismatch: can not convert 33 to boolean'
+- 'Type mismatch: can not convert ''33'' to boolean'
 ...
 box.execute([[INSERT INTO tb(b) VALUES (X'3434');]])
 ---
 - null
-- 'Type mismatch: can not convert varbinary to boolean'
+- 'Type mismatch: can not convert x''3434'' to boolean'
 ...
 box.execute([[SELECT * FROM tb;]])
 ---
@@ -2351,7 +2351,7 @@ box.execute([[INSERT INTO tt(t) VALUES ('33');]])
 box.execute([[INSERT INTO tt(t) VALUES (X'3434');]])
 ---
 - null
-- 'Type mismatch: can not convert varbinary to string'
+- 'Type mismatch: can not convert x''3434'' to string'
 ...
 box.execute([[SELECT * FROM tt;]])
 ---
@@ -2388,7 +2388,7 @@ box.execute([[INSERT INTO tv(v) VALUES (true);]])
 box.execute([[INSERT INTO tv(v) VALUES ('33');]])
 ---
 - null
-- 'Type mismatch: can not convert 33 to varbinary'
+- 'Type mismatch: can not convert ''33'' to varbinary'
 ...
 box.execute([[INSERT INTO tv(v) VALUES (X'3434');]])
 ---
@@ -2562,12 +2562,12 @@ box.execute([[UPDATE ti SET i = true WHERE a = 1;]])
 box.execute([[UPDATE ti SET i = '33' WHERE a = 1;]])
 ---
 - null
-- 'Type mismatch: can not convert 33 to integer'
+- 'Type mismatch: can not convert ''33'' to integer'
 ...
 box.execute([[UPDATE ti SET i = X'3434' WHERE a = 1;]])
 ---
 - null
-- 'Type mismatch: can not convert varbinary to integer'
+- 'Type mismatch: can not convert x''3434'' to integer'
 ...
 box.execute([[SELECT * FROM ti;]])
 ---
@@ -2603,12 +2603,12 @@ box.execute([[UPDATE td SET d = true WHERE a = 1;]])
 box.execute([[UPDATE td SET d = '33' WHERE a = 1;]])
 ---
 - null
-- 'Type mismatch: can not convert 33 to double'
+- 'Type mismatch: can not convert ''33'' to double'
 ...
 box.execute([[UPDATE td SET d = X'3434' WHERE a = 1;]])
 ---
 - null
-- 'Type mismatch: can not convert varbinary to double'
+- 'Type mismatch: can not convert x''3434'' to double'
 ...
 box.execute([[SELECT * FROM td;]])
 ---
@@ -2641,12 +2641,12 @@ box.execute([[UPDATE tb SET b = true WHERE a = 1;]])
 box.execute([[UPDATE tb SET b = '33' WHERE a = 1;]])
 ---
 - null
-- 'Type mismatch: can not convert 33 to boolean'
+- 'Type mismatch: can not convert ''33'' to boolean'
 ...
 box.execute([[UPDATE tb SET b = X'3434' WHERE a = 1;]])
 ---
 - null
-- 'Type mismatch: can not convert varbinary to boolean'
+- 'Type mismatch: can not convert x''3434'' to boolean'
 ...
 box.execute([[SELECT * FROM tb;]])
 ---
@@ -2684,7 +2684,7 @@ box.execute([[UPDATE tt SET t = '33' WHERE a = 1;]])
 box.execute([[UPDATE tt SET t = X'3434' WHERE a = 1;]])
 ---
 - null
-- 'Type mismatch: can not convert varbinary to string'
+- 'Type mismatch: can not convert x''3434'' to string'
 ...
 box.execute([[SELECT * FROM tt;]])
 ---
@@ -2718,7 +2718,7 @@ box.execute([[UPDATE tv SET v = true WHERE a = 1;]])
 box.execute([[UPDATE tv SET v = '33' WHERE a = 1;]])
 ---
 - null
-- 'Type mismatch: can not convert 33 to varbinary'
+- 'Type mismatch: can not convert ''33'' to varbinary'
 ...
 box.execute([[UPDATE tv SET v = X'3434' WHERE a = 1;]])
 ---
-- 
2.25.1


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

* [Tarantool-patches] [PATCH v2 3/4] sql: use proper type names in error descriptions
  2021-07-13  7:03 [Tarantool-patches] [PATCH v2 0/4] sql: fix description of type mismatch errors Mergen Imeev via Tarantool-patches
  2021-07-13  7:03 ` [Tarantool-patches] [PATCH v2 1/4] sql: truncate values in type mismatch error Mergen Imeev via Tarantool-patches
  2021-07-13  7:03 ` [Tarantool-patches] [PATCH v2 2/4] sql: properly show " Mergen Imeev via Tarantool-patches
@ 2021-07-13  7:03 ` Mergen Imeev via Tarantool-patches
  2021-07-13  8:51   ` Timur Safin via Tarantool-patches
  2021-07-13  7:04 ` [Tarantool-patches] [PATCH v2 4/4] sql: make type mismatch errors more informative Mergen Imeev via Tarantool-patches
  3 siblings, 1 reply; 11+ messages in thread
From: Mergen Imeev via Tarantool-patches @ 2021-07-13  7:03 UTC (permalink / raw)
  To: tsafin; +Cc: tarantool-patches

Prior to this patch, the type mismatch error description and the
inconsistent types error description in some cases displayed type names
that were different from the default ones. After this patch, all types
in these descriptions are described using the default names.

Part of #6176
---
 src/box/sql/func.c               |  12 +-
 src/box/sql/mem.c                |  14 +-
 src/box/sql/vdbe.c               |   2 +-
 test/sql-tap/func.test.lua       |   6 +-
 test/sql-tap/index1.test.lua     |   4 +-
 test/sql-tap/position.test.lua   |  16 +-
 test/sql-tap/select1.test.lua    |   2 +-
 test/sql-tap/sql-errors.test.lua |   8 +-
 test/sql-tap/uuid.test.lua       |  28 +-
 test/sql/boolean.result          | 716 +++++++++++++++----------------
 test/sql/types.result            |  34 +-
 11 files changed, 422 insertions(+), 420 deletions(-)

diff --git a/src/box/sql/func.c b/src/box/sql/func.c
index f93ae867d..e4832f46d 100644
--- a/src/box/sql/func.c
+++ b/src/box/sql/func.c
@@ -324,7 +324,7 @@ position_func(struct sql_context *context, int argc, struct Mem **argv)
 		inconsistent_type_arg = haystack;
 	if (inconsistent_type_arg != NULL) {
 		diag_set(ClientError, ER_INCONSISTENT_TYPES,
-			 "text or varbinary",
+			 "string or varbinary",
 			 mem_type_to_str(inconsistent_type_arg));
 		context->is_aborted = true;
 		return;
@@ -590,7 +590,7 @@ roundFunc(sql_context * context, int argc, sql_value ** argv)
 		return;
 	if (!mem_is_num(argv[0]) && !mem_is_str(argv[0])) {
 		diag_set(ClientError, ER_SQL_TYPE_MISMATCH,
-			 mem_str(argv[0]), "numeric");
+			 mem_str(argv[0]), "number");
 		context->is_aborted = true;
 		return;
 	}
@@ -650,7 +650,7 @@ case_type##ICUFunc(sql_context *context, int argc, sql_value **argv)   \
 	UNUSED_PARAMETER(argc);                                                \
 	if (mem_is_bin(argv[0]) || mem_is_map(argv[0]) ||                      \
 	    mem_is_array(argv[0])) {                                           \
-		diag_set(ClientError, ER_INCONSISTENT_TYPES, "text",           \
+		diag_set(ClientError, ER_INCONSISTENT_TYPES, "string",         \
 			 "varbinary");                                         \
 		context->is_aborted = true;                                    \
 		return;                                                        \
@@ -733,7 +733,7 @@ randomBlob(sql_context * context, int argc, sql_value ** argv)
 	if (mem_is_bin(argv[0]) || mem_is_map(argv[0]) ||
 	    mem_is_array(argv[0])) {
 		diag_set(ClientError, ER_SQL_TYPE_MISMATCH,
-			 mem_str(argv[0]), "numeric");
+			 mem_str(argv[0]), "number");
 		context->is_aborted = true;
 		return;
 	}
@@ -987,7 +987,7 @@ likeFunc(sql_context *context, int argc, sql_value **argv)
 		char *inconsistent_type = rhs_type != MP_STR ?
 					  mem_type_to_str(argv[0]) :
 					  mem_type_to_str(argv[1]);
-		diag_set(ClientError, ER_INCONSISTENT_TYPES, "text",
+		diag_set(ClientError, ER_INCONSISTENT_TYPES, "string",
 			 inconsistent_type);
 		context->is_aborted = true;
 		return;
@@ -1624,7 +1624,7 @@ soundexFunc(sql_context * context, int argc, sql_value ** argv)
 	if (mem_is_bin(argv[0]) || mem_is_map(argv[0]) ||
 	    mem_is_array(argv[0])) {
 		diag_set(ClientError, ER_SQL_TYPE_MISMATCH,
-			 mem_str(argv[0]), "text");
+			 mem_str(argv[0]), "string");
 		context->is_aborted = true;
 		return;
 	}
diff --git a/src/box/sql/mem.c b/src/box/sql/mem.c
index 3bbff9897..c4375e1ea 100644
--- a/src/box/sql/mem.c
+++ b/src/box/sql/mem.c
@@ -1450,12 +1450,12 @@ mem_concat(struct Mem *a, struct Mem *b, struct Mem *result)
 	/* Concatenation operation can be applied only to strings and blobs. */
 	if (((b->type & (MEM_TYPE_STR | MEM_TYPE_BIN)) == 0)) {
 		diag_set(ClientError, ER_INCONSISTENT_TYPES,
-			 "text or varbinary", mem_type_to_str(b));
+			 "string or varbinary", mem_type_to_str(b));
 		return -1;
 	}
 	if (((a->type & (MEM_TYPE_STR | MEM_TYPE_BIN)) == 0)) {
 		diag_set(ClientError, ER_INCONSISTENT_TYPES,
-			 "text or varbinary", mem_type_to_str(a));
+			 "string or varbinary", mem_type_to_str(a));
 		return -1;
 	}
 
@@ -1544,12 +1544,12 @@ arithmetic_prepare(const struct Mem *left, const struct Mem *right,
 {
 	if (get_number(right, b) != 0) {
 		diag_set(ClientError, ER_SQL_TYPE_MISMATCH, mem_str(right),
-			 "numeric");
+			 "number");
 		return -1;
 	}
 	if (get_number(left, a) != 0) {
 		diag_set(ClientError, ER_SQL_TYPE_MISMATCH, mem_str(left),
-			 "numeric");
+			 "number");
 		return -1;
 	}
 	assert(a->type != 0 && b->type != 0);
@@ -2065,15 +2065,17 @@ mem_type_to_str(const struct Mem *p)
 	case MEM_TYPE_NULL:
 		return "NULL";
 	case MEM_TYPE_STR:
-		return "text";
+		return "string";
 	case MEM_TYPE_INT:
 		return "integer";
 	case MEM_TYPE_UINT:
 		return "unsigned";
 	case MEM_TYPE_DOUBLE:
-		return "real";
+		return "double";
 	case MEM_TYPE_ARRAY:
+		return "array";
 	case MEM_TYPE_MAP:
+		return "map";
 	case MEM_TYPE_BIN:
 		return "varbinary";
 	case MEM_TYPE_BOOL:
diff --git a/src/box/sql/vdbe.c b/src/box/sql/vdbe.c
index 32d02d96e..03f420bca 100644
--- a/src/box/sql/vdbe.c
+++ b/src/box/sql/vdbe.c
@@ -1674,7 +1674,7 @@ case OP_Ge: {             /* same as TK_GE, jump, in1, in3 */
 				mem_cast_implicit_old(pIn3, type) != 0 ?
 				mem_str(pIn3) : mem_str(pIn1);
 			diag_set(ClientError, ER_SQL_TYPE_MISMATCH, str,
-				 "numeric");
+				 "number");
 			goto abort_due_to_error;
 		}
 	} else {
diff --git a/test/sql-tap/func.test.lua b/test/sql-tap/func.test.lua
index ae6bc9ddd..66e525871 100755
--- a/test/sql-tap/func.test.lua
+++ b/test/sql-tap/func.test.lua
@@ -2931,7 +2931,7 @@ test:do_catchsql_test(
         SELECT ROUND(X'FF')
     ]], {
         -- <func-76.1>
-        1, "Type mismatch: can not convert x'FF' to numeric"
+        1, "Type mismatch: can not convert x'FF' to number"
         -- </func-76.1>
     })
 
@@ -2941,7 +2941,7 @@ test:do_catchsql_test(
         SELECT RANDOMBLOB(X'FF')
     ]], {
         -- <func-76.2>
-        1, "Type mismatch: can not convert x'FF' to numeric"
+        1, "Type mismatch: can not convert x'FF' to number"
         -- </func-76.2>
     })
 
@@ -2951,7 +2951,7 @@ test:do_catchsql_test(
         SELECT SOUNDEX(X'FF')
     ]], {
         -- <func-76.3>
-        1, "Type mismatch: can not convert x'FF' to text"
+        1, "Type mismatch: can not convert x'FF' to string"
         -- </func-76.3>
     })
 
diff --git a/test/sql-tap/index1.test.lua b/test/sql-tap/index1.test.lua
index e03e284aa..9e57639cc 100755
--- a/test/sql-tap/index1.test.lua
+++ b/test/sql-tap/index1.test.lua
@@ -778,7 +778,7 @@ test:do_catchsql_test(
         SELECT c FROM t6 WHERE a>123;
     ]], {
         -- <index-14.6>
-        1, "Type mismatch: can not convert '' to numeric"
+        1, "Type mismatch: can not convert '' to number"
         -- </index-14.6>
     })
 
@@ -788,7 +788,7 @@ test:do_catchsql_test(
         SELECT c FROM t6 WHERE a>=123;
     ]], {
         -- <index-14.7>
-        1, "Type mismatch: can not convert '' to numeric"
+        1, "Type mismatch: can not convert '' to number"
         -- </index-14.7>
     })
 
diff --git a/test/sql-tap/position.test.lua b/test/sql-tap/position.test.lua
index 506efe0f4..dd4fa62d0 100755
--- a/test/sql-tap/position.test.lua
+++ b/test/sql-tap/position.test.lua
@@ -228,7 +228,7 @@ test:do_test(
         return test:catchsql "SELECT position(34, 12345);"
     end, {
         -- <position-1.23>
-        1, "Inconsistent types: expected text or varbinary got unsigned"
+        1, "Inconsistent types: expected string or varbinary got unsigned"
         -- </position-1.23>
     })
 
@@ -238,7 +238,7 @@ test:do_test(
         return test:catchsql "SELECT position(34, 123456.78);"
     end, {
         -- <position-1.24>
-        1, "Inconsistent types: expected text or varbinary got real"
+        1, "Inconsistent types: expected string or varbinary got double"
         -- </position-1.24>
     })
 
@@ -248,7 +248,7 @@ test:do_test(
         return test:catchsql "SELECT position(x'3334', 123456.78);"
     end, {
         -- <position-1.25>
-        1, "Inconsistent types: expected text or varbinary got real"
+        1, "Inconsistent types: expected string or varbinary got double"
         -- </position-1.25>
     })
 
@@ -554,7 +554,7 @@ test:do_test(
         return test:catchsql("SELECT position('x', x'78c3a4e282ac79');")
     end, {
         -- <position-1.54>
-        1, "Inconsistent types: expected text got varbinary"
+        1, "Inconsistent types: expected string got varbinary"
         -- </position-1.54>
     })
 
@@ -564,7 +564,7 @@ test:do_test(
         return test:catchsql "SELECT position('y', x'78c3a4e282ac79');"
     end, {
         -- <position-1.55>
-        1, "Inconsistent types: expected text got varbinary"
+        1, "Inconsistent types: expected string got varbinary"
         -- </position-1.55>
     })
 
@@ -614,7 +614,7 @@ test:do_test(
         return test:catchsql "SELECT position(x'79', 'xä€y');"
     end, {
         -- <position-1.57.1>
-        1, "Inconsistent types: expected varbinary got text"
+        1, "Inconsistent types: expected varbinary got string"
         -- </position-1.57.1>
     })
 
@@ -624,7 +624,7 @@ test:do_test(
         return test:catchsql "SELECT position(x'a4', 'xä€y');"
     end, {
         -- <position-1.57.2>
-        1, "Inconsistent types: expected varbinary got text"
+        1, "Inconsistent types: expected varbinary got string"
         -- </position-1.57.2>
     })
 
@@ -634,7 +634,7 @@ test:do_test(
         return test:catchsql "SELECT position('y', x'78c3a4e282ac79');"
     end, {
         -- <position-1.57.3>
-        1, "Inconsistent types: expected text got varbinary"
+        1, "Inconsistent types: expected string got varbinary"
         -- </position-1.57.3>
     })
 
diff --git a/test/sql-tap/select1.test.lua b/test/sql-tap/select1.test.lua
index 1a7a4ee82..57c5c2cb3 100755
--- a/test/sql-tap/select1.test.lua
+++ b/test/sql-tap/select1.test.lua
@@ -320,7 +320,7 @@ test:do_catchsql_test(
         SELECT count(*),count(a),count(b) FROM t4 WHERE b=5
     ]], {
         -- <select1-2.5.3>
-        1, "Type mismatch: can not convert 'This is a string that is too big to fit inside a NBFS buffer' to numeric"
+        1, "Type mismatch: can not convert 'This is a string that is too big to fit inside a NBFS buffer' to number"
         -- </select1-2.5.3>
     })
 
diff --git a/test/sql-tap/sql-errors.test.lua b/test/sql-tap/sql-errors.test.lua
index 52276c27b..66dc77fa1 100755
--- a/test/sql-tap/sql-errors.test.lua
+++ b/test/sql-tap/sql-errors.test.lua
@@ -696,7 +696,7 @@ test:do_catchsql_test(
 		SELECT X'ff' + 1;
 	]], {
 		-- <sql-errors-2.1>
-		1, "Type mismatch: can not convert x'FF' to numeric"
+		1, "Type mismatch: can not convert x'FF' to number"
 		-- </sql-errors-2.1>
 	})
 
@@ -706,7 +706,7 @@ test:do_catchsql_test(
 		SELECT X'ff' - 1;
 	]], {
 		-- <sql-errors-2.2>
-		1, "Type mismatch: can not convert x'FF' to numeric"
+		1, "Type mismatch: can not convert x'FF' to number"
 		-- </sql-errors-2.2>
 	})
 
@@ -716,7 +716,7 @@ test:do_catchsql_test(
 		SELECT X'ff' * 1;
 	]], {
 		-- <sql-errors-2.3>
-		1, "Type mismatch: can not convert x'FF' to numeric"
+		1, "Type mismatch: can not convert x'FF' to number"
 		-- </sql-errors-2.3>
 	})
 
@@ -726,7 +726,7 @@ test:do_catchsql_test(
 		SELECT X'ff' / 1;
 	]], {
 		-- <sql-errors-2.4>
-		1, "Type mismatch: can not convert x'FF' to numeric"
+		1, "Type mismatch: can not convert x'FF' to number"
 		-- </sql-errors-2.4>
 	})
 
diff --git a/test/sql-tap/uuid.test.lua b/test/sql-tap/uuid.test.lua
index 1fc99916a..c9e1b4fcc 100755
--- a/test/sql-tap/uuid.test.lua
+++ b/test/sql-tap/uuid.test.lua
@@ -337,7 +337,7 @@ test:do_catchsql_test(
     [[
         SELECT u LIKE 'a' from t2;
     ]], {
-        1, "Inconsistent types: expected text got uuid"
+        1, "Inconsistent types: expected string got uuid"
     })
 
 test:do_execsql_test(
@@ -395,7 +395,7 @@ test:do_catchsql_test(
     [[
         SELECT POSITION(u, '1') from t2;
     ]], {
-        1, "Inconsistent types: expected text or varbinary got uuid"
+        1, "Inconsistent types: expected string or varbinary got uuid"
     })
 
 test:do_execsql_test(
@@ -421,7 +421,7 @@ test:do_catchsql_test(
     [[
         SELECT ROUND(u) from t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to numeric"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to number"
     })
 
 test:do_execsql_test(
@@ -505,7 +505,7 @@ test:do_catchsql_test(
     [[
         SELECT u || u from t2;
     ]], {
-        1, "Inconsistent types: expected text or varbinary got uuid"
+        1, "Inconsistent types: expected string or varbinary got uuid"
     })
 
 local func = {language = 'Lua', body = 'function(x) return type(x) end',
@@ -971,7 +971,7 @@ test:do_catchsql_test(
     [[
         SELECT -u FROM t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to numeric"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to number"
     })
 
 test:do_catchsql_test(
@@ -979,7 +979,7 @@ test:do_catchsql_test(
     [[
         SELECT u + 1 FROM t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to numeric"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to number"
     })
 
 test:do_catchsql_test(
@@ -987,7 +987,7 @@ test:do_catchsql_test(
     [[
         SELECT u - 1 FROM t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to numeric"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to number"
     })
 
 test:do_catchsql_test(
@@ -995,7 +995,7 @@ test:do_catchsql_test(
     [[
         SELECT u * 1 FROM t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to numeric"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to number"
     })
 
 test:do_catchsql_test(
@@ -1003,7 +1003,7 @@ test:do_catchsql_test(
     [[
         SELECT u / 1 FROM t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to numeric"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to number"
     })
 
 test:do_catchsql_test(
@@ -1011,7 +1011,7 @@ test:do_catchsql_test(
     [[
         SELECT u % 1 FROM t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to numeric"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to number"
     })
 
 -- Check that bitwise operations work with UUIDs as intended.
@@ -1118,7 +1118,7 @@ test:do_catchsql_test(
     [[
         SELECT u > '1' FROM t2;
     ]], {
-        1, "Type mismatch: can not convert text to uuid"
+        1, "Type mismatch: can not convert string to uuid"
     })
 
 test:do_catchsql_test(
@@ -1126,7 +1126,7 @@ test:do_catchsql_test(
     [[
         SELECT u > 1.5 FROM t2;
     ]], {
-        1, "Type mismatch: can not convert real to uuid"
+        1, "Type mismatch: can not convert double to uuid"
     })
 
 test:do_catchsql_test(
@@ -1182,7 +1182,7 @@ test:do_catchsql_test(
     [[
         SELECT u = '1' FROM t2;
     ]], {
-        1, "Type mismatch: can not convert text to uuid"
+        1, "Type mismatch: can not convert string to uuid"
     })
 
 test:do_catchsql_test(
@@ -1190,7 +1190,7 @@ test:do_catchsql_test(
     [[
         SELECT u = 1.5 FROM t2;
     ]], {
-        1, "Type mismatch: can not convert real to uuid"
+        1, "Type mismatch: can not convert double to uuid"
     })
 
 test:do_catchsql_test(
diff --git a/test/sql/boolean.result b/test/sql/boolean.result
index dbd31fbb5..320525d36 100644
--- a/test/sql/boolean.result
+++ b/test/sql/boolean.result
@@ -138,12 +138,12 @@ INSERT INTO ts(s) VALUES ('abc'), (12.5);
 SELECT s FROM ts WHERE s = true;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT s FROM ts WHERE s < true;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT s FROM ts WHERE s IN (true, 1, 'abcd');
  | ---
@@ -1122,245 +1122,245 @@ SELECT a, a1, a OR a1 FROM t, t6;
 SELECT -true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT -false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT -a FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 
 SELECT true + true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT true + false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT false + true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT false + false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT true - true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT true - false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT false - true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT false - false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT true * true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT true * false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT false * true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT false * false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT true / true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT true / false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT false / true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT false / false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT true % true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT true % false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT false % true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT false % false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 
 SELECT a, true + a FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a, false + a FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a, true - a FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a, false - a FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a, true * a FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a, false * a FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a, true / a FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a, false / a FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a, true % a FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a, false % a FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a, a + true FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a, a + false FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a, a - true FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a, a - false FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a, a * true FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a, a * false FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a, a / true FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a, a / false FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a, a % true FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a, a % false FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 
 SELECT a, a1, a + a1 FROM t, t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a, a1, a - a1 FROM t, t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a, a1, a * a1 FROM t, t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a, a1, a / a1 FROM t, t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a, a1, a % a1 FROM t, t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 
 SELECT ~true;
@@ -1560,64 +1560,64 @@ SELECT a, a1, a >> a1 FROM t, t6;
 SELECT true || true;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 SELECT true || false;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 SELECT false || true;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 SELECT false || false;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 
 SELECT a, true || a FROM t;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 SELECT a, false || a FROM t;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 SELECT a, a || true FROM t;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 SELECT a, a || false FROM t;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 
 SELECT a1, a1 || a1 FROM t6;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 SELECT a2, a2 || a2 FROM t6;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 SELECT a1, a2, a1 || a1 FROM t6;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 SELECT a1, a2, a2 || a2 FROM t6;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 
 -- Check comparisons.
@@ -2643,405 +2643,405 @@ SELECT a2, b, b OR a2 FROM t6, t7;
 SELECT true + 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT false + 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT true - 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT false - 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT true * 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT false * 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT true / 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT false / 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT true % 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT false % 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT 2 + true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT 2 + false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT 2 - true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT 2 - false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT 2 * true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT 2 * false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT 2 / true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT 2 / false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT 2 % true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT 2 % false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 
 SELECT a1, a1 + 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, a1 - 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, a1 * 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, a1 / 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, a1 % 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, 2 + a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, 2 - a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, 2 * a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, 2 / a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, 2 % a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a2, a2 + 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, a2 - 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, a2 * 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, a2 / 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, a2 % 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, 2 + a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, 2 - a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, 2 * a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, 2 / a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, 2 % a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 
 SELECT b, true + b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT b, false + b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT b, true - b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT b, false - b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT b, true * b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT b, false * b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT b, true / b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT b, false / b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT b, true % b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT b, false % b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT b, b + true FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT b, b + false FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT b, b - true FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT b, b - false FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT b, b * true FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT b, b * false FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT b, b / true FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT b, b / false FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT b, b % true FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT b, b % false FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 
 SELECT a1, b, a1 + b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, b, a1 - b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, b, a1 * b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, b, a1 / b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, b, a1 % b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, b, b + a1 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, b, b - a1 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, b, b * a1 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, b, b / a1 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, b, b % a1 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a2, b, a2 + b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, b, a2 - b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, b, a2 * b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, b, a2 / b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, b, a2 % b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, b, b + a2 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, b, b - a2 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, b, b * a2 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, b, b / a2 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, b, b % a2 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 
 SELECT true & 2;
@@ -4112,897 +4112,897 @@ SELECT a2, c, c OR a2 FROM t6, t8;
 SELECT true + 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT false + 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT true - 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT false - 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT true * 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT false * 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT true / 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT false / 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT true % 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT false % 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT 2.3 + true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT 2.3 + false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT 2.3 - true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT 2.3 - false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT 2.3 * true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT 2.3 * false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT 2.3 / true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT 2.3 / false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT 2.3 % true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT 2.3 % false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 
 SELECT a1, a1 + 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, a1 - 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, a1 * 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, a1 / 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, a1 % 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, 2.3 + a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, 2.3 - a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, 2.3 * a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, 2.3 / a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, 2.3 % a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a2, a2 + 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, a2 - 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, a2 * 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, a2 / 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, a2 % 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, 2.3 + a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, 2.3 - a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, 2.3 * a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, 2.3 / a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, 2.3 % a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 
 SELECT c, true + c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT c, false + c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT c, true - c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT c, false - c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT c, true * c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT c, false * c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT c, true / c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT c, false / c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT c, true % c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT c, false % c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT c, c + true FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT c, c + false FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT c, c - true FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT c, c - false FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT c, c * true FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT c, c * false FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT c, c / true FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT c, c / false FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT c, c % true FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT c, c % false FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 
 SELECT a1, c, a1 + c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, c, a1 - c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, c, a1 * c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, c, a1 / c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, c, a1 % c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, c, c + a1 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, c, c - a1 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, c, c * a1 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, c, c / a1 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, c, c % a1 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a2, c, a2 + c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, c, a2 - c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, c, a2 * c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, c, a2 / c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, c, a2 % c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, c, c + a2 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, c, c - a2 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, c, c * a2 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, c, c / a2 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, c, c % a2 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 
 SELECT true > 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT false > 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT true < 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT false < 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT 2.3 > true;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT 2.3 > false;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT 2.3 < true;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT 2.3 < false;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 
 SELECT a1, a1 > 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a1, a1 < 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a1, 2.3 > a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a1, 2.3 < a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, a2 > 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, a2 < 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, 2.3 > a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, 2.3 < a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 
 SELECT c, true > c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, false > c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, true < c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, false < c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, c > true FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, c > false FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, c < true FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, c < false FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 
 SELECT a1, c, a1 > c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a1, c, a1 < c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a1, c, c > a1 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a1, c, c < a1 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, c, a2 > c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, c, a2 < c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, c, c > a2 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, c, c < a2 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 
 SELECT true >= 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT false >= 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT true <= 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT false <= 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT 2.3 >= true;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT 2.3 >= false;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT 2.3 <= true;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT 2.3 <= false;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 
 SELECT a1, a1 >= 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a1, a1 <= 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a1, 2.3 >= a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a1, 2.3 <= a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, a2 >= 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, a2 <= 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, 2.3 >= a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, 2.3 <= a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 
 SELECT c, true >= c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, false >= c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, true <= c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, false <= c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, c >= true FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, c >= false FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, c <= true FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, c <= false FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 
 SELECT a1, c, a1 >= c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a1, c, a1 <= c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a1, c, c >= a1 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a1, c, c <= a1 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, c, a2 >= c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, c, a2 <= c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, c, c >= a2 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, c, c <= a2 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 
 SELECT true == 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT false == 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT true != 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT false != 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT 2.3 == true;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT 2.3 == false;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT 2.3 != true;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT 2.3 != false;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 
 SELECT a1, a1 == 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a1, a1 != 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a1, 2.3 == a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a1, 2.3 != a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, a2 == 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, a2 != 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, 2.3 == a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, 2.3 != a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 
 SELECT c, true == c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, false == c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, true != c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, false != c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, c == true FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, c == false FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, c != true FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, c != false FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 
 SELECT a1, c, a1 == c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a1, c, a1 != c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a1, c, c == a1 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a1, c, c != a1 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, c, a2 == c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, c, a2 != c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, c, c == a2 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, c, c != a2 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 
 SELECT true IN (0.1, 1.2, 2.3, 3.4);
@@ -5061,22 +5061,22 @@ SELECT a2 IN (SELECT c FROM t8) FROM t6 LIMIT 1;
 SELECT true BETWEEN 0.1 and 9.9;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT false BETWEEN 0.1 and 9.9;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a1, a1 BETWEEN 0.1 and 9.9 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, a2 BETWEEN 0.1 and 9.9 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 
 -- Check interaction of BOOLEAN and TEXT.
@@ -5272,187 +5272,187 @@ SELECT a2, d, d OR a2 FROM t6, t9;
 SELECT true > 'abc';
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT false > 'abc';
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT true < 'abc';
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT false < 'abc';
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT 'abc' > true;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT 'abc' > false;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT 'abc' < true;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT 'abc' < false;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 
 SELECT d, true > d FROM t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT d, false > d FROM t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT d, true < d FROM t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT d, false < d FROM t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT d, d > true FROM t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT d, d > false FROM t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT d, d < true FROM t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT d, d < false FROM t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 
 SELECT a1, d, a1 > d FROM t6, t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT a1, d, a1 < d FROM t6, t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT a1, d, d > a1 FROM t6, t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT a1, d, d < a1 FROM t6, t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT a2, d, a2 > d FROM t6, t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT a2, d, a2 < d FROM t6, t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT a2, d, d > a2 FROM t6, t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT a2, d, d < a2 FROM t6, t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 
 SELECT true || 'abc';
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 SELECT false || 'abc';
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 SELECT 'abc' || false;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 SELECT 'abc' || true;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 
 SELECT d, true || d FROM t9;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 SELECT d, false || d FROM t9;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 SELECT d, d || false FROM t9;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 SELECT d, d || true FROM t9;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 
 SELECT d, a1 || d FROM t6, t9;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 SELECT d, a2 || d FROM t6, t9;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 SELECT d, d || a1 FROM t6, t9;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 SELECT d, d || a2 FROM t6, t9;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 
 --
diff --git a/test/sql/types.result b/test/sql/types.result
index 219559619..a9a5fd536 100644
--- a/test/sql/types.result
+++ b/test/sql/types.result
@@ -158,39 +158,39 @@ sp:drop()
 box.execute("SELECT 'abc' || 1;")
 ---
 - null
-- 'Inconsistent types: expected text or varbinary got unsigned'
+- 'Inconsistent types: expected string or varbinary got unsigned'
 ...
 box.execute("SELECT 'abc' || 1.123;")
 ---
 - null
-- 'Inconsistent types: expected text or varbinary got real'
+- 'Inconsistent types: expected string or varbinary got double'
 ...
 box.execute("SELECT 1 || 'abc';")
 ---
 - null
-- 'Inconsistent types: expected text or varbinary got unsigned'
+- 'Inconsistent types: expected string or varbinary got unsigned'
 ...
 box.execute("SELECT 1.123 || 'abc';")
 ---
 - null
-- 'Inconsistent types: expected text or varbinary got real'
+- 'Inconsistent types: expected string or varbinary got double'
 ...
 box.execute("SELECt 'a' || 'b' || 1;")
 ---
 - null
-- 'Inconsistent types: expected text or varbinary got unsigned'
+- 'Inconsistent types: expected string or varbinary got unsigned'
 ...
 -- What is more, they must be of the same type.
 --
 box.execute("SELECT 'abc' || randomblob(5);")
 ---
 - null
-- 'Inconsistent types: expected text got varbinary'
+- 'Inconsistent types: expected string got varbinary'
 ...
 box.execute("SELECT randomblob(5) || 'x';")
 ---
 - null
-- 'Inconsistent types: expected varbinary got text'
+- 'Inconsistent types: expected varbinary got string'
 ...
 -- Result of BLOBs concatenation must be BLOB.
 --
@@ -215,17 +215,17 @@ box.execute("INSERT INTO t1 VALUES (randomblob(5));")
 box.execute("SELECT * FROM t1 WHERE s LIKE 'blob';")
 ---
 - null
-- 'Inconsistent types: expected text got varbinary'
+- 'Inconsistent types: expected string got varbinary'
 ...
 box.execute("SELECT * FROM t1 WHERE 'blob' LIKE s;")
 ---
 - null
-- 'Inconsistent types: expected text got varbinary'
+- 'Inconsistent types: expected string got varbinary'
 ...
 box.execute("SELECT * FROM t1 WHERE 'blob' LIKE x'0000';")
 ---
 - null
-- 'Inconsistent types: expected text got varbinary'
+- 'Inconsistent types: expected string got varbinary'
 ...
 box.execute("SELECT s LIKE NULL FROM t1;")
 ---
@@ -246,12 +246,12 @@ box.execute("INSERT INTO t1 VALUES (1);")
 box.execute("SELECT * FROM t1 WHERE s LIKE 'int';")
 ---
 - null
-- 'Inconsistent types: expected text got unsigned'
+- 'Inconsistent types: expected string got unsigned'
 ...
 box.execute("SELECT * FROM t1 WHERE 'int' LIKE 4;")
 ---
 - null
-- 'Inconsistent types: expected text got unsigned'
+- 'Inconsistent types: expected string got unsigned'
 ...
 box.execute("SELECT NULL LIKE s FROM t1;")
 ---
@@ -354,7 +354,7 @@ box.execute("SELECT * FROM tboolean WHERE s1 = 1;")
 box.execute("SELECT * FROM tboolean WHERE s1 = 1.123;")
 ---
 - null
-- 'Type mismatch: can not convert real to boolean'
+- 'Type mismatch: can not convert double to boolean'
 ...
 box.space.TBOOLEAN:drop()
 ---
@@ -1245,12 +1245,12 @@ box.execute("SELECT * FROM t WHERE v = 1")
 box.execute("SELECT * FROM t WHERE v = 1.123")
 ---
 - null
-- 'Type mismatch: can not convert real to varbinary'
+- 'Type mismatch: can not convert double to varbinary'
 ...
 box.execute("SELECT * FROM t WHERE v = 'str'")
 ---
 - null
-- 'Type mismatch: can not convert text to varbinary'
+- 'Type mismatch: can not convert string to varbinary'
 ...
 box.execute("SELECT * FROM t WHERE v = x'616263'")
 ---
@@ -1312,12 +1312,12 @@ box.execute("SELECT group_concat(v) FROM t;")
 box.execute("SELECT lower(v) FROM t;")
 ---
 - null
-- 'Inconsistent types: expected text got varbinary'
+- 'Inconsistent types: expected string got varbinary'
 ...
 box.execute("SELECT upper(v) FROM t;")
 ---
 - null
-- 'Inconsistent types: expected text got varbinary'
+- 'Inconsistent types: expected string got varbinary'
 ...
 box.execute("SELECT abs(v) FROM t;")
 ---
-- 
2.25.1


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

* [Tarantool-patches] [PATCH v2 4/4] sql: make type mismatch errors more informative
  2021-07-13  7:03 [Tarantool-patches] [PATCH v2 0/4] sql: fix description of type mismatch errors Mergen Imeev via Tarantool-patches
                   ` (2 preceding siblings ...)
  2021-07-13  7:03 ` [Tarantool-patches] [PATCH v2 3/4] sql: use proper type names in error descriptions Mergen Imeev via Tarantool-patches
@ 2021-07-13  7:04 ` Mergen Imeev via Tarantool-patches
  2021-07-13  8:51   ` Timur Safin via Tarantool-patches
  3 siblings, 1 reply; 11+ messages in thread
From: Mergen Imeev via Tarantool-patches @ 2021-07-13  7:04 UTC (permalink / raw)
  To: tsafin; +Cc: tarantool-patches

Prior to this patch, in some cases the type mismatch error description
showed the value, and in some cases the type of the value. After this
patch, both the type and value will be shown. Also, inconsistent type
error description also become more informative. Previously it contained
only type of value, now it contains value and its type.

Close #6176
---
 .../gh-6176-type-mistmatch-description.md     |    4 +
 src/box/sql/func.c                            |   17 +-
 src/box/sql/mem.c                             |   38 +-
 src/box/sql/mem.h                             |    7 +-
 src/box/sql/vdbe.c                            |   17 +-
 test/sql-tap/autoinc.test.lua                 |    4 +-
 test/sql-tap/cast.test.lua                    |   20 +-
 test/sql-tap/func.test.lua                    |    8 +-
 ...-4766-wrong-cast-from-blob-to-int.test.lua |    4 +-
 .../gh-5913-segfault-on-select-uuid.test.lua  |    4 +-
 test/sql-tap/index1.test.lua                  |    4 +-
 test/sql-tap/numcast.test.lua                 |    4 +-
 test/sql-tap/position.test.lua                |   16 +-
 test/sql-tap/select1.test.lua                 |    6 +-
 test/sql-tap/select5.test.lua                 |    2 +-
 test/sql-tap/sql-errors.test.lua              |   56 +-
 test/sql-tap/tkt-80e031a00f.test.lua          |    8 +-
 test/sql-tap/tkt-9a8b09f8e6.test.lua          |   20 +-
 test/sql-tap/uuid.test.lua                    |  122 +-
 test/sql/boolean.result                       | 1534 ++++++++---------
 test/sql/integer-overflow.result              |    4 +-
 test/sql/persistency.result                   |    2 +-
 test/sql/types.result                         |  174 +-
 23 files changed, 1043 insertions(+), 1032 deletions(-)
 create mode 100644 changelogs/unreleased/gh-6176-type-mistmatch-description.md

diff --git a/changelogs/unreleased/gh-6176-type-mistmatch-description.md b/changelogs/unreleased/gh-6176-type-mistmatch-description.md
new file mode 100644
index 000000000..0e00c4175
--- /dev/null
+++ b/changelogs/unreleased/gh-6176-type-mistmatch-description.md
@@ -0,0 +1,4 @@
+## feature/sql
+
+* Descriptions of type mismatch error and inconsistent type error become more
+  informative (gh-6176).
diff --git a/src/box/sql/func.c b/src/box/sql/func.c
index e4832f46d..84768f17c 100644
--- a/src/box/sql/func.c
+++ b/src/box/sql/func.c
@@ -273,7 +273,7 @@ absFunc(sql_context * context, int argc, sql_value ** argv)
 	case MP_ARRAY:
 	case MP_MAP: {
 		diag_set(ClientError, ER_INCONSISTENT_TYPES, "number",
-			 mem_type_to_str(argv[0]));
+			 mem_str(argv[0]));
 		context->is_aborted = true;
 		return;
 	}
@@ -324,8 +324,7 @@ position_func(struct sql_context *context, int argc, struct Mem **argv)
 		inconsistent_type_arg = haystack;
 	if (inconsistent_type_arg != NULL) {
 		diag_set(ClientError, ER_INCONSISTENT_TYPES,
-			 "string or varbinary",
-			 mem_type_to_str(inconsistent_type_arg));
+			 "string or varbinary", mem_str(inconsistent_type_arg));
 		context->is_aborted = true;
 		return;
 	}
@@ -335,7 +334,7 @@ position_func(struct sql_context *context, int argc, struct Mem **argv)
 	 */
 	if (haystack_type != needle_type) {
 		diag_set(ClientError, ER_INCONSISTENT_TYPES,
-			 mem_type_to_str(needle), mem_type_to_str(haystack));
+			 mem_type_to_str(needle), mem_str(haystack));
 		context->is_aborted = true;
 		return;
 	}
@@ -651,7 +650,7 @@ case_type##ICUFunc(sql_context *context, int argc, sql_value **argv)   \
 	if (mem_is_bin(argv[0]) || mem_is_map(argv[0]) ||                      \
 	    mem_is_array(argv[0])) {                                           \
 		diag_set(ClientError, ER_INCONSISTENT_TYPES, "string",         \
-			 "varbinary");                                         \
+			 mem_str(argv[0]));                                    \
 		context->is_aborted = true;                                    \
 		return;                                                        \
 	}                                                                      \
@@ -984,11 +983,9 @@ likeFunc(sql_context *context, int argc, sql_value **argv)
 	if (lhs_type != MP_STR || rhs_type != MP_STR) {
 		if (lhs_type == MP_NIL || rhs_type == MP_NIL)
 			return;
-		char *inconsistent_type = rhs_type != MP_STR ?
-					  mem_type_to_str(argv[0]) :
-					  mem_type_to_str(argv[1]);
-		diag_set(ClientError, ER_INCONSISTENT_TYPES, "string",
-			 inconsistent_type);
+		const char *str = rhs_type != MP_STR ?
+				  mem_str(argv[0]) : mem_str(argv[1]);
+		diag_set(ClientError, ER_INCONSISTENT_TYPES, "string", str);
 		context->is_aborted = true;
 		return;
 	}
diff --git a/src/box/sql/mem.c b/src/box/sql/mem.c
index c4375e1ea..cdb55f858 100644
--- a/src/box/sql/mem.c
+++ b/src/box/sql/mem.c
@@ -78,16 +78,17 @@ mem_str(const struct Mem *mem)
 	case MEM_TYPE_NULL:
 		return "NULL";
 	case MEM_TYPE_STR:
-		if (mem->n > STR_VALUE_MAX_LEN)
-			return tt_sprintf("'%.*s...", STR_VALUE_MAX_LEN, mem->z);
-		return tt_sprintf("'%.*s'", mem->n, mem->z);
+		if (mem->n <= STR_VALUE_MAX_LEN)
+			return tt_sprintf("string('%.*s')", mem->n, mem->z);
+		return tt_sprintf("string('%.*s...)", STR_VALUE_MAX_LEN,
+				  mem->z);
 	case MEM_TYPE_INT:
-		return tt_sprintf("%lld", mem->u.i);
+		return tt_sprintf("integer(%lld)", mem->u.i);
 	case MEM_TYPE_UINT:
-		return tt_sprintf("%llu", mem->u.u);
+		return tt_sprintf("integer(%llu)", mem->u.u);
 	case MEM_TYPE_DOUBLE:
 		sql_snprintf(STR_VALUE_MAX_LEN, buf, "%!.15g", mem->u.r);
-		return tt_sprintf("%s", buf);
+		return tt_sprintf("double(%s)", buf);
 	case MEM_TYPE_BIN: {
 		int len = MIN(mem->n, STR_VALUE_MAX_LEN / 2);
 		for (int i = 0; i < len; ++i) {
@@ -97,22 +98,25 @@ mem_str(const struct Mem *mem)
 			buf[2 * i + 1] = n < 10 ? ('0' + n) : ('A' + n - 10);
 		}
 		if (mem->n > len)
-			return tt_sprintf("x'%.*s...", len * 2, buf);
-		return tt_sprintf("x'%.*s'", len * 2, buf);
+			return tt_sprintf("varbinary(x'%.*s...)", len * 2, buf);
+		return tt_sprintf("varbinary(x'%.*s')", len * 2, buf);
 	}
 	case MEM_TYPE_MAP:
 	case MEM_TYPE_ARRAY: {
 		const char *str = mp_str(mem->z);
-		if (strlen(str) <= STR_VALUE_MAX_LEN)
-			return str;
-		memcpy(buf, str, STR_VALUE_MAX_LEN);
-		return tt_sprintf("%.*s...", STR_VALUE_MAX_LEN, buf);
+		const char *type = mem_type_to_str(mem);
+		uint32_t len = strlen(str);
+		uint32_t minlen = MIN(STR_VALUE_MAX_LEN, len);
+		memcpy(buf, str, minlen);
+		if (len <= STR_VALUE_MAX_LEN)
+			return tt_sprintf("%s(%.*s)", type, minlen, buf);
+		return tt_sprintf("%s(%.*s...)", type, minlen, buf);
 	}
 	case MEM_TYPE_UUID:
 		tt_uuid_to_string(&mem->u.uuid, buf);
-		return tt_sprintf("'%s'", buf);
+		return tt_sprintf("uuid('%s')", buf);
 	case MEM_TYPE_BOOL:
-		return mem->u.b ? "TRUE" : "FALSE";
+		return mem->u.b ? "boolean(TRUE)" : "boolean(FALSE)";
 	default:
 		return "unknown";
 	}
@@ -1450,19 +1454,19 @@ mem_concat(struct Mem *a, struct Mem *b, struct Mem *result)
 	/* Concatenation operation can be applied only to strings and blobs. */
 	if (((b->type & (MEM_TYPE_STR | MEM_TYPE_BIN)) == 0)) {
 		diag_set(ClientError, ER_INCONSISTENT_TYPES,
-			 "string or varbinary", mem_type_to_str(b));
+			 "string or varbinary", mem_str(b));
 		return -1;
 	}
 	if (((a->type & (MEM_TYPE_STR | MEM_TYPE_BIN)) == 0)) {
 		diag_set(ClientError, ER_INCONSISTENT_TYPES,
-			 "string or varbinary", mem_type_to_str(a));
+			 "string or varbinary", mem_str(a));
 		return -1;
 	}
 
 	/* Moreover, both operands must be of the same type. */
 	if (b->type != a->type) {
 		diag_set(ClientError, ER_INCONSISTENT_TYPES,
-			 mem_type_to_str(a), mem_type_to_str(b));
+			 mem_type_to_str(a), mem_str(b));
 		return -1;
 	}
 
diff --git a/src/box/sql/mem.h b/src/box/sql/mem.h
index 0bbc63e68..97aba9ab4 100644
--- a/src/box/sql/mem.h
+++ b/src/box/sql/mem.h
@@ -263,9 +263,10 @@ bool
 mem_is_field_compatible(const struct Mem *mem, enum field_type type);
 
 /**
- * Return a string that represent content of MEM. String is either allocated
- * using static_alloc() of just a static variable. This function should only be
- * used for debugging or displaying MEM values in errors.
+ * Return a string that contains description of type and value of MEM. String is
+ * either allocated using static_alloc() of just a static variable. This
+ * function should only be used for debugging or displaying MEM values in
+ * description of errors.
  */
 const char *
 mem_str(const struct Mem *mem);
diff --git a/src/box/sql/vdbe.c b/src/box/sql/vdbe.c
index 03f420bca..cc698b715 100644
--- a/src/box/sql/vdbe.c
+++ b/src/box/sql/vdbe.c
@@ -1627,27 +1627,24 @@ case OP_Ge: {             /* same as TK_GE, jump, in1, in3 */
 		}
 	} else if (mem_is_bool(pIn3) || mem_is_bool(pIn1)) {
 		if (mem_cmp_bool(pIn3, pIn1, &res) != 0) {
-			char *str = !mem_is_bool(pIn3) ?
-				    mem_type_to_str(pIn3) :
-				    mem_type_to_str(pIn1);
+			const char *str = !mem_is_bool(pIn3) ?
+					  mem_str(pIn3) : mem_str(pIn1);
 			diag_set(ClientError, ER_SQL_TYPE_MISMATCH, str,
 				 "boolean");
 			goto abort_due_to_error;
 		}
 	} else if (((pIn3->type | pIn1->type) & MEM_TYPE_UUID) != 0) {
 		if (mem_cmp_uuid(pIn3, pIn1, &res) != 0) {
-			char *str = pIn3->type != MEM_TYPE_UUID ?
-				    mem_type_to_str(pIn3) :
-				    mem_type_to_str(pIn1);
+			const char *str = pIn3->type != MEM_TYPE_UUID ?
+					  mem_str(pIn3) : mem_str(pIn1);
 			diag_set(ClientError, ER_SQL_TYPE_MISMATCH, str,
 				 "uuid");
 			goto abort_due_to_error;
 		}
 	} else if (mem_is_bin(pIn3) || mem_is_bin(pIn1)) {
 		if (mem_cmp_bin(pIn3, pIn1, &res) != 0) {
-			char *str = !mem_is_bin(pIn3) ?
-				    mem_type_to_str(pIn3) :
-				    mem_type_to_str(pIn1);
+			const char *str = !mem_is_bin(pIn3) ?
+					  mem_str(pIn3) : mem_str(pIn1);
 			diag_set(ClientError, ER_SQL_TYPE_MISMATCH, str,
 				 "varbinary");
 			goto abort_due_to_error;
@@ -1655,7 +1652,7 @@ case OP_Ge: {             /* same as TK_GE, jump, in1, in3 */
 	} else if (mem_is_map(pIn3) || mem_is_map(pIn1) || mem_is_array(pIn3) ||
 		   mem_is_array(pIn1)) {
 		diag_set(ClientError, ER_SQL_TYPE_MISMATCH,
-			 mem_type_to_str(pIn3), mem_type_to_str(pIn1));
+			 mem_str(pIn3), mem_type_to_str(pIn1));
 		goto abort_due_to_error;
 	} else if (type == FIELD_TYPE_STRING) {
 		if (mem_cmp_str(pIn3, pIn1, &res, pOp->p4.pColl) != 0) {
diff --git a/test/sql-tap/autoinc.test.lua b/test/sql-tap/autoinc.test.lua
index 83d983fe1..21e80356a 100755
--- a/test/sql-tap/autoinc.test.lua
+++ b/test/sql-tap/autoinc.test.lua
@@ -616,7 +616,7 @@ test:do_catchsql_test(
             INSERT INTO t2 VALUES('asd');
     ]], {
         -- <autoinc-10.2>
-        1, "Type mismatch: can not convert 'asd' to integer"
+        1, "Type mismatch: can not convert string('asd') to integer"
         -- </autoinc-10.2>
     })
 
@@ -809,7 +809,7 @@ test:do_catchsql_test(
         INSERT INTO t1 SELECT s2, s2 FROM t1;
     ]], {
         -- <autoinc-gh-3670>
-        1, "Type mismatch: can not convert 'a' to integer"
+        1, "Type mismatch: can not convert string('a') to integer"
         -- </autoinc-gh-3670>
     })
 
diff --git a/test/sql-tap/cast.test.lua b/test/sql-tap/cast.test.lua
index e2a227127..8e7b6640e 100755
--- a/test/sql-tap/cast.test.lua
+++ b/test/sql-tap/cast.test.lua
@@ -70,7 +70,7 @@ test:do_catchsql_test(
         SELECT CAST(x'616263' AS NUMBER)
     ]], {
         -- <cast-1.5>
-        1, "Type mismatch: can not convert x'616263' to number"
+        1, "Type mismatch: can not convert varbinary(x'616263') to number"
         -- </cast-1.5>
     })
 
@@ -100,7 +100,7 @@ test:do_catchsql_test(
         SELECT CAST(x'616263' AS integer)
     ]], {
         -- <cast-1.9>
-        1, "Type mismatch: can not convert x'616263' to integer"
+        1, "Type mismatch: can not convert varbinary(x'616263') to integer"
         -- </cast-1.9>
     })
 
@@ -450,7 +450,7 @@ test:do_catchsql_test(
         SELECT CAST('123abc' AS NUMBER)
     ]], {
         -- <cast-1.45>
-        1, "Type mismatch: can not convert '123abc' to number"
+        1, "Type mismatch: can not convert string('123abc') to number"
         -- </cast-1.45>
     })
 
@@ -470,7 +470,7 @@ test:do_catchsql_test(
         SELECT CAST('123abc' AS integer)
     ]], {
         -- <cast-1.49>
-        1, "Type mismatch: can not convert '123abc' to integer"
+        1, "Type mismatch: can not convert string('123abc') to integer"
         -- </cast-1.49>
     })
 
@@ -480,7 +480,7 @@ test:do_catchsql_test(
         SELECT CAST('123.5abc' AS NUMBER)
     ]], {
         -- <cast-1.51>
-        1, "Type mismatch: can not convert '123.5abc' to number"
+        1, "Type mismatch: can not convert string('123.5abc') to number"
         -- </cast-1.51>
     })
 
@@ -490,7 +490,7 @@ test:do_catchsql_test(
         SELECT CAST('123.5abc' AS integer)
     ]], {
         -- <cast-1.53>
-        1, "Type mismatch: can not convert '123.5abc' to integer"
+        1, "Type mismatch: can not convert string('123.5abc') to integer"
         -- </cast-1.53>
     })
 
@@ -561,7 +561,7 @@ test:do_catchsql_test(
         SELECT CAST('abc' AS NUMBER)
     ]], {
         -- <case-1.66>
-        1, "Type mismatch: can not convert 'abc' to number"
+        1, "Type mismatch: can not convert string('abc') to number"
         -- </case-1.66>
     })
 
@@ -835,7 +835,7 @@ test:do_test(
         ]]
     end, {
         -- <cast-4.1>
-        1, "Type mismatch: can not convert 'abc' to integer"
+        1, "Type mismatch: can not convert string('abc') to integer"
         -- </cast-4.1>
     })
 
@@ -847,7 +847,7 @@ test:do_test(
         ]]
     end, {
         -- <cast-4.2>
-        1, "Type mismatch: can not convert 'abc' to integer"
+        1, "Type mismatch: can not convert string('abc') to integer"
         -- </cast-4.2>
     })
 
@@ -859,7 +859,7 @@ test:do_test(
         ]]
     end, {
         -- <cast-4.4>
-        1, "Type mismatch: can not convert 'abc' to number"
+        1, "Type mismatch: can not convert string('abc') to number"
         -- </cast-4.4>
     })
 
diff --git a/test/sql-tap/func.test.lua b/test/sql-tap/func.test.lua
index 66e525871..df55ff9cf 100755
--- a/test/sql-tap/func.test.lua
+++ b/test/sql-tap/func.test.lua
@@ -2931,7 +2931,7 @@ test:do_catchsql_test(
         SELECT ROUND(X'FF')
     ]], {
         -- <func-76.1>
-        1, "Type mismatch: can not convert x'FF' to number"
+        1, "Type mismatch: can not convert varbinary(x'FF') to number"
         -- </func-76.1>
     })
 
@@ -2941,7 +2941,7 @@ test:do_catchsql_test(
         SELECT RANDOMBLOB(X'FF')
     ]], {
         -- <func-76.2>
-        1, "Type mismatch: can not convert x'FF' to number"
+        1, "Type mismatch: can not convert varbinary(x'FF') to number"
         -- </func-76.2>
     })
 
@@ -2951,7 +2951,7 @@ test:do_catchsql_test(
         SELECT SOUNDEX(X'FF')
     ]], {
         -- <func-76.3>
-        1, "Type mismatch: can not convert x'FF' to string"
+        1, "Type mismatch: can not convert varbinary(x'FF') to string"
         -- </func-76.3>
     })
 
@@ -2961,7 +2961,7 @@ test:do_catchsql_test(
         SELECT SUM(X'FF')
     ]], {
         -- <func-76.4>
-        1, "Type mismatch: can not convert x'FF' to number"
+        1, "Type mismatch: can not convert varbinary(x'FF') to number"
         -- </func-76.4>
     })
 
diff --git a/test/sql-tap/gh-4766-wrong-cast-from-blob-to-int.test.lua b/test/sql-tap/gh-4766-wrong-cast-from-blob-to-int.test.lua
index b595f99b0..a8cc0e770 100755
--- a/test/sql-tap/gh-4766-wrong-cast-from-blob-to-int.test.lua
+++ b/test/sql-tap/gh-4766-wrong-cast-from-blob-to-int.test.lua
@@ -32,9 +32,9 @@ test:do_execsql_test(
 test:do_catchsql_test(
     "gh-4766-3",
     "SELECT CAST('" .. long_str .. "1234'" .. " AS INTEGER);", {
-        1, "Type mismatch: can not convert '00000000000000000000000000000000" ..
+        1, "Type mismatch: can not convert string('0000000000000000000000000" ..
         "0000000000000000000000000000000000000000000000000000000000000000000" ..
-        "00000000000000000000000000000... to integer"
+        "000000000000000000000000000000000000...) to integer"
     })
 
 test:finish_test()
diff --git a/test/sql-tap/gh-5913-segfault-on-select-uuid.test.lua b/test/sql-tap/gh-5913-segfault-on-select-uuid.test.lua
index 59a76000a..8847fede4 100755
--- a/test/sql-tap/gh-5913-segfault-on-select-uuid.test.lua
+++ b/test/sql-tap/gh-5913-segfault-on-select-uuid.test.lua
@@ -40,7 +40,7 @@ test:do_catchsql_test(
     [[
         INSERT INTO t1 SELECT i, NULL, d FROM t;
     ]], {
-        1, "Type mismatch: can not convert x'C70501030111111C' to decimal"
+        1, "Type mismatch: can not convert varbinary(x'C70501030111111C') to decimal"
     })
 
 --
@@ -77,7 +77,7 @@ test:do_catchsql_test(
     [[
         UPDATE td SET d = d;
     ]], {
-        1, "Type mismatch: can not convert x'C70501030111111C' to decimal"
+        1, "Type mismatch: can not convert varbinary(x'C70501030111111C') to decimal"
     })
 
 test:finish_test()
diff --git a/test/sql-tap/index1.test.lua b/test/sql-tap/index1.test.lua
index 9e57639cc..6a7450bb7 100755
--- a/test/sql-tap/index1.test.lua
+++ b/test/sql-tap/index1.test.lua
@@ -778,7 +778,7 @@ test:do_catchsql_test(
         SELECT c FROM t6 WHERE a>123;
     ]], {
         -- <index-14.6>
-        1, "Type mismatch: can not convert '' to number"
+        1, "Type mismatch: can not convert string('') to number"
         -- </index-14.6>
     })
 
@@ -788,7 +788,7 @@ test:do_catchsql_test(
         SELECT c FROM t6 WHERE a>=123;
     ]], {
         -- <index-14.7>
-        1, "Type mismatch: can not convert '' to number"
+        1, "Type mismatch: can not convert string('') to number"
         -- </index-14.7>
     })
 
diff --git a/test/sql-tap/numcast.test.lua b/test/sql-tap/numcast.test.lua
index 6ca1316d5..b3aa64e76 100755
--- a/test/sql-tap/numcast.test.lua
+++ b/test/sql-tap/numcast.test.lua
@@ -105,7 +105,7 @@ test:do_catchsql_test(
     [[
         SELECT CAST((20000000000000000000.) AS UNSIGNED);
     ]], {
-        1,"Type mismatch: can not convert 2.0e+19 to unsigned"
+        1,"Type mismatch: can not convert double(2.0e+19) to unsigned"
     })
 
 test:do_execsql_test(
@@ -133,7 +133,7 @@ test:do_catchsql_test(
         INSERT INTO t VALUES(20000000000000000000.01);
         SELECT * FROM t;
     ]], {
-        1,"Type mismatch: can not convert 2.0e+19 to integer"
+        1,"Type mismatch: can not convert double(2.0e+19) to integer"
     })
 
 test:do_execsql_test(
diff --git a/test/sql-tap/position.test.lua b/test/sql-tap/position.test.lua
index dd4fa62d0..6877d08fa 100755
--- a/test/sql-tap/position.test.lua
+++ b/test/sql-tap/position.test.lua
@@ -228,7 +228,7 @@ test:do_test(
         return test:catchsql "SELECT position(34, 12345);"
     end, {
         -- <position-1.23>
-        1, "Inconsistent types: expected string or varbinary got unsigned"
+        1, "Inconsistent types: expected string or varbinary got integer(12345)"
         -- </position-1.23>
     })
 
@@ -238,7 +238,7 @@ test:do_test(
         return test:catchsql "SELECT position(34, 123456.78);"
     end, {
         -- <position-1.24>
-        1, "Inconsistent types: expected string or varbinary got double"
+        1, "Inconsistent types: expected string or varbinary got double(123456.78)"
         -- </position-1.24>
     })
 
@@ -248,7 +248,7 @@ test:do_test(
         return test:catchsql "SELECT position(x'3334', 123456.78);"
     end, {
         -- <position-1.25>
-        1, "Inconsistent types: expected string or varbinary got double"
+        1, "Inconsistent types: expected string or varbinary got double(123456.78)"
         -- </position-1.25>
     })
 
@@ -554,7 +554,7 @@ test:do_test(
         return test:catchsql("SELECT position('x', x'78c3a4e282ac79');")
     end, {
         -- <position-1.54>
-        1, "Inconsistent types: expected string got varbinary"
+        1, "Inconsistent types: expected string got varbinary(x'78C3A4E282AC79')"
         -- </position-1.54>
     })
 
@@ -564,7 +564,7 @@ test:do_test(
         return test:catchsql "SELECT position('y', x'78c3a4e282ac79');"
     end, {
         -- <position-1.55>
-        1, "Inconsistent types: expected string got varbinary"
+        1, "Inconsistent types: expected string got varbinary(x'78C3A4E282AC79')"
         -- </position-1.55>
     })
 
@@ -614,7 +614,7 @@ test:do_test(
         return test:catchsql "SELECT position(x'79', 'xä€y');"
     end, {
         -- <position-1.57.1>
-        1, "Inconsistent types: expected varbinary got string"
+        1, "Inconsistent types: expected varbinary got string('xä€y')"
         -- </position-1.57.1>
     })
 
@@ -624,7 +624,7 @@ test:do_test(
         return test:catchsql "SELECT position(x'a4', 'xä€y');"
     end, {
         -- <position-1.57.2>
-        1, "Inconsistent types: expected varbinary got string"
+        1, "Inconsistent types: expected varbinary got string('xä€y')"
         -- </position-1.57.2>
     })
 
@@ -634,7 +634,7 @@ test:do_test(
         return test:catchsql "SELECT position('y', x'78c3a4e282ac79');"
     end, {
         -- <position-1.57.3>
-        1, "Inconsistent types: expected string got varbinary"
+        1, "Inconsistent types: expected string got varbinary(x'78C3A4E282AC79')"
         -- </position-1.57.3>
     })
 
diff --git a/test/sql-tap/select1.test.lua b/test/sql-tap/select1.test.lua
index 57c5c2cb3..06641a60e 100755
--- a/test/sql-tap/select1.test.lua
+++ b/test/sql-tap/select1.test.lua
@@ -320,7 +320,7 @@ test:do_catchsql_test(
         SELECT count(*),count(a),count(b) FROM t4 WHERE b=5
     ]], {
         -- <select1-2.5.3>
-        1, "Type mismatch: can not convert 'This is a string that is too big to fit inside a NBFS buffer' to number"
+        1, "Type mismatch: can not convert string('This is a string that is too big to fit inside a NBFS buffer') to number"
         -- </select1-2.5.3>
     })
 
@@ -515,7 +515,7 @@ test:do_catchsql_test(
         SELECT sum(a) FROM t3
     ]], {
         -- <select1-2.17.1>
-        1, "Type mismatch: can not convert 'abc' to number"
+        1, "Type mismatch: can not convert string('abc') to number"
         -- </select1-2.17.1>
     })
 
@@ -1484,7 +1484,7 @@ test:do_catchsql_test(
         SELECT f1 FROM test1 WHERE 4.3+2.4 OR 1 ORDER BY f1
     ]], {
         -- <select1-8.1>
-        1, 'Type mismatch: can not convert 6.7 to boolean'
+        1, 'Type mismatch: can not convert double(6.7) to boolean'
         -- </select1-8.1>
     })
 
diff --git a/test/sql-tap/select5.test.lua b/test/sql-tap/select5.test.lua
index bb9951025..b04c9af09 100755
--- a/test/sql-tap/select5.test.lua
+++ b/test/sql-tap/select5.test.lua
@@ -558,7 +558,7 @@ test:do_catchsql_test(
             SELECT 1 FROM jj HAVING avg(s2) = 1 AND avg(s2) = 0;
     ]], {
     -- <select5-9.13.2>
-    1, "Type mismatch: can not convert 'A' to number"
+    1, "Type mismatch: can not convert string('A') to number"
     -- </select5-9.13.2>
 })
 
diff --git a/test/sql-tap/sql-errors.test.lua b/test/sql-tap/sql-errors.test.lua
index 66dc77fa1..17fe4b5b2 100755
--- a/test/sql-tap/sql-errors.test.lua
+++ b/test/sql-tap/sql-errors.test.lua
@@ -1,6 +1,6 @@
 #!/usr/bin/env tarantool
 local test = require("sqltester")
-test:plan(80)
+test:plan(81)
 
 test:execsql([[
 	CREATE TABLE t0 (i INT PRIMARY KEY, a INT);
@@ -696,7 +696,7 @@ test:do_catchsql_test(
 		SELECT X'ff' + 1;
 	]], {
 		-- <sql-errors-2.1>
-		1, "Type mismatch: can not convert x'FF' to number"
+		1, "Type mismatch: can not convert varbinary(x'FF') to number"
 		-- </sql-errors-2.1>
 	})
 
@@ -706,7 +706,7 @@ test:do_catchsql_test(
 		SELECT X'ff' - 1;
 	]], {
 		-- <sql-errors-2.2>
-		1, "Type mismatch: can not convert x'FF' to number"
+		1, "Type mismatch: can not convert varbinary(x'FF') to number"
 		-- </sql-errors-2.2>
 	})
 
@@ -716,7 +716,7 @@ test:do_catchsql_test(
 		SELECT X'ff' * 1;
 	]], {
 		-- <sql-errors-2.3>
-		1, "Type mismatch: can not convert x'FF' to number"
+		1, "Type mismatch: can not convert varbinary(x'FF') to number"
 		-- </sql-errors-2.3>
 	})
 
@@ -726,7 +726,7 @@ test:do_catchsql_test(
 		SELECT X'ff' / 1;
 	]], {
 		-- <sql-errors-2.4>
-		1, "Type mismatch: can not convert x'FF' to number"
+		1, "Type mismatch: can not convert varbinary(x'FF') to number"
 		-- </sql-errors-2.4>
 	})
 
@@ -736,7 +736,7 @@ test:do_catchsql_test(
 		SELECT X'ff' AND true;
 	]], {
 		-- <sql-errors-2.5>
-		1, "Type mismatch: can not convert x'FF' to boolean"
+		1, "Type mismatch: can not convert varbinary(x'FF') to boolean"
 		-- </sql-errors-2.5>
 	})
 
@@ -746,7 +746,7 @@ test:do_catchsql_test(
 		SELECT X'ff' OR false;
 	]], {
 		-- <sql-errors-2.6>
-		1, "Type mismatch: can not convert x'FF' to boolean"
+		1, "Type mismatch: can not convert varbinary(x'FF') to boolean"
 		-- </sql-errors-2.6>
 	})
 
@@ -756,7 +756,7 @@ test:do_catchsql_test(
 		SELECT false OR X'ff';
 	]], {
 		-- <sql-errors-2.7>
-		1, "Type mismatch: can not convert x'FF' to boolean"
+		1, "Type mismatch: can not convert varbinary(x'FF') to boolean"
 		-- </sql-errors-2.7>
 	})
 
@@ -766,7 +766,7 @@ test:do_catchsql_test(
 		SELECT X'ff' >= false;
 	]], {
 		-- <sql-errors-2.8>
-		1, "Type mismatch: can not convert varbinary to boolean"
+		1, "Type mismatch: can not convert varbinary(x'FF') to boolean"
 		-- </sql-errors-2.8>
 	})
 
@@ -776,7 +776,7 @@ test:do_catchsql_test(
 		SELECT X'ff' <= false;
 	]], {
 		-- <sql-errors-2.9>
-		1, "Type mismatch: can not convert varbinary to boolean"
+		1, "Type mismatch: can not convert varbinary(x'FF') to boolean"
 		-- </sql-errors-2.9>
 	})
 
@@ -790,16 +790,16 @@ local str2 = string.rep('ы', 200)
 test:do_catchsql_test(
 	"sql-errors-3.1",
 	"SELECT CAST('"..str1.."'AS UNSIGNED);", {
-		1, "Type mismatch: can not convert 'aaaaaaaaaaaaaaaaaaaaaaaaa"..
+		1, "Type mismatch: can not convert string('aaaaaaaaaaaaaaaaaa"..
 		"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"..
-		"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa... to unsigned"
+		"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...) to unsigned"
 	})
 
 test:do_catchsql_test(
 	"sql-errors-3.2",
 	"SELECT CAST('"..str2.."'AS UNSIGNED);", {
-		1, "Type mismatch: can not convert 'ыыыыыыыыыыыыыыыыыыыыыыыыы"..
-		"ыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыы... to unsigned"
+		1, "Type mismatch: can not convert string('ыыыыыыыыыыыыыыыыыы"..
+		"ыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыыы...) to unsigned"
 	})
 
 local format = {{'I', 'integer'}, {'A', 'array'}, {'M', 'map'}}
@@ -810,17 +810,17 @@ s:insert({1, {str1}, {a = 1, b = str1}})
 test:do_catchsql_test(
 	"sql-errors-3.3",
 	"SELECT CAST(a AS UNSIGNED) from test;", {
-		1, 'Type mismatch: can not convert ["aaaaaaaaaaaaaaaaaaaaaaaa'..
+		1, 'Type mismatch: can not convert array(["aaaaaaaaaaaaaaaaaa'..
 		'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'..
-		'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa... to unsigned'
+		'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...) to unsigned'
 	})
 
 test:do_catchsql_test(
 	"sql-errors-3.4",
 	"SELECT CAST(m AS UNSIGNED) from test;", {
-		1, 'Type mismatch: can not convert {"a": 1, "b": "aaaaaaaaaaa'..
+		1, 'Type mismatch: can not convert map({"a": 1, "b": "aaaaaaa'..
 		'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'..
-		'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa... to unsigned'
+		'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...) to unsigned'
 	})
 
 test:execsql('DROP TABLE test;')
@@ -834,7 +834,7 @@ test:do_catchsql_test(
 	[[
 		SELECT CAST(x'F1' AS UNSIGNED);
 	]], {
-		1, "Type mismatch: can not convert x'F1' to unsigned"
+		1, "Type mismatch: can not convert varbinary(x'F1') to unsigned"
 	})
 
 test:do_catchsql_test(
@@ -842,7 +842,7 @@ test:do_catchsql_test(
 	[[
 		SELECT CAST('F1' AS UNSIGNED);
 	]], {
-		1, "Type mismatch: can not convert 'F1' to unsigned"
+		1, "Type mismatch: can not convert string('F1') to unsigned"
 	})
 
 test:do_catchsql_test(
@@ -850,7 +850,7 @@ test:do_catchsql_test(
 	[[
 		SELECT CAST(CAST('11111111-1111-1111-1111-111111111111' AS UUID) AS UNSIGNED);
 	]], {
-		1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to unsigned"
+		1, "Type mismatch: can not convert uuid('11111111-1111-1111-1111-111111111111') to unsigned"
 	})
 
 local bin = ''
@@ -859,9 +859,17 @@ for i = 1,99 do bin = bin .. string.format("%02x", i) end
 test:do_catchsql_test(
 	"sql-errors-3.8",
 	"SELECT CAST(x'"..bin.."'AS UNSIGNED);", {
-		1, "Type mismatch: can not convert x'0102030405060708090A0B0C"..
-		"0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A"..
-		"2B2C2D2E2F303132333435363738393A3B3C3D3E3F40... to unsigned"
+		1, "Type mismatch: can not convert varbinary(x'01020304050607"..
+		"08090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425"..
+		"262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F40...) to unsigned"
+	})
+
+test:do_catchsql_test(
+	"sql-errors-3.9",
+	[[
+		SELECT POSITION('abc', 2);
+	]], {
+		1, "Inconsistent types: expected string or varbinary got integer(2)"
 	})
 
 test:finish_test()
diff --git a/test/sql-tap/tkt-80e031a00f.test.lua b/test/sql-tap/tkt-80e031a00f.test.lua
index b5bdf038f..fb3bbf2bf 100755
--- a/test/sql-tap/tkt-80e031a00f.test.lua
+++ b/test/sql-tap/tkt-80e031a00f.test.lua
@@ -346,7 +346,7 @@ test:do_catchsql_test(
         SELECT 'hello' IN t1
     ]], {
         -- <tkt-80e031a00f.27>
-        1, "Type mismatch: can not convert 'hello' to integer"
+        1, "Type mismatch: can not convert string('hello') to integer"
         -- </tkt-80e031a00f.27>
     })
 
@@ -356,7 +356,7 @@ test:do_catchsql_test(
         SELECT 'hello' NOT IN t1
     ]], {
         -- <tkt-80e031a00f.28>
-        1, "Type mismatch: can not convert 'hello' to integer"
+        1, "Type mismatch: can not convert string('hello') to integer"
         -- </tkt-80e031a00f.28>
     })
 
@@ -386,7 +386,7 @@ test:do_catchsql_test(
         SELECT x'303132' IN t1
     ]], {
         -- <tkt-80e031a00f.31>
-        1, "Type mismatch: can not convert x'303132' to integer"
+        1, "Type mismatch: can not convert varbinary(x'303132') to integer"
         -- </tkt-80e031a00f.31>
     })
 
@@ -396,7 +396,7 @@ test:do_catchsql_test(
         SELECT x'303132' NOT IN t1
     ]], {
         -- <tkt-80e031a00f.32>
-        1, "Type mismatch: can not convert x'303132' to integer"
+        1, "Type mismatch: can not convert varbinary(x'303132') to integer"
         -- </tkt-80e031a00f.32>
     })
 
diff --git a/test/sql-tap/tkt-9a8b09f8e6.test.lua b/test/sql-tap/tkt-9a8b09f8e6.test.lua
index 53dfafebf..bee4fdf6c 100755
--- a/test/sql-tap/tkt-9a8b09f8e6.test.lua
+++ b/test/sql-tap/tkt-9a8b09f8e6.test.lua
@@ -245,7 +245,7 @@ test:do_catchsql_test(
         SELECT x FROM t3 WHERE x IN ('1');
     ]], {
         -- <4.3>
-        1, "Type mismatch: can not convert '1' to number"
+        1, "Type mismatch: can not convert string('1') to number"
         -- </4.3>
     })
 
@@ -255,7 +255,7 @@ test:do_catchsql_test(
         SELECT x FROM t3 WHERE x IN ('1.0');
     ]], {
         -- <4.4>
-        1, "Type mismatch: can not convert '1.0' to number"
+        1, "Type mismatch: can not convert string('1.0') to number"
         -- </4.4>
     })
 
@@ -285,7 +285,7 @@ test:do_catchsql_test(
         SELECT x FROM t3 WHERE '1' IN (x);
     ]], {
         -- <4.7>
-        1, "Type mismatch: can not convert '1' to number"
+        1, "Type mismatch: can not convert string('1') to number"
         -- </4.7>
     })
 
@@ -295,7 +295,7 @@ test:do_catchsql_test(
         SELECT x FROM t3 WHERE '1.0' IN (x);
     ]], {
         -- <4.8>
-        1, "Type mismatch: can not convert '1.0' to number"
+        1, "Type mismatch: can not convert string('1.0') to number"
         -- </4.8>
     })
 
@@ -325,7 +325,7 @@ test:do_catchsql_test(
         SELECT x FROM t4 WHERE x IN ('1');
     ]], {
         -- <5.3>
-        1, "Type mismatch: can not convert '1' to number"
+        1, "Type mismatch: can not convert string('1') to number"
         -- </5.3>
     })
 
@@ -335,7 +335,7 @@ test:do_catchsql_test(
         SELECT x FROM t4 WHERE x IN ('1.0');
     ]], {
         -- <5.4>
-        1, "Type mismatch: can not convert '1.0' to number"
+        1, "Type mismatch: can not convert string('1.0') to number"
         -- </5.4>
     })
 
@@ -355,7 +355,7 @@ test:do_catchsql_test(
         SELECT x FROM t4 WHERE x IN ('1.11');
     ]], {
         -- <5.6>
-        1, "Type mismatch: can not convert '1.11' to number"
+        1, "Type mismatch: can not convert string('1.11') to number"
         -- </5.6>
     })
 
@@ -385,7 +385,7 @@ test:do_catchsql_test(
         SELECT x FROM t4 WHERE '1' IN (x);
     ]], {
         -- <5.9>
-        1, "Type mismatch: can not convert '1' to number"
+        1, "Type mismatch: can not convert string('1') to number"
         -- </5.9>
     })
 
@@ -395,7 +395,7 @@ test:do_catchsql_test(
         SELECT x FROM t4 WHERE '1.0' IN (x);
     ]], {
         -- <5.10>
-        1, "Type mismatch: can not convert '1.0' to number"
+        1, "Type mismatch: can not convert string('1.0') to number"
         -- </5.10>
     })
 
@@ -415,7 +415,7 @@ test:do_catchsql_test(
         SELECT x FROM t4 WHERE '1.11' IN (x);
     ]], {
         -- <5.12>
-        1, "Type mismatch: can not convert '1.11' to number"
+        1, "Type mismatch: can not convert string('1.11') to number"
         -- </5.12>
     })
 
diff --git a/test/sql-tap/uuid.test.lua b/test/sql-tap/uuid.test.lua
index c9e1b4fcc..70683a4fd 100755
--- a/test/sql-tap/uuid.test.lua
+++ b/test/sql-tap/uuid.test.lua
@@ -229,7 +229,7 @@ test:do_catchsql_test(
     [[
         SELECT ABS(u) from t2;
     ]], {
-        1, "Inconsistent types: expected number got uuid"
+        1, "Inconsistent types: expected number got uuid('11111111-1111-1111-1111-111111111111')"
     })
 
 test:do_catchsql_test(
@@ -237,7 +237,7 @@ test:do_catchsql_test(
     [[
         SELECT AVG(u) from t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to number"
+        1, "Type mismatch: can not convert uuid('11111111-1111-1111-1111-111111111111') to number"
     })
 
 test:do_execsql_test(
@@ -337,7 +337,7 @@ test:do_catchsql_test(
     [[
         SELECT u LIKE 'a' from t2;
     ]], {
-        1, "Inconsistent types: expected string got uuid"
+        1, "Inconsistent types: expected string got uuid('11111111-1111-1111-1111-111111111111')"
     })
 
 test:do_execsql_test(
@@ -395,7 +395,7 @@ test:do_catchsql_test(
     [[
         SELECT POSITION(u, '1') from t2;
     ]], {
-        1, "Inconsistent types: expected string or varbinary got uuid"
+        1, "Inconsistent types: expected string or varbinary got uuid('11111111-1111-1111-1111-111111111111')"
     })
 
 test:do_execsql_test(
@@ -421,7 +421,7 @@ test:do_catchsql_test(
     [[
         SELECT ROUND(u) from t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to number"
+        1, "Type mismatch: can not convert uuid('11111111-1111-1111-1111-111111111111') to number"
     })
 
 test:do_execsql_test(
@@ -445,7 +445,7 @@ test:do_catchsql_test(
     [[
         SELECT SUM(u) from t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to number"
+        1, "Type mismatch: can not convert uuid('11111111-1111-1111-1111-111111111111') to number"
     })
 
 test:do_catchsql_test(
@@ -453,7 +453,7 @@ test:do_catchsql_test(
     [[
         SELECT TOTAL(u) from t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to number"
+        1, "Type mismatch: can not convert uuid('11111111-1111-1111-1111-111111111111') to number"
     })
 
 test:do_execsql_test(
@@ -505,7 +505,7 @@ test:do_catchsql_test(
     [[
         SELECT u || u from t2;
     ]], {
-        1, "Inconsistent types: expected string or varbinary got uuid"
+        1, "Inconsistent types: expected string or varbinary got uuid('11111111-1111-1111-1111-111111111111')"
     })
 
 local func = {language = 'Lua', body = 'function(x) return type(x) end',
@@ -564,7 +564,7 @@ test:do_catchsql_test(
     [[
         SELECT cast(u AS UNSIGNED) FROM t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to unsigned"
+        1, "Type mismatch: can not convert uuid('11111111-1111-1111-1111-111111111111') to unsigned"
     })
 
 test:do_execsql_test(
@@ -582,7 +582,7 @@ test:do_catchsql_test(
     [[
         SELECT cast(u AS NUMBER) FROM t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to number"
+        1, "Type mismatch: can not convert uuid('11111111-1111-1111-1111-111111111111') to number"
     })
 
 test:do_catchsql_test(
@@ -590,7 +590,7 @@ test:do_catchsql_test(
     [[
         SELECT cast(u AS DOUBLE) FROM t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to double"
+        1, "Type mismatch: can not convert uuid('11111111-1111-1111-1111-111111111111') to double"
     })
 
 test:do_catchsql_test(
@@ -598,7 +598,7 @@ test:do_catchsql_test(
     [[
         SELECT cast(u AS INTEGER) FROM t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to integer"
+        1, "Type mismatch: can not convert uuid('11111111-1111-1111-1111-111111111111') to integer"
     })
 
 test:do_catchsql_test(
@@ -606,7 +606,7 @@ test:do_catchsql_test(
     [[
         SELECT cast(u AS BOOLEAN) FROM t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to boolean"
+        1, "Type mismatch: can not convert uuid('11111111-1111-1111-1111-111111111111') to boolean"
     })
 
 test:do_execsql_test(
@@ -641,7 +641,7 @@ test:do_catchsql_test(
     [[
         SELECT cast(1 AS UUID);
     ]], {
-        1, "Type mismatch: can not convert 1 to uuid"
+        1, "Type mismatch: can not convert integer(1) to uuid"
     })
 
 test:do_execsql_test(
@@ -657,7 +657,7 @@ test:do_catchsql_test(
     [[
         SELECT cast('1' AS UUID);
     ]], {
-        1, "Type mismatch: can not convert '1' to uuid"
+        1, "Type mismatch: can not convert string('1') to uuid"
     })
 
 test:do_catchsql_test(
@@ -665,7 +665,7 @@ test:do_catchsql_test(
     [[
         SELECT cast(1.5 AS UUID);
     ]], {
-        1, "Type mismatch: can not convert 1.5 to uuid"
+        1, "Type mismatch: can not convert double(1.5) to uuid"
     })
 
 test:do_catchsql_test(
@@ -673,7 +673,7 @@ test:do_catchsql_test(
     [[
         SELECT cast(-1 AS UUID);
     ]], {
-        1, "Type mismatch: can not convert -1 to uuid"
+        1, "Type mismatch: can not convert integer(-1) to uuid"
     })
 
 test:do_catchsql_test(
@@ -681,7 +681,7 @@ test:do_catchsql_test(
     [[
         SELECT cast(true AS UUID);
     ]], {
-        1, "Type mismatch: can not convert TRUE to uuid"
+        1, "Type mismatch: can not convert boolean(TRUE) to uuid"
     })
 
 test:do_execsql_test(
@@ -697,7 +697,7 @@ test:do_catchsql_test(
     [[
         SELECT cast(x'1234567890abcdef' as UUID) FROM t2 LIMIT 1;
     ]], {
-        1, "Type mismatch: can not convert x'1234567890ABCDEF' to uuid"
+        1, "Type mismatch: can not convert varbinary(x'1234567890ABCDEF') to uuid"
     })
 
 test:execsql([[
@@ -719,7 +719,7 @@ test:do_catchsql_test(
     [[
         INSERT INTO tu(u) SELECT u FROM t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to unsigned"
+        1, "Type mismatch: can not convert uuid('11111111-1111-1111-1111-111111111111') to unsigned"
     })
 
 test:do_execsql_test(
@@ -738,7 +738,7 @@ test:do_catchsql_test(
     [[
         INSERT INTO tn(n) SELECT u FROM t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to number"
+        1, "Type mismatch: can not convert uuid('11111111-1111-1111-1111-111111111111') to number"
     })
 
 test:do_catchsql_test(
@@ -746,7 +746,7 @@ test:do_catchsql_test(
     [[
         INSERT INTO td(d) SELECT u FROM t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to double"
+        1, "Type mismatch: can not convert uuid('11111111-1111-1111-1111-111111111111') to double"
     })
 
 test:do_catchsql_test(
@@ -754,7 +754,7 @@ test:do_catchsql_test(
     [[
         INSERT INTO ti(i) SELECT u FROM t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to integer"
+        1, "Type mismatch: can not convert uuid('11111111-1111-1111-1111-111111111111') to integer"
     })
 
 test:do_catchsql_test(
@@ -762,7 +762,7 @@ test:do_catchsql_test(
     [[
         INSERT INTO tb(b) SELECT u FROM t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to boolean"
+        1, "Type mismatch: can not convert uuid('11111111-1111-1111-1111-111111111111') to boolean"
     })
 
 test:do_execsql_test(
@@ -800,7 +800,7 @@ test:do_catchsql_test(
     [[
         INSERT INTO tsu VALUES ('1_unsigned', 1);
     ]], {
-        1, "Type mismatch: can not convert 1 to uuid"
+        1, "Type mismatch: can not convert integer(1) to uuid"
     })
 
 test:do_execsql_test(
@@ -817,7 +817,7 @@ test:do_catchsql_test(
     [[
         INSERT INTO tsu VALUES ('3_string_wrong', '1');
     ]], {
-        1, "Type mismatch: can not convert '1' to uuid"
+        1, "Type mismatch: can not convert string('1') to uuid"
     })
 
 test:do_catchsql_test(
@@ -825,7 +825,7 @@ test:do_catchsql_test(
     [[
         INSERT INTO tsu VALUES ('4_double', 1.5);
     ]], {
-        1, "Type mismatch: can not convert 1.5 to uuid"
+        1, "Type mismatch: can not convert double(1.5) to uuid"
     })
 
 test:do_catchsql_test(
@@ -833,7 +833,7 @@ test:do_catchsql_test(
     [[
         INSERT INTO tsu VALUES ('5_integer', -1);
     ]], {
-        1, "Type mismatch: can not convert -1 to uuid"
+        1, "Type mismatch: can not convert integer(-1) to uuid"
     })
 
 test:do_catchsql_test(
@@ -841,7 +841,7 @@ test:do_catchsql_test(
     [[
         INSERT INTO tsu VALUES ('6_boolean', true);
     ]], {
-        1, "Type mismatch: can not convert TRUE to uuid"
+        1, "Type mismatch: can not convert boolean(TRUE) to uuid"
     })
 
 test:do_execsql_test(
@@ -858,7 +858,7 @@ test:do_catchsql_test(
     [[
         INSERT INTO tsu VALUES ('8_varbinary', x'1234567890abcdef');
     ]], {
-        1, "Type mismatch: can not convert x'1234567890ABCDEF' to uuid"
+        1, "Type mismatch: can not convert varbinary(x'1234567890ABCDEF') to uuid"
     })
 
 test:execsql([[
@@ -971,7 +971,7 @@ test:do_catchsql_test(
     [[
         SELECT -u FROM t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to number"
+        1, "Type mismatch: can not convert uuid('11111111-1111-1111-1111-111111111111') to number"
     })
 
 test:do_catchsql_test(
@@ -979,7 +979,7 @@ test:do_catchsql_test(
     [[
         SELECT u + 1 FROM t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to number"
+        1, "Type mismatch: can not convert uuid('11111111-1111-1111-1111-111111111111') to number"
     })
 
 test:do_catchsql_test(
@@ -987,7 +987,7 @@ test:do_catchsql_test(
     [[
         SELECT u - 1 FROM t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to number"
+        1, "Type mismatch: can not convert uuid('11111111-1111-1111-1111-111111111111') to number"
     })
 
 test:do_catchsql_test(
@@ -995,7 +995,7 @@ test:do_catchsql_test(
     [[
         SELECT u * 1 FROM t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to number"
+        1, "Type mismatch: can not convert uuid('11111111-1111-1111-1111-111111111111') to number"
     })
 
 test:do_catchsql_test(
@@ -1003,7 +1003,7 @@ test:do_catchsql_test(
     [[
         SELECT u / 1 FROM t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to number"
+        1, "Type mismatch: can not convert uuid('11111111-1111-1111-1111-111111111111') to number"
     })
 
 test:do_catchsql_test(
@@ -1011,7 +1011,7 @@ test:do_catchsql_test(
     [[
         SELECT u % 1 FROM t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to number"
+        1, "Type mismatch: can not convert uuid('11111111-1111-1111-1111-111111111111') to number"
     })
 
 -- Check that bitwise operations work with UUIDs as intended.
@@ -1020,7 +1020,7 @@ test:do_catchsql_test(
     [[
         SELECT ~u FROM t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to integer"
+        1, "Type mismatch: can not convert uuid('11111111-1111-1111-1111-111111111111') to integer"
     })
 
 test:do_catchsql_test(
@@ -1028,7 +1028,7 @@ test:do_catchsql_test(
     [[
         SELECT u >> 1 FROM t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to integer"
+        1, "Type mismatch: can not convert uuid('11111111-1111-1111-1111-111111111111') to integer"
     })
 
 test:do_catchsql_test(
@@ -1036,7 +1036,7 @@ test:do_catchsql_test(
     [[
         SELECT u << 1 FROM t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to integer"
+        1, "Type mismatch: can not convert uuid('11111111-1111-1111-1111-111111111111') to integer"
     })
 
 test:do_catchsql_test(
@@ -1044,7 +1044,7 @@ test:do_catchsql_test(
     [[
         SELECT u | 1 FROM t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to integer"
+        1, "Type mismatch: can not convert uuid('11111111-1111-1111-1111-111111111111') to integer"
     })
 
 test:do_catchsql_test(
@@ -1052,7 +1052,7 @@ test:do_catchsql_test(
     [[
         SELECT u & 1 FROM t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to integer"
+        1, "Type mismatch: can not convert uuid('11111111-1111-1111-1111-111111111111') to integer"
     })
 
 -- Check that logical operations work with UUIDs as intended.
@@ -1061,7 +1061,7 @@ test:do_catchsql_test(
     [[
         SELECT NOT u FROM t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to boolean"
+        1, "Type mismatch: can not convert uuid('11111111-1111-1111-1111-111111111111') to boolean"
     })
 
 test:do_catchsql_test(
@@ -1069,7 +1069,7 @@ test:do_catchsql_test(
     [[
         SELECT u AND true FROM t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to boolean"
+        1, "Type mismatch: can not convert uuid('11111111-1111-1111-1111-111111111111') to boolean"
     })
 
 test:do_catchsql_test(
@@ -1077,7 +1077,7 @@ test:do_catchsql_test(
     [[
         SELECT u OR true FROM t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to boolean"
+        1, "Type mismatch: can not convert uuid('11111111-1111-1111-1111-111111111111') to boolean"
     })
 
 test:do_catchsql_test(
@@ -1085,7 +1085,7 @@ test:do_catchsql_test(
     [[
         SELECT true AND u FROM t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to boolean"
+        1, "Type mismatch: can not convert uuid('11111111-1111-1111-1111-111111111111') to boolean"
     })
 
 test:do_catchsql_test(
@@ -1093,7 +1093,7 @@ test:do_catchsql_test(
     [[
         SELECT true OR u FROM t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to boolean"
+        1, "Type mismatch: can not convert uuid('11111111-1111-1111-1111-111111111111') to boolean"
     })
 
 -- Check that comparison with UUID works as intended.
@@ -1102,7 +1102,7 @@ test:do_catchsql_test(
     [[
         SELECT u > 1 FROM t2;
     ]], {
-        1, "Type mismatch: can not convert unsigned to uuid"
+        1, "Type mismatch: can not convert integer(1) to uuid"
     })
 
 test:do_execsql_test(
@@ -1118,7 +1118,7 @@ test:do_catchsql_test(
     [[
         SELECT u > '1' FROM t2;
     ]], {
-        1, "Type mismatch: can not convert string to uuid"
+        1, "Type mismatch: can not convert string('1') to uuid"
     })
 
 test:do_catchsql_test(
@@ -1126,7 +1126,7 @@ test:do_catchsql_test(
     [[
         SELECT u > 1.5 FROM t2;
     ]], {
-        1, "Type mismatch: can not convert double to uuid"
+        1, "Type mismatch: can not convert double(1.5) to uuid"
     })
 
 test:do_catchsql_test(
@@ -1134,7 +1134,7 @@ test:do_catchsql_test(
     [[
         SELECT u > -1 FROM t2;
     ]], {
-        1, "Type mismatch: can not convert integer to uuid"
+        1, "Type mismatch: can not convert integer(-1) to uuid"
     })
 
 test:do_catchsql_test(
@@ -1142,7 +1142,7 @@ test:do_catchsql_test(
     [[
         SELECT u > true FROM t2;
     ]], {
-        1, "Type mismatch: can not convert uuid to boolean"
+        1, "Type mismatch: can not convert uuid('11111111-1111-1111-1111-111111111111') to boolean"
     })
 
 test:do_execsql_test(
@@ -1158,7 +1158,7 @@ test:do_catchsql_test(
     [[
         SELECT u > x'31' FROM t2;
     ]], {
-        1, "Type mismatch: can not convert varbinary to uuid"
+        1, "Type mismatch: can not convert varbinary(x'31') to uuid"
     })
 
 test:do_catchsql_test(
@@ -1166,7 +1166,7 @@ test:do_catchsql_test(
     [[
         SELECT u = 1 FROM t2;
     ]], {
-        1, "Type mismatch: can not convert unsigned to uuid"
+        1, "Type mismatch: can not convert integer(1) to uuid"
     })
 
 test:do_execsql_test(
@@ -1182,7 +1182,7 @@ test:do_catchsql_test(
     [[
         SELECT u = '1' FROM t2;
     ]], {
-        1, "Type mismatch: can not convert string to uuid"
+        1, "Type mismatch: can not convert string('1') to uuid"
     })
 
 test:do_catchsql_test(
@@ -1190,7 +1190,7 @@ test:do_catchsql_test(
     [[
         SELECT u = 1.5 FROM t2;
     ]], {
-        1, "Type mismatch: can not convert double to uuid"
+        1, "Type mismatch: can not convert double(1.5) to uuid"
     })
 
 test:do_catchsql_test(
@@ -1198,7 +1198,7 @@ test:do_catchsql_test(
     [[
         SELECT u = -1 FROM t2;
     ]], {
-        1, "Type mismatch: can not convert integer to uuid"
+        1, "Type mismatch: can not convert integer(-1) to uuid"
     })
 
 test:do_catchsql_test(
@@ -1206,7 +1206,7 @@ test:do_catchsql_test(
     [[
         SELECT u = true FROM t2;
     ]], {
-        1, "Type mismatch: can not convert uuid to boolean"
+        1, "Type mismatch: can not convert uuid('11111111-1111-1111-1111-111111111111') to boolean"
     })
 
 test:do_execsql_test(
@@ -1222,7 +1222,7 @@ test:do_catchsql_test(
     [[
         SELECT u = x'31' FROM t2;
     ]], {
-        1, "Type mismatch: can not convert varbinary to uuid"
+        1, "Type mismatch: can not convert varbinary(x'31') to uuid"
     })
 
 test:execsql([[
@@ -1296,7 +1296,7 @@ test:do_catchsql_test(
     [[
         SELECT uuid('asd');
     ]], {
-        1, "Type mismatch: can not convert 'asd' to integer"
+        1, "Type mismatch: can not convert string('asd') to integer"
     })
 
 test:do_catchsql_test(
@@ -1322,7 +1322,7 @@ test:do_catchsql_test(
     [[
         SELECT CAST('11111111-1111-1111-1111-111111111111111222222222' AS UUID);
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111111222222222' to uuid"
+        1, "Type mismatch: can not convert string('11111111-1111-1111-1111-111111111111111222222222') to uuid"
     })
 
 test:do_catchsql_test(
@@ -1330,7 +1330,7 @@ test:do_catchsql_test(
     [[
         SELECT CAST('11111111-1111-1111-1111-11111' AS UUID);
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-11111' to uuid"
+        1, "Type mismatch: can not convert string('11111111-1111-1111-1111-11111') to uuid"
     })
 
 test:execsql([[
diff --git a/test/sql/boolean.result b/test/sql/boolean.result
index 320525d36..5594d92cb 100644
--- a/test/sql/boolean.result
+++ b/test/sql/boolean.result
@@ -138,12 +138,12 @@ INSERT INTO ts(s) VALUES ('abc'), (12.5);
 SELECT s FROM ts WHERE s = true;
  | ---
  | - null
- | - 'Type mismatch: can not convert string to boolean'
+ | - 'Type mismatch: can not convert string(''abc'') to boolean'
  | ...
 SELECT s FROM ts WHERE s < true;
  | ---
  | - null
- | - 'Type mismatch: can not convert string to boolean'
+ | - 'Type mismatch: can not convert string(''abc'') to boolean'
  | ...
 SELECT s FROM ts WHERE s IN (true, 1, 'abcd');
  | ---
@@ -161,7 +161,7 @@ SELECT s FROM ts WHERE s IN (true, 1, 'abcd');
 INSERT INTO ts VALUES (true, 12345);
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 
 -- Check that we can create index on field of type BOOLEAN.
@@ -276,7 +276,7 @@ SELECT is_boolean('true');
 SELECT abs(a) FROM t0;
  | ---
  | - null
- | - 'Inconsistent types: expected number got boolean'
+ | - 'Inconsistent types: expected number got boolean(FALSE)'
  | ...
 SELECT lower(a) FROM t0;
  | ---
@@ -339,7 +339,7 @@ SELECT typeof(a) FROM t0;
 SELECT AVG(a) FROM t0;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT MIN(a) FROM t0;
  | ---
@@ -360,7 +360,7 @@ SELECT MAX(a) FROM t0;
 SELECT SUM(a) FROM t0;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT COUNT(a) FROM t0;
  | ---
@@ -373,7 +373,7 @@ SELECT COUNT(a) FROM t0;
 SELECT TOTAL(a) FROM t0;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT GROUP_CONCAT(a, ' +++ ') FROM t0;
  | ---
@@ -1122,502 +1122,502 @@ SELECT a, a1, a OR a1 FROM t, t6;
 SELECT -true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT -false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT -a FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 
 SELECT true + true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT true + false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT false + true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT false + false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT true - true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT true - false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT false - true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT false - false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT true * true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT true * false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT false * true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT false * false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT true / true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT true / false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT false / true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT false / false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT true % true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT true % false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT false % true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT false % false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 
 SELECT a, true + a FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a, false + a FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a, true - a FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a, false - a FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a, true * a FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a, false * a FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a, true / a FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a, false / a FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a, true % a FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a, false % a FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a, a + true FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT a, a + false FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a, a - true FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT a, a - false FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a, a * true FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT a, a * false FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a, a / true FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT a, a / false FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a, a % true FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT a, a % false FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 
 SELECT a, a1, a + a1 FROM t, t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a, a1, a - a1 FROM t, t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a, a1, a * a1 FROM t, t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a, a1, a / a1 FROM t, t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a, a1, a % a1 FROM t, t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 
 SELECT ~true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT ~false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT true & true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT true & false;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT false & true;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT false & false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT true | true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT true | false;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT false | true;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT false | false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT true << true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT true << false;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT false << true;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT false << false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT true >> true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT true >> false;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT false >> true;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT false >> false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 
 SELECT a, true & a FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT a, false & a FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT a, true | a FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT a, false | a FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT a, true << a FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT a, false << a FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT a, true >> a FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT a, false >> a FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT a, a & true FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT a, a & false FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT a, a | true FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT a, a | false FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT a, a << true FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT a, a << false FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT a, a >> true FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT a, a >> false FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 
 SELECT a, a1, a & a1 FROM t, t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT a, a1, a | a1 FROM t, t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT a, a1, a << a1 FROM t, t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT a, a1, a >> a1 FROM t, t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 
 -- Check concatenate.
 SELECT true || true;
  | ---
  | - null
- | - 'Inconsistent types: expected string or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean(TRUE)'
  | ...
 SELECT true || false;
  | ---
  | - null
- | - 'Inconsistent types: expected string or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean(FALSE)'
  | ...
 SELECT false || true;
  | ---
  | - null
- | - 'Inconsistent types: expected string or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean(TRUE)'
  | ...
 SELECT false || false;
  | ---
  | - null
- | - 'Inconsistent types: expected string or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean(FALSE)'
  | ...
 
 SELECT a, true || a FROM t;
  | ---
  | - null
- | - 'Inconsistent types: expected string or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean(FALSE)'
  | ...
 SELECT a, false || a FROM t;
  | ---
  | - null
- | - 'Inconsistent types: expected string or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean(FALSE)'
  | ...
 SELECT a, a || true FROM t;
  | ---
  | - null
- | - 'Inconsistent types: expected string or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean(TRUE)'
  | ...
 SELECT a, a || false FROM t;
  | ---
  | - null
- | - 'Inconsistent types: expected string or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean(FALSE)'
  | ...
 
 SELECT a1, a1 || a1 FROM t6;
  | ---
  | - null
- | - 'Inconsistent types: expected string or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean(FALSE)'
  | ...
 SELECT a2, a2 || a2 FROM t6;
  | ---
  | - null
- | - 'Inconsistent types: expected string or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean(TRUE)'
  | ...
 SELECT a1, a2, a1 || a1 FROM t6;
  | ---
  | - null
- | - 'Inconsistent types: expected string or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean(FALSE)'
  | ...
 SELECT a1, a2, a2 || a2 FROM t6;
  | ---
  | - null
- | - 'Inconsistent types: expected string or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean(TRUE)'
  | ...
 
 -- Check comparisons.
@@ -2463,7 +2463,7 @@ INSERT INTO t7 VALUES (123);
 SELECT true AND 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert 2 to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT false AND 2;
  | ---
@@ -2476,17 +2476,17 @@ SELECT false AND 2;
 SELECT true OR 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert 2 to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT false OR 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert 2 to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT 2 AND true;
  | ---
  | - null
- | - 'Type mismatch: can not convert 2 to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT 2 AND false;
  | ---
@@ -2499,59 +2499,59 @@ SELECT 2 AND false;
 SELECT 2 OR true;
  | ---
  | - null
- | - 'Type mismatch: can not convert 2 to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT 2 OR false;
  | ---
  | - null
- | - 'Type mismatch: can not convert 2 to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 
 SELECT a1, a1 AND 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert 2 to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT a1, a1 OR 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert 2 to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT a1, 2 AND a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert 2 to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT a1, 2 OR a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert 2 to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT a2, a2 AND 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert 2 to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT a2, a2 OR 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert 2 to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT a2, 2 AND a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert 2 to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT a2, 2 OR a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert 2 to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 
 SELECT b, true AND b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert 123 to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT b, false AND b FROM t7;
  | ---
@@ -2566,17 +2566,17 @@ SELECT b, false AND b FROM t7;
 SELECT b, true OR b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert 123 to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT b, false OR b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert 123 to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT b, b AND true FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert 123 to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT b, b AND false FROM t7;
  | ---
@@ -2591,1273 +2591,1273 @@ SELECT b, b AND false FROM t7;
 SELECT b, b OR true FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert 123 to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT b, b OR false FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert 123 to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 
 SELECT a1, b, a1 AND b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert 123 to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT a1, b, a1 OR b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert 123 to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT a1, b, b AND a1 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert 123 to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT a1, b, b OR a1 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert 123 to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT a2, b, a2 AND b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert 123 to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT a2, b, a2 OR b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert 123 to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT a2, b, b AND a2 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert 123 to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT a2, b, b OR a2 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert 123 to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 
 SELECT true + 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT false + 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT true - 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT false - 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT true * 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT false * 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT true / 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT false / 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT true % 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT false % 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT 2 + true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT 2 + false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT 2 - true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT 2 - false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT 2 * true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT 2 * false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT 2 / true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT 2 / false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT 2 % true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT 2 % false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 
 SELECT a1, a1 + 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a1, a1 - 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a1, a1 * 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a1, a1 / 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a1, a1 % 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a1, 2 + a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a1, 2 - a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a1, 2 * a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a1, 2 / a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a1, 2 % a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a2, a2 + 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT a2, a2 - 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT a2, a2 * 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT a2, a2 / 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT a2, a2 % 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT a2, 2 + a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT a2, 2 - a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT a2, 2 * a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT a2, 2 / a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT a2, 2 % a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 
 SELECT b, true + b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT b, false + b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT b, true - b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT b, false - b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT b, true * b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT b, false * b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT b, true / b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT b, false / b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT b, true % b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT b, false % b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT b, b + true FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT b, b + false FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT b, b - true FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT b, b - false FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT b, b * true FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT b, b * false FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT b, b / true FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT b, b / false FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT b, b % true FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT b, b % false FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 
 SELECT a1, b, a1 + b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a1, b, a1 - b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a1, b, a1 * b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a1, b, a1 / b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a1, b, a1 % b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a1, b, b + a1 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a1, b, b - a1 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a1, b, b * a1 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a1, b, b / a1 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a1, b, b % a1 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a2, b, a2 + b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT a2, b, a2 - b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT a2, b, a2 * b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT a2, b, a2 / b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT a2, b, a2 % b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT a2, b, b + a2 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT a2, b, b - a2 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT a2, b, b * a2 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT a2, b, b / a2 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT a2, b, b % a2 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 
 SELECT true & 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT false & 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT true | 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT false | 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT true << 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT false << 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT true >> 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT false >> 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT 2 & true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT 2 & false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT 2 | true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT 2 | false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT 2 << true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT 2 << false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT 2 >> true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT 2 >> false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 
 SELECT a1, a1 & 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT a1, a1 | 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT a1, a1 << 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT a1, a1 >> 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT a1, 2 & a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT a1, 2 | a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT a1, 2 << a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT a1, 2 >> a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT a2, a2 & 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT a2, a2 | 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT a2, a2 << 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT a2, a2 >> 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT a2, 2 & a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT a2, 2 | a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT a2, 2 << a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT a2, 2 >> a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 
 SELECT b, true & b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT b, false & b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT b, true | b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT b, false | b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT b, true << b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT b, false << b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT b, true >> b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT b, false >> b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT b, b & true FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT b, b & false FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT b, b | true FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT b, b | false FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT b, b << true FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT b, b << false FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT b, b >> true FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT b, b >> false FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 
 SELECT a1, b, a1 & b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT a1, b, a1 | b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT a1, b, a1 << b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT a1, b, a1 >> b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT a1, b, b & a1 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT a1, b, b | a1 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT a1, b, b << a1 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT a1, b, b >> a1 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT a2, b, a2 & b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT a2, b, a2 | b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT a2, b, a2 << b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT a2, b, a2 >> b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT a2, b, b & a2 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT a2, b, b | a2 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT a2, b, b << a2 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT a2, b, b >> a2 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 
 SELECT true > 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT false > 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT true < 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT false < 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT 2 > true;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT 2 > false;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT 2 < true;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT 2 < false;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 
 SELECT a1, a1 > 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT a1, a1 < 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT a1, 2 > a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT a1, 2 < a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT a2, a2 > 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT a2, a2 < 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT a2, 2 > a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT a2, 2 < a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 
 SELECT b, true > b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT b, false > b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT b, true < b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT b, false < b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT b, b > true FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT b, b > false FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT b, b < true FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT b, b < false FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 
 SELECT a1, b, a1 > b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT a1, b, a1 < b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT a1, b, b > a1 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT a1, b, b < a1 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT a2, b, a2 > b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT a2, b, a2 < b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT a2, b, b > a2 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT a2, b, b < a2 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 
 SELECT true >= 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT false >= 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT true <= 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT false <= 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT 2 >= true;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT 2 >= false;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT 2 <= true;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT 2 <= false;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 
 SELECT a1, a1 >= 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT a1, a1 <= 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT a1, 2 >= a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT a1, 2 <= a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT a2, a2 >= 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT a2, a2 <= 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT a2, 2 >= a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT a2, 2 <= a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 
 SELECT b, true >= b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT b, false >= b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT b, true <= b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT b, false <= b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT b, b >= true FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT b, b >= false FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT b, b <= true FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT b, b <= false FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 
 SELECT a1, b, a1 >= b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT a1, b, a1 <= b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT a1, b, b >= a1 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT a1, b, b <= a1 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT a2, b, a2 >= b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT a2, b, a2 <= b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT a2, b, b >= a2 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT a2, b, b <= a2 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 
 SELECT true == 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT false == 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT true != 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT false != 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT 2 == true;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT 2 == false;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT 2 != true;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT 2 != false;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 
 SELECT a1, a1 == 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT a1, a1 != 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT a1, 2 == a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT a1, 2 != a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT a2, a2 == 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT a2, a2 != 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT a2, 2 == a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 SELECT a2, 2 != a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(2) to boolean'
  | ...
 
 SELECT b, true == b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT b, false == b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT b, true != b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT b, false != b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT b, b == true FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT b, b == false FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT b, b != true FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT b, b != false FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 
 SELECT a1, b, a1 == b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT a1, b, a1 != b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT a1, b, b == a1 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT a1, b, b != a1 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT a2, b, a2 == b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT a2, b, a2 != b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT a2, b, b == a2 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 SELECT a2, b, b != a2 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(123) to boolean'
  | ...
 
 SELECT true IN (0, 1, 2, 3);
@@ -3879,12 +3879,12 @@ SELECT false IN (0, 1, 2, 3);
 SELECT true IN (SELECT b FROM t7);
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to integer'
+ | - 'Type mismatch: can not convert boolean(TRUE) to integer'
  | ...
 SELECT false IN (SELECT b FROM t7);
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to integer'
+ | - 'Type mismatch: can not convert boolean(FALSE) to integer'
  | ...
 SELECT a1, a1 IN (0, 1, 2, 3) FROM t6
  | ---
@@ -3901,22 +3901,22 @@ SELECT a1, a1 IN (0, 1, 2, 3) FROM t6
 SELECT true BETWEEN 0 and 10;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(0) to boolean'
  | ...
 SELECT false BETWEEN 0 and 10;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(0) to boolean'
  | ...
 SELECT a1, a1 BETWEEN 0 and 10 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(0) to boolean'
  | ...
 SELECT a2, a2 BETWEEN 0 and 10 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert unsigned to boolean'
+ | - 'Type mismatch: can not convert integer(0) to boolean'
  | ...
 
 -- Check interaction of BOOLEAN and NUMBER.
@@ -3932,7 +3932,7 @@ INSERT INTO t8 VALUES (4.56);
 SELECT true AND 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert 2.3 to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT false AND 2.3;
  | ---
@@ -3945,17 +3945,17 @@ SELECT false AND 2.3;
 SELECT true OR 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert 2.3 to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT false OR 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert 2.3 to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT 2.3 AND true;
  | ---
  | - null
- | - 'Type mismatch: can not convert 2.3 to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT 2.3 AND false;
  | ---
@@ -3968,59 +3968,59 @@ SELECT 2.3 AND false;
 SELECT 2.3 OR true;
  | ---
  | - null
- | - 'Type mismatch: can not convert 2.3 to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT 2.3 OR false;
  | ---
  | - null
- | - 'Type mismatch: can not convert 2.3 to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 
 SELECT a1, a1 AND 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert 2.3 to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT a1, a1 OR 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert 2.3 to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT a1, 2.3 AND a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert 2.3 to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT a1, 2.3 OR a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert 2.3 to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT a2, a2 AND 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert 2.3 to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT a2, a2 OR 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert 2.3 to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT a2, 2.3 AND a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert 2.3 to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT a2, 2.3 OR a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert 2.3 to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 
 SELECT c, true AND c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert 4.56 to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT c, false AND c FROM t8;
  | ---
@@ -4035,17 +4035,17 @@ SELECT c, false AND c FROM t8;
 SELECT c, true OR c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert 4.56 to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT c, false OR c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert 4.56 to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT c, c AND true FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert 4.56 to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT c, c AND false FROM t8;
  | ---
@@ -4060,949 +4060,949 @@ SELECT c, c AND false FROM t8;
 SELECT c, c OR true FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert 4.56 to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT c, c OR false FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert 4.56 to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 
 SELECT a1, c, a1 AND c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert 4.56 to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT a1, c, a1 OR c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert 4.56 to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT a1, c, c AND a1 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert 4.56 to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT a1, c, c OR a1 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert 4.56 to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT a2, c, a2 AND c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert 4.56 to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT a2, c, a2 OR c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert 4.56 to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT a2, c, c AND a2 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert 4.56 to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT a2, c, c OR a2 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert 4.56 to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 
 SELECT true + 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT false + 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT true - 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT false - 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT true * 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT false * 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT true / 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT false / 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT true % 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT false % 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT 2.3 + true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT 2.3 + false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT 2.3 - true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT 2.3 - false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT 2.3 * true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT 2.3 * false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT 2.3 / true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT 2.3 / false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT 2.3 % true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT 2.3 % false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 
 SELECT a1, a1 + 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a1, a1 - 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a1, a1 * 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a1, a1 / 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a1, a1 % 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a1, 2.3 + a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a1, 2.3 - a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a1, 2.3 * a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a1, 2.3 / a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a1, 2.3 % a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a2, a2 + 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT a2, a2 - 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT a2, a2 * 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT a2, a2 / 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT a2, a2 % 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT a2, 2.3 + a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT a2, 2.3 - a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT a2, 2.3 * a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT a2, 2.3 / a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT a2, 2.3 % a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 
 SELECT c, true + c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT c, false + c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT c, true - c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT c, false - c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT c, true * c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT c, false * c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT c, true / c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT c, false / c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT c, true % c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT c, false % c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT c, c + true FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT c, c + false FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT c, c - true FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT c, c - false FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT c, c * true FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT c, c * false FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT c, c / true FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT c, c / false FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT c, c % true FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT c, c % false FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 
 SELECT a1, c, a1 + c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a1, c, a1 - c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a1, c, a1 * c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a1, c, a1 / c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a1, c, a1 % c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a1, c, c + a1 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a1, c, c - a1 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a1, c, c * a1 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a1, c, c / a1 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a1, c, c % a1 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a2, c, a2 + c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT a2, c, a2 - c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT a2, c, a2 * c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT a2, c, a2 / c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT a2, c, a2 % c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT a2, c, c + a2 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT a2, c, c - a2 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT a2, c, c * a2 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT a2, c, c / a2 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT a2, c, c % a2 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 
 SELECT true > 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT false > 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT true < 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT false < 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT 2.3 > true;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT 2.3 > false;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT 2.3 < true;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT 2.3 < false;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 
 SELECT a1, a1 > 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT a1, a1 < 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT a1, 2.3 > a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT a1, 2.3 < a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT a2, a2 > 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT a2, a2 < 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT a2, 2.3 > a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT a2, 2.3 < a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 
 SELECT c, true > c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT c, false > c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT c, true < c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT c, false < c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT c, c > true FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT c, c > false FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT c, c < true FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT c, c < false FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 
 SELECT a1, c, a1 > c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT a1, c, a1 < c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT a1, c, c > a1 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT a1, c, c < a1 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT a2, c, a2 > c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT a2, c, a2 < c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT a2, c, c > a2 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT a2, c, c < a2 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 
 SELECT true >= 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT false >= 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT true <= 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT false <= 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT 2.3 >= true;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT 2.3 >= false;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT 2.3 <= true;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT 2.3 <= false;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 
 SELECT a1, a1 >= 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT a1, a1 <= 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT a1, 2.3 >= a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT a1, 2.3 <= a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT a2, a2 >= 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT a2, a2 <= 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT a2, 2.3 >= a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT a2, 2.3 <= a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 
 SELECT c, true >= c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT c, false >= c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT c, true <= c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT c, false <= c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT c, c >= true FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT c, c >= false FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT c, c <= true FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT c, c <= false FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 
 SELECT a1, c, a1 >= c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT a1, c, a1 <= c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT a1, c, c >= a1 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT a1, c, c <= a1 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT a2, c, a2 >= c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT a2, c, a2 <= c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT a2, c, c >= a2 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT a2, c, c <= a2 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 
 SELECT true == 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT false == 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT true != 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT false != 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT 2.3 == true;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT 2.3 == false;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT 2.3 != true;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT 2.3 != false;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 
 SELECT a1, a1 == 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT a1, a1 != 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT a1, 2.3 == a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT a1, 2.3 != a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT a2, a2 == 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT a2, a2 != 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT a2, 2.3 == a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 SELECT a2, 2.3 != a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(2.3) to boolean'
  | ...
 
 SELECT c, true == c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT c, false == c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT c, true != c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT c, false != c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT c, c == true FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT c, c == false FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT c, c != true FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT c, c != false FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 
 SELECT a1, c, a1 == c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT a1, c, a1 != c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT a1, c, c == a1 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT a1, c, c != a1 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT a2, c, a2 == c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT a2, c, a2 != c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT a2, c, c == a2 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 SELECT a2, c, c != a2 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(4.56) to boolean'
  | ...
 
 SELECT true IN (0.1, 1.2, 2.3, 3.4);
@@ -5040,43 +5040,43 @@ SELECT a2 IN (0.1, 1.2, 2.3, 3.4) FROM t6 LIMIT 1;
 SELECT true IN (SELECT c FROM t8);
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 SELECT false IN (SELECT c FROM t8);
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a1 IN (SELECT c FROM t8) FROM t6 LIMIT 1;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to number'
+ | - 'Type mismatch: can not convert boolean(FALSE) to number'
  | ...
 SELECT a2 IN (SELECT c FROM t8) FROM t6 LIMIT 1;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to number'
+ | - 'Type mismatch: can not convert boolean(TRUE) to number'
  | ...
 
 SELECT true BETWEEN 0.1 and 9.9;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(0.1) to boolean'
  | ...
 SELECT false BETWEEN 0.1 and 9.9;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(0.1) to boolean'
  | ...
 SELECT a1, a1 BETWEEN 0.1 and 9.9 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(0.1) to boolean'
  | ...
 SELECT a2, a2 BETWEEN 0.1 and 9.9 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert double to boolean'
+ | - 'Type mismatch: can not convert double(0.1) to boolean'
  | ...
 
 -- Check interaction of BOOLEAN and TEXT.
@@ -5092,7 +5092,7 @@ INSERT INTO t9 VALUES ('AsdF');
 SELECT true AND 'abc';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''abc'' to boolean'
+ | - 'Type mismatch: can not convert string(''abc'') to boolean'
  | ...
 SELECT false AND 'abc';
  | ---
@@ -5105,17 +5105,17 @@ SELECT false AND 'abc';
 SELECT true OR 'abc';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''abc'' to boolean'
+ | - 'Type mismatch: can not convert string(''abc'') to boolean'
  | ...
 SELECT false OR 'abc';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''abc'' to boolean'
+ | - 'Type mismatch: can not convert string(''abc'') to boolean'
  | ...
 SELECT 'abc' AND true;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''abc'' to boolean'
+ | - 'Type mismatch: can not convert string(''abc'') to boolean'
  | ...
 SELECT 'abc' AND false;
  | ---
@@ -5128,59 +5128,59 @@ SELECT 'abc' AND false;
 SELECT 'abc' OR true;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''abc'' to boolean'
+ | - 'Type mismatch: can not convert string(''abc'') to boolean'
  | ...
 SELECT 'abc' OR false;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''abc'' to boolean'
+ | - 'Type mismatch: can not convert string(''abc'') to boolean'
  | ...
 
 SELECT a1, a1 AND 'abc' FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''abc'' to boolean'
+ | - 'Type mismatch: can not convert string(''abc'') to boolean'
  | ...
 SELECT a1, a1 OR 'abc' FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''abc'' to boolean'
+ | - 'Type mismatch: can not convert string(''abc'') to boolean'
  | ...
 SELECT a1, 'abc' AND a1 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''abc'' to boolean'
+ | - 'Type mismatch: can not convert string(''abc'') to boolean'
  | ...
 SELECT a1, 'abc' OR a1 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''abc'' to boolean'
+ | - 'Type mismatch: can not convert string(''abc'') to boolean'
  | ...
 SELECT a2, a2 AND 'abc' FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''abc'' to boolean'
+ | - 'Type mismatch: can not convert string(''abc'') to boolean'
  | ...
 SELECT a2, a2 OR 'abc' FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''abc'' to boolean'
+ | - 'Type mismatch: can not convert string(''abc'') to boolean'
  | ...
 SELECT a2, 'abc' AND a2 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''abc'' to boolean'
+ | - 'Type mismatch: can not convert string(''abc'') to boolean'
  | ...
 SELECT a2, 'abc' OR a2 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''abc'' to boolean'
+ | - 'Type mismatch: can not convert string(''abc'') to boolean'
  | ...
 
 SELECT d, true AND d FROM t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''AsdF'' to boolean'
+ | - 'Type mismatch: can not convert string(''AsdF'') to boolean'
  | ...
 SELECT d, false AND d FROM t9;
  | ---
@@ -5195,17 +5195,17 @@ SELECT d, false AND d FROM t9;
 SELECT d, true OR d FROM t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''AsdF'' to boolean'
+ | - 'Type mismatch: can not convert string(''AsdF'') to boolean'
  | ...
 SELECT d, false OR d FROM t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''AsdF'' to boolean'
+ | - 'Type mismatch: can not convert string(''AsdF'') to boolean'
  | ...
 SELECT d, d AND true FROM t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''AsdF'' to boolean'
+ | - 'Type mismatch: can not convert string(''AsdF'') to boolean'
  | ...
 SELECT d, d AND false FROM t9;
  | ---
@@ -5220,239 +5220,239 @@ SELECT d, d AND false FROM t9;
 SELECT d, d OR true FROM t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''AsdF'' to boolean'
+ | - 'Type mismatch: can not convert string(''AsdF'') to boolean'
  | ...
 SELECT d, d OR false FROM t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''AsdF'' to boolean'
+ | - 'Type mismatch: can not convert string(''AsdF'') to boolean'
  | ...
 
 SELECT a1, d, a1 AND d FROM t6, t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''AsdF'' to boolean'
+ | - 'Type mismatch: can not convert string(''AsdF'') to boolean'
  | ...
 SELECT a1, d, a1 OR d FROM t6, t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''AsdF'' to boolean'
+ | - 'Type mismatch: can not convert string(''AsdF'') to boolean'
  | ...
 SELECT a1, d, d AND a1 FROM t6, t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''AsdF'' to boolean'
+ | - 'Type mismatch: can not convert string(''AsdF'') to boolean'
  | ...
 SELECT a1, d, d OR a1 FROM t6, t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''AsdF'' to boolean'
+ | - 'Type mismatch: can not convert string(''AsdF'') to boolean'
  | ...
 SELECT a2, d, a2 AND d FROM t6, t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''AsdF'' to boolean'
+ | - 'Type mismatch: can not convert string(''AsdF'') to boolean'
  | ...
 SELECT a2, d, a2 OR d FROM t6, t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''AsdF'' to boolean'
+ | - 'Type mismatch: can not convert string(''AsdF'') to boolean'
  | ...
 SELECT a2, d, d AND a2 FROM t6, t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''AsdF'' to boolean'
+ | - 'Type mismatch: can not convert string(''AsdF'') to boolean'
  | ...
 SELECT a2, d, d OR a2 FROM t6, t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''AsdF'' to boolean'
+ | - 'Type mismatch: can not convert string(''AsdF'') to boolean'
  | ...
 
 SELECT true > 'abc';
  | ---
  | - null
- | - 'Type mismatch: can not convert string to boolean'
+ | - 'Type mismatch: can not convert string(''abc'') to boolean'
  | ...
 SELECT false > 'abc';
  | ---
  | - null
- | - 'Type mismatch: can not convert string to boolean'
+ | - 'Type mismatch: can not convert string(''abc'') to boolean'
  | ...
 SELECT true < 'abc';
  | ---
  | - null
- | - 'Type mismatch: can not convert string to boolean'
+ | - 'Type mismatch: can not convert string(''abc'') to boolean'
  | ...
 SELECT false < 'abc';
  | ---
  | - null
- | - 'Type mismatch: can not convert string to boolean'
+ | - 'Type mismatch: can not convert string(''abc'') to boolean'
  | ...
 SELECT 'abc' > true;
  | ---
  | - null
- | - 'Type mismatch: can not convert string to boolean'
+ | - 'Type mismatch: can not convert string(''abc'') to boolean'
  | ...
 SELECT 'abc' > false;
  | ---
  | - null
- | - 'Type mismatch: can not convert string to boolean'
+ | - 'Type mismatch: can not convert string(''abc'') to boolean'
  | ...
 SELECT 'abc' < true;
  | ---
  | - null
- | - 'Type mismatch: can not convert string to boolean'
+ | - 'Type mismatch: can not convert string(''abc'') to boolean'
  | ...
 SELECT 'abc' < false;
  | ---
  | - null
- | - 'Type mismatch: can not convert string to boolean'
+ | - 'Type mismatch: can not convert string(''abc'') to boolean'
  | ...
 
 SELECT d, true > d FROM t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert string to boolean'
+ | - 'Type mismatch: can not convert string(''AsdF'') to boolean'
  | ...
 SELECT d, false > d FROM t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert string to boolean'
+ | - 'Type mismatch: can not convert string(''AsdF'') to boolean'
  | ...
 SELECT d, true < d FROM t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert string to boolean'
+ | - 'Type mismatch: can not convert string(''AsdF'') to boolean'
  | ...
 SELECT d, false < d FROM t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert string to boolean'
+ | - 'Type mismatch: can not convert string(''AsdF'') to boolean'
  | ...
 SELECT d, d > true FROM t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert string to boolean'
+ | - 'Type mismatch: can not convert string(''AsdF'') to boolean'
  | ...
 SELECT d, d > false FROM t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert string to boolean'
+ | - 'Type mismatch: can not convert string(''AsdF'') to boolean'
  | ...
 SELECT d, d < true FROM t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert string to boolean'
+ | - 'Type mismatch: can not convert string(''AsdF'') to boolean'
  | ...
 SELECT d, d < false FROM t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert string to boolean'
+ | - 'Type mismatch: can not convert string(''AsdF'') to boolean'
  | ...
 
 SELECT a1, d, a1 > d FROM t6, t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert string to boolean'
+ | - 'Type mismatch: can not convert string(''AsdF'') to boolean'
  | ...
 SELECT a1, d, a1 < d FROM t6, t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert string to boolean'
+ | - 'Type mismatch: can not convert string(''AsdF'') to boolean'
  | ...
 SELECT a1, d, d > a1 FROM t6, t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert string to boolean'
+ | - 'Type mismatch: can not convert string(''AsdF'') to boolean'
  | ...
 SELECT a1, d, d < a1 FROM t6, t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert string to boolean'
+ | - 'Type mismatch: can not convert string(''AsdF'') to boolean'
  | ...
 SELECT a2, d, a2 > d FROM t6, t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert string to boolean'
+ | - 'Type mismatch: can not convert string(''AsdF'') to boolean'
  | ...
 SELECT a2, d, a2 < d FROM t6, t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert string to boolean'
+ | - 'Type mismatch: can not convert string(''AsdF'') to boolean'
  | ...
 SELECT a2, d, d > a2 FROM t6, t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert string to boolean'
+ | - 'Type mismatch: can not convert string(''AsdF'') to boolean'
  | ...
 SELECT a2, d, d < a2 FROM t6, t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert string to boolean'
+ | - 'Type mismatch: can not convert string(''AsdF'') to boolean'
  | ...
 
 SELECT true || 'abc';
  | ---
  | - null
- | - 'Inconsistent types: expected string or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean(TRUE)'
  | ...
 SELECT false || 'abc';
  | ---
  | - null
- | - 'Inconsistent types: expected string or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean(FALSE)'
  | ...
 SELECT 'abc' || false;
  | ---
  | - null
- | - 'Inconsistent types: expected string or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean(FALSE)'
  | ...
 SELECT 'abc' || true;
  | ---
  | - null
- | - 'Inconsistent types: expected string or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean(TRUE)'
  | ...
 
 SELECT d, true || d FROM t9;
  | ---
  | - null
- | - 'Inconsistent types: expected string or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean(TRUE)'
  | ...
 SELECT d, false || d FROM t9;
  | ---
  | - null
- | - 'Inconsistent types: expected string or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean(FALSE)'
  | ...
 SELECT d, d || false FROM t9;
  | ---
  | - null
- | - 'Inconsistent types: expected string or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean(FALSE)'
  | ...
 SELECT d, d || true FROM t9;
  | ---
  | - null
- | - 'Inconsistent types: expected string or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean(TRUE)'
  | ...
 
 SELECT d, a1 || d FROM t6, t9;
  | ---
  | - null
- | - 'Inconsistent types: expected string or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean(FALSE)'
  | ...
 SELECT d, a2 || d FROM t6, t9;
  | ---
  | - null
- | - 'Inconsistent types: expected string or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean(TRUE)'
  | ...
 SELECT d, d || a1 FROM t6, t9;
  | ---
  | - null
- | - 'Inconsistent types: expected string or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean(FALSE)'
  | ...
 SELECT d, d || a2 FROM t6, t9;
  | ---
  | - null
- | - 'Inconsistent types: expected string or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean(TRUE)'
  | ...
 
 --
@@ -5467,7 +5467,7 @@ INSERT INTO t9 VALUES ('TRUE'), ('true'), ('FALSE'), ('false');
 SELECT true AND 'TRUE';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''TRUE'' to boolean'
+ | - 'Type mismatch: can not convert string(''TRUE'') to boolean'
  | ...
 SELECT false AND 'TRUE';
  | ---
@@ -5480,17 +5480,17 @@ SELECT false AND 'TRUE';
 SELECT true OR 'TRUE';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''TRUE'' to boolean'
+ | - 'Type mismatch: can not convert string(''TRUE'') to boolean'
  | ...
 SELECT false OR 'TRUE';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''TRUE'' to boolean'
+ | - 'Type mismatch: can not convert string(''TRUE'') to boolean'
  | ...
 SELECT 'TRUE' AND true;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''TRUE'' to boolean'
+ | - 'Type mismatch: can not convert string(''TRUE'') to boolean'
  | ...
 SELECT 'TRUE' AND false;
  | ---
@@ -5503,59 +5503,59 @@ SELECT 'TRUE' AND false;
 SELECT 'TRUE' OR true;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''TRUE'' to boolean'
+ | - 'Type mismatch: can not convert string(''TRUE'') to boolean'
  | ...
 SELECT 'TRUE' OR false;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''TRUE'' to boolean'
+ | - 'Type mismatch: can not convert string(''TRUE'') to boolean'
  | ...
 
 SELECT a1, a1 AND 'TRUE' FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''TRUE'' to boolean'
+ | - 'Type mismatch: can not convert string(''TRUE'') to boolean'
  | ...
 SELECT a1, a1 OR 'TRUE' FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''TRUE'' to boolean'
+ | - 'Type mismatch: can not convert string(''TRUE'') to boolean'
  | ...
 SELECT a1, 'TRUE' AND a1 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''TRUE'' to boolean'
+ | - 'Type mismatch: can not convert string(''TRUE'') to boolean'
  | ...
 SELECT a1, 'TRUE' OR a1 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''TRUE'' to boolean'
+ | - 'Type mismatch: can not convert string(''TRUE'') to boolean'
  | ...
 SELECT a2, a2 AND 'TRUE' FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''TRUE'' to boolean'
+ | - 'Type mismatch: can not convert string(''TRUE'') to boolean'
  | ...
 SELECT a2, a2 OR 'TRUE' FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''TRUE'' to boolean'
+ | - 'Type mismatch: can not convert string(''TRUE'') to boolean'
  | ...
 SELECT a2, 'TRUE' AND a2 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''TRUE'' to boolean'
+ | - 'Type mismatch: can not convert string(''TRUE'') to boolean'
  | ...
 SELECT a2, 'TRUE' OR a2 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''TRUE'' to boolean'
+ | - 'Type mismatch: can not convert string(''TRUE'') to boolean'
  | ...
 
 SELECT d, true AND d FROM t9 WHERE d = 'TRUE';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''TRUE'' to boolean'
+ | - 'Type mismatch: can not convert string(''TRUE'') to boolean'
  | ...
 SELECT d, false AND d FROM t9 WHERE d = 'TRUE';
  | ---
@@ -5570,17 +5570,17 @@ SELECT d, false AND d FROM t9 WHERE d = 'TRUE';
 SELECT d, true OR d FROM t9 WHERE d = 'TRUE';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''TRUE'' to boolean'
+ | - 'Type mismatch: can not convert string(''TRUE'') to boolean'
  | ...
 SELECT d, false OR d FROM t9 WHERE d = 'TRUE';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''TRUE'' to boolean'
+ | - 'Type mismatch: can not convert string(''TRUE'') to boolean'
  | ...
 SELECT d, d AND true FROM t9 WHERE d = 'TRUE';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''TRUE'' to boolean'
+ | - 'Type mismatch: can not convert string(''TRUE'') to boolean'
  | ...
 SELECT d, d AND false FROM t9 WHERE d = 'TRUE';
  | ---
@@ -5595,59 +5595,59 @@ SELECT d, d AND false FROM t9 WHERE d = 'TRUE';
 SELECT d, d OR true FROM t9 WHERE d = 'TRUE';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''TRUE'' to boolean'
+ | - 'Type mismatch: can not convert string(''TRUE'') to boolean'
  | ...
 SELECT d, d OR false FROM t9 WHERE d = 'TRUE';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''TRUE'' to boolean'
+ | - 'Type mismatch: can not convert string(''TRUE'') to boolean'
  | ...
 
 SELECT a1, d, a1 AND d FROM t6, t9 WHERE d = 'TRUE';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''TRUE'' to boolean'
+ | - 'Type mismatch: can not convert string(''TRUE'') to boolean'
  | ...
 SELECT a1, d, a1 OR d FROM t6, t9 WHERE d = 'TRUE';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''TRUE'' to boolean'
+ | - 'Type mismatch: can not convert string(''TRUE'') to boolean'
  | ...
 SELECT a1, d, d AND a1 FROM t6, t9 WHERE d = 'TRUE';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''TRUE'' to boolean'
+ | - 'Type mismatch: can not convert string(''TRUE'') to boolean'
  | ...
 SELECT a1, d, d OR a1 FROM t6, t9 WHERE d = 'TRUE';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''TRUE'' to boolean'
+ | - 'Type mismatch: can not convert string(''TRUE'') to boolean'
  | ...
 SELECT a2, d, a2 AND d FROM t6, t9 WHERE d = 'TRUE';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''TRUE'' to boolean'
+ | - 'Type mismatch: can not convert string(''TRUE'') to boolean'
  | ...
 SELECT a2, d, a2 OR d FROM t6, t9 WHERE d = 'TRUE';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''TRUE'' to boolean'
+ | - 'Type mismatch: can not convert string(''TRUE'') to boolean'
  | ...
 SELECT a2, d, d AND a2 FROM t6, t9 WHERE d = 'TRUE';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''TRUE'' to boolean'
+ | - 'Type mismatch: can not convert string(''TRUE'') to boolean'
  | ...
 SELECT a2, d, d OR a2 FROM t6, t9 WHERE d = 'TRUE';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''TRUE'' to boolean'
+ | - 'Type mismatch: can not convert string(''TRUE'') to boolean'
  | ...
 
 SELECT true AND 'true';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''true'' to boolean'
+ | - 'Type mismatch: can not convert string(''true'') to boolean'
  | ...
 SELECT false AND 'true';
  | ---
@@ -5660,17 +5660,17 @@ SELECT false AND 'true';
 SELECT true OR 'true';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''true'' to boolean'
+ | - 'Type mismatch: can not convert string(''true'') to boolean'
  | ...
 SELECT false OR 'true';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''true'' to boolean'
+ | - 'Type mismatch: can not convert string(''true'') to boolean'
  | ...
 SELECT 'true' AND true;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''true'' to boolean'
+ | - 'Type mismatch: can not convert string(''true'') to boolean'
  | ...
 SELECT 'true' AND false;
  | ---
@@ -5683,59 +5683,59 @@ SELECT 'true' AND false;
 SELECT 'true' OR true;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''true'' to boolean'
+ | - 'Type mismatch: can not convert string(''true'') to boolean'
  | ...
 SELECT 'true' OR false;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''true'' to boolean'
+ | - 'Type mismatch: can not convert string(''true'') to boolean'
  | ...
 
 SELECT a1, a1 AND 'true' FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''true'' to boolean'
+ | - 'Type mismatch: can not convert string(''true'') to boolean'
  | ...
 SELECT a1, a1 OR 'true' FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''true'' to boolean'
+ | - 'Type mismatch: can not convert string(''true'') to boolean'
  | ...
 SELECT a1, 'true' AND a1 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''true'' to boolean'
+ | - 'Type mismatch: can not convert string(''true'') to boolean'
  | ...
 SELECT a1, 'true' OR a1 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''true'' to boolean'
+ | - 'Type mismatch: can not convert string(''true'') to boolean'
  | ...
 SELECT a2, a2 AND 'true' FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''true'' to boolean'
+ | - 'Type mismatch: can not convert string(''true'') to boolean'
  | ...
 SELECT a2, a2 OR 'true' FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''true'' to boolean'
+ | - 'Type mismatch: can not convert string(''true'') to boolean'
  | ...
 SELECT a2, 'true' AND a2 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''true'' to boolean'
+ | - 'Type mismatch: can not convert string(''true'') to boolean'
  | ...
 SELECT a2, 'true' OR a2 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''true'' to boolean'
+ | - 'Type mismatch: can not convert string(''true'') to boolean'
  | ...
 
 SELECT d, true AND d FROM t9 WHERE d = 'true';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''true'' to boolean'
+ | - 'Type mismatch: can not convert string(''true'') to boolean'
  | ...
 SELECT d, false AND d FROM t9 WHERE d = 'true';
  | ---
@@ -5750,17 +5750,17 @@ SELECT d, false AND d FROM t9 WHERE d = 'true';
 SELECT d, true OR d FROM t9 WHERE d = 'true';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''true'' to boolean'
+ | - 'Type mismatch: can not convert string(''true'') to boolean'
  | ...
 SELECT d, false OR d FROM t9 WHERE d = 'true';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''true'' to boolean'
+ | - 'Type mismatch: can not convert string(''true'') to boolean'
  | ...
 SELECT d, d AND true FROM t9 WHERE d = 'true';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''true'' to boolean'
+ | - 'Type mismatch: can not convert string(''true'') to boolean'
  | ...
 SELECT d, d AND false FROM t9 WHERE d = 'true';
  | ---
@@ -5775,59 +5775,59 @@ SELECT d, d AND false FROM t9 WHERE d = 'true';
 SELECT d, d OR true FROM t9 WHERE d = 'true';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''true'' to boolean'
+ | - 'Type mismatch: can not convert string(''true'') to boolean'
  | ...
 SELECT d, d OR false FROM t9 WHERE d = 'true';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''true'' to boolean'
+ | - 'Type mismatch: can not convert string(''true'') to boolean'
  | ...
 
 SELECT a1, d, a1 AND d FROM t6, t9 WHERE d = 'true';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''true'' to boolean'
+ | - 'Type mismatch: can not convert string(''true'') to boolean'
  | ...
 SELECT a1, d, a1 OR d FROM t6, t9 WHERE d = 'true';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''true'' to boolean'
+ | - 'Type mismatch: can not convert string(''true'') to boolean'
  | ...
 SELECT a1, d, d AND a1 FROM t6, t9 WHERE d = 'true';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''true'' to boolean'
+ | - 'Type mismatch: can not convert string(''true'') to boolean'
  | ...
 SELECT a1, d, d OR a1 FROM t6, t9 WHERE d = 'true';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''true'' to boolean'
+ | - 'Type mismatch: can not convert string(''true'') to boolean'
  | ...
 SELECT a2, d, a2 AND d FROM t6, t9 WHERE d = 'true';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''true'' to boolean'
+ | - 'Type mismatch: can not convert string(''true'') to boolean'
  | ...
 SELECT a2, d, a2 OR d FROM t6, t9 WHERE d = 'true';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''true'' to boolean'
+ | - 'Type mismatch: can not convert string(''true'') to boolean'
  | ...
 SELECT a2, d, d AND a2 FROM t6, t9 WHERE d = 'true';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''true'' to boolean'
+ | - 'Type mismatch: can not convert string(''true'') to boolean'
  | ...
 SELECT a2, d, d OR a2 FROM t6, t9 WHERE d = 'true';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''true'' to boolean'
+ | - 'Type mismatch: can not convert string(''true'') to boolean'
  | ...
 
 SELECT true AND 'FALSE';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''FALSE'' to boolean'
+ | - 'Type mismatch: can not convert string(''FALSE'') to boolean'
  | ...
 SELECT false AND 'FALSE';
  | ---
@@ -5840,17 +5840,17 @@ SELECT false AND 'FALSE';
 SELECT true OR 'FALSE';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''FALSE'' to boolean'
+ | - 'Type mismatch: can not convert string(''FALSE'') to boolean'
  | ...
 SELECT false OR 'FALSE';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''FALSE'' to boolean'
+ | - 'Type mismatch: can not convert string(''FALSE'') to boolean'
  | ...
 SELECT 'FALSE' AND true;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''FALSE'' to boolean'
+ | - 'Type mismatch: can not convert string(''FALSE'') to boolean'
  | ...
 SELECT 'FALSE' AND false;
  | ---
@@ -5863,59 +5863,59 @@ SELECT 'FALSE' AND false;
 SELECT 'FALSE' OR true;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''FALSE'' to boolean'
+ | - 'Type mismatch: can not convert string(''FALSE'') to boolean'
  | ...
 SELECT 'FALSE' OR false;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''FALSE'' to boolean'
+ | - 'Type mismatch: can not convert string(''FALSE'') to boolean'
  | ...
 
 SELECT a1, a1 AND 'FALSE' FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''FALSE'' to boolean'
+ | - 'Type mismatch: can not convert string(''FALSE'') to boolean'
  | ...
 SELECT a1, a1 OR 'FALSE' FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''FALSE'' to boolean'
+ | - 'Type mismatch: can not convert string(''FALSE'') to boolean'
  | ...
 SELECT a1, 'FALSE' AND a1 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''FALSE'' to boolean'
+ | - 'Type mismatch: can not convert string(''FALSE'') to boolean'
  | ...
 SELECT a1, 'FALSE' OR a1 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''FALSE'' to boolean'
+ | - 'Type mismatch: can not convert string(''FALSE'') to boolean'
  | ...
 SELECT a2, a2 AND 'FALSE' FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''FALSE'' to boolean'
+ | - 'Type mismatch: can not convert string(''FALSE'') to boolean'
  | ...
 SELECT a2, a2 OR 'FALSE' FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''FALSE'' to boolean'
+ | - 'Type mismatch: can not convert string(''FALSE'') to boolean'
  | ...
 SELECT a2, 'FALSE' AND a2 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''FALSE'' to boolean'
+ | - 'Type mismatch: can not convert string(''FALSE'') to boolean'
  | ...
 SELECT a2, 'FALSE' OR a2 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''FALSE'' to boolean'
+ | - 'Type mismatch: can not convert string(''FALSE'') to boolean'
  | ...
 
 SELECT d, true AND d FROM t9 WHERE d = 'FALSE';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''FALSE'' to boolean'
+ | - 'Type mismatch: can not convert string(''FALSE'') to boolean'
  | ...
 SELECT d, false AND d FROM t9 WHERE d = 'FALSE';
  | ---
@@ -5930,17 +5930,17 @@ SELECT d, false AND d FROM t9 WHERE d = 'FALSE';
 SELECT d, true OR d FROM t9 WHERE d = 'FALSE';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''FALSE'' to boolean'
+ | - 'Type mismatch: can not convert string(''FALSE'') to boolean'
  | ...
 SELECT d, false OR d FROM t9 WHERE d = 'FALSE';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''FALSE'' to boolean'
+ | - 'Type mismatch: can not convert string(''FALSE'') to boolean'
  | ...
 SELECT d, d AND true FROM t9 WHERE d = 'FALSE';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''FALSE'' to boolean'
+ | - 'Type mismatch: can not convert string(''FALSE'') to boolean'
  | ...
 SELECT d, d AND false FROM t9 WHERE d = 'FALSE';
  | ---
@@ -5955,59 +5955,59 @@ SELECT d, d AND false FROM t9 WHERE d = 'FALSE';
 SELECT d, d OR true FROM t9 WHERE d = 'FALSE';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''FALSE'' to boolean'
+ | - 'Type mismatch: can not convert string(''FALSE'') to boolean'
  | ...
 SELECT d, d OR false FROM t9 WHERE d = 'FALSE';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''FALSE'' to boolean'
+ | - 'Type mismatch: can not convert string(''FALSE'') to boolean'
  | ...
 
 SELECT a1, d, a1 AND d FROM t6, t9 WHERE d = 'FALSE';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''FALSE'' to boolean'
+ | - 'Type mismatch: can not convert string(''FALSE'') to boolean'
  | ...
 SELECT a1, d, a1 OR d FROM t6, t9 WHERE d = 'FALSE';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''FALSE'' to boolean'
+ | - 'Type mismatch: can not convert string(''FALSE'') to boolean'
  | ...
 SELECT a1, d, d AND a1 FROM t6, t9 WHERE d = 'FALSE';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''FALSE'' to boolean'
+ | - 'Type mismatch: can not convert string(''FALSE'') to boolean'
  | ...
 SELECT a1, d, d OR a1 FROM t6, t9 WHERE d = 'FALSE';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''FALSE'' to boolean'
+ | - 'Type mismatch: can not convert string(''FALSE'') to boolean'
  | ...
 SELECT a2, d, a2 AND d FROM t6, t9 WHERE d = 'FALSE';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''FALSE'' to boolean'
+ | - 'Type mismatch: can not convert string(''FALSE'') to boolean'
  | ...
 SELECT a2, d, a2 OR d FROM t6, t9 WHERE d = 'FALSE';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''FALSE'' to boolean'
+ | - 'Type mismatch: can not convert string(''FALSE'') to boolean'
  | ...
 SELECT a2, d, d AND a2 FROM t6, t9 WHERE d = 'FALSE';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''FALSE'' to boolean'
+ | - 'Type mismatch: can not convert string(''FALSE'') to boolean'
  | ...
 SELECT a2, d, d OR a2 FROM t6, t9 WHERE d = 'FALSE';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''FALSE'' to boolean'
+ | - 'Type mismatch: can not convert string(''FALSE'') to boolean'
  | ...
 
 SELECT true AND 'false';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''false'' to boolean'
+ | - 'Type mismatch: can not convert string(''false'') to boolean'
  | ...
 SELECT false AND 'false';
  | ---
@@ -6020,17 +6020,17 @@ SELECT false AND 'false';
 SELECT true OR 'false';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''false'' to boolean'
+ | - 'Type mismatch: can not convert string(''false'') to boolean'
  | ...
 SELECT false OR 'false';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''false'' to boolean'
+ | - 'Type mismatch: can not convert string(''false'') to boolean'
  | ...
 SELECT 'false' AND true;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''false'' to boolean'
+ | - 'Type mismatch: can not convert string(''false'') to boolean'
  | ...
 SELECT 'false' AND false;
  | ---
@@ -6043,59 +6043,59 @@ SELECT 'false' AND false;
 SELECT 'false' OR true;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''false'' to boolean'
+ | - 'Type mismatch: can not convert string(''false'') to boolean'
  | ...
 SELECT 'false' OR false;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''false'' to boolean'
+ | - 'Type mismatch: can not convert string(''false'') to boolean'
  | ...
 
 SELECT a1, a1 AND 'false' FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''false'' to boolean'
+ | - 'Type mismatch: can not convert string(''false'') to boolean'
  | ...
 SELECT a1, a1 OR 'false' FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''false'' to boolean'
+ | - 'Type mismatch: can not convert string(''false'') to boolean'
  | ...
 SELECT a1, 'false' AND a1 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''false'' to boolean'
+ | - 'Type mismatch: can not convert string(''false'') to boolean'
  | ...
 SELECT a1, 'false' OR a1 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''false'' to boolean'
+ | - 'Type mismatch: can not convert string(''false'') to boolean'
  | ...
 SELECT a2, a2 AND 'false' FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''false'' to boolean'
+ | - 'Type mismatch: can not convert string(''false'') to boolean'
  | ...
 SELECT a2, a2 OR 'false' FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''false'' to boolean'
+ | - 'Type mismatch: can not convert string(''false'') to boolean'
  | ...
 SELECT a2, 'false' AND a2 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''false'' to boolean'
+ | - 'Type mismatch: can not convert string(''false'') to boolean'
  | ...
 SELECT a2, 'false' OR a2 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert ''false'' to boolean'
+ | - 'Type mismatch: can not convert string(''false'') to boolean'
  | ...
 
 SELECT d, true AND d FROM t9 WHERE d = 'false';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''false'' to boolean'
+ | - 'Type mismatch: can not convert string(''false'') to boolean'
  | ...
 SELECT d, false AND d FROM t9 WHERE d = 'false';
  | ---
@@ -6110,17 +6110,17 @@ SELECT d, false AND d FROM t9 WHERE d = 'false';
 SELECT d, true OR d FROM t9 WHERE d = 'false';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''false'' to boolean'
+ | - 'Type mismatch: can not convert string(''false'') to boolean'
  | ...
 SELECT d, false OR d FROM t9 WHERE d = 'false';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''false'' to boolean'
+ | - 'Type mismatch: can not convert string(''false'') to boolean'
  | ...
 SELECT d, d AND true FROM t9 WHERE d = 'false';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''false'' to boolean'
+ | - 'Type mismatch: can not convert string(''false'') to boolean'
  | ...
 SELECT d, d AND false FROM t9 WHERE d = 'false';
  | ---
@@ -6135,53 +6135,53 @@ SELECT d, d AND false FROM t9 WHERE d = 'false';
 SELECT d, d OR true FROM t9 WHERE d = 'false';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''false'' to boolean'
+ | - 'Type mismatch: can not convert string(''false'') to boolean'
  | ...
 SELECT d, d OR false FROM t9 WHERE d = 'false';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''false'' to boolean'
+ | - 'Type mismatch: can not convert string(''false'') to boolean'
  | ...
 
 SELECT a1, d, a1 AND d FROM t6, t9 WHERE d = 'false';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''false'' to boolean'
+ | - 'Type mismatch: can not convert string(''false'') to boolean'
  | ...
 SELECT a1, d, a1 OR d FROM t6, t9 WHERE d = 'false';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''false'' to boolean'
+ | - 'Type mismatch: can not convert string(''false'') to boolean'
  | ...
 SELECT a1, d, d AND a1 FROM t6, t9 WHERE d = 'false';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''false'' to boolean'
+ | - 'Type mismatch: can not convert string(''false'') to boolean'
  | ...
 SELECT a1, d, d OR a1 FROM t6, t9 WHERE d = 'false';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''false'' to boolean'
+ | - 'Type mismatch: can not convert string(''false'') to boolean'
  | ...
 SELECT a2, d, a2 AND d FROM t6, t9 WHERE d = 'false';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''false'' to boolean'
+ | - 'Type mismatch: can not convert string(''false'') to boolean'
  | ...
 SELECT a2, d, a2 OR d FROM t6, t9 WHERE d = 'false';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''false'' to boolean'
+ | - 'Type mismatch: can not convert string(''false'') to boolean'
  | ...
 SELECT a2, d, d AND a2 FROM t6, t9 WHERE d = 'false';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''false'' to boolean'
+ | - 'Type mismatch: can not convert string(''false'') to boolean'
  | ...
 SELECT a2, d, d OR a2 FROM t6, t9 WHERE d = 'false';
  | ---
  | - null
- | - 'Type mismatch: can not convert ''false'' to boolean'
+ | - 'Type mismatch: can not convert string(''false'') to boolean'
  | ...
 
 -- Cleaning.
diff --git a/test/sql/integer-overflow.result b/test/sql/integer-overflow.result
index c5de00fd5..8cad30ef3 100644
--- a/test/sql/integer-overflow.result
+++ b/test/sql/integer-overflow.result
@@ -106,7 +106,7 @@ box.execute('SELECT CAST(\'9223372036854775808\' AS INTEGER);')
 box.execute('SELECT CAST(\'18446744073709551616\' AS INTEGER);')
 ---
 - null
-- 'Type mismatch: can not convert ''18446744073709551616'' to integer'
+- 'Type mismatch: can not convert string(''18446744073709551616'') to integer'
 ...
 -- Due to inexact represantation of large integers in terms of
 -- floating point numbers, numerics with value < UINT64_MAX
@@ -117,7 +117,7 @@ box.execute('SELECT CAST(\'18446744073709551616\' AS INTEGER);')
 box.execute('SELECT CAST(18446744073709551600. AS INTEGER);')
 ---
 - null
-- 'Type mismatch: can not convert 1.84467440737096e+19 to integer'
+- 'Type mismatch: can not convert double(1.84467440737096e+19) to integer'
 ...
 -- gh-3810: make sure that if space contains integers in range
 -- [INT64_MAX, UINT64_MAX], they are handled inside SQL in a
diff --git a/test/sql/persistency.result b/test/sql/persistency.result
index fab94301d..bfd00e764 100644
--- a/test/sql/persistency.result
+++ b/test/sql/persistency.result
@@ -371,7 +371,7 @@ box.execute("SELECT \"name\", \"opts\" FROM \"_trigger\"");
 box.execute("INSERT INTO foobar VALUES ('foobar trigger test', 8888)")
 ---
 - null
-- 'Type mismatch: can not convert ''foobar trigger test'' to integer'
+- 'Type mismatch: can not convert string(''foobar trigger test'') to integer'
 ...
 box.execute("SELECT * FROM barfoo WHERE foo = 9999");
 ---
diff --git a/test/sql/types.result b/test/sql/types.result
index a9a5fd536..a0b8668be 100644
--- a/test/sql/types.result
+++ b/test/sql/types.result
@@ -158,39 +158,39 @@ sp:drop()
 box.execute("SELECT 'abc' || 1;")
 ---
 - null
-- 'Inconsistent types: expected string or varbinary got unsigned'
+- 'Inconsistent types: expected string or varbinary got integer(1)'
 ...
 box.execute("SELECT 'abc' || 1.123;")
 ---
 - null
-- 'Inconsistent types: expected string or varbinary got double'
+- 'Inconsistent types: expected string or varbinary got double(1.123)'
 ...
 box.execute("SELECT 1 || 'abc';")
 ---
 - null
-- 'Inconsistent types: expected string or varbinary got unsigned'
+- 'Inconsistent types: expected string or varbinary got integer(1)'
 ...
 box.execute("SELECT 1.123 || 'abc';")
 ---
 - null
-- 'Inconsistent types: expected string or varbinary got double'
+- 'Inconsistent types: expected string or varbinary got double(1.123)'
 ...
 box.execute("SELECt 'a' || 'b' || 1;")
 ---
 - null
-- 'Inconsistent types: expected string or varbinary got unsigned'
+- 'Inconsistent types: expected string or varbinary got integer(1)'
 ...
 -- What is more, they must be of the same type.
 --
 box.execute("SELECT 'abc' || randomblob(5);")
 ---
 - null
-- 'Inconsistent types: expected string got varbinary'
+- 'Inconsistent types: expected string got varbinary(x''819192E578'')'
 ...
 box.execute("SELECT randomblob(5) || 'x';")
 ---
 - null
-- 'Inconsistent types: expected varbinary got string'
+- 'Inconsistent types: expected varbinary got string(''x'')'
 ...
 -- Result of BLOBs concatenation must be BLOB.
 --
@@ -215,17 +215,17 @@ box.execute("INSERT INTO t1 VALUES (randomblob(5));")
 box.execute("SELECT * FROM t1 WHERE s LIKE 'blob';")
 ---
 - null
-- 'Inconsistent types: expected string got varbinary'
+- 'Inconsistent types: expected string got varbinary(x''91A0FEE366'')'
 ...
 box.execute("SELECT * FROM t1 WHERE 'blob' LIKE s;")
 ---
 - null
-- 'Inconsistent types: expected string got varbinary'
+- 'Inconsistent types: expected string got varbinary(x''91A0FEE366'')'
 ...
 box.execute("SELECT * FROM t1 WHERE 'blob' LIKE x'0000';")
 ---
 - null
-- 'Inconsistent types: expected string got varbinary'
+- 'Inconsistent types: expected string got varbinary(x''0000'')'
 ...
 box.execute("SELECT s LIKE NULL FROM t1;")
 ---
@@ -246,12 +246,12 @@ box.execute("INSERT INTO t1 VALUES (1);")
 box.execute("SELECT * FROM t1 WHERE s LIKE 'int';")
 ---
 - null
-- 'Inconsistent types: expected string got unsigned'
+- 'Inconsistent types: expected string got integer(1)'
 ...
 box.execute("SELECT * FROM t1 WHERE 'int' LIKE 4;")
 ---
 - null
-- 'Inconsistent types: expected string got unsigned'
+- 'Inconsistent types: expected string got integer(4)'
 ...
 box.execute("SELECT NULL LIKE s FROM t1;")
 ---
@@ -270,7 +270,7 @@ box.space.T1:drop()
 box.execute("SELECT CAST('1.123' AS INTEGER);")
 ---
 - null
-- 'Type mismatch: can not convert ''1.123'' to integer'
+- 'Type mismatch: can not convert string(''1.123'') to integer'
 ...
 box.execute("CREATE TABLE t1 (f TEXT PRIMARY KEY);")
 ---
@@ -283,7 +283,7 @@ box.execute("INSERT INTO t1 VALUES('0.0'), ('1.5'), ('3.9312453');")
 box.execute("SELECT CAST(f AS INTEGER) FROM t1;")
 ---
 - null
-- 'Type mismatch: can not convert ''0.0'' to integer'
+- 'Type mismatch: can not convert string(''0.0'') to integer'
 ...
 box.space.T1:drop()
 ---
@@ -339,22 +339,22 @@ box.execute("INSERT INTO tboolean VALUES (TRUE);")
 box.execute("SELECT * FROM tboolean WHERE s1 = x'44';")
 ---
 - null
-- 'Type mismatch: can not convert x''44'' to boolean'
+- 'Type mismatch: can not convert varbinary(x''44'') to boolean'
 ...
 box.execute("SELECT * FROM tboolean WHERE s1 = 'abc';")
 ---
 - null
-- 'Type mismatch: can not convert ''abc'' to boolean'
+- 'Type mismatch: can not convert string(''abc'') to boolean'
 ...
 box.execute("SELECT * FROM tboolean WHERE s1 = 1;")
 ---
 - null
-- 'Type mismatch: can not convert unsigned to boolean'
+- 'Type mismatch: can not convert integer(1) to boolean'
 ...
 box.execute("SELECT * FROM tboolean WHERE s1 = 1.123;")
 ---
 - null
-- 'Type mismatch: can not convert double to boolean'
+- 'Type mismatch: can not convert double(1.123) to boolean'
 ...
 box.space.TBOOLEAN:drop()
 ---
@@ -632,7 +632,7 @@ box.execute("SELECT 1 LIMIT 1 OFFSET 18446744073709551614;")
 box.execute("SELECT CAST('18446744073' || '709551616' AS INTEGER);")
 ---
 - null
-- 'Type mismatch: can not convert ''18446744073709551616'' to integer'
+- 'Type mismatch: can not convert string(''18446744073709551616'') to integer'
 ...
 box.execute("SELECT CAST('18446744073' || '709551615' AS INTEGER);")
 ---
@@ -1062,7 +1062,7 @@ box.execute("INSERT INTO t1 VALUES (0), (1), (2);")
 box.execute("INSERT INTO t1 VALUES (-3);")
 ---
 - null
-- 'Type mismatch: can not convert -3 to unsigned'
+- 'Type mismatch: can not convert integer(-3) to unsigned'
 ...
 box.execute("SELECT id FROM t1;")
 ---
@@ -1085,7 +1085,7 @@ box.execute("SELECT CAST(123 AS UNSIGNED);")
 box.execute("SELECT CAST(-123 AS UNSIGNED);")
 ---
 - null
-- 'Type mismatch: can not convert -123 to unsigned'
+- 'Type mismatch: can not convert integer(-123) to unsigned'
 ...
 box.execute("SELECT CAST(1.5 AS UNSIGNED);")
 ---
@@ -1122,7 +1122,7 @@ box.execute("SELECT CAST('123' AS UNSIGNED);")
 box.execute("SELECT CAST('-123' AS UNSIGNED);")
 ---
 - null
-- 'Type mismatch: can not convert ''-123'' to unsigned'
+- 'Type mismatch: can not convert string(''-123'') to unsigned'
 ...
 box.space.T1:drop()
 ---
@@ -1216,22 +1216,22 @@ box.execute("CREATE TABLE t (id INT PRIMARY KEY, v VARBINARY);")
 box.execute("INSERT INTO t VALUES(1, 1);")
 ---
 - null
-- 'Type mismatch: can not convert 1 to varbinary'
+- 'Type mismatch: can not convert integer(1) to varbinary'
 ...
 box.execute("INSERT INTO t VALUES(1, 1.123);")
 ---
 - null
-- 'Type mismatch: can not convert 1.123 to varbinary'
+- 'Type mismatch: can not convert double(1.123) to varbinary'
 ...
 box.execute("INSERT INTO t VALUES(1, true);")
 ---
 - null
-- 'Type mismatch: can not convert TRUE to varbinary'
+- 'Type mismatch: can not convert boolean(TRUE) to varbinary'
 ...
 box.execute("INSERT INTO t VALUES(1, 'asd');")
 ---
 - null
-- 'Type mismatch: can not convert ''asd'' to varbinary'
+- 'Type mismatch: can not convert string(''asd'') to varbinary'
 ...
 box.execute("INSERT INTO t VALUES(1, x'616263');")
 ---
@@ -1240,17 +1240,17 @@ box.execute("INSERT INTO t VALUES(1, x'616263');")
 box.execute("SELECT * FROM t WHERE v = 1")
 ---
 - null
-- 'Type mismatch: can not convert unsigned to varbinary'
+- 'Type mismatch: can not convert integer(1) to varbinary'
 ...
 box.execute("SELECT * FROM t WHERE v = 1.123")
 ---
 - null
-- 'Type mismatch: can not convert double to varbinary'
+- 'Type mismatch: can not convert double(1.123) to varbinary'
 ...
 box.execute("SELECT * FROM t WHERE v = 'str'")
 ---
 - null
-- 'Type mismatch: can not convert string to varbinary'
+- 'Type mismatch: can not convert string(''str'') to varbinary'
 ...
 box.execute("SELECT * FROM t WHERE v = x'616263'")
 ---
@@ -1265,17 +1265,17 @@ box.execute("SELECT * FROM t WHERE v = x'616263'")
 box.execute("SELECT sum(v) FROM t;")
 ---
 - null
-- 'Type mismatch: can not convert x''616263'' to number'
+- 'Type mismatch: can not convert varbinary(x''616263'') to number'
 ...
 box.execute("SELECT avg(v) FROM t;")
 ---
 - null
-- 'Type mismatch: can not convert x''616263'' to number'
+- 'Type mismatch: can not convert varbinary(x''616263'') to number'
 ...
 box.execute("SELECT total(v) FROM t;")
 ---
 - null
-- 'Type mismatch: can not convert x''616263'' to number'
+- 'Type mismatch: can not convert varbinary(x''616263'') to number'
 ...
 box.execute("SELECT min(v) FROM t;")
 ---
@@ -1312,17 +1312,17 @@ box.execute("SELECT group_concat(v) FROM t;")
 box.execute("SELECT lower(v) FROM t;")
 ---
 - null
-- 'Inconsistent types: expected string got varbinary'
+- 'Inconsistent types: expected string got varbinary(x''616263'')'
 ...
 box.execute("SELECT upper(v) FROM t;")
 ---
 - null
-- 'Inconsistent types: expected string got varbinary'
+- 'Inconsistent types: expected string got varbinary(x''616263'')'
 ...
 box.execute("SELECT abs(v) FROM t;")
 ---
 - null
-- 'Inconsistent types: expected number got varbinary'
+- 'Inconsistent types: expected number got varbinary(x''616263'')'
 ...
 box.execute("SELECT typeof(v) FROM t;")
 ---
@@ -1448,17 +1448,17 @@ box.space.T1:drop()
 box.execute("SELECT CAST(1 AS VARBINARY);")
 ---
 - null
-- 'Type mismatch: can not convert 1 to varbinary'
+- 'Type mismatch: can not convert integer(1) to varbinary'
 ...
 box.execute("SELECT CAST(1.123 AS VARBINARY);")
 ---
 - null
-- 'Type mismatch: can not convert 1.123 to varbinary'
+- 'Type mismatch: can not convert double(1.123) to varbinary'
 ...
 box.execute("SELECT CAST(true AS VARBINARY);")
 ---
 - null
-- 'Type mismatch: can not convert TRUE to varbinary'
+- 'Type mismatch: can not convert boolean(TRUE) to varbinary'
 ...
 box.execute("SELECT CAST('asd' AS VARBINARY);")
 ---
@@ -1613,7 +1613,7 @@ s:insert({1, {1,2,3}})
 box.execute('INSERT INTO t1(a) SELECT a FROM t2;')
 ---
 - null
-- 'Type mismatch: can not convert [1, 2, 3] to scalar'
+- 'Type mismatch: can not convert array([1, 2, 3]) to scalar'
 ...
 s:replace({1, {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30}})
 ---
@@ -1623,8 +1623,8 @@ s:replace({1, {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
 box.execute('INSERT INTO t1(a) SELECT a FROM t2;')
 ---
 - null
-- 'Type mismatch: can not convert [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
-  15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30] to scalar'
+- 'Type mismatch: can not convert array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
+  14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]) to scalar'
 ...
 --
 -- Make sure that the error will be displayed correctly even if
@@ -1649,9 +1649,9 @@ s:replace({1, long_array})
 box.execute('INSERT INTO t1(a) SELECT a FROM t2;')
 ---
 - null
-- 'Type mismatch: can not convert [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
-  15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
-  ... to scalar'
+- 'Type mismatch: can not convert array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
+  14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
+  34, ...) to scalar'
 ...
 s:drop()
 ---
@@ -1672,7 +1672,7 @@ s:insert({1, {b = 1}})
 box.execute('INSERT INTO t1(a) SELECT a FROM t2;')
 ---
 - null
-- 'Type mismatch: can not convert {"b": 1} to scalar'
+- 'Type mismatch: can not convert map({"b": 1}) to scalar'
 ...
 s:drop()
 ---
@@ -1717,12 +1717,12 @@ box.execute("SELECT CAST(1.123 AS DOUBLE);")
 box.execute("SELECT CAST(true AS DOUBLE);")
 ---
 - null
-- 'Type mismatch: can not convert TRUE to double'
+- 'Type mismatch: can not convert boolean(TRUE) to double'
 ...
 box.execute("SELECT CAST('asd' AS DOUBLE);")
 ---
 - null
-- 'Type mismatch: can not convert ''asd'' to double'
+- 'Type mismatch: can not convert string(''asd'') to double'
 ...
 box.execute("SELECT CAST('1' AS DOUBLE);")
 ---
@@ -1743,12 +1743,12 @@ box.execute("SELECT CAST('1.123' AS DOUBLE);")
 box.execute("SELECT CAST(x'' AS DOUBLE);")
 ---
 - null
-- 'Type mismatch: can not convert x'''' to double'
+- 'Type mismatch: can not convert varbinary(x'''') to double'
 ...
 box.execute("SELECT CAST(x'35' AS DOUBLE);")
 ---
 - null
-- 'Type mismatch: can not convert x''35'' to double'
+- 'Type mismatch: can not convert varbinary(x''35'') to double'
 ...
 box.execute("SELECT CAST(CAST(x'35' AS STRING) AS DOUBLE);")
 ---
@@ -2193,7 +2193,7 @@ box.execute([[INSERT INTO ti(i) VALUES (11);]])
 box.execute([[INSERT INTO ti(i) VALUES (100000000000000000000000000000000.1);]])
 ---
 - null
-- 'Type mismatch: can not convert 1.0e+32 to integer'
+- 'Type mismatch: can not convert double(1.0e+32) to integer'
 ...
 box.execute([[INSERT INTO ti(i) VALUES (33.0);]])
 ---
@@ -2204,17 +2204,17 @@ box.execute([[INSERT INTO ti(i) VALUES (33.0);]])
 box.execute([[INSERT INTO ti(i) VALUES (true);]])
 ---
 - null
-- 'Type mismatch: can not convert TRUE to integer'
+- 'Type mismatch: can not convert boolean(TRUE) to integer'
 ...
 box.execute([[INSERT INTO ti(i) VALUES ('33');]])
 ---
 - null
-- 'Type mismatch: can not convert ''33'' to integer'
+- 'Type mismatch: can not convert string(''33'') to integer'
 ...
 box.execute([[INSERT INTO ti(i) VALUES (X'3434');]])
 ---
 - null
-- 'Type mismatch: can not convert x''3434'' to integer'
+- 'Type mismatch: can not convert varbinary(x''3434'') to integer'
 ...
 box.execute([[SELECT * FROM ti;]])
 ---
@@ -2254,17 +2254,17 @@ box.execute([[INSERT INTO td(d) VALUES (22.2);]])
 box.execute([[INSERT INTO td(d) VALUES (true);]])
 ---
 - null
-- 'Type mismatch: can not convert TRUE to double'
+- 'Type mismatch: can not convert boolean(TRUE) to double'
 ...
 box.execute([[INSERT INTO td(d) VALUES ('33');]])
 ---
 - null
-- 'Type mismatch: can not convert ''33'' to double'
+- 'Type mismatch: can not convert string(''33'') to double'
 ...
 box.execute([[INSERT INTO td(d) VALUES (X'3434');]])
 ---
 - null
-- 'Type mismatch: can not convert x''3434'' to double'
+- 'Type mismatch: can not convert varbinary(x''3434'') to double'
 ...
 box.execute([[SELECT * FROM td;]])
 ---
@@ -2287,12 +2287,12 @@ box.execute([[INSERT INTO tb(b) VALUES (NULL);]])
 box.execute([[INSERT INTO tb(b) VALUES (11);]])
 ---
 - null
-- 'Type mismatch: can not convert 11 to boolean'
+- 'Type mismatch: can not convert integer(11) to boolean'
 ...
 box.execute([[INSERT INTO tb(b) VALUES (22.2);]])
 ---
 - null
-- 'Type mismatch: can not convert 22.2 to boolean'
+- 'Type mismatch: can not convert double(22.2) to boolean'
 ...
 box.execute([[INSERT INTO tb(b) VALUES (true);]])
 ---
@@ -2303,12 +2303,12 @@ box.execute([[INSERT INTO tb(b) VALUES (true);]])
 box.execute([[INSERT INTO tb(b) VALUES ('33');]])
 ---
 - null
-- 'Type mismatch: can not convert ''33'' to boolean'
+- 'Type mismatch: can not convert string(''33'') to boolean'
 ...
 box.execute([[INSERT INTO tb(b) VALUES (X'3434');]])
 ---
 - null
-- 'Type mismatch: can not convert x''3434'' to boolean'
+- 'Type mismatch: can not convert varbinary(x''3434'') to boolean'
 ...
 box.execute([[SELECT * FROM tb;]])
 ---
@@ -2330,17 +2330,17 @@ box.execute([[INSERT INTO tt(t) VALUES (NULL);]])
 box.execute([[INSERT INTO tt(t) VALUES (11);]])
 ---
 - null
-- 'Type mismatch: can not convert 11 to string'
+- 'Type mismatch: can not convert integer(11) to string'
 ...
 box.execute([[INSERT INTO tt(t) VALUES (22.2);]])
 ---
 - null
-- 'Type mismatch: can not convert 22.2 to string'
+- 'Type mismatch: can not convert double(22.2) to string'
 ...
 box.execute([[INSERT INTO tt(t) VALUES (true);]])
 ---
 - null
-- 'Type mismatch: can not convert TRUE to string'
+- 'Type mismatch: can not convert boolean(TRUE) to string'
 ...
 box.execute([[INSERT INTO tt(t) VALUES ('33');]])
 ---
@@ -2351,7 +2351,7 @@ box.execute([[INSERT INTO tt(t) VALUES ('33');]])
 box.execute([[INSERT INTO tt(t) VALUES (X'3434');]])
 ---
 - null
-- 'Type mismatch: can not convert x''3434'' to string'
+- 'Type mismatch: can not convert varbinary(x''3434'') to string'
 ...
 box.execute([[SELECT * FROM tt;]])
 ---
@@ -2373,22 +2373,22 @@ box.execute([[INSERT INTO tv(v) VALUES (NULL);]])
 box.execute([[INSERT INTO tv(v) VALUES (11);]])
 ---
 - null
-- 'Type mismatch: can not convert 11 to varbinary'
+- 'Type mismatch: can not convert integer(11) to varbinary'
 ...
 box.execute([[INSERT INTO tv(v) VALUES (22.2);]])
 ---
 - null
-- 'Type mismatch: can not convert 22.2 to varbinary'
+- 'Type mismatch: can not convert double(22.2) to varbinary'
 ...
 box.execute([[INSERT INTO tv(v) VALUES (true);]])
 ---
 - null
-- 'Type mismatch: can not convert TRUE to varbinary'
+- 'Type mismatch: can not convert boolean(TRUE) to varbinary'
 ...
 box.execute([[INSERT INTO tv(v) VALUES ('33');]])
 ---
 - null
-- 'Type mismatch: can not convert ''33'' to varbinary'
+- 'Type mismatch: can not convert string(''33'') to varbinary'
 ...
 box.execute([[INSERT INTO tv(v) VALUES (X'3434');]])
 ---
@@ -2548,7 +2548,7 @@ box.execute([[UPDATE ti SET i = 11 WHERE a = 1;]])
 box.execute([[UPDATE ti SET i = 100000000000000000000000000000000.1 WHERE a = 1;]])
 ---
 - null
-- 'Type mismatch: can not convert 1.0e+32 to integer'
+- 'Type mismatch: can not convert double(1.0e+32) to integer'
 ...
 box.execute([[UPDATE ti SET i = 33.0 WHERE a = 1;]])
 ---
@@ -2557,17 +2557,17 @@ box.execute([[UPDATE ti SET i = 33.0 WHERE a = 1;]])
 box.execute([[UPDATE ti SET i = true WHERE a = 1;]])
 ---
 - null
-- 'Type mismatch: can not convert TRUE to integer'
+- 'Type mismatch: can not convert boolean(TRUE) to integer'
 ...
 box.execute([[UPDATE ti SET i = '33' WHERE a = 1;]])
 ---
 - null
-- 'Type mismatch: can not convert ''33'' to integer'
+- 'Type mismatch: can not convert string(''33'') to integer'
 ...
 box.execute([[UPDATE ti SET i = X'3434' WHERE a = 1;]])
 ---
 - null
-- 'Type mismatch: can not convert x''3434'' to integer'
+- 'Type mismatch: can not convert varbinary(x''3434'') to integer'
 ...
 box.execute([[SELECT * FROM ti;]])
 ---
@@ -2598,17 +2598,17 @@ box.execute([[UPDATE td SET d = 22.2 WHERE a = 1;]])
 box.execute([[UPDATE td SET d = true WHERE a = 1;]])
 ---
 - null
-- 'Type mismatch: can not convert TRUE to double'
+- 'Type mismatch: can not convert boolean(TRUE) to double'
 ...
 box.execute([[UPDATE td SET d = '33' WHERE a = 1;]])
 ---
 - null
-- 'Type mismatch: can not convert ''33'' to double'
+- 'Type mismatch: can not convert string(''33'') to double'
 ...
 box.execute([[UPDATE td SET d = X'3434' WHERE a = 1;]])
 ---
 - null
-- 'Type mismatch: can not convert x''3434'' to double'
+- 'Type mismatch: can not convert varbinary(x''3434'') to double'
 ...
 box.execute([[SELECT * FROM td;]])
 ---
@@ -2627,12 +2627,12 @@ box.execute([[UPDATE tb SET b = NULL WHERE a = 1;]])
 box.execute([[UPDATE tb SET b = 11 WHERE a = 1;]])
 ---
 - null
-- 'Type mismatch: can not convert 11 to boolean'
+- 'Type mismatch: can not convert integer(11) to boolean'
 ...
 box.execute([[UPDATE tb SET b = 22.2 WHERE a = 1;]])
 ---
 - null
-- 'Type mismatch: can not convert 22.2 to boolean'
+- 'Type mismatch: can not convert double(22.2) to boolean'
 ...
 box.execute([[UPDATE tb SET b = true WHERE a = 1;]])
 ---
@@ -2641,12 +2641,12 @@ box.execute([[UPDATE tb SET b = true WHERE a = 1;]])
 box.execute([[UPDATE tb SET b = '33' WHERE a = 1;]])
 ---
 - null
-- 'Type mismatch: can not convert ''33'' to boolean'
+- 'Type mismatch: can not convert string(''33'') to boolean'
 ...
 box.execute([[UPDATE tb SET b = X'3434' WHERE a = 1;]])
 ---
 - null
-- 'Type mismatch: can not convert x''3434'' to boolean'
+- 'Type mismatch: can not convert varbinary(x''3434'') to boolean'
 ...
 box.execute([[SELECT * FROM tb;]])
 ---
@@ -2665,17 +2665,17 @@ box.execute([[UPDATE tt SET t = NULL WHERE a = 1;]])
 box.execute([[UPDATE tt SET t = 11 WHERE a = 1;]])
 ---
 - null
-- 'Type mismatch: can not convert 11 to string'
+- 'Type mismatch: can not convert integer(11) to string'
 ...
 box.execute([[UPDATE tt SET t = 22.2 WHERE a = 1;]])
 ---
 - null
-- 'Type mismatch: can not convert 22.2 to string'
+- 'Type mismatch: can not convert double(22.2) to string'
 ...
 box.execute([[UPDATE tt SET t = true WHERE a = 1;]])
 ---
 - null
-- 'Type mismatch: can not convert TRUE to string'
+- 'Type mismatch: can not convert boolean(TRUE) to string'
 ...
 box.execute([[UPDATE tt SET t = '33' WHERE a = 1;]])
 ---
@@ -2684,7 +2684,7 @@ box.execute([[UPDATE tt SET t = '33' WHERE a = 1;]])
 box.execute([[UPDATE tt SET t = X'3434' WHERE a = 1;]])
 ---
 - null
-- 'Type mismatch: can not convert x''3434'' to string'
+- 'Type mismatch: can not convert varbinary(x''3434'') to string'
 ...
 box.execute([[SELECT * FROM tt;]])
 ---
@@ -2703,22 +2703,22 @@ box.execute([[UPDATE tv SET v = NULL WHERE a = 1;]])
 box.execute([[UPDATE tv SET v = 11 WHERE a = 1;]])
 ---
 - null
-- 'Type mismatch: can not convert 11 to varbinary'
+- 'Type mismatch: can not convert integer(11) to varbinary'
 ...
 box.execute([[UPDATE tv SET v = 22.2 WHERE a = 1;]])
 ---
 - null
-- 'Type mismatch: can not convert 22.2 to varbinary'
+- 'Type mismatch: can not convert double(22.2) to varbinary'
 ...
 box.execute([[UPDATE tv SET v = true WHERE a = 1;]])
 ---
 - null
-- 'Type mismatch: can not convert TRUE to varbinary'
+- 'Type mismatch: can not convert boolean(TRUE) to varbinary'
 ...
 box.execute([[UPDATE tv SET v = '33' WHERE a = 1;]])
 ---
 - null
-- 'Type mismatch: can not convert ''33'' to varbinary'
+- 'Type mismatch: can not convert string(''33'') to varbinary'
 ...
 box.execute([[UPDATE tv SET v = X'3434' WHERE a = 1;]])
 ---
-- 
2.25.1


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

* Re: [Tarantool-patches] [PATCH v2 2/4] sql: properly show values in type mismatch error
  2021-07-13  7:03 ` [Tarantool-patches] [PATCH v2 2/4] sql: properly show " Mergen Imeev via Tarantool-patches
@ 2021-07-13  8:51   ` Timur Safin via Tarantool-patches
  0 siblings, 0 replies; 11+ messages in thread
From: Timur Safin via Tarantool-patches @ 2021-07-13  8:51 UTC (permalink / raw)
  To: imeevma; +Cc: tarantool-patches

LGTM, with one minor note, which may be addressed later.

: From: imeevma@tarantool.org <imeevma@tarantool.org>
: Subject: [PATCH v2 2/4] sql: properly show values in type mismatch error
: 
...
: 
: diff --git a/src/box/sql/mem.c b/src/box/sql/mem.c
: index 05f053c55..3bbff9897 100644
: --- a/src/box/sql/mem.c
: +++ b/src/box/sql/mem.c
: @@ -79,8 +79,8 @@ mem_str(const struct Mem *mem)
:  		return "NULL";
:  	case MEM_TYPE_STR:
:  		if (mem->n > STR_VALUE_MAX_LEN)
: -			return tt_sprintf("%.*s...", STR_VALUE_MAX_LEN, mem->z);
: -		return tt_cstr(mem->z, mem->n);
: +			return tt_sprintf("'%.*s...", STR_VALUE_MAX_LEN, mem->z);
: +		return tt_sprintf("'%.*s'", mem->n, mem->z);
:  	case MEM_TYPE_INT:
:  		return tt_sprintf("%lld", mem->u.i);
:  	case MEM_TYPE_UINT:
: @@ -88,8 +88,18 @@ mem_str(const struct Mem *mem)
:  	case MEM_TYPE_DOUBLE:
:  		sql_snprintf(STR_VALUE_MAX_LEN, buf, "%!.15g", mem->u.r);
:  		return tt_sprintf("%s", buf);
: -	case MEM_TYPE_BIN:
: -		return "varbinary";
: +	case MEM_TYPE_BIN: {
: +		int len = MIN(mem->n, STR_VALUE_MAX_LEN / 2);
: +		for (int i = 0; i < len; ++i) {
: +			int n = (mem->z[i] & 0xF0) >> 4;
: +			buf[2 * i] = n < 10 ? ('0' + n) : ('A' + n - 10);
: +			n = (mem->z[i] & 0x0F);
: +			buf[2 * i + 1] = n < 10 ? ('0' + n) : ('A' + n - 10);
: +		}
: +		if (mem->n > len)
: +			return tt_sprintf("x'%.*s...", len * 2, buf);
: +		return tt_sprintf("x'%.*s'", len * 2, buf);
: +	}

This looks mouthful, and improper abstraction level. I wanted to 
suggest to use cycle with tt_*snprintf for wrapped %0X format calls
but on the second thought this function became too fragile and even
more verbose
(static_reserve(len*2) .. static_alloc(..) series of vsnprintf("%02X",...)
Hell no, these 7 lines are simpler.

:  	case MEM_TYPE_MAP:
:  	case MEM_TYPE_ARRAY: {
:  		const char *str = mp_str(mem->z);
: @@ -99,7 +109,8 @@ mem_str(const struct Mem *mem)
:  		return tt_sprintf("%.*s...", STR_VALUE_MAX_LEN, buf);
:  	}
:  	case MEM_TYPE_UUID:
: -		return tt_uuid_str(&mem->u.uuid);
: +		tt_uuid_to_string(&mem->u.uuid, buf);
: +		return tt_sprintf("'%s'", buf);
:  	case MEM_TYPE_BOOL:
:  		return mem->u.b ? "TRUE" : "FALSE";
:  	default:

Regards,
Timur


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

* Re: [Tarantool-patches] [PATCH v2 1/4] sql: truncate values in type mismatch error
  2021-07-13  7:03 ` [Tarantool-patches] [PATCH v2 1/4] sql: truncate values in type mismatch error Mergen Imeev via Tarantool-patches
@ 2021-07-13  8:51   ` Timur Safin via Tarantool-patches
  0 siblings, 0 replies; 11+ messages in thread
From: Timur Safin via Tarantool-patches @ 2021-07-13  8:51 UTC (permalink / raw)
  To: imeevma; +Cc: tarantool-patches

LGTM, but the same minor complaint about format of truncated 
literal which I've put elsewhere.

Timur

: From: imeevma@tarantool.org <imeevma@tarantool.org>
: Subject: [PATCH v2 1/4] sql: truncate values in type mismatch error
: 
: STRING, MAP, and ARRAY values that are too long can make the type
: mismatch error description less descriptive than necessary. This patch
: truncates values that are too long and adds "..." to indicate that the
: value has been truncated.
: 
: Part of #6176
: ---
:  src/box/sql/mem.c                             | 18 ++++---
:  src/box/sql/mem.h                             |  3 +-
:  ...-4766-wrong-cast-from-blob-to-int.test.lua |  7 +--
:  test/sql-tap/sql-errors.test.lua              | 47 ++++++++++++++++++-
:  test/sql/types.result                         |  6 +--
:  5 files changed, 62 insertions(+), 19 deletions(-)
: 
: diff --git a/src/box/sql/mem.c b/src/box/sql/mem.c
: index 2595e2fd4..05f053c55 100644
: --- a/src/box/sql/mem.c
: +++ b/src/box/sql/mem.c
: @@ -57,6 +57,7 @@ sqlVdbeMemGrow(struct Mem *pMem, int n, int preserve);
: 
:  enum {
:  	BUF_SIZE = 32,
: +	STR_VALUE_MAX_LEN = 128,
:  };
: 
:  bool
: @@ -72,26 +73,31 @@ mem_is_field_compatible(const struct Mem *mem, enum
: field_type type)
:  const char *
:  mem_str(const struct Mem *mem)
:  {
: -	char buf[BUF_SIZE];
: +	char buf[STR_VALUE_MAX_LEN];
:  	switch (mem->type) {
:  	case MEM_TYPE_NULL:
:  		return "NULL";
:  	case MEM_TYPE_STR:
: -		if ((mem->flags & MEM_Term) != 0)
: -			return mem->z;
: +		if (mem->n > STR_VALUE_MAX_LEN)
: +			return tt_sprintf("%.*s...", STR_VALUE_MAX_LEN, mem->z);
:  		return tt_cstr(mem->z, mem->n);
:  	case MEM_TYPE_INT:
:  		return tt_sprintf("%lld", mem->u.i);
:  	case MEM_TYPE_UINT:
:  		return tt_sprintf("%llu", mem->u.u);
:  	case MEM_TYPE_DOUBLE:
: -		sql_snprintf(BUF_SIZE, &buf[0], "%!.15g", mem->u.r);
: +		sql_snprintf(STR_VALUE_MAX_LEN, buf, "%!.15g", mem->u.r);
:  		return tt_sprintf("%s", buf);
:  	case MEM_TYPE_BIN:
:  		return "varbinary";
:  	case MEM_TYPE_MAP:
: -	case MEM_TYPE_ARRAY:
: -		return mp_str(mem->z);
: +	case MEM_TYPE_ARRAY: {
: +		const char *str = mp_str(mem->z);
: +		if (strlen(str) <= STR_VALUE_MAX_LEN)
: +			return str;
: +		memcpy(buf, str, STR_VALUE_MAX_LEN);
: +		return tt_sprintf("%.*s...", STR_VALUE_MAX_LEN, buf);
: +	}
:  	case MEM_TYPE_UUID:
:  		return tt_uuid_str(&mem->u.uuid);
:  	case MEM_TYPE_BOOL:
: diff --git a/src/box/sql/mem.h b/src/box/sql/mem.h


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

* Re: [Tarantool-patches] [PATCH v2 4/4] sql: make type mismatch errors more informative
  2021-07-13  7:04 ` [Tarantool-patches] [PATCH v2 4/4] sql: make type mismatch errors more informative Mergen Imeev via Tarantool-patches
@ 2021-07-13  8:51   ` Timur Safin via Tarantool-patches
  2021-07-13 10:17     ` Mergen Imeev via Tarantool-patches
  0 siblings, 1 reply; 11+ messages in thread
From: Timur Safin via Tarantool-patches @ 2021-07-13  8:51 UTC (permalink / raw)
  To: imeevma; +Cc: tarantool-patches

This is so much clearer now!
LGTM (though there is some minor complain)

: From: imeevma@tarantool.org <imeevma@tarantool.org>
: Subject: [PATCH v2 4/4] sql: make type mismatch errors more informative
: 
...

: diff --git a/src/box/sql/mem.c b/src/box/sql/mem.c
: index c4375e1ea..cdb55f858 100644
: --- a/src/box/sql/mem.c
: +++ b/src/box/sql/mem.c
: @@ -78,16 +78,17 @@ mem_str(const struct Mem *mem)
:  	case MEM_TYPE_NULL:
:  		return "NULL";
:  	case MEM_TYPE_STR:
: -		if (mem->n > STR_VALUE_MAX_LEN)
: -			return tt_sprintf("'%.*s...", STR_VALUE_MAX_LEN, mem->z);
: -		return tt_sprintf("'%.*s'", mem->n, mem->z);
: +		if (mem->n <= STR_VALUE_MAX_LEN)
: +			return tt_sprintf("string('%.*s')", mem->n, mem->z);
: +		return tt_sprintf("string('%.*s...)", STR_VALUE_MAX_LEN,
: +				  mem->z);

Hmm, hmm, see my notice below. 

:  	case MEM_TYPE_INT:
: -		return tt_sprintf("%lld", mem->u.i);
: +		return tt_sprintf("integer(%lld)", mem->u.i);
:  	case MEM_TYPE_UINT:
: -		return tt_sprintf("%llu", mem->u.u);
: +		return tt_sprintf("integer(%llu)", mem->u.u);
:  	case MEM_TYPE_DOUBLE:
:  		sql_snprintf(STR_VALUE_MAX_LEN, buf, "%!.15g", mem->u.r);
: -		return tt_sprintf("%s", buf);
: +		return tt_sprintf("double(%s)", buf);
:  	case MEM_TYPE_BIN: {
:  		int len = MIN(mem->n, STR_VALUE_MAX_LEN / 2);
:  		for (int i = 0; i < len; ++i) {
: @@ -97,22 +98,25 @@ mem_str(const struct Mem *mem)
:  			buf[2 * i + 1] = n < 10 ? ('0' + n) : ('A' + n - 10);
:  		}
:  		if (mem->n > len)
: -			return tt_sprintf("x'%.*s...", len * 2, buf);
: -		return tt_sprintf("x'%.*s'", len * 2, buf);
: +			return tt_sprintf("varbinary(x'%.*s...)", len * 2, buf);
: +		return tt_sprintf("varbinary(x'%.*s')", len * 2, buf);

As for me it makes no much sense to generate not properly quoted 
literal even if we mean that it's shortened and truncated. IMVHO

Though there is no single proper form, because it's simple message, 
and customer will probably get the reason why it looks so.

:  	}
:  	case MEM_TYPE_MAP:
:  	case MEM_TYPE_ARRAY: {
:  		const char *str = mp_str(mem->z);
: -		if (strlen(str) <= STR_VALUE_MAX_LEN)
: -			return str;
: -		memcpy(buf, str, STR_VALUE_MAX_LEN);
: -		return tt_sprintf("%.*s...", STR_VALUE_MAX_LEN, buf);
: +		const char *type = mem_type_to_str(mem);
: +		uint32_t len = strlen(str);
: +		uint32_t minlen = MIN(STR_VALUE_MAX_LEN, len);
: +		memcpy(buf, str, minlen);
: +		if (len <= STR_VALUE_MAX_LEN)
: +			return tt_sprintf("%s(%.*s)", type, minlen, buf);
: +		return tt_sprintf("%s(%.*s...)", type, minlen, buf);


:  	}
:  	case MEM_TYPE_UUID:
:  		tt_uuid_to_string(&mem->u.uuid, buf);
: -		return tt_sprintf("'%s'", buf);
: +		return tt_sprintf("uuid('%s')", buf);
:  	case MEM_TYPE_BOOL:
: -		return mem->u.b ? "TRUE" : "FALSE";
: +		return mem->u.b ? "boolean(TRUE)" : "boolean(FALSE)";
:  	default:
:  		return "unknown";
:  	}

Regards,
Timur


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

* Re: [Tarantool-patches] [PATCH v2 3/4] sql: use proper type names in error descriptions
  2021-07-13  7:03 ` [Tarantool-patches] [PATCH v2 3/4] sql: use proper type names in error descriptions Mergen Imeev via Tarantool-patches
@ 2021-07-13  8:51   ` Timur Safin via Tarantool-patches
  0 siblings, 0 replies; 11+ messages in thread
From: Timur Safin via Tarantool-patches @ 2021-07-13  8:51 UTC (permalink / raw)
  To: imeevma; +Cc: tarantool-patches

Yup, text and real were always confusing before.1

LGTM

: From: imeevma@tarantool.org <imeevma@tarantool.org>
: Subject: [PATCH v2 3/4] sql: use proper type names in error descriptions
: 
: Prior to this patch, the type mismatch error description and the
: inconsistent types error description in some cases displayed type names
: that were different from the default ones. After this patch, all types
: in these descriptions are described using the default names.
: 
: Part of #6176
: ---
:  src/box/sql/func.c               |  12 +-
:  src/box/sql/mem.c                |  14 +-
:  src/box/sql/vdbe.c               |   2 +-
:  test/sql-tap/func.test.lua       |   6 +-
:  test/sql-tap/index1.test.lua     |   4 +-
:  test/sql-tap/position.test.lua   |  16 +-
:  test/sql-tap/select1.test.lua    |   2 +-
:  test/sql-tap/sql-errors.test.lua |   8 +-
:  test/sql-tap/uuid.test.lua       |  28 +-
:  test/sql/boolean.result          | 716 +++++++++++++++----------------
:  test/sql/types.result            |  34 +-
:  11 files changed, 422 insertions(+), 420 deletions(-)
: 
: diff --git a/src/box/sql/func.c b/src/box/sql/func.c
: index f93ae867d..e4832f46d 100644
: --- a/src/box/sql/func.c
: +++ b/src/box/sql/func.c
: @@ -324,7 +324,7 @@ position_func(struct sql_context *context, int argc,
: struct Mem **argv)
:  		inconsistent_type_arg = haystack;
:  	if (inconsistent_type_arg != NULL) {
:  		diag_set(ClientError, ER_INCONSISTENT_TYPES,
: -			 "text or varbinary",
: +			 "string or varbinary",
:  			 mem_type_to_str(inconsistent_type_arg));
:  		context->is_aborted = true;
:  		return;
: @@ -590,7 +590,7 @@ roundFunc(sql_context * context, int argc, sql_value **
: argv)
:  		return;
:  	if (!mem_is_num(argv[0]) && !mem_is_str(argv[0])) {
:  		diag_set(ClientError, ER_SQL_TYPE_MISMATCH,
: -			 mem_str(argv[0]), "numeric");
: +			 mem_str(argv[0]), "number");
:  		context->is_aborted = true;
:  		return;
:  	}
: @@ -650,7 +650,7 @@ case_type##ICUFunc(sql_context *context, int argc,
: sql_value **argv)   \
:  	UNUSED_PARAMETER(argc);
: \
:  	if (mem_is_bin(argv[0]) || mem_is_map(argv[0]) ||
: \
:  	    mem_is_array(argv[0])) {
: \
: -		diag_set(ClientError, ER_INCONSISTENT_TYPES, "text",           \
: +		diag_set(ClientError, ER_INCONSISTENT_TYPES, "string",         \
:  			 "varbinary");                                         \
:  		context->is_aborted = true;                                    \
:  		return;                                                        \
: @@ -733,7 +733,7 @@ randomBlob(sql_context * context, int argc, sql_value **
: argv)
:  	if (mem_is_bin(argv[0]) || mem_is_map(argv[0]) ||
:  	    mem_is_array(argv[0])) {
:  		diag_set(ClientError, ER_SQL_TYPE_MISMATCH,
: -			 mem_str(argv[0]), "numeric");
: +			 mem_str(argv[0]), "number");
:  		context->is_aborted = true;
:  		return;
:  	}
: @@ -987,7 +987,7 @@ likeFunc(sql_context *context, int argc, sql_value
: **argv)
:  		char *inconsistent_type = rhs_type != MP_STR ?
:  					  mem_type_to_str(argv[0]) :
:  					  mem_type_to_str(argv[1]);
: -		diag_set(ClientError, ER_INCONSISTENT_TYPES, "text",
: +		diag_set(ClientError, ER_INCONSISTENT_TYPES, "string",
:  			 inconsistent_type);
:  		context->is_aborted = true;
:  		return;
: @@ -1624,7 +1624,7 @@ soundexFunc(sql_context * context, int argc, sql_value
: ** argv)
:  	if (mem_is_bin(argv[0]) || mem_is_map(argv[0]) ||
:  	    mem_is_array(argv[0])) {
:  		diag_set(ClientError, ER_SQL_TYPE_MISMATCH,
: -			 mem_str(argv[0]), "text");
: +			 mem_str(argv[0]), "string");
:  		context->is_aborted = true;
:  		return;
:  	}
: diff --git a/src/box/sql/mem.c b/src/box/sql/mem.c
: index 3bbff9897..c4375e1ea 100644
: --- a/src/box/sql/mem.c
: +++ b/src/box/sql/mem.c
: @@ -1450,12 +1450,12 @@ mem_concat(struct Mem *a, struct Mem *b, struct Mem
: *result)
:  	/* Concatenation operation can be applied only to strings and blobs.
: */
:  	if (((b->type & (MEM_TYPE_STR | MEM_TYPE_BIN)) == 0)) {
:  		diag_set(ClientError, ER_INCONSISTENT_TYPES,
: -			 "text or varbinary", mem_type_to_str(b));
: +			 "string or varbinary", mem_type_to_str(b));
:  		return -1;
:  	}
:  	if (((a->type & (MEM_TYPE_STR | MEM_TYPE_BIN)) == 0)) {
:  		diag_set(ClientError, ER_INCONSISTENT_TYPES,
: -			 "text or varbinary", mem_type_to_str(a));
: +			 "string or varbinary", mem_type_to_str(a));
:  		return -1;
:  	}
: 
: @@ -1544,12 +1544,12 @@ arithmetic_prepare(const struct Mem *left, const
: struct Mem *right,
:  {
:  	if (get_number(right, b) != 0) {
:  		diag_set(ClientError, ER_SQL_TYPE_MISMATCH, mem_str(right),
: -			 "numeric");
: +			 "number");
:  		return -1;
:  	}
:  	if (get_number(left, a) != 0) {
:  		diag_set(ClientError, ER_SQL_TYPE_MISMATCH, mem_str(left),
: -			 "numeric");
: +			 "number");
:  		return -1;
:  	}
:  	assert(a->type != 0 && b->type != 0);
: @@ -2065,15 +2065,17 @@ mem_type_to_str(const struct Mem *p)
:  	case MEM_TYPE_NULL:
:  		return "NULL";
:  	case MEM_TYPE_STR:
: -		return "text";
: +		return "string";
:  	case MEM_TYPE_INT:
:  		return "integer";
:  	case MEM_TYPE_UINT:
:  		return "unsigned";
:  	case MEM_TYPE_DOUBLE:
: -		return "real";
: +		return "double";
:  	case MEM_TYPE_ARRAY:
: +		return "array";
:  	case MEM_TYPE_MAP:
: +		return "map";
:  	case MEM_TYPE_BIN:
:  		return "varbinary";
:  	case MEM_TYPE_BOOL:
: diff --git a/src/box/sql/vdbe.c b/src/box/sql/vdbe.c
: index 32d02d96e..03f420bca 100644
: --- a/src/box/sql/vdbe.c
: +++ b/src/box/sql/vdbe.c
: @@ -1674,7 +1674,7 @@ case OP_Ge: {             /* same as TK_GE, jump, in1,
: in3 */
:  				mem_cast_implicit_old(pIn3, type) != 0 ?
:  				mem_str(pIn3) : mem_str(pIn1);
:  			diag_set(ClientError, ER_SQL_TYPE_MISMATCH, str,
: -				 "numeric");
: +				 "number");
:  			goto abort_due_to_error;
:  		}
:  	} else {
: diff --git a/test/sql-tap/func.test.lua b/test/sql-tap/func.test.lua
: index ae6bc9ddd..66e525871 100755
: --- a/test/sql-tap/func.test.lua
: +++ b/test/sql-tap/func.test.lua
: @@ -2931,7 +2931,7 @@ test:do_catchsql_test(
:          SELECT ROUND(X'FF')
:      ]], {
:          -- <func-76.1>
: -        1, "Type mismatch: can not convert x'FF' to numeric"
: +        1, "Type mismatch: can not convert x'FF' to number"
:          -- </func-76.1>
:      })
: 
: @@ -2941,7 +2941,7 @@ test:do_catchsql_test(
:          SELECT RANDOMBLOB(X'FF')
:      ]], {
:          -- <func-76.2>
: -        1, "Type mismatch: can not convert x'FF' to numeric"
: +        1, "Type mismatch: can not convert x'FF' to number"
:          -- </func-76.2>
:      })
: 
: @@ -2951,7 +2951,7 @@ test:do_catchsql_test(
:          SELECT SOUNDEX(X'FF')
:      ]], {
:          -- <func-76.3>
: -        1, "Type mismatch: can not convert x'FF' to text"
: +        1, "Type mismatch: can not convert x'FF' to string"
:          -- </func-76.3>
:      })
: 
: diff --git a/test/sql-tap/index1.test.lua b/test/sql-tap/index1.test.lua
: index e03e284aa..9e57639cc 100755
: --- a/test/sql-tap/index1.test.lua
: +++ b/test/sql-tap/index1.test.lua
: @@ -778,7 +778,7 @@ test:do_catchsql_test(
:          SELECT c FROM t6 WHERE a>123;
:      ]], {
:          -- <index-14.6>
: -        1, "Type mismatch: can not convert '' to numeric"
: +        1, "Type mismatch: can not convert '' to number"
:          -- </index-14.6>
:      })
: 
: @@ -788,7 +788,7 @@ test:do_catchsql_test(
:          SELECT c FROM t6 WHERE a>=123;
:      ]], {
:          -- <index-14.7>
: -        1, "Type mismatch: can not convert '' to numeric"
: +        1, "Type mismatch: can not convert '' to number"
:          -- </index-14.7>
:      })
: 
: diff --git a/test/sql-tap/position.test.lua b/test/sql-tap/position.test.lua
: index 506efe0f4..dd4fa62d0 100755
: --- a/test/sql-tap/position.test.lua
: +++ b/test/sql-tap/position.test.lua
: @@ -228,7 +228,7 @@ test:do_test(
:          return test:catchsql "SELECT position(34, 12345);"
:      end, {
:          -- <position-1.23>
: -        1, "Inconsistent types: expected text or varbinary got unsigned"
: +        1, "Inconsistent types: expected string or varbinary got unsigned"
:          -- </position-1.23>
:      })
: 
: @@ -238,7 +238,7 @@ test:do_test(
:          return test:catchsql "SELECT position(34, 123456.78);"
:      end, {
:          -- <position-1.24>
: -        1, "Inconsistent types: expected text or varbinary got real"
: +        1, "Inconsistent types: expected string or varbinary got double"
:          -- </position-1.24>
:      })
: 
: @@ -248,7 +248,7 @@ test:do_test(
:          return test:catchsql "SELECT position(x'3334', 123456.78);"
:      end, {
:          -- <position-1.25>
: -        1, "Inconsistent types: expected text or varbinary got real"
: +        1, "Inconsistent types: expected string or varbinary got double"
:          -- </position-1.25>
:      })
: 
: @@ -554,7 +554,7 @@ test:do_test(
:          return test:catchsql("SELECT position('x', x'78c3a4e282ac79');")
:      end, {
:          -- <position-1.54>
: -        1, "Inconsistent types: expected text got varbinary"
: +        1, "Inconsistent types: expected string got varbinary"
:          -- </position-1.54>
:      })
: 
: @@ -564,7 +564,7 @@ test:do_test(
:          return test:catchsql "SELECT position('y', x'78c3a4e282ac79');"
:      end, {
:          -- <position-1.55>
: -        1, "Inconsistent types: expected text got varbinary"
: +        1, "Inconsistent types: expected string got varbinary"
:          -- </position-1.55>
:      })
: 
: @@ -614,7 +614,7 @@ test:do_test(
:          return test:catchsql "SELECT position(x'79', 'xä€y');"
:      end, {
:          -- <position-1.57.1>
: -        1, "Inconsistent types: expected varbinary got text"
: +        1, "Inconsistent types: expected varbinary got string"
:          -- </position-1.57.1>
:      })
: 
: @@ -624,7 +624,7 @@ test:do_test(
:          return test:catchsql "SELECT position(x'a4', 'xä€y');"
:      end, {
:          -- <position-1.57.2>
: -        1, "Inconsistent types: expected varbinary got text"
: +        1, "Inconsistent types: expected varbinary got string"
:          -- </position-1.57.2>
:      })
: 
: @@ -634,7 +634,7 @@ test:do_test(
:          return test:catchsql "SELECT position('y', x'78c3a4e282ac79');"
:      end, {
:          -- <position-1.57.3>
: -        1, "Inconsistent types: expected text got varbinary"
: +        1, "Inconsistent types: expected string got varbinary"
:          -- </position-1.57.3>
:      })
: 
: diff --git a/test/sql-tap/select1.test.lua b/test/sql-tap/select1.test.lua
: index 1a7a4ee82..57c5c2cb3 100755
: --- a/test/sql-tap/select1.test.lua
: +++ b/test/sql-tap/select1.test.lua
: @@ -320,7 +320,7 @@ test:do_catchsql_test(
:          SELECT count(*),count(a),count(b) FROM t4 WHERE b=5
:      ]], {
:          -- <select1-2.5.3>
: -        1, "Type mismatch: can not convert 'This is a string that is too
: big to fit inside a NBFS buffer' to numeric"
: +        1, "Type mismatch: can not convert 'This is a string that is too
: big to fit inside a NBFS buffer' to number"
:          -- </select1-2.5.3>
:      })
: 
: diff --git a/test/sql-tap/sql-errors.test.lua b/test/sql-tap/sql-
: errors.test.lua
: index 52276c27b..66dc77fa1 100755
: --- a/test/sql-tap/sql-errors.test.lua
: +++ b/test/sql-tap/sql-errors.test.lua
: @@ -696,7 +696,7 @@ test:do_catchsql_test(
:  		SELECT X'ff' + 1;
:  	]], {
:  		-- <sql-errors-2.1>
: -		1, "Type mismatch: can not convert x'FF' to numeric"
: +		1, "Type mismatch: can not convert x'FF' to number"
:  		-- </sql-errors-2.1>
:  	})
: 
: @@ -706,7 +706,7 @@ test:do_catchsql_test(
:  		SELECT X'ff' - 1;
:  	]], {
:  		-- <sql-errors-2.2>
: -		1, "Type mismatch: can not convert x'FF' to numeric"
: +		1, "Type mismatch: can not convert x'FF' to number"
:  		-- </sql-errors-2.2>
:  	})
: 
: @@ -716,7 +716,7 @@ test:do_catchsql_test(
:  		SELECT X'ff' * 1;
:  	]], {
:  		-- <sql-errors-2.3>
: -		1, "Type mismatch: can not convert x'FF' to numeric"
: +		1, "Type mismatch: can not convert x'FF' to number"
:  		-- </sql-errors-2.3>
:  	})
: 
: @@ -726,7 +726,7 @@ test:do_catchsql_test(
:  		SELECT X'ff' / 1;
:  	]], {
:  		-- <sql-errors-2.4>
: -		1, "Type mismatch: can not convert x'FF' to numeric"
: +		1, "Type mismatch: can not convert x'FF' to number"
:  		-- </sql-errors-2.4>
:  	})
: 
: diff --git a/test/sql-tap/uuid.test.lua b/test/sql-tap/uuid.test.lua
: index 1fc99916a..c9e1b4fcc 100755
: --- a/test/sql-tap/uuid.test.lua
: +++ b/test/sql-tap/uuid.test.lua
: @@ -337,7 +337,7 @@ test:do_catchsql_test(
:      [[
:          SELECT u LIKE 'a' from t2;
:      ]], {
: -        1, "Inconsistent types: expected text got uuid"
: +        1, "Inconsistent types: expected string got uuid"
:      })
: 
:  test:do_execsql_test(
: @@ -395,7 +395,7 @@ test:do_catchsql_test(
:      [[
:          SELECT POSITION(u, '1') from t2;
:      ]], {
: -        1, "Inconsistent types: expected text or varbinary got uuid"
: +        1, "Inconsistent types: expected string or varbinary got uuid"
:      })
: 
:  test:do_execsql_test(
: @@ -421,7 +421,7 @@ test:do_catchsql_test(
:      [[
:          SELECT ROUND(u) from t2;
:      ]], {
: -        1, "Type mismatch: can not convert '11111111-1111-1111-1111-
: 111111111111' to numeric"
: +        1, "Type mismatch: can not convert '11111111-1111-1111-1111-
: 111111111111' to number"
:      })
: 
:  test:do_execsql_test(
: @@ -505,7 +505,7 @@ test:do_catchsql_test(
:      [[
:          SELECT u || u from t2;
:      ]], {
: -        1, "Inconsistent types: expected text or varbinary got uuid"
: +        1, "Inconsistent types: expected string or varbinary got uuid"
:      })
: 
:  local func = {language = 'Lua', body = 'function(x) return type(x) end',
: @@ -971,7 +971,7 @@ test:do_catchsql_test(
:      [[
:          SELECT -u FROM t2;
:      ]], {
: -        1, "Type mismatch: can not convert '11111111-1111-1111-1111-
: 111111111111' to numeric"
: +        1, "Type mismatch: can not convert '11111111-1111-1111-1111-
: 111111111111' to number"
:      })
: 
:  test:do_catchsql_test(
: @@ -979,7 +979,7 @@ test:do_catchsql_test(
:      [[
:          SELECT u + 1 FROM t2;
:      ]], {
: -        1, "Type mismatch: can not convert '11111111-1111-1111-1111-
: 111111111111' to numeric"
: +        1, "Type mismatch: can not convert '11111111-1111-1111-1111-
: 111111111111' to number"
:      })
: 
:  test:do_catchsql_test(
: @@ -987,7 +987,7 @@ test:do_catchsql_test(
:      [[
:          SELECT u - 1 FROM t2;
:      ]], {
: -        1, "Type mismatch: can not convert '11111111-1111-1111-1111-
: 111111111111' to numeric"
: +        1, "Type mismatch: can not convert '11111111-1111-1111-1111-
: 111111111111' to number"
:      })
: 
:  test:do_catchsql_test(
: @@ -995,7 +995,7 @@ test:do_catchsql_test(
:      [[
:          SELECT u * 1 FROM t2;
:      ]], {
: -        1, "Type mismatch: can not convert '11111111-1111-1111-1111-
: 111111111111' to numeric"
: +        1, "Type mismatch: can not convert '11111111-1111-1111-1111-
: 111111111111' to number"
:      })
: 
:  test:do_catchsql_test(
: @@ -1003,7 +1003,7 @@ test:do_catchsql_test(
:      [[
:          SELECT u / 1 FROM t2;
:      ]], {
: -        1, "Type mismatch: can not convert '11111111-1111-1111-1111-
: 111111111111' to numeric"
: +        1, "Type mismatch: can not convert '11111111-1111-1111-1111-
: 111111111111' to number"
:      })
: 
:  test:do_catchsql_test(
: @@ -1011,7 +1011,7 @@ test:do_catchsql_test(
:      [[
:          SELECT u % 1 FROM t2;
:      ]], {
: -        1, "Type mismatch: can not convert '11111111-1111-1111-1111-
: 111111111111' to numeric"
: +        1, "Type mismatch: can not convert '11111111-1111-1111-1111-
: 111111111111' to number"
:      })
: 
:  -- Check that bitwise operations work with UUIDs as intended.
: @@ -1118,7 +1118,7 @@ test:do_catchsql_test(
:      [[
:          SELECT u > '1' FROM t2;
:      ]], {
: -        1, "Type mismatch: can not convert text to uuid"
: +        1, "Type mismatch: can not convert string to uuid"
:      })
: 
:  test:do_catchsql_test(
: @@ -1126,7 +1126,7 @@ test:do_catchsql_test(
:      [[
:          SELECT u > 1.5 FROM t2;
:      ]], {
: -        1, "Type mismatch: can not convert real to uuid"
: +        1, "Type mismatch: can not convert double to uuid"
:      })
: 
:  test:do_catchsql_test(
: @@ -1182,7 +1182,7 @@ test:do_catchsql_test(
:      [[
:          SELECT u = '1' FROM t2;
:      ]], {
: -        1, "Type mismatch: can not convert text to uuid"
: +        1, "Type mismatch: can not convert string to uuid"
:      })
: 
:  test:do_catchsql_test(
: @@ -1190,7 +1190,7 @@ test:do_catchsql_test(
:      [[
:          SELECT u = 1.5 FROM t2;
:      ]], {
: -        1, "Type mismatch: can not convert real to uuid"
: +        1, "Type mismatch: can not convert double to uuid"
:      })
: 
:  test:do_catchsql_test(
: diff --git a/test/sql/boolean.result b/test/sql/boolean.result
: index dbd31fbb5..320525d36 100644
: --- a/test/sql/boolean.result
: +++ b/test/sql/boolean.result
: @@ -138,12 +138,12 @@ INSERT INTO ts(s) VALUES ('abc'), (12.5);
:  SELECT s FROM ts WHERE s = true;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert text to boolean'
: + | - 'Type mismatch: can not convert string to boolean'
:   | ...
:  SELECT s FROM ts WHERE s < true;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert text to boolean'
: + | - 'Type mismatch: can not convert string to boolean'
:   | ...
:  SELECT s FROM ts WHERE s IN (true, 1, 'abcd');
:   | ---
: @@ -1122,245 +1122,245 @@ SELECT a, a1, a OR a1 FROM t, t6;
:  SELECT -true;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT -false;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT -a FROM t;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
: 
:  SELECT true + true;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT true + false;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT false + true;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT false + false;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT true - true;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT true - false;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT false - true;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT false - false;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT true * true;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT true * false;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT false * true;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT false * false;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT true / true;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT true / false;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT false / true;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT false / false;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT true % true;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT true % false;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT false % true;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT false % false;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
: 
:  SELECT a, true + a FROM t;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a, false + a FROM t;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a, true - a FROM t;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a, false - a FROM t;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a, true * a FROM t;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a, false * a FROM t;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a, true / a FROM t;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a, false / a FROM t;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a, true % a FROM t;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a, false % a FROM t;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a, a + true FROM t;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT a, a + false FROM t;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a, a - true FROM t;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT a, a - false FROM t;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a, a * true FROM t;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT a, a * false FROM t;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a, a / true FROM t;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT a, a / false FROM t;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a, a % true FROM t;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT a, a % false FROM t;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
: 
:  SELECT a, a1, a + a1 FROM t, t6;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a, a1, a - a1 FROM t, t6;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a, a1, a * a1 FROM t, t6;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a, a1, a / a1 FROM t, t6;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a, a1, a % a1 FROM t, t6;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
: 
:  SELECT ~true;
: @@ -1560,64 +1560,64 @@ SELECT a, a1, a >> a1 FROM t, t6;
:  SELECT true || true;
:   | ---
:   | - null
: - | - 'Inconsistent types: expected text or varbinary got boolean'
: + | - 'Inconsistent types: expected string or varbinary got boolean'
:   | ...
:  SELECT true || false;
:   | ---
:   | - null
: - | - 'Inconsistent types: expected text or varbinary got boolean'
: + | - 'Inconsistent types: expected string or varbinary got boolean'
:   | ...
:  SELECT false || true;
:   | ---
:   | - null
: - | - 'Inconsistent types: expected text or varbinary got boolean'
: + | - 'Inconsistent types: expected string or varbinary got boolean'
:   | ...
:  SELECT false || false;
:   | ---
:   | - null
: - | - 'Inconsistent types: expected text or varbinary got boolean'
: + | - 'Inconsistent types: expected string or varbinary got boolean'
:   | ...
: 
:  SELECT a, true || a FROM t;
:   | ---
:   | - null
: - | - 'Inconsistent types: expected text or varbinary got boolean'
: + | - 'Inconsistent types: expected string or varbinary got boolean'
:   | ...
:  SELECT a, false || a FROM t;
:   | ---
:   | - null
: - | - 'Inconsistent types: expected text or varbinary got boolean'
: + | - 'Inconsistent types: expected string or varbinary got boolean'
:   | ...
:  SELECT a, a || true FROM t;
:   | ---
:   | - null
: - | - 'Inconsistent types: expected text or varbinary got boolean'
: + | - 'Inconsistent types: expected string or varbinary got boolean'
:   | ...
:  SELECT a, a || false FROM t;
:   | ---
:   | - null
: - | - 'Inconsistent types: expected text or varbinary got boolean'
: + | - 'Inconsistent types: expected string or varbinary got boolean'
:   | ...
: 
:  SELECT a1, a1 || a1 FROM t6;
:   | ---
:   | - null
: - | - 'Inconsistent types: expected text or varbinary got boolean'
: + | - 'Inconsistent types: expected string or varbinary got boolean'
:   | ...
:  SELECT a2, a2 || a2 FROM t6;
:   | ---
:   | - null
: - | - 'Inconsistent types: expected text or varbinary got boolean'
: + | - 'Inconsistent types: expected string or varbinary got boolean'
:   | ...
:  SELECT a1, a2, a1 || a1 FROM t6;
:   | ---
:   | - null
: - | - 'Inconsistent types: expected text or varbinary got boolean'
: + | - 'Inconsistent types: expected string or varbinary got boolean'
:   | ...
:  SELECT a1, a2, a2 || a2 FROM t6;
:   | ---
:   | - null
: - | - 'Inconsistent types: expected text or varbinary got boolean'
: + | - 'Inconsistent types: expected string or varbinary got boolean'
:   | ...
: 
:  -- Check comparisons.
: @@ -2643,405 +2643,405 @@ SELECT a2, b, b OR a2 FROM t6, t7;
:  SELECT true + 2;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT false + 2;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT true - 2;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT false - 2;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT true * 2;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT false * 2;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT true / 2;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT false / 2;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT true % 2;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT false % 2;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT 2 + true;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT 2 + false;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT 2 - true;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT 2 - false;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT 2 * true;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT 2 * false;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT 2 / true;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT 2 / false;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT 2 % true;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT 2 % false;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
: 
:  SELECT a1, a1 + 2 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a1, a1 - 2 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a1, a1 * 2 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a1, a1 / 2 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a1, a1 % 2 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a1, 2 + a1 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a1, 2 - a1 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a1, 2 * a1 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a1, 2 / a1 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a1, 2 % a1 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a2, a2 + 2 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT a2, a2 - 2 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT a2, a2 * 2 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT a2, a2 / 2 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT a2, a2 % 2 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT a2, 2 + a2 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT a2, 2 - a2 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT a2, 2 * a2 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT a2, 2 / a2 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT a2, 2 % a2 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
: 
:  SELECT b, true + b FROM t7;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT b, false + b FROM t7;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT b, true - b FROM t7;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT b, false - b FROM t7;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT b, true * b FROM t7;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT b, false * b FROM t7;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT b, true / b FROM t7;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT b, false / b FROM t7;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT b, true % b FROM t7;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT b, false % b FROM t7;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT b, b + true FROM t7;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT b, b + false FROM t7;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT b, b - true FROM t7;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT b, b - false FROM t7;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT b, b * true FROM t7;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT b, b * false FROM t7;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT b, b / true FROM t7;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT b, b / false FROM t7;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT b, b % true FROM t7;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT b, b % false FROM t7;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
: 
:  SELECT a1, b, a1 + b FROM t6, t7;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a1, b, a1 - b FROM t6, t7;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a1, b, a1 * b FROM t6, t7;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a1, b, a1 / b FROM t6, t7;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a1, b, a1 % b FROM t6, t7;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a1, b, b + a1 FROM t6, t7;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a1, b, b - a1 FROM t6, t7;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a1, b, b * a1 FROM t6, t7;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a1, b, b / a1 FROM t6, t7;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a1, b, b % a1 FROM t6, t7;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a2, b, a2 + b FROM t6, t7;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT a2, b, a2 - b FROM t6, t7;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT a2, b, a2 * b FROM t6, t7;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT a2, b, a2 / b FROM t6, t7;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT a2, b, a2 % b FROM t6, t7;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT a2, b, b + a2 FROM t6, t7;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT a2, b, b - a2 FROM t6, t7;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT a2, b, b * a2 FROM t6, t7;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT a2, b, b / a2 FROM t6, t7;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT a2, b, b % a2 FROM t6, t7;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
: 
:  SELECT true & 2;
: @@ -4112,897 +4112,897 @@ SELECT a2, c, c OR a2 FROM t6, t8;
:  SELECT true + 2.3;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT false + 2.3;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT true - 2.3;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT false - 2.3;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT true * 2.3;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT false * 2.3;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT true / 2.3;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT false / 2.3;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT true % 2.3;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT false % 2.3;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT 2.3 + true;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT 2.3 + false;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT 2.3 - true;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT 2.3 - false;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT 2.3 * true;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT 2.3 * false;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT 2.3 / true;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT 2.3 / false;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT 2.3 % true;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT 2.3 % false;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
: 
:  SELECT a1, a1 + 2.3 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a1, a1 - 2.3 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a1, a1 * 2.3 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a1, a1 / 2.3 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a1, a1 % 2.3 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a1, 2.3 + a1 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a1, 2.3 - a1 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a1, 2.3 * a1 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a1, 2.3 / a1 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a1, 2.3 % a1 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a2, a2 + 2.3 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT a2, a2 - 2.3 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT a2, a2 * 2.3 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT a2, a2 / 2.3 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT a2, a2 % 2.3 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT a2, 2.3 + a2 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT a2, 2.3 - a2 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT a2, 2.3 * a2 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT a2, 2.3 / a2 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT a2, 2.3 % a2 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
: 
:  SELECT c, true + c FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT c, false + c FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT c, true - c FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT c, false - c FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT c, true * c FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT c, false * c FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT c, true / c FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT c, false / c FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT c, true % c FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT c, false % c FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT c, c + true FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT c, c + false FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT c, c - true FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT c, c - false FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT c, c * true FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT c, c * false FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT c, c / true FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT c, c / false FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT c, c % true FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT c, c % false FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
: 
:  SELECT a1, c, a1 + c FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a1, c, a1 - c FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a1, c, a1 * c FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a1, c, a1 / c FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a1, c, a1 % c FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a1, c, c + a1 FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a1, c, c - a1 FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a1, c, c * a1 FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a1, c, c / a1 FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a1, c, c % a1 FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert FALSE to numeric'
: + | - 'Type mismatch: can not convert FALSE to number'
:   | ...
:  SELECT a2, c, a2 + c FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT a2, c, a2 - c FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT a2, c, a2 * c FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT a2, c, a2 / c FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT a2, c, a2 % c FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT a2, c, c + a2 FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT a2, c, c - a2 FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT a2, c, c * a2 FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT a2, c, c / a2 FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
:  SELECT a2, c, c % a2 FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert TRUE to numeric'
: + | - 'Type mismatch: can not convert TRUE to number'
:   | ...
: 
:  SELECT true > 2.3;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT false > 2.3;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT true < 2.3;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT false < 2.3;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT 2.3 > true;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT 2.3 > false;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT 2.3 < true;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT 2.3 < false;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
: 
:  SELECT a1, a1 > 2.3 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a1, a1 < 2.3 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a1, 2.3 > a1 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a1, 2.3 < a1 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a2, a2 > 2.3 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a2, a2 < 2.3 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a2, 2.3 > a2 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a2, 2.3 < a2 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
: 
:  SELECT c, true > c FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT c, false > c FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT c, true < c FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT c, false < c FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT c, c > true FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT c, c > false FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT c, c < true FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT c, c < false FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
: 
:  SELECT a1, c, a1 > c FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a1, c, a1 < c FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a1, c, c > a1 FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a1, c, c < a1 FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a2, c, a2 > c FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a2, c, a2 < c FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a2, c, c > a2 FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a2, c, c < a2 FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
: 
:  SELECT true >= 2.3;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT false >= 2.3;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT true <= 2.3;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT false <= 2.3;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT 2.3 >= true;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT 2.3 >= false;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT 2.3 <= true;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT 2.3 <= false;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
: 
:  SELECT a1, a1 >= 2.3 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a1, a1 <= 2.3 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a1, 2.3 >= a1 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a1, 2.3 <= a1 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a2, a2 >= 2.3 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a2, a2 <= 2.3 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a2, 2.3 >= a2 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a2, 2.3 <= a2 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
: 
:  SELECT c, true >= c FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT c, false >= c FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT c, true <= c FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT c, false <= c FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT c, c >= true FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT c, c >= false FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT c, c <= true FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT c, c <= false FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
: 
:  SELECT a1, c, a1 >= c FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a1, c, a1 <= c FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a1, c, c >= a1 FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a1, c, c <= a1 FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a2, c, a2 >= c FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a2, c, a2 <= c FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a2, c, c >= a2 FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a2, c, c <= a2 FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
: 
:  SELECT true == 2.3;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT false == 2.3;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT true != 2.3;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT false != 2.3;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT 2.3 == true;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT 2.3 == false;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT 2.3 != true;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT 2.3 != false;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
: 
:  SELECT a1, a1 == 2.3 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a1, a1 != 2.3 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a1, 2.3 == a1 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a1, 2.3 != a1 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a2, a2 == 2.3 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a2, a2 != 2.3 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a2, 2.3 == a2 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a2, 2.3 != a2 FROM t6
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
: 
:  SELECT c, true == c FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT c, false == c FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT c, true != c FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT c, false != c FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT c, c == true FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT c, c == false FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT c, c != true FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT c, c != false FROM t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
: 
:  SELECT a1, c, a1 == c FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a1, c, a1 != c FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a1, c, c == a1 FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a1, c, c != a1 FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a2, c, a2 == c FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a2, c, a2 != c FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a2, c, c == a2 FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a2, c, c != a2 FROM t6, t8;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
: 
:  SELECT true IN (0.1, 1.2, 2.3, 3.4);
: @@ -5061,22 +5061,22 @@ SELECT a2 IN (SELECT c FROM t8) FROM t6 LIMIT 1;
:  SELECT true BETWEEN 0.1 and 9.9;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT false BETWEEN 0.1 and 9.9;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a1, a1 BETWEEN 0.1 and 9.9 FROM t6;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
:  SELECT a2, a2 BETWEEN 0.1 and 9.9 FROM t6;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert real to boolean'
: + | - 'Type mismatch: can not convert double to boolean'
:   | ...
: 
:  -- Check interaction of BOOLEAN and TEXT.
: @@ -5272,187 +5272,187 @@ SELECT a2, d, d OR a2 FROM t6, t9;
:  SELECT true > 'abc';
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert text to boolean'
: + | - 'Type mismatch: can not convert string to boolean'
:   | ...
:  SELECT false > 'abc';
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert text to boolean'
: + | - 'Type mismatch: can not convert string to boolean'
:   | ...
:  SELECT true < 'abc';
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert text to boolean'
: + | - 'Type mismatch: can not convert string to boolean'
:   | ...
:  SELECT false < 'abc';
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert text to boolean'
: + | - 'Type mismatch: can not convert string to boolean'
:   | ...
:  SELECT 'abc' > true;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert text to boolean'
: + | - 'Type mismatch: can not convert string to boolean'
:   | ...
:  SELECT 'abc' > false;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert text to boolean'
: + | - 'Type mismatch: can not convert string to boolean'
:   | ...
:  SELECT 'abc' < true;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert text to boolean'
: + | - 'Type mismatch: can not convert string to boolean'
:   | ...
:  SELECT 'abc' < false;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert text to boolean'
: + | - 'Type mismatch: can not convert string to boolean'
:   | ...
: 
:  SELECT d, true > d FROM t9;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert text to boolean'
: + | - 'Type mismatch: can not convert string to boolean'
:   | ...
:  SELECT d, false > d FROM t9;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert text to boolean'
: + | - 'Type mismatch: can not convert string to boolean'
:   | ...
:  SELECT d, true < d FROM t9;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert text to boolean'
: + | - 'Type mismatch: can not convert string to boolean'
:   | ...
:  SELECT d, false < d FROM t9;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert text to boolean'
: + | - 'Type mismatch: can not convert string to boolean'
:   | ...
:  SELECT d, d > true FROM t9;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert text to boolean'
: + | - 'Type mismatch: can not convert string to boolean'
:   | ...
:  SELECT d, d > false FROM t9;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert text to boolean'
: + | - 'Type mismatch: can not convert string to boolean'
:   | ...
:  SELECT d, d < true FROM t9;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert text to boolean'
: + | - 'Type mismatch: can not convert string to boolean'
:   | ...
:  SELECT d, d < false FROM t9;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert text to boolean'
: + | - 'Type mismatch: can not convert string to boolean'
:   | ...
: 
:  SELECT a1, d, a1 > d FROM t6, t9;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert text to boolean'
: + | - 'Type mismatch: can not convert string to boolean'
:   | ...
:  SELECT a1, d, a1 < d FROM t6, t9;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert text to boolean'
: + | - 'Type mismatch: can not convert string to boolean'
:   | ...
:  SELECT a1, d, d > a1 FROM t6, t9;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert text to boolean'
: + | - 'Type mismatch: can not convert string to boolean'
:   | ...
:  SELECT a1, d, d < a1 FROM t6, t9;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert text to boolean'
: + | - 'Type mismatch: can not convert string to boolean'
:   | ...
:  SELECT a2, d, a2 > d FROM t6, t9;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert text to boolean'
: + | - 'Type mismatch: can not convert string to boolean'
:   | ...
:  SELECT a2, d, a2 < d FROM t6, t9;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert text to boolean'
: + | - 'Type mismatch: can not convert string to boolean'
:   | ...
:  SELECT a2, d, d > a2 FROM t6, t9;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert text to boolean'
: + | - 'Type mismatch: can not convert string to boolean'
:   | ...
:  SELECT a2, d, d < a2 FROM t6, t9;
:   | ---
:   | - null
: - | - 'Type mismatch: can not convert text to boolean'
: + | - 'Type mismatch: can not convert string to boolean'
:   | ...
: 
:  SELECT true || 'abc';
:   | ---
:   | - null
: - | - 'Inconsistent types: expected text or varbinary got boolean'
: + | - 'Inconsistent types: expected string or varbinary got boolean'
:   | ...
:  SELECT false || 'abc';
:   | ---
:   | - null
: - | - 'Inconsistent types: expected text or varbinary got boolean'
: + | - 'Inconsistent types: expected string or varbinary got boolean'
:   | ...
:  SELECT 'abc' || false;
:   | ---
:   | - null
: - | - 'Inconsistent types: expected text or varbinary got boolean'
: + | - 'Inconsistent types: expected string or varbinary got boolean'
:   | ...
:  SELECT 'abc' || true;
:   | ---
:   | - null
: - | - 'Inconsistent types: expected text or varbinary got boolean'
: + | - 'Inconsistent types: expected string or varbinary got boolean'
:   | ...
: 
:  SELECT d, true || d FROM t9;
:   | ---
:   | - null
: - | - 'Inconsistent types: expected text or varbinary got boolean'
: + | - 'Inconsistent types: expected string or varbinary got boolean'
:   | ...
:  SELECT d, false || d FROM t9;
:   | ---
:   | - null
: - | - 'Inconsistent types: expected text or varbinary got boolean'
: + | - 'Inconsistent types: expected string or varbinary got boolean'
:   | ...
:  SELECT d, d || false FROM t9;
:   | ---
:   | - null
: - | - 'Inconsistent types: expected text or varbinary got boolean'
: + | - 'Inconsistent types: expected string or varbinary got boolean'
:   | ...
:  SELECT d, d || true FROM t9;
:   | ---
:   | - null
: - | - 'Inconsistent types: expected text or varbinary got boolean'
: + | - 'Inconsistent types: expected string or varbinary got boolean'
:   | ...
: 
:  SELECT d, a1 || d FROM t6, t9;
:   | ---
:   | - null
: - | - 'Inconsistent types: expected text or varbinary got boolean'
: + | - 'Inconsistent types: expected string or varbinary got boolean'
:   | ...
:  SELECT d, a2 || d FROM t6, t9;
:   | ---
:   | - null
: - | - 'Inconsistent types: expected text or varbinary got boolean'
: + | - 'Inconsistent types: expected string or varbinary got boolean'
:   | ...
:  SELECT d, d || a1 FROM t6, t9;
:   | ---
:   | - null
: - | - 'Inconsistent types: expected text or varbinary got boolean'
: + | - 'Inconsistent types: expected string or varbinary got boolean'
:   | ...
:  SELECT d, d || a2 FROM t6, t9;
:   | ---
:   | - null
: - | - 'Inconsistent types: expected text or varbinary got boolean'
: + | - 'Inconsistent types: expected string or varbinary got boolean'
:   | ...
: 
:  --
: diff --git a/test/sql/types.result b/test/sql/types.result
: index 219559619..a9a5fd536 100644
: --- a/test/sql/types.result
: +++ b/test/sql/types.result
: @@ -158,39 +158,39 @@ sp:drop()
:  box.execute("SELECT 'abc' || 1;")
:  ---
:  - null
: -- 'Inconsistent types: expected text or varbinary got unsigned'
: +- 'Inconsistent types: expected string or varbinary got unsigned'
:  ...
:  box.execute("SELECT 'abc' || 1.123;")
:  ---
:  - null
: -- 'Inconsistent types: expected text or varbinary got real'
: +- 'Inconsistent types: expected string or varbinary got double'
:  ...
:  box.execute("SELECT 1 || 'abc';")
:  ---
:  - null
: -- 'Inconsistent types: expected text or varbinary got unsigned'
: +- 'Inconsistent types: expected string or varbinary got unsigned'
:  ...
:  box.execute("SELECT 1.123 || 'abc';")
:  ---
:  - null
: -- 'Inconsistent types: expected text or varbinary got real'
: +- 'Inconsistent types: expected string or varbinary got double'
:  ...
:  box.execute("SELECt 'a' || 'b' || 1;")
:  ---
:  - null
: -- 'Inconsistent types: expected text or varbinary got unsigned'
: +- 'Inconsistent types: expected string or varbinary got unsigned'
:  ...
:  -- What is more, they must be of the same type.
:  --
:  box.execute("SELECT 'abc' || randomblob(5);")
:  ---
:  - null
: -- 'Inconsistent types: expected text got varbinary'
: +- 'Inconsistent types: expected string got varbinary'
:  ...
:  box.execute("SELECT randomblob(5) || 'x';")
:  ---
:  - null
: -- 'Inconsistent types: expected varbinary got text'
: +- 'Inconsistent types: expected varbinary got string'
:  ...
:  -- Result of BLOBs concatenation must be BLOB.
:  --
: @@ -215,17 +215,17 @@ box.execute("INSERT INTO t1 VALUES (randomblob(5));")
:  box.execute("SELECT * FROM t1 WHERE s LIKE 'blob';")
:  ---
:  - null
: -- 'Inconsistent types: expected text got varbinary'
: +- 'Inconsistent types: expected string got varbinary'
:  ...
:  box.execute("SELECT * FROM t1 WHERE 'blob' LIKE s;")
:  ---
:  - null
: -- 'Inconsistent types: expected text got varbinary'
: +- 'Inconsistent types: expected string got varbinary'
:  ...
:  box.execute("SELECT * FROM t1 WHERE 'blob' LIKE x'0000';")
:  ---
:  - null
: -- 'Inconsistent types: expected text got varbinary'
: +- 'Inconsistent types: expected string got varbinary'
:  ...
:  box.execute("SELECT s LIKE NULL FROM t1;")
:  ---
: @@ -246,12 +246,12 @@ box.execute("INSERT INTO t1 VALUES (1);")
:  box.execute("SELECT * FROM t1 WHERE s LIKE 'int';")
:  ---
:  - null
: -- 'Inconsistent types: expected text got unsigned'
: +- 'Inconsistent types: expected string got unsigned'
:  ...
:  box.execute("SELECT * FROM t1 WHERE 'int' LIKE 4;")
:  ---
:  - null
: -- 'Inconsistent types: expected text got unsigned'
: +- 'Inconsistent types: expected string got unsigned'
:  ...
:  box.execute("SELECT NULL LIKE s FROM t1;")
:  ---
: @@ -354,7 +354,7 @@ box.execute("SELECT * FROM tboolean WHERE s1 = 1;")
:  box.execute("SELECT * FROM tboolean WHERE s1 = 1.123;")
:  ---
:  - null
: -- 'Type mismatch: can not convert real to boolean'
: +- 'Type mismatch: can not convert double to boolean'
:  ...
:  box.space.TBOOLEAN:drop()
:  ---
: @@ -1245,12 +1245,12 @@ box.execute("SELECT * FROM t WHERE v = 1")
:  box.execute("SELECT * FROM t WHERE v = 1.123")
:  ---
:  - null
: -- 'Type mismatch: can not convert real to varbinary'
: +- 'Type mismatch: can not convert double to varbinary'
:  ...
:  box.execute("SELECT * FROM t WHERE v = 'str'")
:  ---
:  - null
: -- 'Type mismatch: can not convert text to varbinary'
: +- 'Type mismatch: can not convert string to varbinary'
:  ...
:  box.execute("SELECT * FROM t WHERE v = x'616263'")
:  ---
: @@ -1312,12 +1312,12 @@ box.execute("SELECT group_concat(v) FROM t;")
:  box.execute("SELECT lower(v) FROM t;")
:  ---
:  - null
: -- 'Inconsistent types: expected text got varbinary'
: +- 'Inconsistent types: expected string got varbinary'
:  ...
:  box.execute("SELECT upper(v) FROM t;")
:  ---
:  - null
: -- 'Inconsistent types: expected text got varbinary'
: +- 'Inconsistent types: expected string got varbinary'
:  ...
:  box.execute("SELECT abs(v) FROM t;")
:  ---
: --
: 2.25.1



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

* Re: [Tarantool-patches] [PATCH v2 4/4] sql: make type mismatch errors more informative
  2021-07-13  8:51   ` Timur Safin via Tarantool-patches
@ 2021-07-13 10:17     ` Mergen Imeev via Tarantool-patches
  0 siblings, 0 replies; 11+ messages in thread
From: Mergen Imeev via Tarantool-patches @ 2021-07-13 10:17 UTC (permalink / raw)
  To: Timur Safin; +Cc: tarantool-patches

Hi! Thank you for the review! My answer below.

On 13.07.2021 11:51, Timur Safin wrote:
> This is so much clearer now!
> LGTM (though there is some minor complain)
>
> : From: imeevma@tarantool.org <imeevma@tarantool.org>
> : Subject: [PATCH v2 4/4] sql: make type mismatch errors more informative
> :
> ...
>
> : diff --git a/src/box/sql/mem.c b/src/box/sql/mem.c
> : index c4375e1ea..cdb55f858 100644
> : --- a/src/box/sql/mem.c
> : +++ b/src/box/sql/mem.c
> : @@ -78,16 +78,17 @@ mem_str(const struct Mem *mem)
> :  	case MEM_TYPE_NULL:
> :  		return "NULL";
> :  	case MEM_TYPE_STR:
> : -		if (mem->n > STR_VALUE_MAX_LEN)
> : -			return tt_sprintf("'%.*s...", STR_VALUE_MAX_LEN, mem->z);
> : -		return tt_sprintf("'%.*s'", mem->n, mem->z);
> : +		if (mem->n <= STR_VALUE_MAX_LEN)
> : +			return tt_sprintf("string('%.*s')", mem->n, mem->z);
> : +		return tt_sprintf("string('%.*s...)", STR_VALUE_MAX_LEN,
> : +				  mem->z);
>
> Hmm, hmm, see my notice below.
>
> :  	case MEM_TYPE_INT:
> : -		return tt_sprintf("%lld", mem->u.i);
> : +		return tt_sprintf("integer(%lld)", mem->u.i);
> :  	case MEM_TYPE_UINT:
> : -		return tt_sprintf("%llu", mem->u.u);
> : +		return tt_sprintf("integer(%llu)", mem->u.u);
> :  	case MEM_TYPE_DOUBLE:
> :  		sql_snprintf(STR_VALUE_MAX_LEN, buf, "%!.15g", mem->u.r);
> : -		return tt_sprintf("%s", buf);
> : +		return tt_sprintf("double(%s)", buf);
> :  	case MEM_TYPE_BIN: {
> :  		int len = MIN(mem->n, STR_VALUE_MAX_LEN / 2);
> :  		for (int i = 0; i < len; ++i) {
> : @@ -97,22 +98,25 @@ mem_str(const struct Mem *mem)
> :  			buf[2 * i + 1] = n < 10 ? ('0' + n) : ('A' + n - 10);
> :  		}
> :  		if (mem->n > len)
> : -			return tt_sprintf("x'%.*s...", len * 2, buf);
> : -		return tt_sprintf("x'%.*s'", len * 2, buf);
> : +			return tt_sprintf("varbinary(x'%.*s...)", len * 2, buf);
> : +		return tt_sprintf("varbinary(x'%.*s')", len * 2, buf);
>
> As for me it makes no much sense to generate not properly quoted
> literal even if we mean that it's shortened and truncated. IMVHO
>
> Though there is no single proper form, because it's simple message,
> and customer will probably get the reason why it looks so.

My answer from previous review:

I believe that "'" is actually part of value. This way we will get inconsistent
value in case only part of it was printed. This is similar for what we do with
array - in case it is too long we will not close it using "]".


Also, it can be confusing because the quoted value with '...' is actually a
valid STRING, however it may or may not be the same as the original 
value. If we
don't add "" at the end, there will be no misunderstanding.

> :  	}
> :  	case MEM_TYPE_MAP:
> :  	case MEM_TYPE_ARRAY: {
> :  		const char *str = mp_str(mem->z);
> : -		if (strlen(str) <= STR_VALUE_MAX_LEN)
> : -			return str;
> : -		memcpy(buf, str, STR_VALUE_MAX_LEN);
> : -		return tt_sprintf("%.*s...", STR_VALUE_MAX_LEN, buf);
> : +		const char *type = mem_type_to_str(mem);
> : +		uint32_t len = strlen(str);
> : +		uint32_t minlen = MIN(STR_VALUE_MAX_LEN, len);
> : +		memcpy(buf, str, minlen);
> : +		if (len <= STR_VALUE_MAX_LEN)
> : +			return tt_sprintf("%s(%.*s)", type, minlen, buf);
> : +		return tt_sprintf("%s(%.*s...)", type, minlen, buf);
>
>
> :  	}
> :  	case MEM_TYPE_UUID:
> :  		tt_uuid_to_string(&mem->u.uuid, buf);
> : -		return tt_sprintf("'%s'", buf);
> : +		return tt_sprintf("uuid('%s')", buf);
> :  	case MEM_TYPE_BOOL:
> : -		return mem->u.b ? "TRUE" : "FALSE";
> : +		return mem->u.b ? "boolean(TRUE)" : "boolean(FALSE)";
> :  	default:
> :  		return "unknown";
> :  	}
>
> Regards,
> Timur
>

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

* [Tarantool-patches] [PATCH v2 3/4] sql: use proper type names in error descriptions
  2021-07-05 15:27 [Tarantool-patches] [PATCH v2 0/4] sql: fix description of type mismatch error Mergen Imeev via Tarantool-patches
@ 2021-07-05 15:27 ` Mergen Imeev via Tarantool-patches
  0 siblings, 0 replies; 11+ messages in thread
From: Mergen Imeev via Tarantool-patches @ 2021-07-05 15:27 UTC (permalink / raw)
  To: v.shpilevoy; +Cc: tarantool-patches

Prior to this patch, the type mismatch error description and the
inconsistent types error description in some cases displayed type names
that were different from the default ones. After this patch, all types
in these descriptions are described using the default names.

Part of #6176
---
 src/box/sql/func.c               |  12 +-
 src/box/sql/mem.c                |  14 +-
 src/box/sql/vdbe.c               |   2 +-
 test/sql-tap/func.test.lua       |   6 +-
 test/sql-tap/index1.test.lua     |   4 +-
 test/sql-tap/position.test.lua   |  16 +-
 test/sql-tap/select1.test.lua    |   2 +-
 test/sql-tap/sql-errors.test.lua |   8 +-
 test/sql-tap/uuid.test.lua       |  28 +-
 test/sql/boolean.result          | 716 +++++++++++++++----------------
 test/sql/types.result            |  34 +-
 11 files changed, 422 insertions(+), 420 deletions(-)

diff --git a/src/box/sql/func.c b/src/box/sql/func.c
index f93ae867d..e4832f46d 100644
--- a/src/box/sql/func.c
+++ b/src/box/sql/func.c
@@ -324,7 +324,7 @@ position_func(struct sql_context *context, int argc, struct Mem **argv)
 		inconsistent_type_arg = haystack;
 	if (inconsistent_type_arg != NULL) {
 		diag_set(ClientError, ER_INCONSISTENT_TYPES,
-			 "text or varbinary",
+			 "string or varbinary",
 			 mem_type_to_str(inconsistent_type_arg));
 		context->is_aborted = true;
 		return;
@@ -590,7 +590,7 @@ roundFunc(sql_context * context, int argc, sql_value ** argv)
 		return;
 	if (!mem_is_num(argv[0]) && !mem_is_str(argv[0])) {
 		diag_set(ClientError, ER_SQL_TYPE_MISMATCH,
-			 mem_str(argv[0]), "numeric");
+			 mem_str(argv[0]), "number");
 		context->is_aborted = true;
 		return;
 	}
@@ -650,7 +650,7 @@ case_type##ICUFunc(sql_context *context, int argc, sql_value **argv)   \
 	UNUSED_PARAMETER(argc);                                                \
 	if (mem_is_bin(argv[0]) || mem_is_map(argv[0]) ||                      \
 	    mem_is_array(argv[0])) {                                           \
-		diag_set(ClientError, ER_INCONSISTENT_TYPES, "text",           \
+		diag_set(ClientError, ER_INCONSISTENT_TYPES, "string",         \
 			 "varbinary");                                         \
 		context->is_aborted = true;                                    \
 		return;                                                        \
@@ -733,7 +733,7 @@ randomBlob(sql_context * context, int argc, sql_value ** argv)
 	if (mem_is_bin(argv[0]) || mem_is_map(argv[0]) ||
 	    mem_is_array(argv[0])) {
 		diag_set(ClientError, ER_SQL_TYPE_MISMATCH,
-			 mem_str(argv[0]), "numeric");
+			 mem_str(argv[0]), "number");
 		context->is_aborted = true;
 		return;
 	}
@@ -987,7 +987,7 @@ likeFunc(sql_context *context, int argc, sql_value **argv)
 		char *inconsistent_type = rhs_type != MP_STR ?
 					  mem_type_to_str(argv[0]) :
 					  mem_type_to_str(argv[1]);
-		diag_set(ClientError, ER_INCONSISTENT_TYPES, "text",
+		diag_set(ClientError, ER_INCONSISTENT_TYPES, "string",
 			 inconsistent_type);
 		context->is_aborted = true;
 		return;
@@ -1624,7 +1624,7 @@ soundexFunc(sql_context * context, int argc, sql_value ** argv)
 	if (mem_is_bin(argv[0]) || mem_is_map(argv[0]) ||
 	    mem_is_array(argv[0])) {
 		diag_set(ClientError, ER_SQL_TYPE_MISMATCH,
-			 mem_str(argv[0]), "text");
+			 mem_str(argv[0]), "string");
 		context->is_aborted = true;
 		return;
 	}
diff --git a/src/box/sql/mem.c b/src/box/sql/mem.c
index 728d3c9a7..6303fcdf0 100644
--- a/src/box/sql/mem.c
+++ b/src/box/sql/mem.c
@@ -1456,12 +1456,12 @@ mem_concat(struct Mem *a, struct Mem *b, struct Mem *result)
 	/* Concatenation operation can be applied only to strings and blobs. */
 	if (((b->type & (MEM_TYPE_STR | MEM_TYPE_BIN)) == 0)) {
 		diag_set(ClientError, ER_INCONSISTENT_TYPES,
-			 "text or varbinary", mem_type_to_str(b));
+			 "string or varbinary", mem_type_to_str(b));
 		return -1;
 	}
 	if (((a->type & (MEM_TYPE_STR | MEM_TYPE_BIN)) == 0)) {
 		diag_set(ClientError, ER_INCONSISTENT_TYPES,
-			 "text or varbinary", mem_type_to_str(a));
+			 "string or varbinary", mem_type_to_str(a));
 		return -1;
 	}
 
@@ -1550,12 +1550,12 @@ arithmetic_prepare(const struct Mem *left, const struct Mem *right,
 {
 	if (get_number(right, b) != 0) {
 		diag_set(ClientError, ER_SQL_TYPE_MISMATCH, mem_str(right),
-			 "numeric");
+			 "number");
 		return -1;
 	}
 	if (get_number(left, a) != 0) {
 		diag_set(ClientError, ER_SQL_TYPE_MISMATCH, mem_str(left),
-			 "numeric");
+			 "number");
 		return -1;
 	}
 	assert(a->type != 0 && b->type != 0);
@@ -2071,15 +2071,17 @@ mem_type_to_str(const struct Mem *p)
 	case MEM_TYPE_NULL:
 		return "NULL";
 	case MEM_TYPE_STR:
-		return "text";
+		return "string";
 	case MEM_TYPE_INT:
 		return "integer";
 	case MEM_TYPE_UINT:
 		return "unsigned";
 	case MEM_TYPE_DOUBLE:
-		return "real";
+		return "double";
 	case MEM_TYPE_ARRAY:
+		return "array";
 	case MEM_TYPE_MAP:
+		return "map";
 	case MEM_TYPE_BIN:
 		return "varbinary";
 	case MEM_TYPE_BOOL:
diff --git a/src/box/sql/vdbe.c b/src/box/sql/vdbe.c
index 32d02d96e..03f420bca 100644
--- a/src/box/sql/vdbe.c
+++ b/src/box/sql/vdbe.c
@@ -1674,7 +1674,7 @@ case OP_Ge: {             /* same as TK_GE, jump, in1, in3 */
 				mem_cast_implicit_old(pIn3, type) != 0 ?
 				mem_str(pIn3) : mem_str(pIn1);
 			diag_set(ClientError, ER_SQL_TYPE_MISMATCH, str,
-				 "numeric");
+				 "number");
 			goto abort_due_to_error;
 		}
 	} else {
diff --git a/test/sql-tap/func.test.lua b/test/sql-tap/func.test.lua
index ae6bc9ddd..66e525871 100755
--- a/test/sql-tap/func.test.lua
+++ b/test/sql-tap/func.test.lua
@@ -2931,7 +2931,7 @@ test:do_catchsql_test(
         SELECT ROUND(X'FF')
     ]], {
         -- <func-76.1>
-        1, "Type mismatch: can not convert x'FF' to numeric"
+        1, "Type mismatch: can not convert x'FF' to number"
         -- </func-76.1>
     })
 
@@ -2941,7 +2941,7 @@ test:do_catchsql_test(
         SELECT RANDOMBLOB(X'FF')
     ]], {
         -- <func-76.2>
-        1, "Type mismatch: can not convert x'FF' to numeric"
+        1, "Type mismatch: can not convert x'FF' to number"
         -- </func-76.2>
     })
 
@@ -2951,7 +2951,7 @@ test:do_catchsql_test(
         SELECT SOUNDEX(X'FF')
     ]], {
         -- <func-76.3>
-        1, "Type mismatch: can not convert x'FF' to text"
+        1, "Type mismatch: can not convert x'FF' to string"
         -- </func-76.3>
     })
 
diff --git a/test/sql-tap/index1.test.lua b/test/sql-tap/index1.test.lua
index e03e284aa..9e57639cc 100755
--- a/test/sql-tap/index1.test.lua
+++ b/test/sql-tap/index1.test.lua
@@ -778,7 +778,7 @@ test:do_catchsql_test(
         SELECT c FROM t6 WHERE a>123;
     ]], {
         -- <index-14.6>
-        1, "Type mismatch: can not convert '' to numeric"
+        1, "Type mismatch: can not convert '' to number"
         -- </index-14.6>
     })
 
@@ -788,7 +788,7 @@ test:do_catchsql_test(
         SELECT c FROM t6 WHERE a>=123;
     ]], {
         -- <index-14.7>
-        1, "Type mismatch: can not convert '' to numeric"
+        1, "Type mismatch: can not convert '' to number"
         -- </index-14.7>
     })
 
diff --git a/test/sql-tap/position.test.lua b/test/sql-tap/position.test.lua
index 506efe0f4..dd4fa62d0 100755
--- a/test/sql-tap/position.test.lua
+++ b/test/sql-tap/position.test.lua
@@ -228,7 +228,7 @@ test:do_test(
         return test:catchsql "SELECT position(34, 12345);"
     end, {
         -- <position-1.23>
-        1, "Inconsistent types: expected text or varbinary got unsigned"
+        1, "Inconsistent types: expected string or varbinary got unsigned"
         -- </position-1.23>
     })
 
@@ -238,7 +238,7 @@ test:do_test(
         return test:catchsql "SELECT position(34, 123456.78);"
     end, {
         -- <position-1.24>
-        1, "Inconsistent types: expected text or varbinary got real"
+        1, "Inconsistent types: expected string or varbinary got double"
         -- </position-1.24>
     })
 
@@ -248,7 +248,7 @@ test:do_test(
         return test:catchsql "SELECT position(x'3334', 123456.78);"
     end, {
         -- <position-1.25>
-        1, "Inconsistent types: expected text or varbinary got real"
+        1, "Inconsistent types: expected string or varbinary got double"
         -- </position-1.25>
     })
 
@@ -554,7 +554,7 @@ test:do_test(
         return test:catchsql("SELECT position('x', x'78c3a4e282ac79');")
     end, {
         -- <position-1.54>
-        1, "Inconsistent types: expected text got varbinary"
+        1, "Inconsistent types: expected string got varbinary"
         -- </position-1.54>
     })
 
@@ -564,7 +564,7 @@ test:do_test(
         return test:catchsql "SELECT position('y', x'78c3a4e282ac79');"
     end, {
         -- <position-1.55>
-        1, "Inconsistent types: expected text got varbinary"
+        1, "Inconsistent types: expected string got varbinary"
         -- </position-1.55>
     })
 
@@ -614,7 +614,7 @@ test:do_test(
         return test:catchsql "SELECT position(x'79', 'xä€y');"
     end, {
         -- <position-1.57.1>
-        1, "Inconsistent types: expected varbinary got text"
+        1, "Inconsistent types: expected varbinary got string"
         -- </position-1.57.1>
     })
 
@@ -624,7 +624,7 @@ test:do_test(
         return test:catchsql "SELECT position(x'a4', 'xä€y');"
     end, {
         -- <position-1.57.2>
-        1, "Inconsistent types: expected varbinary got text"
+        1, "Inconsistent types: expected varbinary got string"
         -- </position-1.57.2>
     })
 
@@ -634,7 +634,7 @@ test:do_test(
         return test:catchsql "SELECT position('y', x'78c3a4e282ac79');"
     end, {
         -- <position-1.57.3>
-        1, "Inconsistent types: expected text got varbinary"
+        1, "Inconsistent types: expected string got varbinary"
         -- </position-1.57.3>
     })
 
diff --git a/test/sql-tap/select1.test.lua b/test/sql-tap/select1.test.lua
index 1a7a4ee82..57c5c2cb3 100755
--- a/test/sql-tap/select1.test.lua
+++ b/test/sql-tap/select1.test.lua
@@ -320,7 +320,7 @@ test:do_catchsql_test(
         SELECT count(*),count(a),count(b) FROM t4 WHERE b=5
     ]], {
         -- <select1-2.5.3>
-        1, "Type mismatch: can not convert 'This is a string that is too big to fit inside a NBFS buffer' to numeric"
+        1, "Type mismatch: can not convert 'This is a string that is too big to fit inside a NBFS buffer' to number"
         -- </select1-2.5.3>
     })
 
diff --git a/test/sql-tap/sql-errors.test.lua b/test/sql-tap/sql-errors.test.lua
index 52276c27b..66dc77fa1 100755
--- a/test/sql-tap/sql-errors.test.lua
+++ b/test/sql-tap/sql-errors.test.lua
@@ -696,7 +696,7 @@ test:do_catchsql_test(
 		SELECT X'ff' + 1;
 	]], {
 		-- <sql-errors-2.1>
-		1, "Type mismatch: can not convert x'FF' to numeric"
+		1, "Type mismatch: can not convert x'FF' to number"
 		-- </sql-errors-2.1>
 	})
 
@@ -706,7 +706,7 @@ test:do_catchsql_test(
 		SELECT X'ff' - 1;
 	]], {
 		-- <sql-errors-2.2>
-		1, "Type mismatch: can not convert x'FF' to numeric"
+		1, "Type mismatch: can not convert x'FF' to number"
 		-- </sql-errors-2.2>
 	})
 
@@ -716,7 +716,7 @@ test:do_catchsql_test(
 		SELECT X'ff' * 1;
 	]], {
 		-- <sql-errors-2.3>
-		1, "Type mismatch: can not convert x'FF' to numeric"
+		1, "Type mismatch: can not convert x'FF' to number"
 		-- </sql-errors-2.3>
 	})
 
@@ -726,7 +726,7 @@ test:do_catchsql_test(
 		SELECT X'ff' / 1;
 	]], {
 		-- <sql-errors-2.4>
-		1, "Type mismatch: can not convert x'FF' to numeric"
+		1, "Type mismatch: can not convert x'FF' to number"
 		-- </sql-errors-2.4>
 	})
 
diff --git a/test/sql-tap/uuid.test.lua b/test/sql-tap/uuid.test.lua
index 1fc99916a..c9e1b4fcc 100755
--- a/test/sql-tap/uuid.test.lua
+++ b/test/sql-tap/uuid.test.lua
@@ -337,7 +337,7 @@ test:do_catchsql_test(
     [[
         SELECT u LIKE 'a' from t2;
     ]], {
-        1, "Inconsistent types: expected text got uuid"
+        1, "Inconsistent types: expected string got uuid"
     })
 
 test:do_execsql_test(
@@ -395,7 +395,7 @@ test:do_catchsql_test(
     [[
         SELECT POSITION(u, '1') from t2;
     ]], {
-        1, "Inconsistent types: expected text or varbinary got uuid"
+        1, "Inconsistent types: expected string or varbinary got uuid"
     })
 
 test:do_execsql_test(
@@ -421,7 +421,7 @@ test:do_catchsql_test(
     [[
         SELECT ROUND(u) from t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to numeric"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to number"
     })
 
 test:do_execsql_test(
@@ -505,7 +505,7 @@ test:do_catchsql_test(
     [[
         SELECT u || u from t2;
     ]], {
-        1, "Inconsistent types: expected text or varbinary got uuid"
+        1, "Inconsistent types: expected string or varbinary got uuid"
     })
 
 local func = {language = 'Lua', body = 'function(x) return type(x) end',
@@ -971,7 +971,7 @@ test:do_catchsql_test(
     [[
         SELECT -u FROM t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to numeric"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to number"
     })
 
 test:do_catchsql_test(
@@ -979,7 +979,7 @@ test:do_catchsql_test(
     [[
         SELECT u + 1 FROM t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to numeric"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to number"
     })
 
 test:do_catchsql_test(
@@ -987,7 +987,7 @@ test:do_catchsql_test(
     [[
         SELECT u - 1 FROM t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to numeric"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to number"
     })
 
 test:do_catchsql_test(
@@ -995,7 +995,7 @@ test:do_catchsql_test(
     [[
         SELECT u * 1 FROM t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to numeric"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to number"
     })
 
 test:do_catchsql_test(
@@ -1003,7 +1003,7 @@ test:do_catchsql_test(
     [[
         SELECT u / 1 FROM t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to numeric"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to number"
     })
 
 test:do_catchsql_test(
@@ -1011,7 +1011,7 @@ test:do_catchsql_test(
     [[
         SELECT u % 1 FROM t2;
     ]], {
-        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to numeric"
+        1, "Type mismatch: can not convert '11111111-1111-1111-1111-111111111111' to number"
     })
 
 -- Check that bitwise operations work with UUIDs as intended.
@@ -1118,7 +1118,7 @@ test:do_catchsql_test(
     [[
         SELECT u > '1' FROM t2;
     ]], {
-        1, "Type mismatch: can not convert text to uuid"
+        1, "Type mismatch: can not convert string to uuid"
     })
 
 test:do_catchsql_test(
@@ -1126,7 +1126,7 @@ test:do_catchsql_test(
     [[
         SELECT u > 1.5 FROM t2;
     ]], {
-        1, "Type mismatch: can not convert real to uuid"
+        1, "Type mismatch: can not convert double to uuid"
     })
 
 test:do_catchsql_test(
@@ -1182,7 +1182,7 @@ test:do_catchsql_test(
     [[
         SELECT u = '1' FROM t2;
     ]], {
-        1, "Type mismatch: can not convert text to uuid"
+        1, "Type mismatch: can not convert string to uuid"
     })
 
 test:do_catchsql_test(
@@ -1190,7 +1190,7 @@ test:do_catchsql_test(
     [[
         SELECT u = 1.5 FROM t2;
     ]], {
-        1, "Type mismatch: can not convert real to uuid"
+        1, "Type mismatch: can not convert double to uuid"
     })
 
 test:do_catchsql_test(
diff --git a/test/sql/boolean.result b/test/sql/boolean.result
index dbd31fbb5..320525d36 100644
--- a/test/sql/boolean.result
+++ b/test/sql/boolean.result
@@ -138,12 +138,12 @@ INSERT INTO ts(s) VALUES ('abc'), (12.5);
 SELECT s FROM ts WHERE s = true;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT s FROM ts WHERE s < true;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT s FROM ts WHERE s IN (true, 1, 'abcd');
  | ---
@@ -1122,245 +1122,245 @@ SELECT a, a1, a OR a1 FROM t, t6;
 SELECT -true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT -false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT -a FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 
 SELECT true + true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT true + false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT false + true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT false + false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT true - true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT true - false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT false - true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT false - false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT true * true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT true * false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT false * true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT false * false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT true / true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT true / false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT false / true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT false / false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT true % true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT true % false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT false % true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT false % false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 
 SELECT a, true + a FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a, false + a FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a, true - a FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a, false - a FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a, true * a FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a, false * a FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a, true / a FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a, false / a FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a, true % a FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a, false % a FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a, a + true FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a, a + false FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a, a - true FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a, a - false FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a, a * true FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a, a * false FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a, a / true FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a, a / false FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a, a % true FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a, a % false FROM t;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 
 SELECT a, a1, a + a1 FROM t, t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a, a1, a - a1 FROM t, t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a, a1, a * a1 FROM t, t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a, a1, a / a1 FROM t, t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a, a1, a % a1 FROM t, t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 
 SELECT ~true;
@@ -1560,64 +1560,64 @@ SELECT a, a1, a >> a1 FROM t, t6;
 SELECT true || true;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 SELECT true || false;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 SELECT false || true;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 SELECT false || false;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 
 SELECT a, true || a FROM t;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 SELECT a, false || a FROM t;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 SELECT a, a || true FROM t;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 SELECT a, a || false FROM t;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 
 SELECT a1, a1 || a1 FROM t6;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 SELECT a2, a2 || a2 FROM t6;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 SELECT a1, a2, a1 || a1 FROM t6;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 SELECT a1, a2, a2 || a2 FROM t6;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 
 -- Check comparisons.
@@ -2643,405 +2643,405 @@ SELECT a2, b, b OR a2 FROM t6, t7;
 SELECT true + 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT false + 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT true - 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT false - 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT true * 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT false * 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT true / 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT false / 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT true % 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT false % 2;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT 2 + true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT 2 + false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT 2 - true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT 2 - false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT 2 * true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT 2 * false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT 2 / true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT 2 / false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT 2 % true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT 2 % false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 
 SELECT a1, a1 + 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, a1 - 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, a1 * 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, a1 / 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, a1 % 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, 2 + a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, 2 - a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, 2 * a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, 2 / a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, 2 % a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a2, a2 + 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, a2 - 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, a2 * 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, a2 / 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, a2 % 2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, 2 + a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, 2 - a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, 2 * a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, 2 / a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, 2 % a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 
 SELECT b, true + b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT b, false + b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT b, true - b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT b, false - b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT b, true * b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT b, false * b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT b, true / b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT b, false / b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT b, true % b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT b, false % b FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT b, b + true FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT b, b + false FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT b, b - true FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT b, b - false FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT b, b * true FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT b, b * false FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT b, b / true FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT b, b / false FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT b, b % true FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT b, b % false FROM t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 
 SELECT a1, b, a1 + b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, b, a1 - b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, b, a1 * b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, b, a1 / b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, b, a1 % b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, b, b + a1 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, b, b - a1 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, b, b * a1 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, b, b / a1 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, b, b % a1 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a2, b, a2 + b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, b, a2 - b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, b, a2 * b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, b, a2 / b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, b, a2 % b FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, b, b + a2 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, b, b - a2 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, b, b * a2 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, b, b / a2 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, b, b % a2 FROM t6, t7;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 
 SELECT true & 2;
@@ -4112,897 +4112,897 @@ SELECT a2, c, c OR a2 FROM t6, t8;
 SELECT true + 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT false + 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT true - 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT false - 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT true * 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT false * 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT true / 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT false / 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT true % 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT false % 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT 2.3 + true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT 2.3 + false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT 2.3 - true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT 2.3 - false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT 2.3 * true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT 2.3 * false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT 2.3 / true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT 2.3 / false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT 2.3 % true;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT 2.3 % false;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 
 SELECT a1, a1 + 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, a1 - 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, a1 * 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, a1 / 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, a1 % 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, 2.3 + a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, 2.3 - a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, 2.3 * a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, 2.3 / a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, 2.3 % a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a2, a2 + 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, a2 - 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, a2 * 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, a2 / 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, a2 % 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, 2.3 + a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, 2.3 - a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, 2.3 * a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, 2.3 / a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, 2.3 % a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 
 SELECT c, true + c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT c, false + c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT c, true - c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT c, false - c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT c, true * c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT c, false * c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT c, true / c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT c, false / c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT c, true % c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT c, false % c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT c, c + true FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT c, c + false FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT c, c - true FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT c, c - false FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT c, c * true FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT c, c * false FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT c, c / true FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT c, c / false FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT c, c % true FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT c, c % false FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 
 SELECT a1, c, a1 + c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, c, a1 - c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, c, a1 * c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, c, a1 / c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, c, a1 % c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, c, c + a1 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, c, c - a1 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, c, c * a1 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, c, c / a1 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a1, c, c % a1 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert FALSE to numeric'
+ | - 'Type mismatch: can not convert FALSE to number'
  | ...
 SELECT a2, c, a2 + c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, c, a2 - c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, c, a2 * c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, c, a2 / c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, c, a2 % c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, c, c + a2 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, c, c - a2 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, c, c * a2 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, c, c / a2 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 SELECT a2, c, c % a2 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert TRUE to numeric'
+ | - 'Type mismatch: can not convert TRUE to number'
  | ...
 
 SELECT true > 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT false > 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT true < 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT false < 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT 2.3 > true;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT 2.3 > false;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT 2.3 < true;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT 2.3 < false;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 
 SELECT a1, a1 > 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a1, a1 < 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a1, 2.3 > a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a1, 2.3 < a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, a2 > 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, a2 < 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, 2.3 > a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, 2.3 < a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 
 SELECT c, true > c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, false > c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, true < c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, false < c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, c > true FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, c > false FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, c < true FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, c < false FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 
 SELECT a1, c, a1 > c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a1, c, a1 < c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a1, c, c > a1 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a1, c, c < a1 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, c, a2 > c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, c, a2 < c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, c, c > a2 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, c, c < a2 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 
 SELECT true >= 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT false >= 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT true <= 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT false <= 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT 2.3 >= true;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT 2.3 >= false;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT 2.3 <= true;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT 2.3 <= false;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 
 SELECT a1, a1 >= 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a1, a1 <= 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a1, 2.3 >= a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a1, 2.3 <= a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, a2 >= 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, a2 <= 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, 2.3 >= a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, 2.3 <= a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 
 SELECT c, true >= c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, false >= c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, true <= c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, false <= c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, c >= true FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, c >= false FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, c <= true FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, c <= false FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 
 SELECT a1, c, a1 >= c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a1, c, a1 <= c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a1, c, c >= a1 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a1, c, c <= a1 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, c, a2 >= c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, c, a2 <= c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, c, c >= a2 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, c, c <= a2 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 
 SELECT true == 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT false == 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT true != 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT false != 2.3;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT 2.3 == true;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT 2.3 == false;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT 2.3 != true;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT 2.3 != false;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 
 SELECT a1, a1 == 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a1, a1 != 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a1, 2.3 == a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a1, 2.3 != a1 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, a2 == 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, a2 != 2.3 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, 2.3 == a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, 2.3 != a2 FROM t6
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 
 SELECT c, true == c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, false == c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, true != c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, false != c FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, c == true FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, c == false FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, c != true FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT c, c != false FROM t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 
 SELECT a1, c, a1 == c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a1, c, a1 != c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a1, c, c == a1 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a1, c, c != a1 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, c, a2 == c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, c, a2 != c FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, c, c == a2 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, c, c != a2 FROM t6, t8;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 
 SELECT true IN (0.1, 1.2, 2.3, 3.4);
@@ -5061,22 +5061,22 @@ SELECT a2 IN (SELECT c FROM t8) FROM t6 LIMIT 1;
 SELECT true BETWEEN 0.1 and 9.9;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT false BETWEEN 0.1 and 9.9;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a1, a1 BETWEEN 0.1 and 9.9 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 SELECT a2, a2 BETWEEN 0.1 and 9.9 FROM t6;
  | ---
  | - null
- | - 'Type mismatch: can not convert real to boolean'
+ | - 'Type mismatch: can not convert double to boolean'
  | ...
 
 -- Check interaction of BOOLEAN and TEXT.
@@ -5272,187 +5272,187 @@ SELECT a2, d, d OR a2 FROM t6, t9;
 SELECT true > 'abc';
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT false > 'abc';
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT true < 'abc';
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT false < 'abc';
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT 'abc' > true;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT 'abc' > false;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT 'abc' < true;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT 'abc' < false;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 
 SELECT d, true > d FROM t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT d, false > d FROM t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT d, true < d FROM t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT d, false < d FROM t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT d, d > true FROM t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT d, d > false FROM t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT d, d < true FROM t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT d, d < false FROM t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 
 SELECT a1, d, a1 > d FROM t6, t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT a1, d, a1 < d FROM t6, t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT a1, d, d > a1 FROM t6, t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT a1, d, d < a1 FROM t6, t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT a2, d, a2 > d FROM t6, t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT a2, d, a2 < d FROM t6, t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT a2, d, d > a2 FROM t6, t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 SELECT a2, d, d < a2 FROM t6, t9;
  | ---
  | - null
- | - 'Type mismatch: can not convert text to boolean'
+ | - 'Type mismatch: can not convert string to boolean'
  | ...
 
 SELECT true || 'abc';
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 SELECT false || 'abc';
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 SELECT 'abc' || false;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 SELECT 'abc' || true;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 
 SELECT d, true || d FROM t9;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 SELECT d, false || d FROM t9;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 SELECT d, d || false FROM t9;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 SELECT d, d || true FROM t9;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 
 SELECT d, a1 || d FROM t6, t9;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 SELECT d, a2 || d FROM t6, t9;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 SELECT d, d || a1 FROM t6, t9;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 SELECT d, d || a2 FROM t6, t9;
  | ---
  | - null
- | - 'Inconsistent types: expected text or varbinary got boolean'
+ | - 'Inconsistent types: expected string or varbinary got boolean'
  | ...
 
 --
diff --git a/test/sql/types.result b/test/sql/types.result
index 219559619..a9a5fd536 100644
--- a/test/sql/types.result
+++ b/test/sql/types.result
@@ -158,39 +158,39 @@ sp:drop()
 box.execute("SELECT 'abc' || 1;")
 ---
 - null
-- 'Inconsistent types: expected text or varbinary got unsigned'
+- 'Inconsistent types: expected string or varbinary got unsigned'
 ...
 box.execute("SELECT 'abc' || 1.123;")
 ---
 - null
-- 'Inconsistent types: expected text or varbinary got real'
+- 'Inconsistent types: expected string or varbinary got double'
 ...
 box.execute("SELECT 1 || 'abc';")
 ---
 - null
-- 'Inconsistent types: expected text or varbinary got unsigned'
+- 'Inconsistent types: expected string or varbinary got unsigned'
 ...
 box.execute("SELECT 1.123 || 'abc';")
 ---
 - null
-- 'Inconsistent types: expected text or varbinary got real'
+- 'Inconsistent types: expected string or varbinary got double'
 ...
 box.execute("SELECt 'a' || 'b' || 1;")
 ---
 - null
-- 'Inconsistent types: expected text or varbinary got unsigned'
+- 'Inconsistent types: expected string or varbinary got unsigned'
 ...
 -- What is more, they must be of the same type.
 --
 box.execute("SELECT 'abc' || randomblob(5);")
 ---
 - null
-- 'Inconsistent types: expected text got varbinary'
+- 'Inconsistent types: expected string got varbinary'
 ...
 box.execute("SELECT randomblob(5) || 'x';")
 ---
 - null
-- 'Inconsistent types: expected varbinary got text'
+- 'Inconsistent types: expected varbinary got string'
 ...
 -- Result of BLOBs concatenation must be BLOB.
 --
@@ -215,17 +215,17 @@ box.execute("INSERT INTO t1 VALUES (randomblob(5));")
 box.execute("SELECT * FROM t1 WHERE s LIKE 'blob';")
 ---
 - null
-- 'Inconsistent types: expected text got varbinary'
+- 'Inconsistent types: expected string got varbinary'
 ...
 box.execute("SELECT * FROM t1 WHERE 'blob' LIKE s;")
 ---
 - null
-- 'Inconsistent types: expected text got varbinary'
+- 'Inconsistent types: expected string got varbinary'
 ...
 box.execute("SELECT * FROM t1 WHERE 'blob' LIKE x'0000';")
 ---
 - null
-- 'Inconsistent types: expected text got varbinary'
+- 'Inconsistent types: expected string got varbinary'
 ...
 box.execute("SELECT s LIKE NULL FROM t1;")
 ---
@@ -246,12 +246,12 @@ box.execute("INSERT INTO t1 VALUES (1);")
 box.execute("SELECT * FROM t1 WHERE s LIKE 'int';")
 ---
 - null
-- 'Inconsistent types: expected text got unsigned'
+- 'Inconsistent types: expected string got unsigned'
 ...
 box.execute("SELECT * FROM t1 WHERE 'int' LIKE 4;")
 ---
 - null
-- 'Inconsistent types: expected text got unsigned'
+- 'Inconsistent types: expected string got unsigned'
 ...
 box.execute("SELECT NULL LIKE s FROM t1;")
 ---
@@ -354,7 +354,7 @@ box.execute("SELECT * FROM tboolean WHERE s1 = 1;")
 box.execute("SELECT * FROM tboolean WHERE s1 = 1.123;")
 ---
 - null
-- 'Type mismatch: can not convert real to boolean'
+- 'Type mismatch: can not convert double to boolean'
 ...
 box.space.TBOOLEAN:drop()
 ---
@@ -1245,12 +1245,12 @@ box.execute("SELECT * FROM t WHERE v = 1")
 box.execute("SELECT * FROM t WHERE v = 1.123")
 ---
 - null
-- 'Type mismatch: can not convert real to varbinary'
+- 'Type mismatch: can not convert double to varbinary'
 ...
 box.execute("SELECT * FROM t WHERE v = 'str'")
 ---
 - null
-- 'Type mismatch: can not convert text to varbinary'
+- 'Type mismatch: can not convert string to varbinary'
 ...
 box.execute("SELECT * FROM t WHERE v = x'616263'")
 ---
@@ -1312,12 +1312,12 @@ box.execute("SELECT group_concat(v) FROM t;")
 box.execute("SELECT lower(v) FROM t;")
 ---
 - null
-- 'Inconsistent types: expected text got varbinary'
+- 'Inconsistent types: expected string got varbinary'
 ...
 box.execute("SELECT upper(v) FROM t;")
 ---
 - null
-- 'Inconsistent types: expected text got varbinary'
+- 'Inconsistent types: expected string got varbinary'
 ...
 box.execute("SELECT abs(v) FROM t;")
 ---
-- 
2.25.1


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

end of thread, other threads:[~2021-07-13 10:17 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-13  7:03 [Tarantool-patches] [PATCH v2 0/4] sql: fix description of type mismatch errors Mergen Imeev via Tarantool-patches
2021-07-13  7:03 ` [Tarantool-patches] [PATCH v2 1/4] sql: truncate values in type mismatch error Mergen Imeev via Tarantool-patches
2021-07-13  8:51   ` Timur Safin via Tarantool-patches
2021-07-13  7:03 ` [Tarantool-patches] [PATCH v2 2/4] sql: properly show " Mergen Imeev via Tarantool-patches
2021-07-13  8:51   ` Timur Safin via Tarantool-patches
2021-07-13  7:03 ` [Tarantool-patches] [PATCH v2 3/4] sql: use proper type names in error descriptions Mergen Imeev via Tarantool-patches
2021-07-13  8:51   ` Timur Safin via Tarantool-patches
2021-07-13  7:04 ` [Tarantool-patches] [PATCH v2 4/4] sql: make type mismatch errors more informative Mergen Imeev via Tarantool-patches
2021-07-13  8:51   ` Timur Safin via Tarantool-patches
2021-07-13 10:17     ` Mergen Imeev via Tarantool-patches
  -- strict thread matches above, loose matches on Subject: below --
2021-07-05 15:27 [Tarantool-patches] [PATCH v2 0/4] sql: fix description of type mismatch error Mergen Imeev via Tarantool-patches
2021-07-05 15:27 ` [Tarantool-patches] [PATCH v2 3/4] sql: use proper type names in error descriptions Mergen Imeev via Tarantool-patches

Tarantool development patches archive

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://lists.tarantool.org/tarantool-patches/0 tarantool-patches/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 tarantool-patches tarantool-patches/ https://lists.tarantool.org/tarantool-patches \
		tarantool-patches@dev.tarantool.org.
	public-inbox-index tarantool-patches

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git