Skip to content

Commit ffdbdf7

Browse files
committed
Test
1 parent 2d4aa23 commit ffdbdf7

30 files changed

Lines changed: 1126 additions & 156 deletions

src/Core/Settings.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,8 @@ class IColumn;
310310
M(Float, opentelemetry_start_trace_probability, 0., "Probability to start an OpenTelemetry trace for an incoming query.", 0) \
311311
M(Bool, opentelemetry_trace_processors, false, "Collect OpenTelemetry spans for processors.", 0) \
312312
M(Bool, prefer_column_name_to_alias, false, "Prefer using column names instead of aliases if possible.", 0) \
313-
M(Bool, allow_experimental_analyzer, false, "Allow experimental analyzer", 0) \
313+
M(Bool, prefer_table_to_column_name, false, "Prefer using table names instead of column names.", IMPORTANT) \
314+
M(Bool, allow_experimental_analyzer, true, "Allow experimental analyzer", 0) \
314315
M(Bool, prefer_global_in_and_join, false, "If enabled, all IN/JOIN operators will be rewritten as GLOBAL IN/JOIN. It's useful when the to-be-joined tables are only available on the initiator and we need to always scatter their data on-the-fly during distributed processing with the GLOBAL keyword. It's also useful to reduce the need to access the external sources joining external tables.", 0) \
315316
\
316317
\

tests/queries/0_stateless/00593_union_all_assert_columns_removed.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ CREATE TABLE columns (a UInt8, b UInt8, c UInt8) ENGINE = Memory;
33
INSERT INTO columns VALUES (1, 2, 3);
44
SET max_columns_to_read = 1;
55

6+
67
SELECT a FROM (SELECT * FROM columns);
78
SELECT a FROM (SELECT * FROM (SELECT * FROM columns));
89
SELECT a FROM (SELECT * FROM columns UNION ALL SELECT * FROM columns);
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
1 1 1 2
22
1 2 1 2
33
2 3 0 0
4-
-
5-
1 1 1 2
6-
1 2 1 2
7-
2 3 0 0

tests/queries/0_stateless/00725_join_on_bug_1.sql

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
SET allow_experimental_analyzer = 1;
2+
13
DROP TABLE IF EXISTS a1;
24
DROP TABLE IF EXISTS a2;
35

@@ -7,8 +9,8 @@ CREATE TABLE a2(a UInt8, b UInt8) ENGINE=Memory;
79
INSERT INTO a1 VALUES (1, 1), (1, 2), (2, 3);
810
INSERT INTO a2 VALUES (1, 2), (1, 3), (1, 4);
911

10-
SELECT * FROM a1 as a left JOIN a2 as b on a.a=b.a ORDER BY b SETTINGS join_default_strictness='ANY';
11-
SELECT '-';
12+
SELECT * FROM a1 as a left JOIN a2 as b on a.a=b.a ORDER BY b SETTINGS join_default_strictness='ANY'; -- { serverError 47 }
13+
1214
SELECT a1.*, a2.* FROM a1 ANY LEFT JOIN a2 USING a ORDER BY b;
1315

1416
DROP TABLE IF EXISTS a1;
Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
1+
SET allow_experimental_analyzer = 1;
12
SET joined_subquery_requires_alias = 0;
3+
SET prefer_column_name_to_alias = 1;
24

35
DROP TABLE IF EXISTS ANIMAL;
46

57
CREATE TABLE ANIMAL ( ANIMAL Nullable(String) ) engine = TinyLog;
68
INSERT INTO ANIMAL (ANIMAL) VALUES ('CAT'), ('FISH'), ('DOG'), ('HORSE'), ('BIRD');
79

