ClickHouse/tests/queries/0_stateless/03202_enum_json_cast.sql

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
621 B
MySQL
Raw Normal View History

2024-07-27 18:41:30 +00:00
DROP TABLE IF EXISTS test;
2024-07-20 19:21:48 +00:00
CREATE TABLE test
(
`answer` Enum8('Question' = 1, 'Answer' = 2, 'Wiki' = 3, 'TagWikiExcerpt' = 4, 'TagWiki' = 5, 'ModeratorNomination' = 6, 'WikiPlaceholder' = 7, 'PrivilegeWiki' = 8)
)
ENGINE = Memory;
2024-09-25 01:13:14 +00:00
2024-07-20 19:21:48 +00:00
INSERT INTO test FORMAT JSONEachRow {"answer": 1};
2024-09-25 01:13:14 +00:00
2024-07-20 19:21:48 +00:00
INSERT INTO test FORMAT JSONEachRow {"answer": "2"};
2024-09-25 01:13:14 +00:00
2024-09-25 02:51:45 +00:00
SELECT * FROM test ORDER BY ALL;
2024-07-27 18:41:30 +00:00
DROP TABLE test;
CREATE TABLE test
(
`answer` Enum8('1' = 2, '2' = 1, 'Wiki' = 3)
)
ENGINE = Memory;
2024-09-25 01:13:14 +00:00
2024-07-27 18:41:30 +00:00
INSERT INTO test FORMAT JSONEachRow {"answer": 1};
2024-09-25 01:13:14 +00:00
2024-07-27 18:41:30 +00:00
INSERT INTO test FORMAT JSONEachRow {"answer": "2"};
2024-09-25 01:13:14 +00:00
2024-09-25 02:51:45 +00:00
SELECT * FROM test ORDER BY ALL;