未验证 提交 18752990 编写于 作者: A alexey-milovidov 提交者: GitHub

Merge pull request #3390 from proller/fix13

clickhouse-odbc#125 : Make TIMESTAMP alias for DateTime type for allowing CAST(x AS TIMESTAMP)
......@@ -172,6 +172,7 @@ static DataTypePtr create(const ASTPtr & arguments)
void registerDataTypeDateTime(DataTypeFactory & factory)
{
factory.registerDataType("DateTime", create, DataTypeFactory::CaseInsensitive);
factory.registerAlias("TIMESTAMP", "DateTime", DataTypeFactory::CaseInsensitive);
}
......
......@@ -6,6 +6,7 @@ hello
hello
hello
hello
1970-01-01 00:00:01
CREATE TABLE test.cast ( x UInt8, e Enum8('hello' = 1, 'world' = 2) DEFAULT CAST(x, 'Enum8(\'hello\' = 1, \'world\' = 2)')) ENGINE = MergeTree ORDER BY e SETTINGS index_granularity = 8192
x UInt8
e Enum8(\'hello\' = 1, \'world\' = 2) DEFAULT CAST(x, \'Enum8(\\\'hello\\\' = 1, \\\'world\\\' = 2)\')
......
......@@ -15,6 +15,8 @@ SELECT cast(1 AS Enum8(
SELECT CAST(1, 'Enum8(\'hello\' = 1,\n\t\'world\' = 2)');
SELECT cast(1, 'Enum8(\'hello\' = 1,\n\t\'world\' = 2)');
SELECT toTimeZone(CAST(1 AS TIMESTAMP), 'UTC');
DROP TABLE IF EXISTS test.cast;
CREATE TABLE test.cast
(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册