ClickHouse/tests/queries/0_stateless/00806_alter_update.sql

14 lines
545 B
MySQL
Raw Normal View History

2019-06-03 17:36:27 +00:00
DROP TABLE IF EXISTS alter_update_00806;
2018-12-19 14:36:55 +00:00
2022-06-23 08:37:52 +00:00
set allow_deprecated_syntax_for_merge_tree=1;
2019-06-03 17:36:27 +00:00
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');
2018-12-19 14:36:55 +00:00
2020-03-23 09:05:51 +00:00
ALTER TABLE alter_update_00806 UPDATE e = CAST('foo', 'Enum8(\'foo\' = 1, \'bar\' = 2)') WHERE d='2018-01-02' SETTINGS mutations_sync = 1;
2018-12-19 14:36:55 +00:00
2019-06-03 17:36:27 +00:00
SELECT e FROM alter_update_00806 ORDER BY d;
2019-06-07 16:02:24 +00:00
DROP TABLE alter_update_00806;