Add extra check to make sure both replicas are present in system.replicas

This commit is contained in:
János Benjamin Antal 2024-08-09 09:31:33 +00:00
parent dc64550536
commit e4903858c8
2 changed files with 4 additions and 0 deletions

View File

@ -1,4 +1,6 @@
information_schema tables
both default test_03217_system_tables_replica_1 r1
both default test_03217_system_tables_replica_2 r2
default test_03217_system_tables_replica_1 r1
1
1

View File

@ -8,6 +8,8 @@ CREATE TABLE test_03217_system_tables_replica_2(x UInt32)
ENGINE ReplicatedMergeTree('/clickhouse/tables/{database}/test_03217_system_tables_replica', 'r2')
ORDER BY x;
-- Make sure we can read both replicas
SELECT 'both', database, table, replica_name FROM system.replicas WHERE database = currentDatabase();
-- If filtering is not done correctly on database-table column, then this query report to read 2 rows, which are the above tables
SELECT database, table, replica_name FROM system.replicas WHERE database = currentDatabase() AND table = 'test_03217_system_tables_replica_1' AND replica_name = 'r1';
SYSTEM FLUSH LOGS;