156 lines
4.3 KiB
SQL
156 lines
4.3 KiB
SQL
# name: test/optimizer/compare_blob.test
|
|
# description: Test case simplification
|
|
# group: [optimizer]
|
|
|
|
statement ok
|
|
CREATE TABLE t1(c0 BLOB);
|
|
|
|
statement ok
|
|
CREATE TABLE t0(c0 BIT);
|
|
|
|
statement ok
|
|
INSERT INTO t0(c0) VALUES (0);
|
|
|
|
statement ok
|
|
INSERT INTO t0(c0) VALUES (1);
|
|
|
|
statement ok
|
|
INSERT INTO t0(c0) VALUES (2);
|
|
|
|
statement ok
|
|
INSERT INTO t0(c0) VALUES (3);
|
|
|
|
statement ok
|
|
INSERT INTO t0(c0) VALUES (4);
|
|
|
|
statement ok
|
|
INSERT INTO t0(c0) VALUES (5);
|
|
|
|
statement ok
|
|
INSERT INTO t1(c0) VALUES (X'41');
|
|
|
|
statement ok
|
|
INSERT INTO t1(c0) VALUES ( X'123456');
|
|
|
|
statement ok
|
|
INSERT INTO t1(c0) VALUES ('2119350449');
|
|
|
|
statement ok
|
|
INSERT INTO t1(c0) VALUES ( X'48656C6C6F');
|
|
|
|
statement ok
|
|
INSERT INTO t1(c0) VALUES (E'\\xabcd');
|
|
|
|
statement ok
|
|
INSERT INTO t1(c0) VALUES (CAST('' AS BLOB));
|
|
|
|
|
|
query III
|
|
SELECT t0.c0, t1.c0, (t1.c0)>=(CAST(t0.c0 AS BLOB)) FROM t0, t1 WHERE ((t1.c0)>=(CAST(t0.c0 AS BLOB))) ORDER BY ALL;
|
|
----
|
|
00000000000000000000000000000000 2119350449 1
|
|
00000000000000000000000000000000 x123456 1
|
|
00000000000000000000000000000000 x41 1
|
|
00000000000000000000000000000000 x48656C6C6F 1
|
|
00000000000000000000000000000000 \xABcd 1
|
|
00000000000000000000000000000001 2119350449 1
|
|
00000000000000000000000000000001 x123456 1
|
|
00000000000000000000000000000001 x41 1
|
|
00000000000000000000000000000001 x48656C6C6F 1
|
|
00000000000000000000000000000001 \xABcd 1
|
|
00000000000000000000000000000010 2119350449 1
|
|
00000000000000000000000000000010 x123456 1
|
|
00000000000000000000000000000010 x41 1
|
|
00000000000000000000000000000010 x48656C6C6F 1
|
|
00000000000000000000000000000010 \xABcd 1
|
|
00000000000000000000000000000011 2119350449 1
|
|
00000000000000000000000000000011 x123456 1
|
|
00000000000000000000000000000011 x41 1
|
|
00000000000000000000000000000011 x48656C6C6F 1
|
|
00000000000000000000000000000011 \xABcd 1
|
|
00000000000000000000000000000100 2119350449 1
|
|
00000000000000000000000000000100 x123456 1
|
|
00000000000000000000000000000100 x41 1
|
|
00000000000000000000000000000100 x48656C6C6F 1
|
|
00000000000000000000000000000100 \xABcd 1
|
|
00000000000000000000000000000101 2119350449 1
|
|
00000000000000000000000000000101 x123456 1
|
|
00000000000000000000000000000101 x41 1
|
|
00000000000000000000000000000101 x48656C6C6F 1
|
|
00000000000000000000000000000101 \xABcd 1
|
|
|
|
|
|
|
|
## original issue
|
|
|
|
|
|
statement ok
|
|
CREATE OR REPLACE TABLE t1(c0 BLOB);
|
|
|
|
statement ok
|
|
CREATE OR REPLACE TABLE t0(c0 BIT);
|
|
|
|
statement ok
|
|
CREATE OR REPLACE VIEW v0(c0) AS SELECT 1 FROM t1, t0 GROUP BY t0.c0;
|
|
|
|
statement ok
|
|
INSERT INTO t0(c0) VALUES ( NULL);
|
|
|
|
statement ok
|
|
INSERT INTO t0(c0) VALUES (0);
|
|
|
|
statement ok
|
|
INSERT INTO t0(c0) VALUES ( 1);
|
|
|
|
statement ok
|
|
INSERT INTO t1(c0) VALUES (X'41');
|
|
|
|
statement ok
|
|
INSERT INTO t1(c0) VALUES ( X'123456');
|
|
|
|
statement ok
|
|
INSERT INTO t1(c0) VALUES ('2119350449');
|
|
|
|
statement ok
|
|
INSERT INTO t1(c0) VALUES ( X'48656C6C6F');
|
|
|
|
statement ok
|
|
INSERT INTO t1(c0) VALUES (E'\\xabcd');
|
|
|
|
statement ok
|
|
INSERT INTO t1(c0) VALUES (CAST('' AS BLOB));
|
|
|
|
query III
|
|
SELECT t0.c0, t1.c0, (t1.c0)>=(CAST(t0.c0 AS BLOB)) FROM t0, v0, t1 WHERE ((t1.c0)>=(CAST(t0.c0 AS BLOB))) ORDER BY ALL
|
|
----
|
|
00000000000000000000000000000000 2119350449 true
|
|
00000000000000000000000000000000 2119350449 true
|
|
00000000000000000000000000000000 2119350449 true
|
|
00000000000000000000000000000000 x123456 true
|
|
00000000000000000000000000000000 x123456 true
|
|
00000000000000000000000000000000 x123456 true
|
|
00000000000000000000000000000000 x41 true
|
|
00000000000000000000000000000000 x41 true
|
|
00000000000000000000000000000000 x41 true
|
|
00000000000000000000000000000000 x48656C6C6F true
|
|
00000000000000000000000000000000 x48656C6C6F true
|
|
00000000000000000000000000000000 x48656C6C6F true
|
|
00000000000000000000000000000000 \xABcd true
|
|
00000000000000000000000000000000 \xABcd true
|
|
00000000000000000000000000000000 \xABcd true
|
|
00000000000000000000000000000001 2119350449 true
|
|
00000000000000000000000000000001 2119350449 true
|
|
00000000000000000000000000000001 2119350449 true
|
|
00000000000000000000000000000001 x123456 true
|
|
00000000000000000000000000000001 x123456 true
|
|
00000000000000000000000000000001 x123456 true
|
|
00000000000000000000000000000001 x41 true
|
|
00000000000000000000000000000001 x41 true
|
|
00000000000000000000000000000001 x41 true
|
|
00000000000000000000000000000001 x48656C6C6F true
|
|
00000000000000000000000000000001 x48656C6C6F true
|
|
00000000000000000000000000000001 x48656C6C6F true
|
|
00000000000000000000000000000001 \xABcd true
|
|
00000000000000000000000000000001 \xABcd true
|
|
00000000000000000000000000000001 \xABcd true
|