Add some basic tests to read rows with scalar subqueries

This commit is contained in:
Raúl Marín 2021-12-22 18:55:16 +01:00
parent 2470a8d380
commit 781fe36391
2 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,9 @@
#02136_scalar_subquery_1 999
#02136_scalar_subquery_2 999 0
#02136_scalar_subquery_3 999 999
#02136_scalar_subquery_4 999
#02136_scalar_subquery_4 999
1001 SELECT \'#02136_scalar_subquery_1\', (SELECT max(number) FROM numbers(1000)) as n;
2001 SELECT \'#02136_scalar_subquery_2\', (SELECT max(number) FROM numbers(1000)) as n, (SELECT min(number) FROM numbers(1000)) as n2;
1001 SELECT \'#02136_scalar_subquery_3\', (SELECT max(number) FROM numbers(1000)) as n, (SELECT max(number) FROM numbers(1000)) as n2;
1002 SELECT \'#02136_scalar_subquery_4\', (SELECT max(number) FROM numbers(1000)) as n FROM system.numbers LIMIT 2;

View File

@ -0,0 +1,13 @@
SELECT '#02136_scalar_subquery_1', (SELECT max(number) FROM numbers(1000)) as n;
SELECT '#02136_scalar_subquery_2', (SELECT max(number) FROM numbers(1000)) as n, (SELECT min(number) FROM numbers(1000)) as n2;
SELECT '#02136_scalar_subquery_3', (SELECT max(number) FROM numbers(1000)) as n, (SELECT max(number) FROM numbers(1000)) as n2; -- Cached
SELECT '#02136_scalar_subquery_4', (SELECT max(number) FROM numbers(1000)) as n FROM system.numbers LIMIT 2; -- Cached
SYSTEM FLUSH LOGS;
SELECT read_rows, query FROM system.query_log
WHERE
event_date > yesterday()
AND type = 'QueryFinish'
AND current_database == currentDatabase()
AND query LIKE 'SELECT ''#02136_scalar_subquery_%'
ORDER BY query ASC;