Tarantool development patches archive
 help / color / mirror / Atom feed
* [tarantool-patches] [PATCH 0/2] sql: boolean introduction follow-ups
@ 2019-06-25 11:42 Nikita Pettik
  2019-06-25 11:42 ` [tarantool-patches] [PATCH 1/2] sqltester: don't convert booleans to 0/1 numerics Nikita Pettik
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Nikita Pettik @ 2019-06-25 11:42 UTC (permalink / raw)
  To: tarantool-patches; +Cc: Nikita Pettik

Branch: https://github.com/tarantool/tarantool/tree/np/boolean-follow-ups

First patch gets rid of redundant conversion of results from booleans
to numeric values 0 and 1 in testing framework (sqltester).

Second one fixes obvious bug during comparison of booleans with values
of other types.

Nikita Pettik (2):
  sqltester: don't convert booleans to 0/1 numerics
  sql: fix antisymmetric boolean comparison in VDBE

 src/box/sql/vdbeaux.c                              |   2 +
 test/sql-tap/atof1.test.lua                        |   2 +-
 test/sql-tap/autoinc.test.lua                      |   2 +-
 test/sql-tap/cse.test.lua                          |  10 +-
 test/sql-tap/e_select1.test.lua                    |   8 +-
 test/sql-tap/func.test.lua                         |  42 +++---
 test/sql-tap/func5.test.lua                        |  30 ++++-
 .../gh-3251-string-pattern-comparison.test.lua     |  18 +--
 test/sql-tap/in1.test.lua                          |  26 ++--
 test/sql-tap/in2.test.lua                          |   2 +-
 test/sql-tap/in3.test.lua                          |  16 +--
 test/sql-tap/in4.test.lua                          |   2 +-
 test/sql-tap/insert1.test.lua                      |   4 +-
 test/sql-tap/lua/sqltester.lua                     |  24 ----
 test/sql-tap/lua_sql.test.lua                      |   2 +-
 test/sql-tap/misc1.test.lua                        |   6 +-
 test/sql-tap/select1.test.lua                      |   2 +-
 test/sql-tap/select7.test.lua                      |   4 +-
 test/sql-tap/selectG.test.lua                      |   2 +-
 test/sql-tap/sql-errors.test.lua                   |   4 +-
 test/sql-tap/subquery.test.lua                     |   6 +-
 test/sql-tap/subselect.test.lua                    |   4 +-
 test/sql-tap/tkt-80e031a00f.test.lua               | 148 ++++++++++-----------
 test/sql-tap/tkt-a7b7803e.test.lua                 |  16 +--
 test/sql-tap/tkt-b351d95f9.test.lua                |   2 +-
 test/sql-tap/tkt1473.test.lua                      |  30 ++---
 test/sql-tap/tkt3346.test.lua                      |   2 +-
 test/sql-tap/tkt3493.test.lua                      |  28 ++--
 test/sql-tap/triggerC.test.lua                     |   2 +-
 test/sql-tap/types.test.lua                        |   2 +-
 test/sql-tap/where5.test.lua                       |   4 +-
 test/sql-tap/whereB.test.lua                       | 102 +++++++-------
 test/sql-tap/with2.test.lua                        |   6 +-
 33 files changed, 283 insertions(+), 277 deletions(-)

-- 
2.15.1

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

* [tarantool-patches] [PATCH 1/2] sqltester: don't convert booleans to 0/1 numerics
  2019-06-25 11:42 [tarantool-patches] [PATCH 0/2] sql: boolean introduction follow-ups Nikita Pettik
@ 2019-06-25 11:42 ` Nikita Pettik
  2019-06-25 11:42 ` [tarantool-patches] [PATCH 2/2] sql: fix antisymmetric boolean comparison in VDBE Nikita Pettik
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Nikita Pettik @ 2019-06-25 11:42 UTC (permalink / raw)
  To: tarantool-patches; +Cc: Nikita Pettik

When there were no booleans in SQL, to represent them numeric values 0
and 1 were involved. However, recently booleans have been introduced in
SQL, so values of result set can take boolean values. Hence, it makes
no sense to continue converting booleans to numeric, so we can use
directly booleans.
---
 test/sql-tap/atof1.test.lua                        |   2 +-
 test/sql-tap/autoinc.test.lua                      |   2 +-
 test/sql-tap/cse.test.lua                          |  10 +-
 test/sql-tap/e_select1.test.lua                    |   8 +-
 test/sql-tap/func.test.lua                         |  42 +++---
 .../gh-3251-string-pattern-comparison.test.lua     |  18 +--
 test/sql-tap/in1.test.lua                          |  24 ++--
 test/sql-tap/in2.test.lua                          |   2 +-
 test/sql-tap/in3.test.lua                          |  16 +--
 test/sql-tap/in4.test.lua                          |   2 +-
 test/sql-tap/insert1.test.lua                      |   4 +-
 test/sql-tap/lua/sqltester.lua                     |  24 ----
 test/sql-tap/lua_sql.test.lua                      |   2 +-
 test/sql-tap/misc1.test.lua                        |   6 +-
 test/sql-tap/select1.test.lua                      |   2 +-
 test/sql-tap/select7.test.lua                      |   4 +-
 test/sql-tap/selectG.test.lua                      |   2 +-
 test/sql-tap/sql-errors.test.lua                   |   4 +-
 test/sql-tap/subquery.test.lua                     |   6 +-
 test/sql-tap/subselect.test.lua                    |   4 +-
 test/sql-tap/tkt-80e031a00f.test.lua               | 148 ++++++++++-----------
 test/sql-tap/tkt-a7b7803e.test.lua                 |  16 +--
 test/sql-tap/tkt-b351d95f9.test.lua                |   2 +-
 test/sql-tap/tkt1473.test.lua                      |  30 ++---
 test/sql-tap/tkt3346.test.lua                      |   2 +-
 test/sql-tap/tkt3493.test.lua                      |  28 ++--
 test/sql-tap/triggerC.test.lua                     |   2 +-
 test/sql-tap/types.test.lua                        |   2 +-
 test/sql-tap/where5.test.lua                       |   4 +-
 test/sql-tap/whereB.test.lua                       | 102 +++++++-------
 test/sql-tap/with2.test.lua                        |   6 +-
 31 files changed, 251 insertions(+), 275 deletions(-)

diff --git a/test/sql-tap/atof1.test.lua b/test/sql-tap/atof1.test.lua
index e4de744d8..40778cd81 100755
--- a/test/sql-tap/atof1.test.lua
+++ b/test/sql-tap/atof1.test.lua
@@ -48,7 +48,7 @@ for i = 1, 10000 - 1, 1 do
             local y = test:execsql(string.format("SELECT %s=CAST(quote(%s) AS real)",x, x))
             return y
         end, {
-            1
+            true
         })
 
 end
diff --git a/test/sql-tap/autoinc.test.lua b/test/sql-tap/autoinc.test.lua
index 3e3eaad14..260196845 100755
--- a/test/sql-tap/autoinc.test.lua
+++ b/test/sql-tap/autoinc.test.lua
@@ -43,7 +43,7 @@ test:do_execsql_test(
         SELECT * FROM "_sequence";
     ]], {
         -- <autoinc-1.3>
-        1,1,"T1",1,0,9223372036854775807LL,1,0,0
+        1,1,"T1",1,0,9223372036854775807LL,1,0,false
         -- </autoinc-1.3>
     })
 
diff --git a/test/sql-tap/cse.test.lua b/test/sql-tap/cse.test.lua
index 78d0d2046..341b6de01 100755
--- a/test/sql-tap/cse.test.lua
+++ b/test/sql-tap/cse.test.lua
@@ -35,7 +35,7 @@ test:do_test(
         ]]
     end, {
         -- <cse-1.1>
-        11, -11, -12, 0, 1, 0, 22, 121, 1, 11, 21, -21, -22, 0, 1, 0, 42, 441, 1, 21
+        11, -11, -12, false, true, 0, 22, 121, 1, 11, 21, -21, -22, false, true, 0, 42, 441, 1, 21
         -- </cse-1.1>
     })
 
@@ -45,7 +45,7 @@ test:do_execsql_test(
         SELECT b, b%b, b==b, b!=b, b<b, b<=b, b IS NULL, b IS NOT NULL, b FROM t1
     ]], {
         -- <cse-1.2>
-        11, 0, 1, 0, 0, 1, 0, 1, 11, 21, 0, 1, 0, 0, 1, 0, 1, 21
+        11, 0, true, false, false, true, false, true, 11, 21, 0, true, false, false, true, false, true, 21
         -- </cse-1.2>
     })
 
@@ -135,7 +135,7 @@ test:do_execsql_test(
         SELECT a, -a, ~a, NOT CAST(a AS BOOLEAN), NOT NOT CAST(a AS BOOLEAN), a-a, a+a, a*a, a/a, a FROM t1
     ]], {
         -- <cse-1.7>
-        1, -1, -2, 0, 1, 0, 2, 1, 1, 1, 2, -2, -3, 0, 1, 0, 4, 4, 1, 2
+        1, -1 ,-2, false, true, 0, 2, 1, 1, 1, 2, -2, -3, false, true, 0, 4, 4, 1, 2
         -- </cse-1.7>
     })
 
@@ -145,7 +145,7 @@ test:do_execsql_test(
         SELECT a, a%a, a==a, a!=a, a<a, a<=a, a IS NULL, a IS NOT NULL, a FROM t1
     ]], {
         -- <cse-1.8>
-        1, 0, 1, 0, 0, 1, 0, 1, 1, 2, 0, 1, 0, 0, 1, 0, 1, 2
+        1, 0, true, false, false, true, false, true, 1, 2, 0, true, false, false, true, false, true, 2
         -- </cse-1.8>
     })
 
@@ -155,7 +155,7 @@ test:do_execsql_test(
         SELECT NOT CAST(b AS BOOLEAN), ~b, NOT NOT CAST(b AS BOOLEAN), b FROM t1
     ]], {
         -- <cse-1.9>
-        0, -12, 1, 11, 0, -22, 1, 21
+        false, -12, true, 11, false, -22, true, 21
         -- </cse-1.9>
     })
 
diff --git a/test/sql-tap/e_select1.test.lua b/test/sql-tap/e_select1.test.lua
index 99680380a..e5b63e12d 100755
--- a/test/sql-tap/e_select1.test.lua
+++ b/test/sql-tap/e_select1.test.lua
@@ -869,9 +869,9 @@ test:do_select_tests(
         {"1", "SELECT a, b FROM z1", {51.65, -59.58, -5, "", -2.2, -23.18, "", 67, -1.04, -32.3, 63, 0}},
 
         {"2", "SELECT a IS NULL, b+1, a,b,c FROM z1",
-            {0, -58.58, 51.65, -59.58, "belfries", 0, "", -5, "", "75",
-                0, -22.18, -2.2, -23.18, "suiters", 1, 68, "", 67, "quartets", 0, -31.3,
-                -1.04, -32.3, "aspen", 0, 1, 63, 0, "-26"}},
+            {false, -58.58, 51.65, -59.58, "belfries", false, "", -5, "", "75",
+                false, -22.18, -2.2, -23.18, "suiters", true, 68, "", 67, "quartets", false, -31.3,
+                -1.04, -32.3, "aspen", false, 1, 63, 0, "-26"}},
 
         {"3", "SELECT 32*32, CAST(d AS TEXT) || CAST(e AS TEXT) FROM z2", {1024, "", 1024, "36.06.0"}},
     })
@@ -952,7 +952,7 @@ test:do_select_tests(
     {
         {"1", "SELECT one, two, count(*) FROM a1 WHERE false", {"", "", 0}},
         {"2", "SELECT sum(two), * FROM a1, a2 WHERE three>5", {"", "", "", "", ""}},
-        {"3", "SELECT max(one) IS NULL, one IS NULL, two IS NULL FROM a1 WHERE two=7", {1, 1, 1}},
+        {"3", "SELECT max(one) IS NULL, one IS NULL, two IS NULL FROM a1 WHERE two=7", {true, true, true}},
     })
 
 -- EVIDENCE-OF: R-64138-28774 An aggregate query without a GROUP BY
diff --git a/test/sql-tap/func.test.lua b/test/sql-tap/func.test.lua
index f9044ad01..a0c6b47b5 100755
--- a/test/sql-tap/func.test.lua
+++ b/test/sql-tap/func.test.lua
@@ -930,7 +930,7 @@ test:do_execsql_test(
                             UNION ALL SELECT -9223372036850000000)
     ]], {
         -- <func-8.8>
-        1
+        true
         -- </func-8.8>
     })
 
@@ -948,7 +948,7 @@ test:do_execsql_test(
         SELECT random() is not null;
     ]], {
         -- <func-9.1>
-        1
+        true
         -- </func-9.1>
     })
 
@@ -968,7 +968,7 @@ test:do_execsql_test(
         SELECT randomblob(32) is not null;
     ]], {
         -- <func-9.3>
-        1
+        true
         -- </func-9.3>
     })
 
@@ -2746,94 +2746,94 @@ test:do_execsql_test(
 test:do_execsql_test(
     "func-43",
     "SELECT CHAR(00) LIKE CHAR(00);",
-    {1})
+    {true})
 
 test:do_execsql_test(
     "func-44",
     "SELECT CHAR(00) LIKE CHAR(65);",
-    {0})
+    {false})
 
 test:do_execsql_test(
     "func-45",
     "SELECT CHAR(00,65) LIKE CHAR(00,65);",
-    {1})
+    {true})
 
 test:do_execsql_test(
     "func-46",
     "SELECT CHAR(00,65) LIKE CHAR(00,66);",
-    {0})
+    {false})
 
 test:do_execsql_test(
     "func-47",
     "SELECT CHAR(00,65, 00) LIKE CHAR(00,65,00);",
-    {1})
+    {true})
 
 test:do_execsql_test(
     "func-48",
     "SELECT CHAR(00,65,00) LIKE CHAR(00,65);",
-    {0})
+    {false})
 
 test:do_execsql_test(
     "func-49",
     "SELECT CHAR(65,00,65,00,65) LIKE CHAR(65,00,65,00,65);",
-    {1})
+    {true})
 
 test:do_execsql_test(
     "func-50",
     "SELECT CHAR(65,00,65,00,65) LIKE CHAR(65,00,65,00,66);",
-    {0})
+    {false})
 
 -- LIKE ('%' and '_')
 test:do_execsql_test(
     "func-51",
     "SELECT CHAR(00) LIKE '_';",
-    {1})
+    {true})
 
 test:do_execsql_test(
     "func-52",
     "SELECT CHAR(00) LIKE '__';",
-    {0})
+    {false})
 
 test:do_execsql_test(
     "func-53",
     "SELECT CHAR(00,65) LIKE '__';",
-    {1})
+    {true})
 
 test:do_execsql_test(
     "func-54",
     "SELECT CHAR(00,65) LIKE '_A';",
-    {1})
+    {true})
 
 test:do_execsql_test(
     "func-55",
     "SELECT CHAR(00,65,00) LIKE '%';",
-    {1})
+    {true})
 
 test:do_execsql_test(
     "func-56",
     "SELECT CHAR(00,65,00) LIKE '%A';",
-    {0})
+    {false})
 
 test:do_execsql_test(
     "func-57",
     "SELECT CHAR(65,00,65,00,65) LIKE '%A';",
-    {1})
+    {true})
 
 test:do_execsql_test(
     "func-58",
     "SELECT CHAR(65,00,65,00,65) LIKE '%B';",
-    {0})
+    {false})
 
 -- LIKE (ESCAPE symbols)
 test:do_execsql_test(
     "func-59",
     "SELECT CHAR(00) || '_' LIKE '_#_' ESCAPE '#';",
-    {1})
+    {true})
 
 test:do_execsql_test(
     "func-60",
     "SELECT CHAR(00) || '_' LIKE '_#%' ESCAPE '#';",
-    {0})
+    {false})
 
 -- REPLACE
 test:do_execsql_test(
diff --git a/test/sql-tap/gh-3251-string-pattern-comparison.test.lua b/test/sql-tap/gh-3251-string-pattern-comparison.test.lua
index 861ac8ba2..95e8c98d0 100755
--- a/test/sql-tap/gh-3251-string-pattern-comparison.test.lua
+++ b/test/sql-tap/gh-3251-string-pattern-comparison.test.lua
@@ -158,15 +158,15 @@ for i, tested_string in ipairs(invalid_testcases) do
 
     test_name = prefix .. "5." .. tostring(i)
     test_itself = "SELECT 'ab" .. tested_string .. "' LIKE 'abc';"
-    test:do_execsql_test(test_name, test_itself, {0})
+    test:do_execsql_test(test_name, test_itself, {false})
 
     test_name = prefix .. "6." .. tostring(i)
     test_itself = "SELECT 'abc" .. tested_string .. "' LIKE 'abc';"
-    test:do_execsql_test(test_name, test_itself, {0})
+    test:do_execsql_test(test_name, test_itself, {false})
 
     test_name = prefix .. "7." .. tostring(i)
     test_itself = "SELECT 'ab" .. tested_string .. "c' LIKE 'abc';"
-    test:do_execsql_test(test_name, test_itself, {0})
+    test:do_execsql_test(test_name, test_itself, {false})
 end
 
 -- Unicode byte sequences.
@@ -187,27 +187,27 @@ local valid_testcases = {
 for i, tested_string in ipairs(valid_testcases) do
     local test_name = prefix .. "8." .. tostring(i)
     local test_itself = "SELECT 'abc' LIKE 'ab" .. tested_string .. "';"
-    test:do_execsql_test(test_name, test_itself, {0})
+    test:do_execsql_test(test_name, test_itself, {false})
 
     test_name = prefix .. "9." .. tostring(i)
     test_itself = "SELECT 'abc' LIKE 'abc" .. tested_string .. "';"
-    test:do_execsql_test(test_name, test_itself, {0})
+    test:do_execsql_test(test_name, test_itself, {false})
 
     test_name = prefix .. "10." .. tostring(i)
     test_itself = "SELECT 'abc' LIKE 'ab" .. tested_string .. "c';"
-    test:do_execsql_test(test_name,	test_itself, {0})
+    test:do_execsql_test(test_name,	test_itself, {false})
 
     test_name = prefix .. "11." .. tostring(i)
     test_itself = "SELECT 'ab" .. tested_string .. "' LIKE 'abc';"
-    test:do_execsql_test(test_name,	test_itself, {0})
+    test:do_execsql_test(test_name,	test_itself, {false})
 
     test_name = prefix .. "12." .. tostring(i)
     test_itself = "SELECT 'abc" .. tested_string .. "' LIKE 'abc';"
-    test:do_execsql_test(test_name, test_itself, {0})
+    test:do_execsql_test(test_name, test_itself, {false})
 
     test_name = prefix .. "13." .. tostring(i)
     test_itself = "SELECT 'ab" .. tested_string .. "c' LIKE 'abc';"
-    test:do_execsql_test(test_name, test_itself, {0})
+    test:do_execsql_test(test_name, test_itself, {false})
 end
 
 test:finish_test()
diff --git a/test/sql-tap/in1.test.lua b/test/sql-tap/in1.test.lua
index 76112cff9..eca7c15ba 100755
--- a/test/sql-tap/in1.test.lua
+++ b/test/sql-tap/in1.test.lua
@@ -865,7 +865,7 @@ test:do_test(
   ]]
     end, {
         -- <in-13.1>
-        1, '', 0, ''
+        true, '', false, ''
         -- </in-13.1>
     })
 
@@ -890,7 +890,7 @@ test:do_execsql_test(
         SELECT 2 IN (SELECT a FROM t7) 
     ]], {
         -- <in-13.3>
-        1
+        true
         -- </in-13.3>
     })
 
@@ -900,7 +900,7 @@ test:do_execsql_test(
         SELECT 6 IN (SELECT a FROM t7) 
     ]], {
         -- <in-13.4>
-        ''
+        ""
         -- </in-13.4>
     })
 
@@ -910,7 +910,7 @@ test:do_execsql_test(
         SELECT 2 IN (SELECT b FROM t7) 
     ]], {
         -- <in-13.5>
-        1
+        true
         -- </in-13.5>
     })
 
@@ -920,7 +920,7 @@ test:do_execsql_test(
         SELECT 6 IN (SELECT b FROM t7) 
     ]], {
         -- <in-13.6>
-        0
+        false
         -- </in-13.6>
     })
 
@@ -930,7 +930,7 @@ test:do_execsql_test(
         SELECT 2 IN (SELECT c FROM t7) 
     ]], {
         -- <in-13.7>
-        1
+        true
         -- </in-13.7>
     })
 
@@ -940,7 +940,7 @@ test:do_execsql_test(
         SELECT 6 IN (SELECT c FROM t7) 
     ]], {
         -- <in-13.8>
-        0
+        false
         -- </in-13.8>
     })
 
@@ -956,7 +956,7 @@ test:do_execsql_test(
           6 NOT IN (SELECT c FROM t7)
     ]], {
         -- <in-13.9>
-        0, '', 0, 1, 0, 1
+        false, "", false, true, false, true
         -- </in-13.9>
     })
 
@@ -971,7 +971,7 @@ test:do_execsql_test(
         FROM t7 AS outside ORDER BY b;
     ]], {
         -- <in-13.10>
-        0, '', '', '', 0
+        false, "", "", "", false
         -- </in-13.10>
     })
 
@@ -986,7 +986,7 @@ test:do_execsql_test(
         FROM t7 AS outside ORDER BY b;
     ]], {
         -- <in-13.11>
-        1, '', '', '', 1
+        true, "", "", "", true
         -- </in-13.11>
     })
 
@@ -1009,7 +1009,7 @@ test:do_test(
         ]]
     end, {
         -- <in-13.12>
-        1, '', 1, 0, 1, 0
+        true, "", true, false, true, false
         -- </in-13.12>
     })
 
@@ -1025,7 +1025,7 @@ test:do_execsql_test(
           6 NOT IN (SELECT c FROM t7)
     ]], {
         -- <in-13.13>
-        0, '', 0, 1, 0, 1
+        false, "", false, true, false, true
         -- </in-13.13>
     })
 
diff --git a/test/sql-tap/in2.test.lua b/test/sql-tap/in2.test.lua
index 9d9a3c3b3..5782eab0c 100755
--- a/test/sql-tap/in2.test.lua
+++ b/test/sql-tap/in2.test.lua
@@ -90,7 +90,7 @@ for ii=3,N-1 do
         "in2-"..ii,
         'SELECT 1 IN (SELECT a FROM a WHERE (i <'..ii..' ) OR (i >= '..N..'))',
         {
-            1
+            true
         })
 
 end
diff --git a/test/sql-tap/in3.test.lua b/test/sql-tap/in3.test.lua
index 1ca6a6446..4677c4925 100755
--- a/test/sql-tap/in3.test.lua
+++ b/test/sql-tap/in3.test.lua
@@ -299,7 +299,7 @@ test:do_test(
         return exec_neph(" SELECT x IN (SELECT a FROM t1) FROM t2 ")
     end, {
         -- <in3-3.2>
-        0, 1
+        0, true
         -- </in3-3.2>
     })
 
@@ -311,7 +311,7 @@ test:do_test(
         return exec_neph(" SELECT x IN (SELECT b FROM t1) FROM t2 ")
     end, {
         -- <in3-3.3>
-        1, 1
+        1, true
         -- </in3-3.3>
     })
 
@@ -323,7 +323,7 @@ test:do_test(
         return exec_neph(" SELECT x IN (SELECT c FROM t1) FROM t2 ")
     end, {
         -- <in3-3.4>
-        1, 1
+        1, true
         -- </in3-3.4>
     })
 
@@ -335,7 +335,7 @@ test:do_test(
         return exec_neph(" SELECT y IN (SELECT a FROM t1) FROM t2 ")
     end, {
         -- <in3-3.5>
-        1, 1
+        1, true
         -- </in3-3.5>
     })
 
@@ -347,7 +347,7 @@ test:do_test(
         return exec_neph(" SELECT y IN (SELECT b FROM t1) FROM t2 ")
     end, {
         -- <in3-3.6>
-        0, 1
+        0, true
         -- </in3-3.6>
     })
 
@@ -359,7 +359,7 @@ test:do_test(
         return exec_neph(" SELECT y IN (SELECT c FROM t1) FROM t2 ")
     end, {
         -- <in3-3.7>
-        1, 1
+        1, true
         -- </in3-3.7>
     })
 
@@ -395,7 +395,7 @@ test:do_test(
         return exec_neph(" SELECT 'text' IN (SELECT b FROM t3)")
     end, {
         -- <in3-4.2>
-        0, 1
+        0, true
         -- </in3-4.2>
     })
 
@@ -408,7 +408,7 @@ test:do_test(
         return exec_neph(" SELECT 'TEXT' COLLATE \"unicode_ci\" IN (SELECT b FROM t3) ")
     end, {
         -- <in3-4.3>
-        1, 1
+        1, true
         -- </in3-4.3>
     })
 
diff --git a/test/sql-tap/in4.test.lua b/test/sql-tap/in4.test.lua
index 9d488745d..92427b657 100755
--- a/test/sql-tap/in4.test.lua
+++ b/test/sql-tap/in4.test.lua
@@ -272,7 +272,7 @@ test:do_execsql_test(
         SELECT x IN() AS a FROM t3 WHERE NOT a 
     ]], {
         -- <in4-3.9>
-        0, 0
+        false, false
         -- </in4-3.9>
     })
 
diff --git a/test/sql-tap/insert1.test.lua b/test/sql-tap/insert1.test.lua
index 031fd224a..9f80976f8 100755
--- a/test/sql-tap/insert1.test.lua
+++ b/test/sql-tap/insert1.test.lua
@@ -313,7 +313,7 @@ test:do_execsql_test("insert-4.7", [[
       return {test:lsearch(x, 'OpenTEphemeral') > 0} -- X(264, "X!cmd", [=[["expr","[lsearch $x OpenEphemeral]>0"]]=])
     end, {
       -- <insert-5.3>
-      1
+      true
       -- </insert-5.3>
     })
 
@@ -348,7 +348,7 @@ test:do_execsql_test("insert-4.7", [[
       return {test:lsearch(x, 'OpenTemp') > 0} -- X(298, "X!cmd", [=[["expr","[lsearch $x OpenTemp]>0"]]=])
     end, {
       -- <insert-5.7>
-      0
+      false
       -- </insert-5.7>
     })
 
diff --git a/test/sql-tap/lua/sqltester.lua b/test/sql-tap/lua/sqltester.lua
index 87ddca718..e83a8e404 100644
--- a/test/sql-tap/lua/sqltester.lua
+++ b/test/sql-tap/lua/sqltester.lua
@@ -27,28 +27,6 @@ local function flatten(arr)
     return result
 end
 
--- Goal of this routine is to update expected result
--- to be comparable with expected.
--- Right now it converts logical values to numbers.
--- Input must be a table.
-local function fix_result(arr)
-    if type(arr) ~= 'table' then return arr end
-    for i, v in ipairs(arr) do
-        if type(v) == 'table' then
-            -- it is ok to pass array
-            --fix_expect(v)
-        else
-            if type(v) == 'boolean' then
-                if v then
-                    arr[i] = 1
-                else
-                    arr[i] = 0
-                end
-            end
-        end
-    end
-end
-
 local function finish_test()
     test:check()
     os.exit()
@@ -143,8 +121,6 @@ local function do_test(self, label, func, expect)
     local ok, result = pcall(func)
     if ok then
         if result == nil then result = { } end
-        -- Convert all trues and falses to 1s and 0s
-        fix_result(result)
 
         -- If nothing is expected: just make sure there were no error.
         if expect == nil then
diff --git a/test/sql-tap/lua_sql.test.lua b/test/sql-tap/lua_sql.test.lua
index b0913e7f4..921fc3922 100755
--- a/test/sql-tap/lua_sql.test.lua
+++ b/test/sql-tap/lua_sql.test.lua
@@ -115,7 +115,7 @@ for i = 1, #from_lua_to_sql, 1 do
     test:do_execsql_test(
         "lua_sql-2.3."..i,
         "select "..from_lua_to_sql[i][1].." = check_from_lua_to_sql("..i..")",
-        {1})
+        {true})
 end
 
 local from_lua_to_sql_bad = {
diff --git a/test/sql-tap/misc1.test.lua b/test/sql-tap/misc1.test.lua
index f332fb791..d5e17ce01 100755
--- a/test/sql-tap/misc1.test.lua
+++ b/test/sql-tap/misc1.test.lua
@@ -606,7 +606,7 @@ test:do_execsql_test(
         SELECT '0'=='0.0'
     ]], {
         -- <misc1-12.1>
-        0
+        false
         -- </misc1-12.1>
     })
 
@@ -616,7 +616,7 @@ test:do_execsql_test(
         SELECT '0'==0.0
     ]], {
         -- <misc1-12.2>
-        1
+        true
         -- </misc1-12.2>
     })
 
@@ -626,7 +626,7 @@ test:do_execsql_test(
         SELECT '12345678901234567890'=='12345678901234567891'
     ]], {
         -- <misc1-12.3>
-        0
+        false
         -- </misc1-12.3>
     })
 
diff --git a/test/sql-tap/select1.test.lua b/test/sql-tap/select1.test.lua
index 6beeb34cb..58a523787 100755
--- a/test/sql-tap/select1.test.lua
+++ b/test/sql-tap/select1.test.lua
@@ -2058,7 +2058,7 @@ test:do_test(
             SELECT 2 IN (SELECT a FROM t1) 
         ]], {
             -- <select1-15.3>
-            1
+            true
             -- </select1-15.3>
         })
 
diff --git a/test/sql-tap/select7.test.lua b/test/sql-tap/select7.test.lua
index f2a071d04..4c76ee65a 100755
--- a/test/sql-tap/select7.test.lua
+++ b/test/sql-tap/select7.test.lua
@@ -236,7 +236,7 @@ test:do_execsql_test(
         SELECT a=0, typeof(a) FROM t4 
     ]], {
         -- <select7-7.5>
-        0, "number", 0, "number"
+        false, "number", false, "number"
         -- </select7-7.5>
     })
 
@@ -246,7 +246,7 @@ test:do_execsql_test(
         SELECT a=0, typeof(a) FROM t4 GROUP BY a 
     ]], {
         -- <select7-7.6>
-        0, "number", 0, "number"
+        false, "number", false, "number"
         -- </select7-7.6>
     })
 
diff --git a/test/sql-tap/selectG.test.lua b/test/sql-tap/selectG.test.lua
index 69029023f..0ca066d1c 100755
--- a/test/sql-tap/selectG.test.lua
+++ b/test/sql-tap/selectG.test.lua
@@ -50,7 +50,7 @@ test:do_test(
             :format(end_time - start_time, time_quota))
     end, {
         -- <100>
-        100000, 5000050000, 50000.5, 1
+        100000, 5000050000, 50000.5, true
         -- </100>
     })
 
diff --git a/test/sql-tap/sql-errors.test.lua b/test/sql-tap/sql-errors.test.lua
index a8d39472d..7ffa0aed0 100755
--- a/test/sql-tap/sql-errors.test.lua
+++ b/test/sql-tap/sql-errors.test.lua
@@ -492,7 +492,7 @@ test:do_execsql_test(
 		SELECT (1, 2, 3) < (1, 2, 4);
 	]], {
 		-- <sql-errors-1.44>
-		1
+		true
 		-- </sql-errors-1.44>
 	})
 
@@ -502,7 +502,7 @@ test:do_execsql_test(
 		SELECT (1, 2, 3) < (1, 2, 2);
 	]], {
 		-- <sql-errors-1.45>
-		0
+		false
 		-- </sql-errors-1.45>
 	})
 
diff --git a/test/sql-tap/subquery.test.lua b/test/sql-tap/subquery.test.lua
index 7a3e270dc..4e4b8d453 100755
--- a/test/sql-tap/subquery.test.lua
+++ b/test/sql-tap/subquery.test.lua
@@ -130,7 +130,7 @@ test:do_execsql_test(
         SELECT (y*2)>b FROM t1, t2 WHERE a=x;
     ]], {
         -- <subquery-1.9.1>
-        0, 1, 1, 1
+        false, true, true, true
         -- </subquery-1.9.1>
     })
 
@@ -290,7 +290,7 @@ test:do_execsql_test(
         SELECT a IN (10.0, 20) FROM t3;
     ]], {
         -- <subquery-2.3.2>
-        0
+        false
         -- </subquery-2.3.2>
     })
 
@@ -572,7 +572,7 @@ test:do_execsql_test(
          ORDER BY a.x;
     ]], {
         -- <subquery-3.4.3>
-        106, 4.5, 0, 1, 107, 4.0, 1, 0
+        106, 4.5, false, true, 107, 4.0, true, false
         -- </subquery-3.4.3>
     })
 
diff --git a/test/sql-tap/subselect.test.lua b/test/sql-tap/subselect.test.lua
index ebfdf431e..1c3558f9b 100755
--- a/test/sql-tap/subselect.test.lua
+++ b/test/sql-tap/subselect.test.lua
@@ -175,7 +175,7 @@ test:do_execsql_test(
         SELECT 1 IN (SELECT a FROM t1 ORDER BY a);
     ]], {
         -- <subselect-2.2>
-        1
+        true
         -- </subselect-2.2>
     })
 
@@ -185,7 +185,7 @@ test:do_execsql_test(
         SELECT 2 IN (SELECT a FROM t1 ORDER BY a DESC);
     ]], {
         -- <subselect-2.3>
-        0
+        false
         -- </subselect-2.3>
     })
 
diff --git a/test/sql-tap/tkt-80e031a00f.test.lua b/test/sql-tap/tkt-80e031a00f.test.lua
index 3edea11ac..75bae0ed2 100755
--- a/test/sql-tap/tkt-80e031a00f.test.lua
+++ b/test/sql-tap/tkt-80e031a00f.test.lua
@@ -43,7 +43,7 @@ test:do_execsql_test(
         SELECT 1 IN ()
     ]], {
         -- <tkt-80e031a00f.1>
-        0
+        false
         -- </tkt-80e031a00f.1>
     })
 
@@ -53,7 +53,7 @@ test:do_execsql_test(
         SELECT 1 IN (2)
     ]], {
         -- <tkt-80e031a00f.1b>
-        0
+        false
         -- </tkt-80e031a00f.1b>
     })
 
@@ -63,7 +63,7 @@ test:do_execsql_test(
         SELECT 1 IN (2,3,4,5,6,7,8,9)
     ]], {
         -- <tkt-80e031a00f.1c>
-        0
+        false
         -- </tkt-80e031a00f.1c>
     })
 
@@ -73,7 +73,7 @@ test:do_execsql_test(
         SELECT 1 NOT IN ()
     ]], {
         -- <tkt-80e031a00f.2>
-        1
+        true
         -- </tkt-80e031a00f.2>
     })
 
@@ -83,7 +83,7 @@ test:do_execsql_test(
         SELECT 1 NOT IN (2)
     ]], {
         -- <tkt-80e031a00f.2b>
-        1
+        true
         -- </tkt-80e031a00f.2b>
     })
 
@@ -93,7 +93,7 @@ test:do_execsql_test(
         SELECT 1 NOT IN (2,3,4,5,6,7,8,9)
     ]], {
         -- <tkt-80e031a00f.2c>
-        1
+        true
         -- </tkt-80e031a00f.2c>
     })
 
@@ -103,7 +103,7 @@ test:do_execsql_test(
         SELECT null IN ()
     ]], {
         -- <tkt-80e031a00f.3>
-        0
+        false
         -- </tkt-80e031a00f.3>
     })
 
@@ -113,7 +113,7 @@ test:do_execsql_test(
         SELECT null NOT IN ()
     ]], {
         -- <tkt-80e031a00f.4>
-        1
+        true
         -- </tkt-80e031a00f.4>
     })
 
@@ -124,7 +124,7 @@ test:do_execsql_test(
         SELECT 1 IN t1;
     ]], {
         -- <tkt-80e031a00f.5>
-        0
+        false
         -- </tkt-80e031a00f.5>
     })
 
@@ -134,7 +134,7 @@ test:do_execsql_test(
         SELECT 1 NOT IN t1
     ]], {
         -- <tkt-80e031a00f.6>
-        1
+        true
         -- </tkt-80e031a00f.6>
     })
 
@@ -144,7 +144,7 @@ test:do_execsql_test(
         SELECT null IN t1
     ]], {
         -- <tkt-80e031a00f.7>
-        0
+        false
         -- </tkt-80e031a00f.7>
     })
 
@@ -154,7 +154,7 @@ test:do_execsql_test(
         SELECT null NOT IN t1
     ]], {
         -- <tkt-80e031a00f.8>
-        1
+        true
         -- </tkt-80e031a00f.8>
     })
 
@@ -165,7 +165,7 @@ test:do_execsql_test(
         SELECT 1 IN t2;
     ]], {
         -- <tkt-80e031a00f.9>
-        0
+        false
         -- </tkt-80e031a00f.9>
     })
 
@@ -175,7 +175,7 @@ test:do_execsql_test(
         SELECT 1 NOT IN t2
     ]], {
         -- <tkt-80e031a00f.10>
-        1
+        true
         -- </tkt-80e031a00f.10>
     })
 
@@ -185,7 +185,7 @@ test:do_execsql_test(
         SELECT null IN t2
     ]], {
         -- <tkt-80e031a00f.11>
-        0
+        false
         -- </tkt-80e031a00f.11>
     })
 
@@ -195,7 +195,7 @@ test:do_execsql_test(
         SELECT null NOT IN t2
     ]], {
         -- <tkt-80e031a00f.12>
-        1
+        true
         -- </tkt-80e031a00f.12>
     })
 
@@ -206,7 +206,7 @@ test:do_execsql_test(
         SELECT 1 IN t3;
     ]], {
         -- <tkt-80e031a00f.13>
-        0
+        false
         -- </tkt-80e031a00f.13>
     })
 
@@ -216,7 +216,7 @@ test:do_execsql_test(
         SELECT 1 NOT IN t3
     ]], {
         -- <tkt-80e031a00f.14>
-        1
+        true
         -- </tkt-80e031a00f.14>
     })
 
@@ -226,7 +226,7 @@ test:do_execsql_test(
         SELECT null IN t3
     ]], {
         -- <tkt-80e031a00f.15>
-        0
+        false
         -- </tkt-80e031a00f.15>
     })
 
@@ -236,7 +236,7 @@ test:do_execsql_test(
         SELECT null NOT IN t3
     ]], {
         -- <tkt-80e031a00f.16>
-        1
+        true
         -- </tkt-80e031a00f.16>
     })
 
@@ -246,7 +246,7 @@ test:do_execsql_test(
         SELECT 1 IN (SELECT x+y FROM t1, t2)
     ]], {
         -- <tkt-80e031a00f.17>
-        0
+        false
         -- </tkt-80e031a00f.17>
     })
 
@@ -256,7 +256,7 @@ test:do_execsql_test(
         SELECT 1 NOT IN (SELECT x+y FROM t1,t2)
     ]], {
         -- <tkt-80e031a00f.18>
-        1
+        true
         -- </tkt-80e031a00f.18>
     })
 
@@ -266,7 +266,7 @@ test:do_execsql_test(
         SELECT null IN (SELECT x+y FROM t1,t2)
     ]], {
         -- <tkt-80e031a00f.19>
-        0
+        false
         -- </tkt-80e031a00f.19>
     })
 
@@ -276,7 +276,7 @@ test:do_execsql_test(
         SELECT null NOT IN (SELECT x+y FROM t1,t2)
     ]], {
         -- <tkt-80e031a00f.20>
-        1
+        true
         -- </tkt-80e031a00f.20>
     })
 
@@ -286,7 +286,7 @@ test:do_execsql_test(
         SELECT 1.23 IN ()
     ]], {
         -- <tkt-80e031a00f.21>
-        0
+        false
         -- </tkt-80e031a00f.21>
     })
 
@@ -296,7 +296,7 @@ test:do_execsql_test(
         SELECT 1.23 NOT IN ()
     ]], {
         -- <tkt-80e031a00f.22>
-        1
+        true
         -- </tkt-80e031a00f.22>
     })
 
@@ -306,7 +306,7 @@ test:do_execsql_test(
         SELECT 1.23 IN t1
     ]], {
         -- <tkt-80e031a00f.23>
-        0
+        false
         -- </tkt-80e031a00f.23>
     })
 
@@ -316,7 +316,7 @@ test:do_execsql_test(
         SELECT 1.23 NOT IN t1
     ]], {
         -- <tkt-80e031a00f.24>
-        1
+        true
         -- </tkt-80e031a00f.24>
     })
 
@@ -326,7 +326,7 @@ test:do_execsql_test(
         SELECT 'hello' IN ()
     ]], {
         -- <tkt-80e031a00f.25>
-        0
+        false
         -- </tkt-80e031a00f.25>
     })
 
@@ -336,7 +336,7 @@ test:do_execsql_test(
         SELECT 'hello' NOT IN ()
     ]], {
         -- <tkt-80e031a00f.26>
-        1
+        true
         -- </tkt-80e031a00f.26>
     })
 
@@ -366,7 +366,7 @@ test:do_execsql_test(
         SELECT x'303132' IN ()
     ]], {
         -- <tkt-80e031a00f.29>
-        0
+        false
         -- </tkt-80e031a00f.29>
     })
 
@@ -376,7 +376,7 @@ test:do_execsql_test(
         SELECT x'303132' NOT IN ()
     ]], {
         -- <tkt-80e031a00f.30>
-        1
+        true
         -- </tkt-80e031a00f.30>
     })
 
@@ -415,7 +415,7 @@ test:do_execsql_test(
         SELECT 1 IN (2,3,4)
     ]], {
         -- <tkt-80e031a00f.100>
-        0
+        false
         -- </tkt-80e031a00f.100>
     })
 
@@ -425,7 +425,7 @@ test:do_execsql_test(
         SELECT 1 NOT IN (2,3,4)
     ]], {
         -- <tkt-80e031a00f.101>
-        1
+        true
         -- </tkt-80e031a00f.101>
     })
 
@@ -435,7 +435,7 @@ test:do_execsql_test(
         SELECT 'a' IN ('b','c','d')
     ]], {
         -- <tkt-80e031a00f.102>
-        0
+        false
         -- </tkt-80e031a00f.102>
     })
 
@@ -445,7 +445,7 @@ test:do_execsql_test(
         SELECT 'a' NOT IN ('b','c','d')
     ]], {
         -- <tkt-80e031a00f.103>
-        1
+        true
         -- </tkt-80e031a00f.103>
     })
 
@@ -485,7 +485,7 @@ test:do_test(
         return test:execsql "SELECT 1 IN t4"
     end, {
         -- <tkt-80e031a00f.104>
-        0
+        false
         -- </tkt-80e031a00f.104>
     })
 
@@ -495,7 +495,7 @@ test:do_execsql_test(
         SELECT 1 NOT IN t4
     ]], {
         -- <tkt-80e031a00f.105>
-        1
+        true
         -- </tkt-80e031a00f.105>
     })
 
@@ -505,7 +505,7 @@ test:do_execsql_test(
         SELECT 1 IN t5
     ]], {
         -- <tkt-80e031a00f.106>
-        0
+        false
         -- </tkt-80e031a00f.106>
     })
 
@@ -515,7 +515,7 @@ test:do_execsql_test(
         SELECT 1 NOT IN t5
     ]], {
         -- <tkt-80e031a00f.107>
-        1
+        true
         -- </tkt-80e031a00f.107>
     })
 
@@ -525,7 +525,7 @@ test:do_execsql_test(
         SELECT 1 IN t6
     ]], {
         -- <tkt-80e031a00f.108>
-        0
+        false
         -- </tkt-80e031a00f.108>
     })
 
@@ -535,7 +535,7 @@ test:do_execsql_test(
         SELECT 1 NOT IN t6
     ]], {
         -- <tkt-80e031a00f.109>
-        1
+        true
         -- </tkt-80e031a00f.109>
     })
 
@@ -545,7 +545,7 @@ test:do_execsql_test(
         SELECT 'a' IN t7
     ]], {
         -- <tkt-80e031a00f.110>
-        0
+        false
         -- </tkt-80e031a00f.110>
     })
 
@@ -555,7 +555,7 @@ test:do_execsql_test(
         SELECT 'a' NOT IN t7
     ]], {
         -- <tkt-80e031a00f.111>
-        1
+        true
         -- </tkt-80e031a00f.111>
     })
 
@@ -565,7 +565,7 @@ test:do_execsql_test(
         SELECT 'a' IN t8
     ]], {
         -- <tkt-80e031a00f.112>
-        0
+        false
         -- </tkt-80e031a00f.112>
     })
 
@@ -575,7 +575,7 @@ test:do_execsql_test(
         SELECT 'a' NOT IN t8
     ]], {
         -- <tkt-80e031a00f.113>
-        1
+        true
         -- </tkt-80e031a00f.113>
     })
 
@@ -588,7 +588,7 @@ test:do_execsql_test(
         SELECT 2 IN (2,3,4,null)
     ]], {
         -- <tkt-80e031a00f.300>
-        1
+        true
         -- </tkt-80e031a00f.300>
     })
 
@@ -598,7 +598,7 @@ test:do_execsql_test(
         SELECT 3 NOT IN (2,3,4,null)
     ]], {
         -- <tkt-80e031a00f.301>
-        0
+        false
         -- </tkt-80e031a00f.301>
     })
 
@@ -608,7 +608,7 @@ test:do_execsql_test(
         SELECT 4 IN (2,3,4)
     ]], {
         -- <tkt-80e031a00f.302>
-        1
+        true
         -- </tkt-80e031a00f.302>
     })
 
@@ -618,7 +618,7 @@ test:do_execsql_test(
         SELECT 2 NOT IN (2,3,4)
     ]], {
         -- <tkt-80e031a00f.303>
-        0
+        false
         -- </tkt-80e031a00f.303>
     })
 
@@ -628,7 +628,7 @@ test:do_execsql_test(
         SELECT 'b' IN ('b','c','d')
     ]], {
         -- <tkt-80e031a00f.304>
-        1
+        true
         -- </tkt-80e031a00f.304>
     })
 
@@ -638,7 +638,7 @@ test:do_execsql_test(
         SELECT 'c' NOT IN ('b','c','d')
     ]], {
         -- <tkt-80e031a00f.305>
-        0
+        false
         -- </tkt-80e031a00f.305>
     })
 
@@ -648,7 +648,7 @@ test:do_execsql_test(
         SELECT 'd' IN ('b','c',null,'d')
     ]], {
         -- <tkt-80e031a00f.306>
-        1
+        true
         -- </tkt-80e031a00f.306>
     })
 
@@ -658,7 +658,7 @@ test:do_execsql_test(
         SELECT 'b' NOT IN (null,'b','c','d')
     ]], {
         -- <tkt-80e031a00f.307>
-        0
+        false
         -- </tkt-80e031a00f.307>
     })
 
@@ -668,7 +668,7 @@ test:do_execsql_test(
         SELECT 2 IN t4
     ]], {
         -- <tkt-80e031a00f.308>
-        1
+        true
         -- </tkt-80e031a00f.308>
     })
 
@@ -678,7 +678,7 @@ test:do_execsql_test(
         SELECT 3 NOT IN t4
     ]], {
         -- <tkt-80e031a00f.309>
-        0
+        false
         -- </tkt-80e031a00f.309>
     })
 
@@ -688,7 +688,7 @@ test:do_execsql_test(
         SELECT 4 IN (select a from t4n)
     ]], {
         -- <tkt-80e031a00f.310>
-        1
+        true
         -- </tkt-80e031a00f.310>
     })
 
@@ -698,7 +698,7 @@ test:do_execsql_test(
         SELECT 2 NOT IN (select a from t4n)
     ]], {
         -- <tkt-80e031a00f.311>
-        0
+        false
         -- </tkt-80e031a00f.311>
     })
 
@@ -708,7 +708,7 @@ test:do_execsql_test(
         SELECT 2 IN t5
     ]], {
         -- <tkt-80e031a00f.312>
-        1
+        true
         -- </tkt-80e031a00f.312>
     })
 
@@ -718,7 +718,7 @@ test:do_execsql_test(
         SELECT 3 NOT IN t5
     ]], {
         -- <tkt-80e031a00f.313>
-        0
+        false
         -- </tkt-80e031a00f.313>
     })
 
@@ -728,7 +728,7 @@ test:do_execsql_test(
         SELECT 2 IN t6
     ]], {
         -- <tkt-80e031a00f.314>
-        1
+        true
         -- </tkt-80e031a00f.314>
     })
 
@@ -738,7 +738,7 @@ test:do_execsql_test(
         SELECT 3 NOT IN t6
     ]], {
         -- <tkt-80e031a00f.315>
-        0
+        false
         -- </tkt-80e031a00f.315>
     })
 
@@ -748,7 +748,7 @@ test:do_execsql_test(
         SELECT 4 IN (select b from t6n)
     ]], {
         -- <tkt-80e031a00f.316>
-        1
+        true
         -- </tkt-80e031a00f.316>
     })
 
@@ -758,7 +758,7 @@ test:do_execsql_test(
         SELECT 2 NOT IN (select b from t6n)
     ]], {
         -- <tkt-80e031a00f.317>
-        0
+        false
         -- </tkt-80e031a00f.317>
     })
 
@@ -768,7 +768,7 @@ test:do_execsql_test(
         SELECT 'b' IN t7
     ]], {
         -- <tkt-80e031a00f.318>
-        1
+        true
         -- </tkt-80e031a00f.318>
     })
 
@@ -778,7 +778,7 @@ test:do_execsql_test(
         SELECT 'c' NOT IN t7
     ]], {
         -- <tkt-80e031a00f.319>
-        0
+        false
         -- </tkt-80e031a00f.319>
     })
 
@@ -788,7 +788,7 @@ test:do_execsql_test(
         SELECT 'c' IN (select a from t7n)
     ]], {
         -- <tkt-80e031a00f.320>
-        1
+        true
         -- </tkt-80e031a00f.320>
     })
 
@@ -798,7 +798,7 @@ test:do_execsql_test(
         SELECT 'd' NOT IN (select a from t7n)
     ]], {
         -- <tkt-80e031a00f.321>
-        0
+        false
         -- </tkt-80e031a00f.321>
     })
 
@@ -808,7 +808,7 @@ test:do_execsql_test(
         SELECT 'b' IN t8
     ]], {
         -- <tkt-80e031a00f.322>
-        1
+        true
         -- </tkt-80e031a00f.322>
     })
 
@@ -818,7 +818,7 @@ test:do_execsql_test(
         SELECT 'c' NOT IN t8
     ]], {
         -- <tkt-80e031a00f.323>
-        0
+        false
         -- </tkt-80e031a00f.323>
     })
 
@@ -828,7 +828,7 @@ test:do_execsql_test(
         SELECT 'c' IN (select c from t8n)
     ]], {
         -- <tkt-80e031a00f.324>
-        1
+        true
         -- </tkt-80e031a00f.324>
     })
 
@@ -838,7 +838,7 @@ test:do_execsql_test(
         SELECT 'd' NOT IN (select c from t8n)
     ]], {
         -- <tkt-80e031a00f.325>
-        0
+        false
         -- </tkt-80e031a00f.325>
     })
 
@@ -848,7 +848,7 @@ test:do_execsql_test(
         SELECT 'a' IN (NULL,'a')
     ]], {
         -- <tkt-80e031a00f.326>
-        1
+        true
         -- </tkt-80e031a00f.326>
     })
 
@@ -868,7 +868,7 @@ test:do_execsql_test(
         SELECT 'a' NOT IN (NULL,'a')
     ]], {
         -- <tkt-80e031a00f.328>
-        0
+        false
         -- </tkt-80e031a00f.328>
     })
 
diff --git a/test/sql-tap/tkt-a7b7803e.test.lua b/test/sql-tap/tkt-a7b7803e.test.lua
index f94bcac9a..14f05ebfd 100755
--- a/test/sql-tap/tkt-a7b7803e.test.lua
+++ b/test/sql-tap/tkt-a7b7803e.test.lua
@@ -33,7 +33,7 @@ test:do_test(
         ]]
     end, {
         -- <tkt-a7b7803e.1>
-        1, "first"
+        true, "first"
         -- </tkt-a7b7803e.1>
     })
 
@@ -47,7 +47,7 @@ test:do_test(
         ]]
     end, {
         -- <tkt-a7b7803e.2>
-        99, 1
+        99, true
         -- </tkt-a7b7803e.2>
     })
 
@@ -61,7 +61,7 @@ test:do_test(
         ]]
     end, {
         -- <tkt-a7b7803e.3>
-        1, 1, 99, "fuzzy"
+        true, true, 99, "fuzzy"
         -- </tkt-a7b7803e.3>
     })
 
@@ -76,7 +76,7 @@ test:do_test(
         ]]
     end, {
         -- <tkt-a7b7803e.4>
-        0, 1, 0, "first", 1, 0, 99, "fuzzy"
+        false, true, 0, "first", true, false, 99, "fuzzy"
         -- </tkt-a7b7803e.4>
     })
 
@@ -91,7 +91,7 @@ test:do_test(
         ]]
     end, {
         -- <tkt-a7b7803e.5>
-        0, "first", 1, "first", 1, "fuzzy", 1, "first", 1, "fuzzy", 0, "fuzzy"
+        false, "first", true, "first", true, "fuzzy", true, "first", true, "fuzzy", false, "fuzzy"
         -- </tkt-a7b7803e.5>
     })
 
@@ -106,7 +106,7 @@ test:do_test(
         ]]
     end, {
         -- <tkt-a7b7803e.6>
-        1, "fuzzy", 1, "first"
+        true, "fuzzy", true, "first"
         -- </tkt-a7b7803e.6>
     })
 
@@ -120,7 +120,7 @@ test:do_test(
         ]]
     end, {
         -- <tkt-a7b7803e.7>
-        1, "fuzzy", 1, "first"
+        true, "fuzzy", true, "first"
         -- </tkt-a7b7803e.7>
     })
 
@@ -134,7 +134,7 @@ test:do_test(
         ]]
     end, {
         -- <tkt-a7b7803e.8>
-        1, "fuzzy", 1, "first", 1, "fuzzy", 0, "fuzzy"
+        true, "fuzzy", true, "first", true, "fuzzy", false, "fuzzy"
         -- </tkt-a7b7803e.8>
     })
 
diff --git a/test/sql-tap/tkt-b351d95f9.test.lua b/test/sql-tap/tkt-b351d95f9.test.lua
index 2e9b52687..9bdf573b3 100755
--- a/test/sql-tap/tkt-b351d95f9.test.lua
+++ b/test/sql-tap/tkt-b351d95f9.test.lua
@@ -56,7 +56,7 @@ test:do_execsql_test(
         SELECT x, y BETWEEN 'xy' AND 'xz' FROM t2 ORDER BY x;
     ]], {
         -- <tkt-b351d95.3>
-        "name1", 0, "name2", 1
+        "name1", false, "name2", true
         -- </tkt-b351d95.3>
     })
 
diff --git a/test/sql-tap/tkt1473.test.lua b/test/sql-tap/tkt1473.test.lua
index ada18d030..bc7991593 100755
--- a/test/sql-tap/tkt1473.test.lua
+++ b/test/sql-tap/tkt1473.test.lua
@@ -217,7 +217,7 @@ test:do_execsql_test(
           (SELECT 1 FROM t1 WHERE a=1 UNION SELECT 2 FROM t1 WHERE b=0)
     ]], {
         -- <tkt1473-3.3>
-        1
+        true
         -- </tkt1473-3.3>
     })
 
@@ -261,7 +261,7 @@ test:do_execsql_test(
           (SELECT 1 FROM t1 WHERE a=0 UNION SELECT 2 FROM t1 WHERE b=4)
     ]], {
         -- <tkt1473-3.7>
-        1
+        true
         -- </tkt1473-3.7>
     })
 
@@ -272,7 +272,7 @@ test:do_execsql_test(
           (SELECT 1 FROM t1 WHERE a=0 UNION ALL SELECT 2 FROM t1 WHERE b=0)
     ]], {
         -- <tkt1473-3.8>
-        0
+        false
         -- </tkt1473-3.8>
     })
 
@@ -283,7 +283,7 @@ test:do_execsql_test(
           (SELECT 1 FROM t1 WHERE a=0 UNION SELECT 2 FROM t1 WHERE b=0)
     ]], {
         -- <tkt1473-3.9>
-        0
+        false
         -- </tkt1473-3.9>
     })
 
@@ -629,7 +629,7 @@ test:do_execsql_test(
         )
     ]], {
         -- <tkt1473-5.7>
-        0
+        false
         -- </tkt1473-5.7>
     })
 
@@ -719,7 +719,7 @@ test:do_execsql_test(
         )
     ]], {
         -- <tkt1473-6.5>
-        1
+        true
         -- </tkt1473-6.5>
     })
 
@@ -749,7 +749,7 @@ test:do_execsql_test(
         )
     ]], {
         -- <tkt1473-6.6>
-        1
+        true
         -- </tkt1473-6.6>
     })
 
@@ -779,7 +779,7 @@ test:do_execsql_test(
         )
     ]], {
         -- <tkt1473-6.7>
-        0
+        false
         -- </tkt1473-6.7>
     })
 
@@ -809,7 +809,7 @@ test:do_execsql_test(
         )
     ]], {
         -- <tkt1473-6.8>
-        1
+        true
         -- </tkt1473-6.8>
     })
 
@@ -839,7 +839,7 @@ test:do_execsql_test(
         )
     ]], {
         -- <tkt1473-6.9>
-        0
+        false
         -- </tkt1473-6.9>
     })
 
@@ -873,7 +873,7 @@ test:do_execsql_test(
         )
     ]], {
         -- <tkt1473-7.3>
-        1
+        true
         -- </tkt1473-7.3>
     })
 
@@ -897,7 +897,7 @@ test:do_execsql_test(
         )
     ]], {
         -- <tkt1473-7.5>
-        0
+        false
         -- </tkt1473-7.5>
     })
 
@@ -953,7 +953,7 @@ test:do_execsql_test(
         )
     ]], {
         -- <tkt1473-8.5>
-        0
+        false
         -- </tkt1473-8.5>
     })
 
@@ -965,7 +965,7 @@ test:do_execsql_test(
         )
     ]], {
         -- <tkt1473-8.6>
-        1
+        true
         -- </tkt1473-8.6>
     })
 
@@ -989,7 +989,7 @@ test:do_execsql_test(
         )
     ]], {
         -- <tkt1473-8.8>
-        0
+        false
         -- </tkt1473-8.8>
     })
 
diff --git a/test/sql-tap/tkt3346.test.lua b/test/sql-tap/tkt3346.test.lua
index ce57a2db0..12c1785bf 100755
--- a/test/sql-tap/tkt3346.test.lua
+++ b/test/sql-tap/tkt3346.test.lua
@@ -33,7 +33,7 @@ test:do_test(
         ]]
     end, {
         -- <tkt3346-1.1>
-        2, "bob", 0, 1, "alice", 1, 3, "claire", 0
+        2, "bob", false, 1, "alice", true, 3, "claire", false
         -- </tkt3346-1.1>
     })
 
diff --git a/test/sql-tap/tkt3493.test.lua b/test/sql-tap/tkt3493.test.lua
index 67e79da72..7ceec4702 100755
--- a/test/sql-tap/tkt3493.test.lua
+++ b/test/sql-tap/tkt3493.test.lua
@@ -129,7 +129,7 @@ test:do_execsql_test(
         SELECT a=123 FROM t1 GROUP BY a 
     ]], {
         -- <tkt3493-2.2.1>
-        1
+        true
         -- </tkt3493-2.2.1>
     })
 
@@ -139,7 +139,7 @@ test:do_execsql_test(
         SELECT a=123 FROM t1 
     ]], {
         -- <tkt3493-2.2.2>
-        1
+        true
         -- </tkt3493-2.2.2>
     })
 
@@ -149,7 +149,7 @@ test:do_execsql_test(
         SELECT a='123' FROM t1 
     ]], {
         -- <tkt3493-2.2.3>
-        1
+        true
         -- </tkt3493-2.2.3>
     })
 
@@ -159,7 +159,7 @@ test:do_execsql_test(
         SELECT count(*), a=123 FROM t1 
     ]], {
         -- <tkt3493-2.2.4>
-        1, 1
+        1, true
         -- </tkt3493-2.2.4>
     })
 
@@ -169,7 +169,7 @@ test:do_execsql_test(
         SELECT count(*), +a=123 FROM t1 
     ]], {
         -- <tkt3493-2.2.5>
-        1, 1
+        1, true
         -- </tkt3493-2.2.5>
     })
 
@@ -179,7 +179,7 @@ test:do_execsql_test(
         SELECT b='456' FROM t1 GROUP BY a 
     ]], {
         -- <tkt3493-2.3.3>
-        1
+        true
         -- </tkt3493-2.3.3>
     })
 
@@ -189,7 +189,7 @@ test:do_execsql_test(
         SELECT b='456' FROM t1 GROUP BY b 
     ]], {
         -- <tkt3493-2.3.1>
-        1
+        true
         -- </tkt3493-2.3.1>
     })
 
@@ -199,7 +199,7 @@ test:do_execsql_test(
         SELECT b='456' FROM t1 
     ]], {
         -- <tkt3493-2.3.2>
-        1
+        true
         -- </tkt3493-2.3.2>
     })
 
@@ -264,7 +264,7 @@ test:do_execsql_test(
         SELECT a='abc' FROM t2 GROUP BY a 
     ]], {
         -- <tkt3493-3.2.1>
-        1
+        true
         -- </tkt3493-3.2.1>
     })
 
@@ -274,7 +274,7 @@ test:do_execsql_test(
         SELECT a='abc' FROM t2 
     ]], {
         -- <tkt3493-3.2.2>
-        1
+        true
         -- </tkt3493-3.2.2>
     })
 
@@ -284,7 +284,7 @@ test:do_execsql_test(
         SELECT a>b FROM t2 GROUP BY a, b
     ]], {
         -- <tkt3493-3.3.1>
-        0
+        false
         -- </tkt3493-3.3.1>
     })
 
@@ -294,7 +294,7 @@ test:do_execsql_test(
         SELECT a>b COLLATE "binary" FROM t2 GROUP BY a, b
     ]], {
         -- <tkt3493-3.3.2>
-        1
+        true
         -- </tkt3493-3.3.2>
     })
 
@@ -304,7 +304,7 @@ test:do_execsql_test(
         SELECT b>a FROM t2 GROUP BY a, b
     ]], {
         -- <tkt3493-3.3.3>
-        1
+        true
         -- </tkt3493-3.3.3>
     })
 
@@ -314,7 +314,7 @@ test:do_execsql_test(
         SELECT b>a COLLATE "unicode_ci" FROM t2 GROUP BY a, b
     ]], {
         -- <tkt3493-3.3.4>
-        1
+        true
         -- </tkt3493-3.3.4>
     })
 
diff --git a/test/sql-tap/triggerC.test.lua b/test/sql-tap/triggerC.test.lua
index 0d4024224..cf7dd7b1a 100755
--- a/test/sql-tap/triggerC.test.lua
+++ b/test/sql-tap/triggerC.test.lua
@@ -870,7 +870,7 @@ test:do_test(
         ]]
     end, {
         -- <triggerC-11.4>
-        "", "", 1, 1
+        "", "", true, true
         -- </triggerC-11.4>
     })
 
diff --git a/test/sql-tap/types.test.lua b/test/sql-tap/types.test.lua
index 8de87b5bf..1cbb577ac 100755
--- a/test/sql-tap/types.test.lua
+++ b/test/sql-tap/types.test.lua
@@ -216,7 +216,7 @@ test:do_execsql_test(
         SELECT a IS NULL FROM t3;
     ]], {
         -- <types-2.3.2>
-        1
+        true
         -- </types-2.3.2>
     })
 
diff --git a/test/sql-tap/where5.test.lua b/test/sql-tap/where5.test.lua
index e46694871..749201564 100755
--- a/test/sql-tap/where5.test.lua
+++ b/test/sql-tap/where5.test.lua
@@ -422,7 +422,7 @@ test:do_execsql_test("where5-4.6", [[
     SELECT x IS NULL FROM t3
 ]], {
     -- <where5-4.6>
-    0, 0, 0
+    false, false, false
     -- </where5-4.6>
 })
 
@@ -430,7 +430,7 @@ test:do_execsql_test("where5-4.7", [[
     SELECT x IS NOT NULL FROM t3
 ]], {
     -- <where5-4.7>
-    1, 1, 1
+    true, true, true
     -- </where5-4.7>
 })
 
diff --git a/test/sql-tap/whereB.test.lua b/test/sql-tap/whereB.test.lua
index e04e37dc4..f75d0772c 100755
--- a/test/sql-tap/whereB.test.lua
+++ b/test/sql-tap/whereB.test.lua
@@ -41,7 +41,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-1.1>
-    1, 2, 1
+    1, 2, true
     -- </whereB-1.1>
     })
 
@@ -52,7 +52,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-1.2>
-    1, 2, 1
+    1, 2, true
     -- </whereB-1.2>
     })
 
@@ -63,7 +63,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-1.3>
-    1, 2, 1
+    1, 2, true
     -- </whereB-1.3>
     })
 
@@ -74,7 +74,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-1.4>
-    1, 2, 1
+    1, 2, true
     -- </whereB-1.4>
     })
 
@@ -86,7 +86,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-1.100>
-    1, 2, 1
+    1, 2, true
     -- </whereB-1.100>
     })
 
@@ -97,7 +97,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-1.101>
-    1, 2, 1
+    1, 2, true
     -- </whereB-1.101>
     })
 
@@ -108,7 +108,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-1.102>
-    1, 2, 1
+    1, 2, true
     -- </whereB-1.102>
     })
 
@@ -137,7 +137,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-2.1>
-    1, 2, 0
+    1, 2, false
     -- </whereB-2.1>
     })
 
@@ -233,7 +233,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-3.1>
-    1, 2, 0
+    1, 2, false
     -- </whereB-3.1>
     })
 
@@ -329,7 +329,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-4.1>
-    1, 2, 1
+    1, 2, true
     -- </whereB-4.1>
     })
 
@@ -340,7 +340,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-4.2>
-    1, 2, 1
+    1, 2, true
     -- </whereB-4.2>
     })
 
@@ -351,7 +351,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-4.3>
-    1, 2, 1
+    1, 2, true
     -- </whereB-4.3>
     })
 
@@ -364,7 +364,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-4.4>
-    1, 2, 1
+    1, 2, true
     -- </whereB-4.4>
     })
 
@@ -376,7 +376,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-4.100>
-    1, 2, 1
+    1, 2, true
     -- </whereB-4.100>
     })
 
@@ -387,7 +387,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-4.101>
-    1, 2, 1
+    1, 2, true
     -- </whereB-4.101>
     })
 
@@ -400,7 +400,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-4.102>
-    1, 2, 1
+    1, 2, true
     -- </whereB-4.102>
     })
 
@@ -429,7 +429,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-5.1>
-    1, 2, 1
+    1, 2, true
     -- </whereB-5.1>
     })
 
@@ -440,7 +440,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-5.2>
-    1, 2, 1
+    1, 2, true
     -- </whereB-5.2>
     })
 
@@ -451,7 +451,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-5.3>
-    1, 2, 1
+    1, 2, true
     -- </whereB-5.3>
     })
 
@@ -464,7 +464,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-5.4>
-    1, 2, 1
+    1, 2, true
     -- </whereB-5.4>
     })
 
@@ -476,7 +476,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-5.100>
-    1, 2, 1
+    1, 2, true
     -- </whereB-5.100>
     })
 
@@ -487,7 +487,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-5.101>
-    1, 2, 1
+    1, 2, true
     -- </whereB-5.101>
     })
 
@@ -500,7 +500,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-5.102>
-    1, 2, 1
+    1, 2, true
     -- </whereB-5.102>
     })
 
@@ -529,7 +529,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-6.1>
-    1, 2, 1
+    1, 2, true
     -- </whereB-6.1>
     })
 
@@ -540,7 +540,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-6.2>
-    1, 2, 1
+    1, 2, true
     -- </whereB-6.2>
     })
 
@@ -551,7 +551,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-6.3>
-    1, 2, 1
+    1, 2, true
     -- </whereB-6.3>
     })
 
@@ -564,7 +564,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-6.4>
-    1, 2, 1
+    1, 2, true
     -- </whereB-6.4>
     })
 
@@ -576,7 +576,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-6.100>
-    1, 2, 1
+    1, 2, true
     -- </whereB-6.100>
     })
 
@@ -587,7 +587,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-6.101>
-    1, 2, 1
+    1, 2, true
     -- </whereB-6.101>
     })
 
@@ -600,7 +600,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-6.102>
-    1, 2, 1
+    1, 2, true
     -- </whereB-6.102>
     })
 
@@ -629,7 +629,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-7.1>
-    1, 2, 1
+    1, 2, true
     -- </whereB-7.1>
     })
 
@@ -640,7 +640,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-7.2>
-    1, 2, 1
+    1, 2, true
     -- </whereB-7.2>
     })
 
@@ -651,7 +651,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-7.3>
-    1, 2, 1
+    1, 2, true
     -- </whereB-7.3>
     })
 
@@ -664,7 +664,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-7.4>
-    1, 2, 1
+    1, 2, true
     -- </whereB-7.4>
     })
 
@@ -676,7 +676,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-7.100>
-    1, 2, 1
+    1, 2, true
     -- </whereB-7.100>
     })
 
@@ -687,7 +687,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-7.101>
-    1, 2, 1
+    1, 2, true
     -- </whereB-7.101>
     })
 
@@ -700,7 +700,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-7.102>
-    1, 2, 1
+    1, 2, true
     -- </whereB-7.102>
     })
 
@@ -729,7 +729,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-8.1>
-    1, 2, 1
+    1, 2, true
     -- </whereB-8.1>
     })
 
@@ -740,7 +740,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-8.2>
-    1, 2, 1
+    1, 2, true
     -- </whereB-8.2>
     })
 
@@ -751,7 +751,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-8.3>
-    1, 2, 1
+    1, 2, true
     -- </whereB-8.3>
     })
 
@@ -764,7 +764,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-8.4>
-    1, 2, 1
+    1, 2, true
     -- </whereB-8.4>
     })
 
@@ -776,7 +776,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-8.100>
-    1, 2, 1
+    1, 2, true
     -- </whereB-8.100>
     })
 
@@ -787,7 +787,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-8.101>
-    1, 2, 1
+    1, 2, true
     -- </whereB-8.101>
     })
 
@@ -800,7 +800,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-8.102>
-    1, 2, 1
+    1, 2, true
     -- </whereB-8.102>
     })
 
@@ -829,7 +829,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-9.1>
-    1, 2, 1
+    1, 2, true
     -- </whereB-9.1>
     })
 
@@ -840,7 +840,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-9.2>
-    1, 2, 1
+    1, 2, true
     -- </whereB-9.2>
     })
 
@@ -851,7 +851,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-9.3>
-    1, 2, 1
+    1, 2, true
     -- </whereB-9.3>
     })
 
@@ -864,7 +864,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-9.4>
-    1, 2, 1
+    1, 2, true
     -- </whereB-9.4>
     })
 
@@ -876,7 +876,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-9.100>
-    1, 2, 1
+    1, 2, true
     -- </whereB-9.100>
     })
 
@@ -887,7 +887,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-9.101>
-    1, 2, 1
+    1, 2, true
     -- </whereB-9.101>
     })
 
@@ -900,7 +900,7 @@ test:do_execsql_test(
     ]],
     {
     -- <whereB-9.102>
-    1, 2, 1
+    1, 2, true
     -- </whereB-9.102>
     })
 
diff --git a/test/sql-tap/with2.test.lua b/test/sql-tap/with2.test.lua
index 48f737725..8c7f9f2d9 100755
--- a/test/sql-tap/with2.test.lua
+++ b/test/sql-tap/with2.test.lua
@@ -338,7 +338,7 @@ test:do_execsql_test(
     4.2,
 genstmt(10), {
         -- <4.2>
-        1
+        true
         -- </4.2>
     })
 
@@ -346,7 +346,7 @@ test:do_execsql_test(
     4.3,
 genstmt(100), {
         -- <4.3>
-        1
+        true
         -- </4.3>
     })
 
@@ -354,7 +354,7 @@ test:do_execsql_test(
     4.4,
 genstmt(255), {
         -- <4.4>
-        1
+        true
         -- </4.4>
     })
 
-- 
2.15.1

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

* [tarantool-patches] [PATCH 2/2] sql: fix antisymmetric boolean comparison in VDBE
  2019-06-25 11:42 [tarantool-patches] [PATCH 0/2] sql: boolean introduction follow-ups Nikita Pettik
  2019-06-25 11:42 ` [tarantool-patches] [PATCH 1/2] sqltester: don't convert booleans to 0/1 numerics Nikita Pettik
