ClickHouse/dbms/tests/queries/0_stateless/00806_alter_update.sql
2019-06-07 19:02:24 +03:00

14 lines
552 B
SQL

DROP TABLE IF EXISTS alter_update_00806;
CREATE TABLE alter_update_00806 (d Date, e Enum8('foo'=1, 'bar'=2)) Engine = MergeTree(d, (d), 8192);
INSERT INTO alter_update_00806 (d, e) VALUES ('2018-01-01', 'foo');
INSERT INTO alter_update_00806 (d, e) VALUES ('2018-01-02', 'bar');
ALTER TABLE alter_update_00806 UPDATE e = CAST('foo', 'Enum8(\'foo\' = 1, \'bar\' = 2)') WHERE d='2018-01-02';
SELECT sleep(1); -- TODO: there should be setting for sync ALTER UPDATE someday.
SELECT e FROM alter_update_00806 ORDER BY d;
DROP TABLE alter_update_00806;