Add test 02725_any_join_single_row

This commit is contained in:
vdimir 2023-05-04 14:08:03 +00:00
parent 62f950ddaf
commit 0f0958f82d
No known key found for this signature in database
GPG Key ID: 6EE4CE2BEDC51862
2 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,3 @@
Join(ANY, LEFT, key) 0 1
Join(ANY, LEFT, key) 1 1
Join(ANY, LEFT, key) 1 1

View File

@ -0,0 +1,26 @@
CREATE TABLE join_test
(
`key` UInt64,
`value` UInt64
)
ENGINE = Join(ANY, LEFT, key);
CREATE TEMPORARY TABLE initial_table_size AS
SELECT engine_full, total_rows, total_bytes FROM system.tables WHERE (name = 'join_test') AND (database = currentDatabase());
SELECT engine_full, total_rows, total_bytes < 100_000 FROM initial_table_size;
INSERT INTO join_test (key, value) SELECT 1, number FROM numbers(1);
CREATE TEMPORARY TABLE one_row_table_size AS
SELECT engine_full, total_rows, total_bytes FROM system.tables WHERE (name = 'join_test') AND (database = currentDatabase());
SELECT engine_full, total_rows, total_bytes < 2 * (SELECT total_bytes FROM initial_table_size) FROM one_row_table_size;
INSERT INTO join_test (key, value) SELECT 1, number FROM numbers(1);
INSERT INTO join_test (key, value) SELECT 1, number FROM numbers(1);
INSERT INTO join_test (key, value) SELECT 1, number FROM numbers(1);
INSERT INTO join_test (key, value) SELECT 1, number FROM numbers(10_000);
SELECT engine_full, total_rows, total_bytes == (SELECT total_bytes FROM one_row_table_size) FROM system.tables WHERE (name = 'join_test') AND (database = currentDatabase());