mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
clickhouse-odbc#125 : Make TIMESTAMP alias for DateTime type for allowing CAST(x AS TIMESTAMP)
This commit is contained in:
parent
394b9760f4
commit
0cf72f9b26
@ -172,6 +172,7 @@ static DataTypePtr create(const ASTPtr & arguments)
|
|||||||
void registerDataTypeDateTime(DataTypeFactory & factory)
|
void registerDataTypeDateTime(DataTypeFactory & factory)
|
||||||
{
|
{
|
||||||
factory.registerDataType("DateTime", create, DataTypeFactory::CaseInsensitive);
|
factory.registerDataType("DateTime", create, DataTypeFactory::CaseInsensitive);
|
||||||
|
factory.registerAlias("TIMESTAMP", "DateTime", DataTypeFactory::CaseInsensitive);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ hello
|
|||||||
hello
|
hello
|
||||||
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
|
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
|
x UInt8
|
||||||
e Enum8(\'hello\' = 1, \'world\' = 2) DEFAULT CAST(x, \'Enum8(\\\'hello\\\' = 1, \\\'world\\\' = 2)\')
|
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 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;
|
DROP TABLE IF EXISTS test.cast;
|
||||||
CREATE TABLE test.cast
|
CREATE TABLE test.cast
|
||||||
(
|
(
|
||||||
|
Loading…
Reference in New Issue
Block a user