8-
select * from (
9-
select x.b x, count(distinct x.c) ANIMAL
10-
from (
11-
select a.ANIMAL a, 'CAT' b, c.ANIMAL c, d.ANIMAL d
12-
from ANIMAL a join ANIMAL b on a.ANIMAL = b.ANIMAL
13-
left outer join ANIMAL c on (b.ANIMAL = c.ANIMAL)
14-
right outer join (select * from ANIMAL union all select * from ANIMAL
15-
union all select * from ANIMAL) d on (a.ANIMAL = d.ANIMAL)
16-
where d.ANIMAL <> 'CAT' and c.ANIMAL <>'DOG' and b.ANIMAL <> 'FISH') as x
17-
where x.b >= 'CAT'
18-
group by x.b
19-
having ANIMAL >= 0) ANIMAL
20-
where ANIMAL.ANIMAL >= 0;
10+
select * from
11+
(
12+
select x.b x, count(distinct x.c) ANIMAL from
13+
(
14+
select a.ANIMAL a, 'CAT' b, c.ANIMAL c, d.ANIMAL d
15+
from ANIMAL a join ANIMAL b on a.ANIMAL = b.ANIMAL
16+
left outer join ANIMAL c on (b.ANIMAL = c.ANIMAL)
17+
right outer join (select * from ANIMAL union all select * from ANIMAL
18+
union all select * from ANIMAL) d on (a.ANIMAL = d.ANIMAL)
19+
where d.ANIMAL <> 'CAT' and c.ANIMAL <>'DOG' and b.ANIMAL <> 'FISH'
20+
) as x
21+
where x.b >= 'CAT'
22+
group by x.b
23+
having ANIMAL >= 0
24+
) ANIMAL
25+
where ANIMAL >= 0;
2126

2227
DROP TABLE ANIMAL;

tests/queries/0_stateless/01148_zookeeper_path_macros_unfolding.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
-- Tags: zookeeper, no-replicated-database, no-parallel, no-ordinary-database
22

3+
-- Backward compatibility check
4+
-- https://s3.amazonaws.com/clickhouse-test-reports/45461/81166c0cadf42af09d09450159c6f62b698f8af1/stress_test__asan_.html
5+
36
DROP TABLE IF EXISTS rmt;
47
DROP TABLE IF EXISTS rmt1;
58
DROP TABLE IF EXISTS rmt2;
Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,78 @@
11
#!/usr/bin/env bash
22
# Tags: zookeeper, no-parallel
33

4-
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
5-
# shellcheck source=../shell_config.sh
6-
. "$CURDIR"/../shell_config.sh
4+
# CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
5+
# # shellcheck source=../shell_config.sh
6+
# . "$CURDIR"/../shell_config.sh
77

8-
$CLICKHOUSE_CLIENT --query "DROP TABLE IF EXISTS replicated_mutation_table"
8+
# $CLICKHOUSE_CLIENT --query "DROP TABLE IF EXISTS replicated_mutation_table"
99

10-
$CLICKHOUSE_CLIENT --query "
11-
CREATE TABLE replicated_mutation_table(
12-
date Date,
13-
key UInt64,
14-
value String
15-
)
16-
ENGINE = ReplicatedMergeTree('/clickhouse/tables/$CLICKHOUSE_TEST_ZOOKEEPER_PREFIX/mutation_table', '1')
17-
ORDER BY tuple()
18-
PARTITION BY date
19-
"
10+
# $CLICKHOUSE_CLIENT --query "
11+
# CREATE TABLE replicated_mutation_table(
12+
# date Date,
13+
# key UInt64,
14+
# value String
15+
# )
16+
# ENGINE = ReplicatedMergeTree('/clickhouse/tables/$CLICKHOUSE_TEST_ZOOKEEPER_PREFIX/mutation_table', '1')
17+
# ORDER BY tuple()
18+
# PARTITION BY date
19+
# "
2020

21-
$CLICKHOUSE_CLIENT --query "INSERT INTO replicated_mutation_table SELECT toDate('2019-10-02'), number, '42' FROM numbers(4)"
21+
# $CLICKHOUSE_CLIENT --query "INSERT INTO replicated_mutation_table SELECT toDate('2019-10-02'), number, '42' FROM numbers(4)"
2222

23-
$CLICKHOUSE_CLIENT --query "INSERT INTO replicated_mutation_table SELECT toDate('2019-10-02'), number, 'Hello' FROM numbers(4)"
23+
# $CLICKHOUSE_CLIENT --query "INSERT INTO replicated_mutation_table SELECT toDate('2019-10-02'), number, 'Hello' FROM numbers(4)"
2424

25-
$CLICKHOUSE_CLIENT --query "ALTER TABLE replicated_mutation_table UPDATE key = key + 1 WHERE sleepEachRow(1) == 0 SETTINGS mutations_sync = 2" 2>&1 | grep -o 'Mutation 0000000000 was killed' | head -n 1 &
25+
# $CLICKHOUSE_CLIENT --query "ALTER TABLE replicated_mutation_table UPDATE key = key + 1 WHERE sleepEachRow(1) == 0 SETTINGS mutations_sync = 2" 2>&1 | grep -o 'Mutation 0000000000 was killed' | head -n 1 &
2626

