ClickHouse/tests/queries/0_stateless/00643_cast_zookeeper.sql

41 lines
758 B
MySQL
Raw Normal View History

2021-02-19 09:28:01 +00:00
SET database_atomic_wait_for_drop_and_detach_synchronously=1;
2020-11-11 15:29:36 +00:00
DROP TABLE IF EXISTS cast1;
DROP TABLE IF EXISTS cast2;
2020-11-11 15:29:36 +00:00
CREATE TABLE cast1
(
x UInt8,
e Enum8
(
'hello' = 1,
'world' = 2
)
DEFAULT
CAST
(
x
AS
Enum8
(
'hello' = 1,
'world' = 2
)
)
2020-08-26 17:45:20 +00:00
) ENGINE = ReplicatedMergeTree('/clickhouse/tables/test_00643/cast', 'r1') ORDER BY e;
2020-11-11 15:29:36 +00:00
SHOW CREATE TABLE cast1 FORMAT TSVRaw;
DESC TABLE cast1;
2020-11-11 15:29:36 +00:00
INSERT INTO cast1 (x) VALUES (1);
SELECT * FROM cast1;
2020-11-11 15:29:36 +00:00
CREATE TABLE cast2 AS cast1 ENGINE = ReplicatedMergeTree('/clickhouse/tables/test_00643/cast', 'r2') ORDER BY e;
2020-11-11 15:29:36 +00:00
SYSTEM SYNC REPLICA cast2;
2020-11-11 15:29:36 +00:00
SELECT * FROM cast2;
2020-11-11 15:29:36 +00:00
DROP TABLE cast1;
DROP TABLE cast2;