@ 2019-06-25 11:42 ` Nikita Pettik
  2019-06-27 19:02 ` [tarantool-patches] Re: [PATCH 0/2] sql: boolean introduction follow-ups Vladislav Shpilevoy
  2019-07-11  9:13 ` Kirill Yukhin
  3 siblings, 0 replies; 5+ messages in thread
From: Nikita Pettik @ 2019-06-25 11:42 UTC (permalink / raw)
  To: tarantool-patches; +Cc: Nikita Pettik

There are a few situations when booleans can be compared with values of
other types. To process them, we assume that booleans are always less
than numbers, which in turn are less than strings. On the other hand,
function which implements internal comparison of values -
sqlMemCompare() always returns 'less' result if one of values is boolean
and another one is not, ignoring the order of values. For instance:

... max (false, 'abc') -> 'abc'
... max ('abc', false) -> false

This patch fixes this misbehaviour making boolean values always less
than values of other types.
---
 src/box/sql/vdbeaux.c       |  2 ++
 test/sql-tap/func5.test.lua | 30 +++++++++++++++++++++++++++++-
 test/sql-tap/in1.test.lua   |  2 +-
 3 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/src/box/sql/vdbeaux.c b/src/box/sql/vdbeaux.c
index baeeb4624..d1388f20d 100644
--- a/src/box/sql/vdbeaux.c
+++ b/src/box/sql/vdbeaux.c
@@ -2955,6 +2955,8 @@ sqlMemCompare(const Mem * pMem1, const Mem * pMem2, const struct coll * pColl)
 				return 1;
 			return -1;
 		}
+		if ((f2 & MEM_Bool) != 0)
+			return +1;
 		return -1;
 	}
 
diff --git a/test/sql-tap/func5.test.lua b/test/sql-tap/func5.test.lua
index f3706e631..6da089994 100755
--- a/test/sql-tap/func5.test.lua
+++ b/test/sql-tap/func5.test.lua
@@ -1,6 +1,6 @@
 #!/usr/bin/env tarantool
 test = require("sqltester")
-test:plan(15)
+test:plan(19)
 
 --!./tcltestrunner.lua
 -- 2010 August 27
@@ -229,4 +229,32 @@ test:do_catchsql_test(
     }
 )
 
+-- Order of arguments of min/max functions doesn't affect
+-- the result: boolean is always less than numbers, which
+-- are less than strings.
+--
+test:do_execsql_test(
+    "func-5-4.1",
+    [[
+        SELECT max (false, 'STR', 1, 0.5);
+    ]], { "STR" } )
+
+test:do_execsql_test(
+    "func-5-4.2",
+    [[
+        SELECT max ('STR', 1, 0.5, false);
+    ]], { "STR" } )
+
+test:do_execsql_test(
+    "func-5-4.3",
+    [[
+        SELECT min ('STR', 1, 0.5, false);
+    ]], { false } )
+
+test:do_execsql_test(
+    "func-5-4.4",
+    [[
+        SELECT min (false, 'STR', 1, 0.5);
+    ]], { false } )
+
 test:finish_test()
diff --git a/test/sql-tap/in1.test.lua b/test/sql-tap/in1.test.lua
index eca7c15ba..50c4e4837 100755
--- a/test/sql-tap/in1.test.lua
+++ b/test/sql-tap/in1.test.lua
@@ -207,7 +207,7 @@ test:do_execsql_test(
 test:do_execsql_test(
     "in-2.10",
     [[
-        SELECT a FROM t1 WHERE min(0,b IN (a,30)) <> 0
+        SELECT a FROM t1 WHERE min(0, CAST(b IN (a,30) AS INT)) <> 0
     ]], {
         -- <in-2.10>
         
-- 
2.15.1

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

* [tarantool-patches] Re: [PATCH 0/2] sql: boolean introduction follow-ups
  2019-06-25 11:42 [tarantool-patches] [PATCH 0/2] sql: boolean introduction follow-ups Nikita Pettik
  2019-06-25 11:42 ` [tarantool-patches] [PATCH 1/2] sqltester: don't convert booleans to 0/1 numerics Nikita Pettik
  2019-06-25 11:42 ` [tarantool-patches] [PATCH 2/2] sql: fix antisymmetric boolean comparison in VDBE Nikita Pettik
@ 2019-06-27 19:02 ` Vladislav Shpilevoy
  2019-07-11  9:13 ` Kirill Yukhin
  3 siblings, 0 replies; 5+ messages in thread
From: Vladislav Shpilevoy @ 2019-06-27 19:02 UTC (permalink / raw)
  To: tarantool-patches, Nikita Pettik, Kirill Yukhin

Hi! Thanks for the patchset!

LGTM.

On 25/06/2019 13:42, Nikita Pettik wrote:
> Branch: https://github.com/tarantool/tarantool/tree/np/boolean-follow-ups
> 
> First patch gets rid of redundant conversion of results from booleans
> to numeric values 0 and 1 in testing framework (sqltester).
> 
> Second one fixes obvious bug during comparison of booleans with values
> of other types.
> 
> Nikita Pettik (2):
>   sqltester: don't convert booleans to 0/1 numerics
>   sql: fix antisymmetric boolean comparison in VDBE
> 
>  src/box/sql/vdbeaux.c                              |   2 +
>  test/sql-tap/atof1.test.lua                        |   2 +-
>  test/sql-tap/autoinc.test.lua                      |   2 +-
>  test/sql-tap/cse.test.lua                          |  10 +-
>  test/sql-tap/e_select1.test.lua                    |   8 +-
>  test/sql-tap/func.test.lua                         |  42 +++---
>  test/sql-tap/func5.test.lua                        |  30 ++++-
>  .../gh-3251-string-pattern-comparison.test.lua     |  18 +--
>  test/sql-tap/in1.test.lua                          |  26 ++--
>  test/sql-tap/in2.test.lua                          |   2 +-
>  test/sql-tap/in3.test.lua                          |  16 +--
>  test/sql-tap/in4.test.lua                          |   2 +-
>  test/sql-tap/insert1.test.lua                      |   4 +-
>  test/sql-tap/lua/sqltester.lua                     |  24 ----
>  test/sql-tap/lua_sql.test.lua                      |   2 +-
>  test/sql-tap/misc1.test.lua                        |   6 +-
>  test/sql-tap/select1.test.lua                      |   2 +-
>  test/sql-tap/select7.test.lua                      |   4 +-
>  test/sql-tap/selectG.test.lua                      |   2 +-
>  test/sql-tap/sql-errors.test.lua                   |   4 +-
>  test/sql-tap/subquery.test.lua                     |   6 +-
>  test/sql-tap/subselect.test.lua                    |   4 +-
>  test/sql-tap/tkt-80e031a00f.test.lua               | 148 ++++++++++-----------
>  test/sql-tap/tkt-a7b7803e.test.lua                 |  16 +--
>  test/sql-tap/tkt-b351d95f9.test.lua                |   2 +-
>  test/sql-tap/tkt1473.test.lua                      |  30 ++---
>  test/sql-tap/tkt3346.test.lua                      |   2 +-
>  test/sql-tap/tkt3493.test.lua                      |  28 ++--
>  test/sql-tap/triggerC.test.lua                     |   2 +-
>  test/sql-tap/types.test.lua                        |   2 +-
>  test/sql-tap/where5.test.lua                       |   4 +-
>  test/sql-tap/whereB.test.lua                       | 102 +++++++-------
>  test/sql-tap/with2.test.lua                        |   6 +-
>  33 files changed, 283 insertions(+), 277 deletions(-)
> 

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

* [tarantool-patches] Re: [PATCH 0/2] sql: boolean introduction follow-ups
  2019-06-25 11:42 [tarantool-patches] [PATCH 0/2] sql: boolean introduction follow-ups Nikita Pettik
                   ` (2 preceding siblings ...)
  2019-06-27 19:02 ` [tarantool-patches] Re: [PATCH 0/2] sql: boolean introduction follow-ups Vladislav Shpilevoy
@ 2019-07-11  9:13 ` Kirill Yukhin
  3 siblings, 0 replies; 5+ messages in thread