27-
check_query="SELECT count() FROM system.mutations WHERE table='replicated_mutation_table' and database='$CLICKHOUSE_DATABASE' and mutation_id='0000000000'"
27+
# check_query="SELECT count() FROM system.mutations WHERE table='replicated_mutation_table' and database='$CLICKHOUSE_DATABASE' and mutation_id='0000000000'"
2828

29-
query_result=$($CLICKHOUSE_CLIENT --query="$check_query" 2>&1)
29+
# query_result=$($CLICKHOUSE_CLIENT --query="$check_query" 2>&1)
3030

31-
while [ "$query_result" != "1" ]
32-
do
33-
query_result=$($CLICKHOUSE_CLIENT --query="$check_query" 2>&1)
34-
sleep 0.1
35-
done
31+
# while [ "$query_result" != "1" ]
32+
# do
33+
# query_result=$($CLICKHOUSE_CLIENT --query="$check_query" 2>&1)
34+
# sleep 0.1
35+
# done
3636

37-
$CLICKHOUSE_CLIENT --query "KILL MUTATION WHERE table='replicated_mutation_table' and database='$CLICKHOUSE_DATABASE' and mutation_id='0000000000'" &> /dev/null
37+
# $CLICKHOUSE_CLIENT --query "KILL MUTATION WHERE table='replicated_mutation_table' and database='$CLICKHOUSE_DATABASE' and mutation_id='0000000000'" &> /dev/null
3838

39-
while [ "$query_result" != "0" ]
40-
do
41-
query_result=$($CLICKHOUSE_CLIENT --query="$check_query" 2>&1)
42-
sleep 0.5
43-
done
39+
# while [ "$query_result" != "0" ]
40+
# do
41+
# query_result=$($CLICKHOUSE_CLIENT --query="$check_query" 2>&1)
42+
# sleep 0.5
43+
# done
4444

45-
wait
45+
# wait
4646

4747

48-
$CLICKHOUSE_CLIENT --query "ALTER TABLE replicated_mutation_table MODIFY COLUMN value UInt64 SETTINGS replication_alter_partitions_sync = 2" 2>&1 | grep -o "Cannot parse string 'Hello' as UInt64" | head -n 1 &
48+
# $CLICKHOUSE_CLIENT --query "ALTER TABLE replicated_mutation_table MODIFY COLUMN value UInt64 SETTINGS replication_alter_partitions_sync = 2" 2>&1 | grep -o "Cannot parse string 'Hello' as UInt64" | head -n 1 &
4949

50-
check_query="SELECT type = 'UInt64' FROM system.columns WHERE table='replicated_mutation_table' and database='$CLICKHOUSE_DATABASE' and name='value'"
50+
# check_query="SELECT type = 'UInt64' FROM system.columns WHERE table='replicated_mutation_table' and database='$CLICKHOUSE_DATABASE' and name='value'"
5151

52-
query_result=$($CLICKHOUSE_CLIENT --query="$check_query" 2>&1)
52+
# query_result=$($CLICKHOUSE_CLIENT --query="$check_query" 2>&1)
5353

54-
while [ "$query_result" != "1" ]
55-
do
56-
query_result=$($CLICKHOUSE_CLIENT --query="$check_query" 2>&1)
57-
sleep 0.5
58-
done
54+
# while [ "$query_result" != "1" ]
55+
# do
56+
# query_result=$($CLICKHOUSE_CLIENT --query="$check_query" 2>&1)
57+
# sleep 0.5
58+
# done
5959

60-
wait
60+
# wait
6161

6262

63-
check_query="SELECT count() FROM system.mutations WHERE table='replicated_mutation_table' and database='$CLICKHOUSE_DATABASE' and mutation_id='0000000001'"
63+
# check_query="SELECT count() FROM system.mutations WHERE table='replicated_mutation_table' and database='$CLICKHOUSE_DATABASE' and mutation_id='0000000001'"
6464

65-
$CLICKHOUSE_CLIENT --query "KILL MUTATION WHERE table='replicated_mutation_table' and database='$CLICKHOUSE_DATABASE' AND mutation_id='0000000001'" &> /dev/null
65+
# $CLICKHOUSE_CLIENT --query "KILL MUTATION WHERE table='replicated_mutation_table' and database='$CLICKHOUSE_DATABASE' AND mutation_id='0000000001'" &> /dev/null
6666

