From 4c3af43ed34c3ec8c730fbe8ebefb00e6d58471d Mon Sep 17 00:00:00 2001 From: Ivan Lezhankin Date: Wed, 19 Dec 2018 17:36:55 +0300 Subject: [PATCH] Add test. --- .../queries/0_stateless/00806_alter_update.reference | 3 +++ dbms/tests/queries/0_stateless/00806_alter_update.sql | 11 +++++++++++ 2 files changed, 14 insertions(+) create mode 100644 dbms/tests/queries/0_stateless/00806_alter_update.reference create mode 100644 dbms/tests/queries/0_stateless/00806_alter_update.sql diff --git a/dbms/tests/queries/0_stateless/00806_alter_update.reference b/dbms/tests/queries/0_stateless/00806_alter_update.reference new file mode 100644 index 00000000000..fbc804c35ca --- /dev/null +++ b/dbms/tests/queries/0_stateless/00806_alter_update.reference @@ -0,0 +1,3 @@ +0 +foo +foo diff --git a/dbms/tests/queries/0_stateless/00806_alter_update.sql b/dbms/tests/queries/0_stateless/00806_alter_update.sql new file mode 100644 index 00000000000..65e98188c3f --- /dev/null +++ b/dbms/tests/queries/0_stateless/00806_alter_update.sql @@ -0,0 +1,11 @@ +DROP TABLE IF EXISTS test.alter_update; + +CREATE TABLE test.alter_update (d Date, e Enum8('foo'=1, 'bar'=2)) Engine = MergeTree(d, (d), 8192); +INSERT INTO test.alter_update (d, e) VALUES ('2018-01-01', 'foo'); +INSERT INTO test.alter_update (d, e) VALUES ('2018-01-02', 'bar'); + +ALTER TABLE test.alter_update 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 test.alter_update ORDER BY d;