diff --git a/src/Databases/DatabaseReplicated.h b/src/Databases/DatabaseReplicated.h index 26c79362af9..72d19a5340a 100644 --- a/src/Databases/DatabaseReplicated.h +++ b/src/Databases/DatabaseReplicated.h @@ -112,7 +112,7 @@ private: zkutil::ZooKeeperPtr getZooKeeper() const; std::atomic_bool is_readonly = true; - bool is_recovering = false; + std::atomic_bool is_recovering = false; std::unique_ptr ddl_worker; UInt32 max_log_ptr_at_creation = 0; diff --git a/tests/queries/0_stateless/01148_zookeeper_path_macros_unfolding.reference b/tests/queries/0_stateless/01148_zookeeper_path_macros_unfolding.reference index 91666f7ceed..fad3b45a354 100644 --- a/tests/queries/0_stateless/01148_zookeeper_path_macros_unfolding.reference +++ b/tests/queries/0_stateless/01148_zookeeper_path_macros_unfolding.reference @@ -2,6 +2,6 @@ CREATE TABLE default.rmt\n(\n `n` UInt64,\n `s` String\n)\nENGINE = Replic CREATE TABLE default.rmt1\n(\n `n` UInt64,\n `s` String\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/test_01148/{shard}/default/rmt\', \'{replica}\')\nORDER BY n\nSETTINGS index_granularity = 8192 CREATE TABLE default.rmt\n(\n `n` UInt64,\n `s` String\n)\nENGINE = ReplicatedMergeTree(\'{default_path_test}test_01148\', \'{default_name_test}\')\nORDER BY n\nSETTINGS index_granularity = 8192 CREATE TABLE default.rmt\n(\n `n` UInt64,\n `s` String\n)\nENGINE = ReplicatedMergeTree(\'{default_path_test}test_01148\', \'{default_name_test}\')\nORDER BY n\nSETTINGS index_granularity = 8192 -CREATE TABLE default.rmt2\n(\n `n` Int32\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/{uuid}/{shard}\', \'{replica}\')\nPRIMARY KEY n\nORDER BY n\nSETTINGS index_granularity = 8192 -CREATE TABLE default.rmt3\n(\n `n` Int32\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/{uuid}/{shard}\', \'{replica}\')\nPRIMARY KEY n\nORDER BY n\nSETTINGS index_granularity = 8192 +CREATE TABLE test_01148_atomic.rmt2\n(\n `n` Int32\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/{uuid}/{shard}\', \'{replica}\')\nPRIMARY KEY n\nORDER BY n\nSETTINGS index_granularity = 8192 +CREATE TABLE test_01148_atomic.rmt3\n(\n `n` Int32\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/{uuid}/{shard}\', \'{replica}\')\nPRIMARY KEY n\nORDER BY n\nSETTINGS index_granularity = 8192 CREATE TABLE imdb_01148.anything\n(\n `director_id` UInt64,\n `movie_id` UInt64\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/{uuid}/{shard}\', \'{replica}\')\nORDER BY (director_id, movie_id)\nSETTINGS index_granularity = 8192 diff --git a/tests/queries/0_stateless/01148_zookeeper_path_macros_unfolding.sql b/tests/queries/0_stateless/01148_zookeeper_path_macros_unfolding.sql index b75fd6852d2..479c0db499a 100644 --- a/tests/queries/0_stateless/01148_zookeeper_path_macros_unfolding.sql +++ b/tests/queries/0_stateless/01148_zookeeper_path_macros_unfolding.sql @@ -20,22 +20,23 @@ DETACH TABLE rmt; ATTACH TABLE rmt; SHOW CREATE TABLE rmt; -CREATE TABLE rmt2 ON CLUSTER test_shard_localhost (n int, PRIMARY KEY n) ENGINE=ReplicatedMergeTree; -CREATE TABLE rmt3 AS rmt2; -- { serverError 62 } -CREATE TABLE rmt4 ON CLUSTER test_shard_localhost AS rmt2; -SHOW CREATE TABLE rmt2; -RENAME TABLE rmt4 to rmt3; -SHOW CREATE TABLE rmt3; +DROP DATABASE IF EXISTS test_01148_atomic; +CREATE DATABASE test_01148_atomic ENGINE=Atomic; +CREATE TABLE test_01148_atomic.rmt2 ON CLUSTER test_shard_localhost (n int, PRIMARY KEY n) ENGINE=ReplicatedMergeTree; +CREATE TABLE test_01148_atomic.rmt3 AS test_01148_atomic.rmt2; -- { serverError 62 } +CREATE TABLE test_01148_atomic.rmt4 ON CLUSTER test_shard_localhost AS test_01148_atomic.rmt2; +SHOW CREATE TABLE test_01148_atomic.rmt2; +RENAME TABLE test_01148_atomic.rmt4 to test_01148_atomic.rmt3; +SHOW CREATE TABLE test_01148_atomic.rmt3; DROP DATABASE IF EXISTS test_01148_ordinary; CREATE DATABASE test_01148_ordinary ENGINE=Ordinary; -RENAME TABLE rmt3 to test_01148_ordinary.rmt3; -- { serverError 48 } +RENAME TABLE test_01148_atomic.rmt3 to test_01148_ordinary.rmt3; -- { serverError 48 } DROP DATABASE test_01148_ordinary; +DROP DATABASE test_01148_atomic; DROP TABLE rmt; DROP TABLE rmt1; -DROP TABLE rmt2; -DROP TABLE rmt3; DROP DATABASE IF EXISTS imdb_01148; CREATE DATABASE imdb_01148 ENGINE = Replicated('/test/databases/imdb_01148', '{shard}', '{replica}');