mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-10-19 06:50:50 +00:00
36 lines
975 B
MySQL
36 lines
975 B
MySQL
|
USE test;
|
||
|
|
||
|
DROP TABLE IF EXISTS t1;
|
||
|
DROP TABLE IF EXISTS t2;
|
||
|
|
||
|
CREATE TABLE t1 (a Int8, b Nullable(Int8)) ENGINE = Memory;
|
||
|
CREATE TABLE t2 (a Int8, b Nullable(Int8)) ENGINE = Memory;
|
||
|
|
||
|
INSERT INTO t1 values (1,1), (2,2);
|
||
|
INSERT INTO t2 values (1,1);
|
||
|
INSERT INTO t2 (a) values (2), (3);
|
||
|
|
||
|
SELECT 'cross';
|
||
|
SELECT * FROM t1 cross join t2 where t1.a = t2.a;
|
||
|
SELECT 'cross nullable';
|
||
|
SELECT * FROM t1 cross join t2 where t1.b = t2.b;
|
||
|
SELECT 'cross nullable vs not nullable';
|
||
|
SELECT * FROM t1 cross join t2 where t1.a = t2.b;
|
||
|
|
||
|
SET enable_debug_queries = 1;
|
||
|
AST SELECT * FROM t1 cross join t2 where t1.a = t2.a;
|
||
|
|
||
|
SET allow_experimental_cross_to_join_conversion = 1;
|
||
|
|
||
|
AST SELECT * FROM t1 cross join t2 where t1.a = t2.a;
|
||
|
|
||
|
SELECT 'cross';
|
||
|
SELECT * FROM t1 cross join t2 where t1.a = t2.a;
|
||
|
SELECT 'cross nullable';
|
||
|
SELECT * FROM t1 cross join t2 where t1.b = t2.b;
|
||
|
SELECT 'cross nullable vs not nullable';
|
||
|
SELECT * FROM t1 cross join t2 where t1.a = t2.b;
|
||
|
|
||
|
DROP TABLE t1;
|
||
|
DROP TABLE t2;
|