mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Merge pull request #23378 from ClickHouse/add-test-2582
Add test for #2582
This commit is contained in:
commit
71c27a4dc0
@ -0,0 +1 @@
|
|||||||
|
Ok
|
27
tests/queries/0_stateless/01834_alias_columns_laziness_filimonov.sh
Executable file
27
tests/queries/0_stateless/01834_alias_columns_laziness_filimonov.sh
Executable file
@ -0,0 +1,27 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||||
|
# shellcheck source=../shell_config.sh
|
||||||
|
. "$CUR_DIR"/../shell_config.sh
|
||||||
|
|
||||||
|
${CLICKHOUSE_CLIENT} --multiquery --query "
|
||||||
|
drop table if exists aliases_lazyness;
|
||||||
|
create table aliases_lazyness (x UInt32, y ALIAS sleepEachRow(0.1)) Engine=MergeTree ORDER BY x;
|
||||||
|
insert into aliases_lazyness(x) select * from numbers(40);
|
||||||
|
"
|
||||||
|
|
||||||
|
# In very old ClickHouse versions alias column was calculated for every row.
|
||||||
|
# If it works this way, the query will take at least 0.1 * 40 = 4 seconds.
|
||||||
|
# If the issue does not exist, the query should take slightly more than 0.1 seconds.
|
||||||
|
# The exact time is not guaranteed, so we check in a loop that at least once
|
||||||
|
# the query will process in less than one second, that proves that the behaviour is not like it was long time ago.
|
||||||
|
|
||||||
|
while true
|
||||||
|
do
|
||||||
|
timeout 1 ${CLICKHOUSE_CLIENT} --query "SELECT x, y FROM aliases_lazyness WHERE x = 1 FORMAT Null" && break
|
||||||
|
done
|
||||||
|
|
||||||
|
${CLICKHOUSE_CLIENT} --multiquery --query "
|
||||||
|
drop table aliases_lazyness;
|
||||||
|
SELECT 'Ok';
|
||||||
|
"
|
Loading…
Reference in New Issue
Block a user