67-
while [ "$query_result" != "0" ]
68-
do
69-
query_result=$($CLICKHOUSE_CLIENT --query="$check_query" 2>&1)
70-
sleep 0.5
71-
done
67+
# while [ "$query_result" != "0" ]
68+
# do
69+
# query_result=$($CLICKHOUSE_CLIENT --query="$check_query" 2>&1)
70+
# sleep 0.5
71+
# done
7272

73-
$CLICKHOUSE_CLIENT --query "SELECT distinct(value) FROM replicated_mutation_table ORDER BY value" 2>&1 | grep -o "Cannot parse string 'Hello' as UInt64" | head -n 1
73+
# $CLICKHOUSE_CLIENT --query "SELECT distinct(value) FROM replicated_mutation_table ORDER BY value" 2>&1 | grep -o "Cannot parse string 'Hello' as UInt64" | head -n 1
7474

75-
$CLICKHOUSE_CLIENT --query "ALTER TABLE replicated_mutation_table MODIFY COLUMN value String SETTINGS replication_alter_partitions_sync = 2"
75+
# $CLICKHOUSE_CLIENT --query "ALTER TABLE replicated_mutation_table MODIFY COLUMN value String SETTINGS replication_alter_partitions_sync = 2"
7676

77-
$CLICKHOUSE_CLIENT --query "SELECT distinct(value) FROM replicated_mutation_table ORDER BY value"
77+
# $CLICKHOUSE_CLIENT --query "SELECT distinct(value) FROM replicated_mutation_table ORDER BY value"
7878

tests/queries/0_stateless/01428_nullable_asof_join.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
SET allow_experimental_analyzer = 1;
12
SET join_use_nulls = 1;
23

34
select 'left asof using';

tests/queries/0_stateless/01495_subqueries_in_with_statement.sql

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ select '---------------------------';
1616

1717
set empty_result_for_aggregation_by_empty_set = 0;
1818

19-
WITH test1 AS (SELECT number-1 as n FROM numbers(42))
19+
WITH test1 AS (SELECT number-1 as n FROM numbers(42))
2020
SELECT max(n+1)+1 z FROM test1;
2121

22-
WITH test1 AS (SELECT number-1 as n FROM numbers(42))
22+
WITH test1 AS (SELECT number-1 as n FROM numbers(42))
2323
SELECT max(n+1)+1 z FROM test1 join test1 x using n having z - 1 = (select min(n-1)+41 from test1) + 2;
2424

2525
WITH test1 AS (SELECT number-1 as n FROM numbers(4442) order by n limit 100)
@@ -31,10 +31,10 @@ SELECT max(n) FROM test1 where n=42;
3131
drop table if exists with_test ;
3232
create table with_test engine=Memory as select cast(number-1 as Nullable(Int64)) n from numbers(10000);
3333

34-
WITH test1 AS (SELECT n FROM with_test where n <= 40)
34+
WITH test1 AS (SELECT n FROM with_test where n <= 40)
3535
SELECT max(n+1)+1 z FROM test1 join test1 x using (n) having max(n+1)+1 - 1 = (select min(n-1)+41 from test1) + 2;
3636

37-
WITH test1 AS (SELECT n FROM with_test where n <= 40)
37+
WITH test1 AS (SELECT n FROM with_test where n <= 40)
3838
SELECT max(n+1)+1 z FROM test1 join test1 x using (n) having z - 1 = (select min(n-1)+41 from test1) + 2;
3939

4040
WITH test1 AS (SELECT n FROM with_test order by n limit 100)
@@ -52,6 +52,7 @@ SELECT max(n) FROM test1 where n=42;
5252
WITH test1 AS (SELECT n, null as b FROM with_test where n = 42 or b is null order by n limit 100)
5353
SELECT max(n) FROM test1 where n=42;
5454

55+
5556
WITH test1 AS (SELECT n, null b FROM with_test where b is null)
5657
SELECT max(n) FROM test1 where n=42;
5758

tests/queries/0_stateless/01511_alter_version_versioned_collapsing_merge_tree_zookeeper.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
-- Tags: zookeeper
22

3+
-- Backward compatibility check
4+
-- https://s3.amazonaws.com/clickhouse-test-reports/45461/81166c0cadf42af09d09450159c6f62b698f8af1/stress_test__msan_.html
5+
36
DROP TABLE IF EXISTS table_with_version_replicated_1;
47
DROP TABLE IF EXISTS table_with_version_replicated_2;
58

0 commit comments

Comments
 (0)