From: Kirill Yukhin @ 2019-07-11  9:13 UTC (permalink / raw)
  To: tarantool-patches; +Cc: Nikita Pettik

Hello,

On 25 Jun 14:42, Nikita Pettik wrote:
> Branch: https://github.com/tarantool/tarantool/tree/np/boolean-follow-ups
> 
> First patch gets rid of redundant conversion of results from booleans
> to numeric values 0 and 1 in testing framework (sqltester).
> 
> Second one fixes obvious bug during comparison of booleans with values
> of other types.
> 
> Nikita Pettik (2):
>   sqltester: don't convert booleans to 0/1 numerics
>   sql: fix antisymmetric boolean comparison in VDBE

I've checked your patches into master.

--
Regrads, Kirill Yukhin

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

end of thread, other threads:[~2019-07-11  9:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-25 11:42 [tarantool-patches] [PATCH 0/2] sql: boolean introduction follow-ups Nikita Pettik
2019-06-25 11:42 ` [tarantool-patches] [PATCH 1/2] sqltester: don't convert booleans to 0/1 numerics Nikita Pettik
2019-06-25 11:42 ` [tarantool-patches] [PATCH 2/2] sql: fix antisymmetric boolean comparison in VDBE Nikita Pettik
2019-06-27 19:02 ` [tarantool-patches] Re: [PATCH 0/2] sql: boolean introduction follow-ups Vladislav Shpilevoy
2019-07-11  9:13 ` Kirill Yukhin

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