add tests

This commit is contained in:
MaxWk 2021-11-04 16:46:09 +08:00
parent 1ba71c20fd
commit e264b4dcba
2 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,29 @@
CREATE TABLE test.bool_test\n(\n `value` Bool\n)\nENGINE = Memory
false
true
false
true
false
true
false
true
{"value":false}
{"value":true}
{"value":false}
{"value":true}
{"value":false}
{"value":true}
{"value":false}
{"value":true}
0
1
0
1
0
1
0
1
true
true
true
true

View File

@ -0,0 +1,16 @@
DROP TABLE IF EXISTS test.bool_test;
CREATE TABLE test.bool_test (value Bool) ENGINE = Memory;
-- value column shoud have type 'Bool'
SHOW CREATE TABLE test.bool_test;
INSERT INTO test.bool_test (value) VALUES ('false'), ('true'), (0), (1);
INSERT INTO test.bool_test (value) FORMAT JSONEachRow {"value":false}{"value":true}{"value":0}{"value":1}
SELECT value FROM test.bool_test;
SELECT value FROM test.bool_test FORMAT JSONEachRow;
SELECT toUInt64(value) FROM test.bool_test;
SELECT value FROM test.bool_test where value > 0;
DROP TABLE IF EXISTS test.bool_test;