diff --git a/src/Dictionaries/DictionaryStructure.cpp b/src/Dictionaries/DictionaryStructure.cpp index 74bf67a2738..eea24dbc461 100644 --- a/src/Dictionaries/DictionaryStructure.cpp +++ b/src/Dictionaries/DictionaryStructure.cpp @@ -42,7 +42,8 @@ namespace AttributeUnderlyingType getAttributeUnderlyingType(const std::string & type) { - static const std::unordered_map dictionary{ + static const std::unordered_map dictionary + { {"UInt8", AttributeUnderlyingType::utUInt8}, {"UInt16", AttributeUnderlyingType::utUInt16}, {"UInt32", AttributeUnderlyingType::utUInt32}, @@ -56,13 +57,20 @@ AttributeUnderlyingType getAttributeUnderlyingType(const std::string & type) {"Float64", AttributeUnderlyingType::utFloat64}, {"String", AttributeUnderlyingType::utString}, {"Date", AttributeUnderlyingType::utUInt16}, - {"DateTime", AttributeUnderlyingType::utUInt32}, }; const auto it = dictionary.find(type); if (it != std::end(dictionary)) return it->second; + /// Can contain arbitrary scale and timezone parameters. + if (type.find("DateTime64") == 0) + return AttributeUnderlyingType::utUInt64; + + /// Can contain arbitrary timezone as parameter. + if (type.find("DateTime") == 0) + return AttributeUnderlyingType::utUInt32; + if (type.find("Decimal") == 0) { size_t start = strlen("Decimal"); diff --git a/tests/queries/0_stateless/00062_replicated_merge_tree_alter_zookeeper.reference b/tests/queries/0_stateless/00062_replicated_merge_tree_alter_zookeeper.reference index ac0e0d557cb..128a9b477e5 100644 --- a/tests/queries/0_stateless/00062_replicated_merge_tree_alter_zookeeper.reference +++ b/tests/queries/0_stateless/00062_replicated_merge_tree_alter_zookeeper.reference @@ -10,207 +10,207 @@ CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32 d Date k UInt64 i32 Int32 -dt DateTime -CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192) +dt DateTime(\'UTC\') +CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime(\'UTC\')\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192) d Date k UInt64 i32 Int32 -dt DateTime -CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192) +dt DateTime(\'UTC\') +CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime(\'UTC\')\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192) 2015-01-01 9 41 1992-01-01 08:00:00 -2015-01-01 10 42 0000-00-00 00:00:00 +2015-01-01 10 42 1970-01-01 00:00:00 d Date k UInt64 i32 Int32 -dt DateTime +dt DateTime(\'UTC\') n.ui8 Array(UInt8) n.s Array(String) -CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime,\n `n.ui8` Array(UInt8),\n `n.s` Array(String)\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192) +CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime(\'UTC\'),\n `n.ui8` Array(UInt8),\n `n.s` Array(String)\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192) d Date k UInt64 i32 Int32 -dt DateTime +dt DateTime(\'UTC\') n.ui8 Array(UInt8) n.s Array(String) -CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime,\n `n.ui8` Array(UInt8),\n `n.s` Array(String)\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192) +CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime(\'UTC\'),\n `n.ui8` Array(UInt8),\n `n.s` Array(String)\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192) 2015-01-01 8 40 2012-12-12 12:12:12 [1,2,3] ['12','13','14'] 2015-01-01 9 41 1992-01-01 08:00:00 [] [] -2015-01-01 10 42 0000-00-00 00:00:00 [] [] +2015-01-01 10 42 1970-01-01 00:00:00 [] [] d Date k UInt64 i32 Int32 -dt DateTime +dt DateTime(\'UTC\') n.ui8 Array(UInt8) n.s Array(String) n.d Array(Date) -CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime,\n `n.ui8` Array(UInt8),\n `n.s` Array(String),\n `n.d` Array(Date)\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192) +CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime(\'UTC\'),\n `n.ui8` Array(UInt8),\n `n.s` Array(String),\n `n.d` Array(Date)\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192) d Date k UInt64 i32 Int32 -dt DateTime +dt DateTime(\'UTC\') n.ui8 Array(UInt8) n.s Array(String) n.d Array(Date) -CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime,\n `n.ui8` Array(UInt8),\n `n.s` Array(String),\n `n.d` Array(Date)\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192) +CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime(\'UTC\'),\n `n.ui8` Array(UInt8),\n `n.s` Array(String),\n `n.d` Array(Date)\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192) 2015-01-01 7 39 2014-07-14 13:26:50 [10,20,30] ['120','130','140'] ['2000-01-01','2000-01-01','2000-01-03'] -2015-01-01 8 40 2012-12-12 12:12:12 [1,2,3] ['12','13','14'] ['0000-00-00','0000-00-00','0000-00-00'] +2015-01-01 8 40 2012-12-12 12:12:12 [1,2,3] ['12','13','14'] ['1970-01-01','1970-01-01','1970-01-01'] 2015-01-01 9 41 1992-01-01 08:00:00 [] [] [] -2015-01-01 10 42 0000-00-00 00:00:00 [] [] [] +2015-01-01 10 42 1970-01-01 00:00:00 [] [] [] d Date k UInt64 i32 Int32 -dt DateTime +dt DateTime(\'UTC\') n.ui8 Array(UInt8) n.s Array(String) n.d Array(Date) s String DEFAULT \'0\' -CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime,\n `n.ui8` Array(UInt8),\n `n.s` Array(String),\n `n.d` Array(Date),\n `s` String DEFAULT \'0\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192) +CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime(\'UTC\'),\n `n.ui8` Array(UInt8),\n `n.s` Array(String),\n `n.d` Array(Date),\n `s` String DEFAULT \'0\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192) d Date k UInt64 i32 Int32 -dt DateTime +dt DateTime(\'UTC\') n.ui8 Array(UInt8) n.s Array(String) n.d Array(Date) s String DEFAULT \'0\' -CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime,\n `n.ui8` Array(UInt8),\n `n.s` Array(String),\n `n.d` Array(Date),\n `s` String DEFAULT \'0\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192) +CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime(\'UTC\'),\n `n.ui8` Array(UInt8),\n `n.s` Array(String),\n `n.d` Array(Date),\n `s` String DEFAULT \'0\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192) 2015-01-01 6 38 2014-07-15 13:26:50 [10,20,30] ['asd','qwe','qwe'] ['2000-01-01','2000-01-01','2000-01-03'] 100500 2015-01-01 7 39 2014-07-14 13:26:50 [10,20,30] ['120','130','140'] ['2000-01-01','2000-01-01','2000-01-03'] 0 -2015-01-01 8 40 2012-12-12 12:12:12 [1,2,3] ['12','13','14'] ['0000-00-00','0000-00-00','0000-00-00'] 0 +2015-01-01 8 40 2012-12-12 12:12:12 [1,2,3] ['12','13','14'] ['1970-01-01','1970-01-01','1970-01-01'] 0 2015-01-01 9 41 1992-01-01 08:00:00 [] [] [] 0 -2015-01-01 10 42 0000-00-00 00:00:00 [] [] [] 0 +2015-01-01 10 42 1970-01-01 00:00:00 [] [] [] 0 d Date k UInt64 i32 Int32 -dt DateTime +dt DateTime(\'UTC\') n.ui8 Array(UInt8) n.s Array(String) s Int64 DEFAULT \'0\' -CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime,\n `n.ui8` Array(UInt8),\n `n.s` Array(String),\n `s` Int64 DEFAULT \'0\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192) +CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime(\'UTC\'),\n `n.ui8` Array(UInt8),\n `n.s` Array(String),\n `s` Int64 DEFAULT \'0\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192) d Date k UInt64 i32 Int32 -dt DateTime +dt DateTime(\'UTC\') n.ui8 Array(UInt8) n.s Array(String) s Int64 DEFAULT \'0\' -CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime,\n `n.ui8` Array(UInt8),\n `n.s` Array(String),\n `s` Int64 DEFAULT \'0\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192) +CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime(\'UTC\'),\n `n.ui8` Array(UInt8),\n `n.s` Array(String),\n `s` Int64 DEFAULT \'0\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192) 2015-01-01 6 38 2014-07-15 13:26:50 [10,20,30] ['asd','qwe','qwe'] 100500 2015-01-01 7 39 2014-07-14 13:26:50 [10,20,30] ['120','130','140'] 0 2015-01-01 8 40 2012-12-12 12:12:12 [1,2,3] ['12','13','14'] 0 2015-01-01 9 41 1992-01-01 08:00:00 [] [] 0 -2015-01-01 10 42 0000-00-00 00:00:00 [] [] 0 +2015-01-01 10 42 1970-01-01 00:00:00 [] [] 0 d Date k UInt64 i32 Int32 -dt DateTime +dt DateTime(\'UTC\') n.ui8 Array(UInt8) n.s Array(String) s UInt32 DEFAULT \'0\' n.d Array(Date) -CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime,\n `n.ui8` Array(UInt8),\n `n.s` Array(String),\n `s` UInt32 DEFAULT \'0\',\n `n.d` Array(Date)\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192) +CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime(\'UTC\'),\n `n.ui8` Array(UInt8),\n `n.s` Array(String),\n `s` UInt32 DEFAULT \'0\',\n `n.d` Array(Date)\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192) d Date k UInt64 i32 Int32 -dt DateTime +dt DateTime(\'UTC\') n.ui8 Array(UInt8) n.s Array(String) s UInt32 DEFAULT \'0\' n.d Array(Date) -CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime,\n `n.ui8` Array(UInt8),\n `n.s` Array(String),\n `s` UInt32 DEFAULT \'0\',\n `n.d` Array(Date)\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192) -2015-01-01 6 38 2014-07-15 13:26:50 [10,20,30] ['asd','qwe','qwe'] 100500 ['0000-00-00','0000-00-00','0000-00-00'] -2015-01-01 7 39 2014-07-14 13:26:50 [10,20,30] ['120','130','140'] 0 ['0000-00-00','0000-00-00','0000-00-00'] -2015-01-01 8 40 2012-12-12 12:12:12 [1,2,3] ['12','13','14'] 0 ['0000-00-00','0000-00-00','0000-00-00'] +CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime(\'UTC\'),\n `n.ui8` Array(UInt8),\n `n.s` Array(String),\n `s` UInt32 DEFAULT \'0\',\n `n.d` Array(Date)\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192) +2015-01-01 6 38 2014-07-15 13:26:50 [10,20,30] ['asd','qwe','qwe'] 100500 ['1970-01-01','1970-01-01','1970-01-01'] +2015-01-01 7 39 2014-07-14 13:26:50 [10,20,30] ['120','130','140'] 0 ['1970-01-01','1970-01-01','1970-01-01'] +2015-01-01 8 40 2012-12-12 12:12:12 [1,2,3] ['12','13','14'] 0 ['1970-01-01','1970-01-01','1970-01-01'] 2015-01-01 9 41 1992-01-01 08:00:00 [] [] 0 [] -2015-01-01 10 42 0000-00-00 00:00:00 [] [] 0 [] +2015-01-01 10 42 1970-01-01 00:00:00 [] [] 0 [] d Date k UInt64 i32 Int32 -dt DateTime +dt DateTime(\'UTC\') n.s Array(String) s UInt32 DEFAULT \'0\' -CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime,\n `n.s` Array(String),\n `s` UInt32 DEFAULT \'0\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192) +CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime(\'UTC\'),\n `n.s` Array(String),\n `s` UInt32 DEFAULT \'0\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192) d Date k UInt64 i32 Int32 -dt DateTime +dt DateTime(\'UTC\') n.s Array(String) s UInt32 DEFAULT \'0\' -CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime,\n `n.s` Array(String),\n `s` UInt32 DEFAULT \'0\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192) +CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime(\'UTC\'),\n `n.s` Array(String),\n `s` UInt32 DEFAULT \'0\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192) 2015-01-01 6 38 2014-07-15 13:26:50 ['asd','qwe','qwe'] 100500 2015-01-01 7 39 2014-07-14 13:26:50 ['120','130','140'] 0 2015-01-01 8 40 2012-12-12 12:12:12 ['12','13','14'] 0 2015-01-01 9 41 1992-01-01 08:00:00 [] 0 -2015-01-01 10 42 0000-00-00 00:00:00 [] 0 +2015-01-01 10 42 1970-01-01 00:00:00 [] 0 d Date k UInt64 i32 Int32 -dt DateTime +dt DateTime(\'UTC\') s UInt32 DEFAULT \'0\' -CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime,\n `s` UInt32 DEFAULT \'0\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192) +CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime(\'UTC\'),\n `s` UInt32 DEFAULT \'0\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192) d Date k UInt64 i32 Int32 -dt DateTime +dt DateTime(\'UTC\') s UInt32 DEFAULT \'0\' -CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime,\n `s` UInt32 DEFAULT \'0\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192) +CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime(\'UTC\'),\n `s` UInt32 DEFAULT \'0\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192) 2015-01-01 6 38 2014-07-15 13:26:50 100500 2015-01-01 7 39 2014-07-14 13:26:50 0 2015-01-01 8 40 2012-12-12 12:12:12 0 2015-01-01 9 41 1992-01-01 08:00:00 0 -2015-01-01 10 42 0000-00-00 00:00:00 0 +2015-01-01 10 42 1970-01-01 00:00:00 0 d Date k UInt64 i32 Int32 -dt DateTime +dt DateTime(\'UTC\') s UInt32 DEFAULT \'0\' n.s Array(String) n.d Array(Date) -CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime,\n `s` UInt32 DEFAULT \'0\',\n `n.s` Array(String),\n `n.d` Array(Date)\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192) +CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime(\'UTC\'),\n `s` UInt32 DEFAULT \'0\',\n `n.s` Array(String),\n `n.d` Array(Date)\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192) d Date k UInt64 i32 Int32 -dt DateTime +dt DateTime(\'UTC\') s UInt32 DEFAULT \'0\' n.s Array(String) n.d Array(Date) -CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime,\n `s` UInt32 DEFAULT \'0\',\n `n.s` Array(String),\n `n.d` Array(Date)\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192) +CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime(\'UTC\'),\n `s` UInt32 DEFAULT \'0\',\n `n.s` Array(String),\n `n.d` Array(Date)\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192) 2015-01-01 6 38 2014-07-15 13:26:50 100500 [] [] 2015-01-01 7 39 2014-07-14 13:26:50 0 [] [] 2015-01-01 8 40 2012-12-12 12:12:12 0 [] [] 2015-01-01 9 41 1992-01-01 08:00:00 0 [] [] -2015-01-01 10 42 0000-00-00 00:00:00 0 [] [] +2015-01-01 10 42 1970-01-01 00:00:00 0 [] [] d Date k UInt64 i32 Int32 -dt DateTime +dt DateTime(\'UTC\') s UInt32 DEFAULT \'0\' -CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime,\n `s` UInt32 DEFAULT \'0\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192) +CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime(\'UTC\'),\n `s` UInt32 DEFAULT \'0\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192) d Date k UInt64 i32 Int32 -dt DateTime +dt DateTime(\'UTC\') s UInt32 DEFAULT \'0\' -CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime,\n `s` UInt32 DEFAULT \'0\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192) +CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime(\'UTC\'),\n `s` UInt32 DEFAULT \'0\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192) 2015-01-01 6 38 2014-07-15 13:26:50 100500 2015-01-01 7 39 2014-07-14 13:26:50 0 2015-01-01 8 40 2012-12-12 12:12:12 0 2015-01-01 9 41 1992-01-01 08:00:00 0 -2015-01-01 10 42 0000-00-00 00:00:00 0 +2015-01-01 10 42 1970-01-01 00:00:00 0 d Date k UInt64 i32 Int32 dt Date -s DateTime DEFAULT \'0000-00-00 00:00:00\' -CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` Date,\n `s` DateTime DEFAULT \'0000-00-00 00:00:00\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192) +s DateTime(\'UTC\') DEFAULT \'1970-01-01 00:00:00\' +CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` Date,\n `s` DateTime(\'UTC\') DEFAULT \'1970-01-01 00:00:00\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192) d Date k UInt64 i32 Int32 dt Date -s DateTime DEFAULT \'0000-00-00 00:00:00\' -CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` Date,\n `s` DateTime DEFAULT \'0000-00-00 00:00:00\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192) -2015-01-01 6 38 2014-07-15 1970-01-02 06:55:00 -2015-01-01 7 39 2014-07-14 0000-00-00 00:00:00 -2015-01-01 8 40 2012-12-12 0000-00-00 00:00:00 -2015-01-01 9 41 1992-01-01 0000-00-00 00:00:00 -2015-01-01 10 42 0000-00-00 0000-00-00 00:00:00 +s DateTime(\'UTC\') DEFAULT \'1970-01-01 00:00:00\' +CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` Date,\n `s` DateTime(\'UTC\') DEFAULT \'1970-01-01 00:00:00\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192) +2015-01-01 6 38 2014-07-15 1970-01-02 03:55:00 +2015-01-01 7 39 2014-07-14 1970-01-01 00:00:00 +2015-01-01 8 40 2012-12-12 1970-01-01 00:00:00 +2015-01-01 9 41 1992-01-01 1970-01-01 00:00:00 +2015-01-01 10 42 1970-01-01 1970-01-01 00:00:00 diff --git a/tests/queries/0_stateless/00062_replicated_merge_tree_alter_zookeeper.sql b/tests/queries/0_stateless/00062_replicated_merge_tree_alter_zookeeper.sql index 4679c6f5a4e..1bce062e766 100644 --- a/tests/queries/0_stateless/00062_replicated_merge_tree_alter_zookeeper.sql +++ b/tests/queries/0_stateless/00062_replicated_merge_tree_alter_zookeeper.sql @@ -14,7 +14,7 @@ DESC TABLE test.replicated_alter2; SHOW CREATE TABLE test.replicated_alter2; SELECT * FROM test.replicated_alter1 ORDER BY k; -ALTER TABLE test.replicated_alter1 ADD COLUMN dt DateTime; +ALTER TABLE test.replicated_alter1 ADD COLUMN dt DateTime('UTC'); INSERT INTO test.replicated_alter1 VALUES ('2015-01-01', 9, 41, '1992-01-01 08:00:00'); DESC TABLE test.replicated_alter1; @@ -98,7 +98,7 @@ DESC TABLE test.replicated_alter2; SHOW CREATE TABLE test.replicated_alter2; SELECT * FROM test.replicated_alter1 ORDER BY k; -ALTER TABLE test.replicated_alter1 MODIFY COLUMN dt Date, MODIFY COLUMN s DateTime DEFAULT '0000-00-00 00:00:00'; +ALTER TABLE test.replicated_alter1 MODIFY COLUMN dt Date, MODIFY COLUMN s DateTime('UTC') DEFAULT '1970-01-01 00:00:00'; DESC TABLE test.replicated_alter1; SHOW CREATE TABLE test.replicated_alter1; diff --git a/tests/queries/0_stateless/00101_materialized_views_and_insert_without_explicit_database.reference b/tests/queries/0_stateless/00101_materialized_views_and_insert_without_explicit_database.reference index 37514bc429b..2176028b1c0 100644 --- a/tests/queries/0_stateless/00101_materialized_views_and_insert_without_explicit_database.reference +++ b/tests/queries/0_stateless/00101_materialized_views_and_insert_without_explicit_database.reference @@ -1,5 +1,5 @@ -2014-01-02 0 0 0000-00-00 00:00:00 2014-01-02 03:04:06 -1 2014-01-02 03:04:06 +2014-01-02 0 0 1970-01-01 03:00:00 2014-01-02 03:04:06 +1 2014-01-02 07:04:06 0 0 0 diff --git a/tests/queries/0_stateless/00101_materialized_views_and_insert_without_explicit_database.sql b/tests/queries/0_stateless/00101_materialized_views_and_insert_without_explicit_database.sql index 69fc61a4968..9885c3c6f44 100644 --- a/tests/queries/0_stateless/00101_materialized_views_and_insert_without_explicit_database.sql +++ b/tests/queries/0_stateless/00101_materialized_views_and_insert_without_explicit_database.sql @@ -6,8 +6,8 @@ DROP TABLE IF EXISTS test_table; DROP TABLE IF EXISTS test_view; DROP TABLE IF EXISTS test_view_filtered; -CREATE TABLE test_table (EventDate Date, CounterID UInt32, UserID UInt64, EventTime DateTime, UTCEventTime DateTime) ENGINE = MergeTree(EventDate, CounterID, 8192); -CREATE MATERIALIZED VIEW test_view (Rows UInt64, MaxHitTime DateTime) ENGINE = Memory AS SELECT count() AS Rows, max(UTCEventTime) AS MaxHitTime FROM test_table; +CREATE TABLE test_table (EventDate Date, CounterID UInt32, UserID UInt64, EventTime DateTime('Europe/Moscow'), UTCEventTime DateTime('UTC')) ENGINE = MergeTree(EventDate, CounterID, 8192); +CREATE MATERIALIZED VIEW test_view (Rows UInt64, MaxHitTime DateTime('Europe/Moscow')) ENGINE = Memory AS SELECT count() AS Rows, max(UTCEventTime) AS MaxHitTime FROM test_table; CREATE MATERIALIZED VIEW test_view_filtered (EventDate Date, CounterID UInt32) ENGINE = Memory POPULATE AS SELECT CounterID, EventDate FROM test_table WHERE EventDate < '2013-01-01'; INSERT INTO test_table (EventDate, UTCEventTime) VALUES ('2014-01-02', '2014-01-02 03:04:06'); diff --git a/tests/queries/0_stateless/00206_empty_array_to_single.reference b/tests/queries/0_stateless/00206_empty_array_to_single.reference index e4e7e38fa36..1f616bf2f86 100644 --- a/tests/queries/0_stateless/00206_empty_array_to_single.reference +++ b/tests/queries/0_stateless/00206_empty_array_to_single.reference @@ -1,14 +1,14 @@ [1,2] [0] [4,5,6] -[''] ['0000-00-00'] ['0000-00-00 00:00:00'] -[0] [''] ['0000-00-00 00:00:00'] ['0000-00-00'] +[''] ['1970-01-01'] ['1970-01-01 03:00:00'] +[0] [''] ['1970-01-01 00:00:00'] ['1970-01-01'] [0] ['0'] ['2015-01-01 00:00:00'] ['2015-01-01'] [0,1] [''] ['2015-01-01 00:00:00','2015-01-01 00:00:01'] ['2015-01-01','2015-01-02'] [0] ['0'] ['2015-01-01 00:00:00','2015-01-01 00:00:01','2015-01-01 00:00:02'] ['2015-01-01','2015-01-02','2015-01-03'] -[0] [''] ['2015-01-01 00:00:00','2015-01-01 00:00:01','2015-01-01 00:00:02','2015-01-01 00:00:03'] ['0000-00-00'] -[0,1] ['0'] ['0000-00-00 00:00:00'] ['2015-01-01'] +[0] [''] ['2015-01-01 00:00:00','2015-01-01 00:00:01','2015-01-01 00:00:02','2015-01-01 00:00:03'] ['1970-01-01'] +[0,1] ['0'] ['1970-01-01 00:00:00'] ['2015-01-01'] [0] [''] ['2015-01-01 00:00:00'] ['2015-01-01','2015-01-02'] [0] ['0'] ['2015-01-01 00:00:00','2015-01-01 00:00:01'] ['2015-01-01','2015-01-02','2015-01-03'] -[0,1] [''] ['2015-01-01 00:00:00','2015-01-01 00:00:01','2015-01-01 00:00:02'] ['0000-00-00'] +[0,1] [''] ['2015-01-01 00:00:00','2015-01-01 00:00:01','2015-01-01 00:00:02'] ['1970-01-01'] [0] ['0'] ['2015-01-01 00:00:00','2015-01-01 00:00:01','2015-01-01 00:00:02','2015-01-01 00:00:03'] ['2015-01-01'] diff --git a/tests/queries/0_stateless/00206_empty_array_to_single.sql b/tests/queries/0_stateless/00206_empty_array_to_single.sql index 0ad2975fa7f..9724aa3fda7 100644 --- a/tests/queries/0_stateless/00206_empty_array_to_single.sql +++ b/tests/queries/0_stateless/00206_empty_array_to_single.sql @@ -1,8 +1,8 @@ SELECT emptyArrayToSingle(arrayFilter(x -> x != 99, arrayJoin([[1, 2], [99], [4, 5, 6]]))); SELECT emptyArrayToSingle(emptyArrayString()), emptyArrayToSingle(emptyArrayDate()), emptyArrayToSingle(emptyArrayDateTime()); -SELECT - emptyArrayToSingle(range(number % 3)), - emptyArrayToSingle(arrayMap(x -> toString(x), range(number % 2))), - emptyArrayToSingle(arrayMap(x -> toDateTime('2015-01-01 00:00:00') + x, range(number % 5))), +SELECT + emptyArrayToSingle(range(number % 3)), + emptyArrayToSingle(arrayMap(x -> toString(x), range(number % 2))), + emptyArrayToSingle(arrayMap(x -> toDateTime('2015-01-01 00:00:00', 'UTC') + x, range(number % 5))), emptyArrayToSingle(arrayMap(x -> toDate('2015-01-01') + x, range(number % 4))) FROM system.numbers LIMIT 10; diff --git a/tests/queries/0_stateless/00261_storage_aliases_and_array_join.reference b/tests/queries/0_stateless/00261_storage_aliases_and_array_join.reference index da01364729f..56a867c4f8d 100644 --- a/tests/queries/0_stateless/00261_storage_aliases_and_array_join.reference +++ b/tests/queries/0_stateless/00261_storage_aliases_and_array_join.reference @@ -1,5 +1,5 @@ -- Ensure ALIAS columns are not selected by asterisk -0000-00-00 0 ['zero','one','two'] ['zero','one','two'] ['zero','one','two'] +1970-01-01 0 ['zero','one','two'] ['zero','one','two'] ['zero','one','two'] -- select DEFAULT and ALIAS arrays ['zero','one','two'] ['zero','one','two'] ['zero','one','two'] ['zero','one','two'] ['0','1','2'] ['0','1','2'] ['0','1','2'] -- select DEFAULT and ALIAS nested columns diff --git a/tests/queries/0_stateless/00310_tskv.reference b/tests/queries/0_stateless/00310_tskv.reference index bfe3a751eb0..b5847b319ea 100644 --- a/tests/queries/0_stateless/00310_tskv.reference +++ b/tests/queries/0_stateless/00310_tskv.reference @@ -1,5 +1,5 @@ - 0000-00-00 00:00:00 - 0000-00-00 00:00:00 - 0000-00-00 00:00:00 Hello, world abc + 1970-01-01 00:00:00 + 1970-01-01 00:00:00 + 1970-01-01 00:00:00 Hello, world abc custom-service-log 2013-01-01 00:00:00 +0400 multiline\ntext can contain \0 symbol - 0000-00-00 00:00:00 def + 1970-01-01 00:00:00 def diff --git a/tests/queries/0_stateless/00310_tskv.sh b/tests/queries/0_stateless/00310_tskv.sh index 859753519ec..1c03874f2ee 100755 --- a/tests/queries/0_stateless/00310_tskv.sh +++ b/tests/queries/0_stateless/00310_tskv.sh @@ -4,7 +4,7 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) . $CURDIR/../shell_config.sh $CLICKHOUSE_CLIENT --query="DROP TABLE IF EXISTS tskv"; -$CLICKHOUSE_CLIENT --query="CREATE TABLE tskv (tskv_format String, timestamp DateTime, timezone String, text String, binary_data String) ENGINE = Memory"; +$CLICKHOUSE_CLIENT --query="CREATE TABLE tskv (tskv_format String, timestamp DateTime('UTC'), timezone String, text String, binary_data String) ENGINE = Memory"; echo -n 'tskv tskv_format=custom-service-log timestamp=2013-01-01 00:00:00 timezone=+0400 text=multiline\ntext binary_data=can contain \0 symbol binary_data=abc text=Hello, world diff --git a/tests/queries/0_stateless/00461_default_value_of_argument_type.reference b/tests/queries/0_stateless/00461_default_value_of_argument_type.reference index 32b90eabb16..b19cd169e76 100644 --- a/tests/queries/0_stateless/00461_default_value_of_argument_type.reference +++ b/tests/queries/0_stateless/00461_default_value_of_argument_type.reference @@ -1 +1 @@ -[] [] (0,'','0000-00-00 00:00:00','0000-00-00') +[] [] (0,'','1970-01-01 00:00:00','1970-01-01') diff --git a/tests/queries/0_stateless/00461_default_value_of_argument_type.sql b/tests/queries/0_stateless/00461_default_value_of_argument_type.sql index f4786b5541e..d74af75cc83 100644 --- a/tests/queries/0_stateless/00461_default_value_of_argument_type.sql +++ b/tests/queries/0_stateless/00461_default_value_of_argument_type.sql @@ -1 +1 @@ -SELECT defaultValueOfArgumentType([1, 2, 3]), defaultValueOfArgumentType([[[1]]]), defaultValueOfArgumentType((1, 'Hello', now(), today())); +SELECT defaultValueOfArgumentType([1, 2, 3]), defaultValueOfArgumentType([[[1]]]), defaultValueOfArgumentType((1, 'Hello', toTimeZone(now(), 'UTC'), today())); diff --git a/tests/queries/0_stateless/00521_multidimensional.reference b/tests/queries/0_stateless/00521_multidimensional.reference index 864da3431cf..046e979d34e 100644 --- a/tests/queries/0_stateless/00521_multidimensional.reference +++ b/tests/queries/0_stateless/00521_multidimensional.reference @@ -1,7 +1,7 @@ 1 [['Hello','World'],['Goodbye'],[]] -1 [['Hello','World'],['Goodbye'],[]] ('',[],(0,'0000-00-00')) +1 [['Hello','World'],['Goodbye'],[]] ('',[],(0,'1970-01-01')) 0 [] ('Hello',['World',NULL],(123,'2000-01-01')) -1 [['Hello','World'],['Goodbye'],[]] ('',[],(0,'0000-00-00')) +1 [['Hello','World'],['Goodbye'],[]] ('',[],(0,'1970-01-01')) 0 [] ('Hello',['World',NULL],(123,'2000-01-01')) 1 [['Hello','World'],['Goodbye'],[]] ('Hello',['World',NULL],(123,'2000-01-01')) 1 [['Hello','World'],['Goodbye'],[]] ('Hello',['World',NULL],(123,'2000-01-01')) diff --git a/tests/queries/0_stateless/00540_bad_data_types.reference b/tests/queries/0_stateless/00540_bad_data_types.reference index a598a35471e..74153b9b8f9 100644 --- a/tests/queries/0_stateless/00540_bad_data_types.reference +++ b/tests/queries/0_stateless/00540_bad_data_types.reference @@ -1,4 +1,4 @@ -0000-00-00 00:00:00 +1970-01-01 00:00:00 0 0 diff --git a/tests/queries/0_stateless/00540_bad_data_types.sh b/tests/queries/0_stateless/00540_bad_data_types.sh index 245a0abe0fa..b1adb57490e 100755 --- a/tests/queries/0_stateless/00540_bad_data_types.sh +++ b/tests/queries/0_stateless/00540_bad_data_types.sh @@ -9,7 +9,7 @@ $CLICKHOUSE_CLIENT --query="SELECT CAST(0 AS Nullable)" 2>/dev/null || true; $CLICKHOUSE_CLIENT --query="SELECT CAST(0 AS Tuple)" 2>/dev/null || true; $CLICKHOUSE_CLIENT --query="SELECT CAST(0 AS FixedString)" 2>/dev/null || true; $CLICKHOUSE_CLIENT --query="SELECT CAST(0 AS Enum)" 2>/dev/null || true; -$CLICKHOUSE_CLIENT --query="SELECT CAST(0 AS DateTime)"; +$CLICKHOUSE_CLIENT --query="SELECT CAST(0 AS DateTime('UTC'))"; echo diff --git a/tests/queries/0_stateless/00569_parse_date_time_best_effort.reference b/tests/queries/0_stateless/00569_parse_date_time_best_effort.reference index b353b66f8eb..6c10720d0b1 100644 --- a/tests/queries/0_stateless/00569_parse_date_time_best_effort.reference +++ b/tests/queries/0_stateless/00569_parse_date_time_best_effort.reference @@ -13,12 +13,12 @@ 11 Feb 2018 06:40:50 +0300 2018-02-11 03:40:50 2018-02-11 03:40:50 17 Apr 2 1:2:3 2000-04-17 01:02:03 2000-04-17 01:02:03 19700102 01:00:00 1970-01-02 01:00:00 1970-01-02 01:00:00 - 1970010201:00:00 ᴺᵁᴸᴸ 0000-00-00 00:00:00 + 1970010201:00:00 ᴺᵁᴸᴸ 1970-01-01 00:00:00 19700102010203 1970-01-02 01:02:03 1970-01-02 01:02:03 19700102010203Z 1970-01-02 01:02:03 1970-01-02 01:02:03 1970/01/02 010203Z 1970-01-02 01:02:03 1970-01-02 01:02:03 20 2000-01-20 00:00:00 2000-01-20 00:00:00 - 201 ᴺᵁᴸᴸ 0000-00-00 00:00:00 + 201 ᴺᵁᴸᴸ 1970-01-01 00:00:00 20160101 2016-01-01 00:00:00 2016-01-01 00:00:00 2016-01-01 2016-01-01 00:00:00 2016-01-01 00:00:00 201601-01 2016-01-01 01:00:00 2016-01-01 01:00:00 @@ -34,7 +34,7 @@ 2017/01/01 2017-01-01 00:00:00 2017-01-01 00:00:00 201701 02 010203 UTC+0300 2017-01-01 22:02:03 2017-01-01 22:02:03 2017-01-02 03:04:05 2017-01-02 03:04:05 2017-01-02 03:04:05 - 2017-01-0203:04:05 ᴺᵁᴸᴸ 0000-00-00 00:00:00 + 2017-01-0203:04:05 ᴺᵁᴸᴸ 1970-01-01 00:00:00 2017-01-02 03:04:05+0 2017-01-02 03:04:05 2017-01-02 03:04:05 2017-01-02 03:04:05+00 2017-01-02 03:04:05 2017-01-02 03:04:05 2017-01-02 03:04:05+0000 2017-01-02 03:04:05 2017-01-02 03:04:05 @@ -58,13 +58,13 @@ 2017-01 03:04:05 MSD Jun 2017-05-31 23:04:05 2017-05-31 23:04:05 2017-01 03:04 MSD Jun 2017-05-31 23:04:00 2017-05-31 23:04:00 2017/01/31 2017-01-31 00:00:00 2017-01-31 00:00:00 - 2017/01/32 ᴺᵁᴸᴸ 0000-00-00 00:00:00 + 2017/01/32 ᴺᵁᴸᴸ 1970-01-01 00:00:00 2017-01 MSD Jun 2017-05-31 20:00:00 2017-05-31 20:00:00 201701 MSD Jun 2017-05-31 20:00:00 2017-05-31 20:00:00 - 2017 25 1:2:3 ᴺᵁᴸᴸ 0000-00-00 00:00:00 + 2017 25 1:2:3 ᴺᵁᴸᴸ 1970-01-01 00:00:00 2017 25 Apr 1:2:3 2017-04-01 01:02:03 2017-04-01 01:02:03 2017 Apr 01 11:22:33 2017-04-01 11:22:33 2017-04-01 11:22:33 - 2017 Apr 02 01/02/03 UTC+0300 ᴺᵁᴸᴸ 0000-00-00 00:00:00 + 2017 Apr 02 01/02/03 UTC+0300 ᴺᵁᴸᴸ 1970-01-01 00:00:00 2017 Apr 02 010203 UTC+0300 2017-04-01 22:02:03 2017-04-01 22:02:03 2017 Apr 02 01:2:3 UTC+0300 2017-04-01 22:02:03 2017-04-01 22:02:03 2017 Apr 02 1:02:3 2017-04-02 01:02:03 2017-04-02 01:02:03 @@ -74,8 +74,8 @@ 2017 Apr 02 1:2:3 2017-04-02 01:02:03 2017-04-02 01:02:03 2017 Apr 02 1:2:33 2017-04-02 01:02:33 2017-04-02 01:02:33 2017 Apr 02 1:2:3 MSK 2017-04-01 22:02:03 2017-04-01 22:02:03 - 2017 Apr 02 1:2:3 MSK 2017 ᴺᵁᴸᴸ 0000-00-00 00:00:00 - 2017 Apr 02 1:2:3 MSK 2018 ᴺᵁᴸᴸ 0000-00-00 00:00:00 + 2017 Apr 02 1:2:3 MSK 2017 ᴺᵁᴸᴸ 1970-01-01 00:00:00 + 2017 Apr 02 1:2:3 MSK 2018 ᴺᵁᴸᴸ 1970-01-01 00:00:00 2017 Apr 02 1:2:3 UTC+0000 2017-04-02 01:02:03 2017-04-02 01:02:03 2017 Apr 02 1:2:3 UTC+0300 2017-04-01 22:02:03 2017-04-01 22:02:03 2017 Apr 02 1:2:3 UTC+0400 2017-04-01 21:02:03 2017-04-01 21:02:03 @@ -90,17 +90,17 @@ 25 Jan 2017 1:2:3 Z 2017-01-25 01:02:03 2017-01-25 01:02:03 25 Jan 2017 1:2:3 Z +0300 2017-01-24 22:02:03 2017-01-24 22:02:03 25 Jan 2017 1:2:3 Z+03:00 2017-01-24 22:02:03 2017-01-24 22:02:03 - 25 Jan 2017 1:2:3 Z +0300 OM ᴺᵁᴸᴸ 0000-00-00 00:00:00 + 25 Jan 2017 1:2:3 Z +0300 OM ᴺᵁᴸᴸ 1970-01-01 00:00:00 25 Jan 2017 1:2:3 Z +03:00 PM 2017-01-25 10:02:03 2017-01-25 10:02:03 25 Jan 2017 1:2:3 Z +0300 PM 2017-01-25 10:02:03 2017-01-25 10:02:03 25 Jan 2017 1:2:3 Z+03:00 PM 2017-01-25 10:02:03 2017-01-25 10:02:03 25 Jan 2017 1:2:3 Z +03:30 PM 2017-01-25 09:32:03 2017-01-25 09:32:03 - 25 Jan 2017 1:2:3Z Mo ᴺᵁᴸᴸ 0000-00-00 00:00:00 + 25 Jan 2017 1:2:3Z Mo ᴺᵁᴸᴸ 1970-01-01 00:00:00 25 Jan 2017 1:2:3Z Mon 2017-01-25 01:02:03 2017-01-25 01:02:03 - 25 Jan 2017 1:2:3Z Moo ᴺᵁᴸᴸ 0000-00-00 00:00:00 + 25 Jan 2017 1:2:3Z Moo ᴺᵁᴸᴸ 1970-01-01 00:00:00 25 Jan 2017 1:2:3 Z PM 2017-01-25 13:02:03 2017-01-25 13:02:03 25 Jan 2017 1:2:3Z PM 2017-01-25 13:02:03 2017-01-25 13:02:03 25 Jan 2017 1:2:3 Z PM +03:00 2017-01-25 10:02:03 2017-01-25 10:02:03 - Jun, 11 Feb 2018 06:40:50 +0300 ᴺᵁᴸᴸ 0000-00-00 00:00:00 + Jun, 11 Feb 2018 06:40:50 +0300 ᴺᵁᴸᴸ 1970-01-01 00:00:00 Sun 11 Feb 2018 06:40:50 +0300 2018-02-11 03:40:50 2018-02-11 03:40:50 Sun, 11 Feb 2018 06:40:50 +0300 2018-02-11 03:40:50 2018-02-11 03:40:50 diff --git a/tests/queries/0_stateless/00664_cast_from_string_to_nullable.reference b/tests/queries/0_stateless/00664_cast_from_string_to_nullable.reference index 1924bbb36e9..a69e7186aab 100644 --- a/tests/queries/0_stateless/00664_cast_from_string_to_nullable.reference +++ b/tests/queries/0_stateless/00664_cast_from_string_to_nullable.reference @@ -21,14 +21,14 @@ abc 123 123a -123 -0000-00-00 -0000-00-00 +1970-01-01 +1970-01-01 2018-01-02 2018-01-02 2018-01-02 2018-01-02 -0000-00-00 -0000-00-00 +1970-01-01 +1970-01-01 \N \N 2018-01-02 @@ -37,11 +37,11 @@ abc 2018-01-02 \N \N -0000-00-00 00:00:00 -0000-00-00 00:00:00 +1970-01-01 00:00:00 +1970-01-01 00:00:00 2018-01-02 01:02:03 2018-01-02 01:02:03 -0000-00-00 00:00:00 +1970-01-01 00:00:00 \N \N 2018-01-02 01:02:03 diff --git a/tests/queries/0_stateless/00664_cast_from_string_to_nullable.sql b/tests/queries/0_stateless/00664_cast_from_string_to_nullable.sql index 2c4e1adf955..96dd4172fc6 100644 --- a/tests/queries/0_stateless/00664_cast_from_string_to_nullable.sql +++ b/tests/queries/0_stateless/00664_cast_from_string_to_nullable.sql @@ -6,6 +6,6 @@ SELECT CAST(arrayJoin(['', 'abc', '123', '123a', '-123']) AS Nullable(String)); SELECT toDateOrZero(arrayJoin(['', '2018', '2018-01-02', '2018-1-2', '2018-01-2', '2018-1-02', '2018-ab-cd', '2018-01-02a'])); SELECT toDateOrNull(arrayJoin(['', '2018', '2018-01-02', '2018-1-2', '2018-01-2', '2018-1-02', '2018-ab-cd', '2018-01-02a'])); -SELECT toDateTimeOrZero(arrayJoin(['', '2018', '2018-01-02 01:02:03', '2018-01-02T01:02:03', '2018-01-02 01:02:03 abc'])); +SELECT toDateTimeOrZero(arrayJoin(['', '2018', '2018-01-02 01:02:03', '2018-01-02T01:02:03', '2018-01-02 01:02:03 abc']), 'UTC'); SELECT toDateTimeOrNull(arrayJoin(['', '2018', '2018-01-02 01:02:03', '2018-01-02T01:02:03', '2018-01-02 01:02:03 abc'])); diff --git a/tests/queries/0_stateless/00693_max_block_size_system_tables_columns.reference b/tests/queries/0_stateless/00693_max_block_size_system_tables_columns.reference index b674529e010..f8fe62bc722 100644 --- a/tests/queries/0_stateless/00693_max_block_size_system_tables_columns.reference +++ b/tests/queries/0_stateless/00693_max_block_size_system_tables_columns.reference @@ -2,7 +2,7 @@ 1 1 1 - t_00693 Memory 1 [] 0000-00-00 00:00:00 [] [] Memory \N \N + t_00693 Memory 1 [] 1970-01-01 00:00:00 [] [] Memory \N \N 1 1 1 diff --git a/tests/queries/0_stateless/00693_max_block_size_system_tables_columns.sql b/tests/queries/0_stateless/00693_max_block_size_system_tables_columns.sql index 6f7ccc29892..9415952e0b3 100644 --- a/tests/queries/0_stateless/00693_max_block_size_system_tables_columns.sql +++ b/tests/queries/0_stateless/00693_max_block_size_system_tables_columns.sql @@ -5,7 +5,7 @@ SELECT (SELECT count() FROM system.tables SETTINGS max_block_size = 100) = (SELE DROP TEMPORARY TABLE IF EXISTS t_00693; CREATE TEMPORARY TABLE t_00693 (x UInt8); -SELECT database, name, engine, is_temporary, data_paths, metadata_path, metadata_modification_time, dependencies_database, +SELECT database, name, engine, is_temporary, data_paths, metadata_path, toTimeZone(metadata_modification_time, 'UTC'), dependencies_database, dependencies_table, create_table_query, engine_full, partition_key, sorting_key, primary_key, sampling_key, storage_policy, total_rows, total_bytes FROM system.tables WHERE is_temporary AND name='t_00693'; diff --git a/tests/queries/0_stateless/00735_conditional.reference b/tests/queries/0_stateless/00735_conditional.reference index e0db75a1044..2d5040a336d 100644 --- a/tests/queries/0_stateless/00735_conditional.reference +++ b/tests/queries/0_stateless/00735_conditional.reference @@ -87,10 +87,10 @@ value vs value 0 1 1 UInt64 UInt32 UInt64 0 1 1 UInt64 UInt64 UInt64 0 1 1 UInt64 Decimal(38, 0) Decimal(38, 0) -0000-00-00 1970-01-02 1970-01-02 Date Date Date +1970-01-01 1970-01-02 1970-01-02 Date Date Date 2000-01-01 2000-01-01 00:00:01 2000-01-01 00:00:01 Date DateTime(\'Europe/Moscow\') DateTime 2000-01-01 00:00:00 2000-01-02 2000-01-02 00:00:00 DateTime(\'Europe/Moscow\') Date DateTime -0000-00-00 00:00:00 1970-01-01 03:00:01 1970-01-01 03:00:01 DateTime(\'Europe/Moscow\') DateTime(\'Europe/Moscow\') DateTime(\'Europe/Moscow\') +1970-01-01 03:00:00 1970-01-01 03:00:01 1970-01-01 03:00:01 DateTime(\'Europe/Moscow\') DateTime(\'Europe/Moscow\') DateTime(\'Europe/Moscow\') 00000000-0000-0000-0000-000000000000 00000000-0000-0001-0000-000000000000 00000000-0000-0001-0000-000000000000 UUID UUID UUID column vs value 0 1 1 Int8 Int8 Int8 @@ -161,8 +161,8 @@ column vs value 0 1 1 UInt64 UInt16 UInt64 0 1 1 UInt64 UInt32 UInt64 0 1 1 UInt64 UInt64 UInt64 -0000-00-00 1970-01-02 1970-01-02 Date Date Date +1970-01-01 1970-01-02 1970-01-02 Date Date Date 2000-01-01 2000-01-01 00:00:01 2000-01-01 00:00:01 Date DateTime(\'Europe/Moscow\') DateTime 2000-01-01 00:00:00 2000-01-02 2000-01-02 00:00:00 DateTime(\'Europe/Moscow\') Date DateTime -0000-00-00 00:00:00 1970-01-01 03:00:01 1970-01-01 03:00:01 DateTime(\'Europe/Moscow\') DateTime(\'Europe/Moscow\') DateTime(\'Europe/Moscow\') +1970-01-01 03:00:00 1970-01-01 03:00:01 1970-01-01 03:00:01 DateTime(\'Europe/Moscow\') DateTime(\'Europe/Moscow\') DateTime(\'Europe/Moscow\') 00000000-0000-0000-0000-000000000000 00000000-0000-0001-0000-000000000000 00000000-0000-0001-0000-000000000000 UUID UUID UUID diff --git a/tests/queries/0_stateless/00802_system_parts_with_datetime_partition.reference b/tests/queries/0_stateless/00802_system_parts_with_datetime_partition.reference index c2cfc585044..3733d31c627 100644 --- a/tests/queries/0_stateless/00802_system_parts_with_datetime_partition.reference +++ b/tests/queries/0_stateless/00802_system_parts_with_datetime_partition.reference @@ -1,5 +1,5 @@ -"2","0000-00-00 00:00:00","0000-00-00 00:00:00" -"4","0000-00-00 00:00:00","0000-00-00 00:00:00" +"2","1970-01-01 00:00:00","1970-01-01 00:00:00" +"4","1970-01-01 00:00:00","1970-01-01 00:00:00" "2016-01-01 00:00:00","2016-01-01 00:00:00","2016-01-01 02:00:00" "2016-01-02 00:00:00","2016-01-02 01:00:00","2016-01-02 23:00:00" "2016-01-03 00:00:00","2016-01-03 04:00:00","2016-01-03 04:00:00" diff --git a/tests/queries/0_stateless/00802_system_parts_with_datetime_partition.sql b/tests/queries/0_stateless/00802_system_parts_with_datetime_partition.sql index 38eba9bf37b..70042e4bf84 100644 --- a/tests/queries/0_stateless/00802_system_parts_with_datetime_partition.sql +++ b/tests/queries/0_stateless/00802_system_parts_with_datetime_partition.sql @@ -3,20 +3,20 @@ DROP TABLE IF EXISTS datetime_table; -- Create a table with DateTime column, but not used in partition key CREATE TABLE datetime_table ( - t DateTime, + t DateTime('UTC'), name String, value UInt32 ) ENGINE = MergeTree() ORDER BY (t, name) PARTITION BY value; -INSERT INTO datetime_table VALUES (toDateTime('2016-01-01 00:00:00'),'name1',2); -INSERT INTO datetime_table VALUES (toDateTime('2016-01-02 00:00:00'),'name2',2); -INSERT INTO datetime_table VALUES (toDateTime('2016-01-03 00:00:00'),'name1',4); +INSERT INTO datetime_table VALUES ('2016-01-01 00:00:00','name1',2); +INSERT INTO datetime_table VALUES ('2016-01-02 00:00:00','name2',2); +INSERT INTO datetime_table VALUES ('2016-01-03 00:00:00','name1',4); -- min_time and max_time are not filled -SELECT partition, MIN(min_time) as min_time, MAX(max_time) as max_time +SELECT partition, toTimeZone(MIN(min_time), 'UTC') as min_time, toTimeZone(MAX(max_time), 'UTC') as max_time FROM system.parts WHERE database = currentDatabase() and table = 'datetime_table' AND active = 1 GROUP BY partition @@ -28,22 +28,22 @@ DROP TABLE IF EXISTS datetime_table; -- Create a table with DateTime column, this time used in partition key CREATE TABLE datetime_table ( - t DateTime, + t DateTime('UTC'), name String, value UInt32 ) ENGINE = MergeTree() ORDER BY (t, name) PARTITION BY toStartOfDay(t); -INSERT INTO datetime_table VALUES (toDateTime('2016-01-01 00:00:00'),'name1',2); -INSERT INTO datetime_table VALUES (toDateTime('2016-01-01 02:00:00'),'name1',3); -INSERT INTO datetime_table VALUES (toDateTime('2016-01-02 01:00:00'),'name2',2); -INSERT INTO datetime_table VALUES (toDateTime('2016-01-02 23:00:00'),'name2',5); -INSERT INTO datetime_table VALUES (toDateTime('2016-01-03 04:00:00'),'name1',4); +INSERT INTO datetime_table VALUES ('2016-01-01 00:00:00','name1',2); +INSERT INTO datetime_table VALUES ('2016-01-01 02:00:00','name1',3); +INSERT INTO datetime_table VALUES ('2016-01-02 01:00:00','name2',2); +INSERT INTO datetime_table VALUES ('2016-01-02 23:00:00','name2',5); +INSERT INTO datetime_table VALUES ('2016-01-03 04:00:00','name1',4); -- min_time and max_time are now filled -SELECT partition, MIN(min_time) as min_time, MAX(max_time) as max_time +SELECT partition, toTimeZone(MIN(min_time), 'UTC') as min_time, toTimeZone(MAX(max_time), 'UTC') as max_time FROM system.parts WHERE database = currentDatabase() and table = 'datetime_table' AND active = 1 GROUP BY partition @@ -55,7 +55,7 @@ DROP TABLE IF EXISTS datetime_table; -- Create a table with DateTime column, this time used in partition key, but not at the first level CREATE TABLE datetime_table ( - t DateTime, + t DateTime('UTC'), name String, value UInt32 ) ENGINE = MergeTree() diff --git a/tests/queries/0_stateless/00818_inner_join_bug_3567.reference b/tests/queries/0_stateless/00818_inner_join_bug_3567.reference index c0fe46ee963..173e53ebc34 100644 --- a/tests/queries/0_stateless/00818_inner_join_bug_3567.reference +++ b/tests/queries/0_stateless/00818_inner_join_bug_3567.reference @@ -9,7 +9,7 @@ │ D │ d │ 2018-01-01 │ D │ 2018-01-01 │ └───┴───┴────────────┴───┴────────────┘ ┌─a─┬──────────b─┬─c─┬──────────d─┐ -│ a │ 2018-01-01 │ │ 0000-00-00 │ +│ a │ 2018-01-01 │ │ 1970-01-01 │ │ b │ 2018-01-01 │ B │ 2018-01-01 │ │ c │ 2018-01-01 │ C │ 2018-01-01 │ └───┴────────────┴───┴────────────┘ diff --git a/tests/queries/0_stateless/00927_asof_join_noninclusive.reference b/tests/queries/0_stateless/00927_asof_join_noninclusive.reference index 5d19ee97374..fe2844a2a43 100644 --- a/tests/queries/0_stateless/00927_asof_join_noninclusive.reference +++ b/tests/queries/0_stateless/00927_asof_join_noninclusive.reference @@ -1,18 +1,18 @@ -1 1970-01-01 00:00:01 1 0 0000-00-00 00:00:00 0 +1 1970-01-01 00:00:01 1 0 1970-01-01 00:00:00 0 1 1970-01-01 00:00:02 2 2 1970-01-01 00:00:02 1 1 1970-01-01 00:00:03 3 2 1970-01-01 00:00:02 1 1 1970-01-01 00:00:04 4 4 1970-01-01 00:00:04 1 1 1970-01-01 00:00:05 5 4 1970-01-01 00:00:04 1 -2 1970-01-01 00:00:01 1 0 0000-00-00 00:00:00 0 -2 1970-01-01 00:00:02 2 0 0000-00-00 00:00:00 0 +2 1970-01-01 00:00:01 1 0 1970-01-01 00:00:00 0 +2 1970-01-01 00:00:02 2 0 1970-01-01 00:00:00 0 2 1970-01-01 00:00:03 3 3 1970-01-01 00:00:03 2 2 1970-01-01 00:00:04 4 3 1970-01-01 00:00:03 2 2 1970-01-01 00:00:05 5 3 1970-01-01 00:00:03 2 -3 1970-01-01 00:00:01 1 0 0000-00-00 00:00:00 0 -3 1970-01-01 00:00:02 2 0 0000-00-00 00:00:00 0 -3 1970-01-01 00:00:03 3 0 0000-00-00 00:00:00 0 -3 1970-01-01 00:00:04 4 0 0000-00-00 00:00:00 0 -3 1970-01-01 00:00:05 5 0 0000-00-00 00:00:00 0 +3 1970-01-01 00:00:01 1 0 1970-01-01 00:00:00 0 +3 1970-01-01 00:00:02 2 0 1970-01-01 00:00:00 0 +3 1970-01-01 00:00:03 3 0 1970-01-01 00:00:00 0 +3 1970-01-01 00:00:04 4 0 1970-01-01 00:00:00 0 +3 1970-01-01 00:00:05 5 0 1970-01-01 00:00:00 0 1 1970-01-01 00:00:02 2 2 1970-01-01 00:00:02 1 1 1970-01-01 00:00:03 3 2 1970-01-01 00:00:02 1 1 1970-01-01 00:00:04 4 4 1970-01-01 00:00:04 1 diff --git a/tests/queries/0_stateless/00935_to_iso_week_first_year.reference b/tests/queries/0_stateless/00935_to_iso_week_first_year.reference index 5eeb23e3620..399352bb641 100644 --- a/tests/queries/0_stateless/00935_to_iso_week_first_year.reference +++ b/tests/queries/0_stateless/00935_to_iso_week_first_year.reference @@ -1,4 +1,4 @@ -0000-00-00 1 1970 +1970-01-01 1 1970 1970-01-02 1 1970 1970-01-03 1 1970 1970-01-04 1 1970 diff --git a/tests/queries/0_stateless/00937_template_output_format.reference b/tests/queries/0_stateless/00937_template_output_format.reference index c7b81d262ae..375f93ed618 100644 --- a/tests/queries/0_stateless/00937_template_output_format.reference +++ b/tests/queries/0_stateless/00937_template_output_format.reference @@ -5,7 +5,7 @@ n: "456", s1: as"df\'gh, s2: '', s3: "zx\ncv\tbn m", s4: "qwe,rty", d: 2016-01-0 n: "789", s1: zx\ncv\tbn m, s2: 'qwe,rty', s3: "as\"df'gh", s4: "", d: 2016-01-04, n: 789 ; n: "9876543210", s1: , s2: 'zx\ncv\tbn m', s3: "qwe,rty", s4: "as""df'gh", d: 2016-01-03, n: 9876543210 ------ -n: "0", s1: , s2: '', s3: "", s4: "", d: 0000-00-00, n: 0 +n: "0", s1: , s2: '', s3: "", s4: "", d: 1970-01-01, n: 0 ------ n: "123", s1: , s2: '', s3: "", s4: "", d: 2016-01-01, n: 123 ------ diff --git a/tests/queries/0_stateless/00937_test_use_header_csv.reference b/tests/queries/0_stateless/00937_test_use_header_csv.reference index 8a8b605ad41..3b49a770dac 100644 --- a/tests/queries/0_stateless/00937_test_use_header_csv.reference +++ b/tests/queries/0_stateless/00937_test_use_header_csv.reference @@ -13,9 +13,9 @@ 2019-04-18 2 Line13 2019-04-18 1 2019-04-18 2 -0000-00-00 1 Line16 -0000-00-00 2 Line17 +1970-01-01 1 Line16 +1970-01-01 2 Line17 2019-04-18 0 Line18 2019-04-18 0 Line19 -0000-00-00 0 -0000-00-00 0 +1970-01-01 0 +1970-01-01 0 diff --git a/tests/queries/0_stateless/00937_test_use_header_tsv.reference b/tests/queries/0_stateless/00937_test_use_header_tsv.reference index 8a8b605ad41..3b49a770dac 100644 --- a/tests/queries/0_stateless/00937_test_use_header_tsv.reference +++ b/tests/queries/0_stateless/00937_test_use_header_tsv.reference @@ -13,9 +13,9 @@ 2019-04-18 2 Line13 2019-04-18 1 2019-04-18 2 -0000-00-00 1 Line16 -0000-00-00 2 Line17 +1970-01-01 1 Line16 +1970-01-01 2 Line17 2019-04-18 0 Line18 2019-04-18 0 Line19 -0000-00-00 0 -0000-00-00 0 +1970-01-01 0 +1970-01-01 0 diff --git a/tests/queries/0_stateless/00952_input_function.reference b/tests/queries/0_stateless/00952_input_function.reference index dde0451626a..4ea90616cec 100644 --- a/tests/queries/0_stateless/00952_input_function.reference +++ b/tests/queries/0_stateless/00952_input_function.reference @@ -1,19 +1,19 @@ -"0","0000-00-00",0,0 +"0","1970-01-01",0,0 "1","1970-01-02",1,0 "2","1970-01-03",4,0 "3","1970-01-04",9,0 "4","1970-01-05",16,0 -"0","0000-00-00",0,0 +"0","1970-01-01",0,0 "1","1970-01-02",1,0 "2","1970-01-03",4,0 "3","1970-01-04",9,0 "4","1970-01-05",16,0 -"0","0000-00-00",0,0 +"0","1970-01-01",0,0 "1","1970-01-02",1,0 "2","1970-01-03",4,0 "3","1970-01-04",9,0 "4","1970-01-05",16,0 -"0","0000-00-00",0,0 +"0","1970-01-01",0,0 "1","1970-01-02",1,0 "2","1970-01-03",4,0 "3","1970-01-04",9,0 diff --git a/tests/queries/0_stateless/00974_full_outer_join.reference b/tests/queries/0_stateless/00974_full_outer_join.reference index d8e9d3ea067..d9490f6f654 100644 --- a/tests/queries/0_stateless/00974_full_outer_join.reference +++ b/tests/queries/0_stateless/00974_full_outer_join.reference @@ -1,5 +1,5 @@ 2015-12-01 0 0 2015-12-02 1 1 -0000-00-00 0 2 -0000-00-00 0 3 -0000-00-00 0 4 +1970-01-01 0 2 +1970-01-01 0 3 +1970-01-01 0 4 diff --git a/tests/queries/0_stateless/01008_materialized_view_henyihanwobushi.reference b/tests/queries/0_stateless/01008_materialized_view_henyihanwobushi.reference index 2f3b99134b8..33d7958ecde 100644 --- a/tests/queries/0_stateless/01008_materialized_view_henyihanwobushi.reference +++ b/tests/queries/0_stateless/01008_materialized_view_henyihanwobushi.reference @@ -1 +1 @@ -0000-00-00 1 bar_n_1 1 +1970-01-01 1 bar_n_1 1 diff --git a/tests/queries/0_stateless/01064_incremental_streaming_from_2_src_with_feedback.reference b/tests/queries/0_stateless/01064_incremental_streaming_from_2_src_with_feedback.reference index 02010fd6d80..bf05cc131b4 100644 --- a/tests/queries/0_stateless/01064_incremental_streaming_from_2_src_with_feedback.reference +++ b/tests/queries/0_stateless/01064_incremental_streaming_from_2_src_with_feedback.reference @@ -1,16 +1,16 @@ -- unmerged state -1 0000-00-00 00:00:00 0000-00-00 00:00:00 18446744073709551615 0 -1 0000-00-00 00:00:00 2000-01-01 10:00:00 7200 0 -1 0000-00-00 00:00:00 2000-01-01 11:10:00 600 0 -1 2000-01-01 08:00:00 0000-00-00 00:00:00 18446744073709551615 0 -1 2000-01-01 11:00:00 0000-00-00 00:00:00 18446744073709551615 3600 -2 0000-00-00 00:00:00 0000-00-00 00:00:00 18446744073709551615 0 -2 0000-00-00 00:00:00 2000-01-01 10:00:00 7200 0 -2 0000-00-00 00:00:00 2000-01-01 11:10:00 600 0 -2 0000-00-00 00:00:00 2001-01-01 11:10:02 1 0 -2 2000-01-01 08:00:00 0000-00-00 00:00:00 18446744073709551615 0 -2 2000-01-01 11:00:00 0000-00-00 00:00:00 18446744073709551615 3600 -2 2001-01-01 11:10:01 0000-00-00 00:00:00 18446744073709551615 31622401 +1 1970-01-01 00:00:00 1970-01-01 00:00:00 18446744073709551615 0 +1 1970-01-01 00:00:00 2000-01-01 10:00:00 7200 0 +1 1970-01-01 00:00:00 2000-01-01 11:10:00 600 0 +1 2000-01-01 08:00:00 1970-01-01 00:00:00 18446744073709551615 0 +1 2000-01-01 11:00:00 1970-01-01 00:00:00 18446744073709551615 3600 +2 1970-01-01 00:00:00 1970-01-01 00:00:00 18446744073709551615 0 +2 1970-01-01 00:00:00 2000-01-01 10:00:00 7200 0 +2 1970-01-01 00:00:00 2000-01-01 11:10:00 600 0 +2 1970-01-01 00:00:00 2001-01-01 11:10:02 1 0 +2 2000-01-01 08:00:00 1970-01-01 00:00:00 18446744073709551615 0 +2 2000-01-01 11:00:00 1970-01-01 00:00:00 18446744073709551615 3600 +2 2001-01-01 11:10:01 1970-01-01 00:00:00 18446744073709551615 31622401 -- merged state 1 2000-01-01 11:00:00 2000-01-01 11:10:00 600 3600 2 2001-01-01 11:10:01 2001-01-01 11:10:02 1 31622401 diff --git a/tests/queries/0_stateless/01064_incremental_streaming_from_2_src_with_feedback.sql b/tests/queries/0_stateless/01064_incremental_streaming_from_2_src_with_feedback.sql index c2d0333bf46..6d499466e41 100644 --- a/tests/queries/0_stateless/01064_incremental_streaming_from_2_src_with_feedback.sql +++ b/tests/queries/0_stateless/01064_incremental_streaming_from_2_src_with_feedback.sql @@ -15,8 +15,8 @@ CREATE TABLE target_table Engine=SummingMergeTree() ORDER BY id AS SELECT number as id, - maxState( toDateTime(0) ) as latest_login_time, - maxState( toDateTime(0) ) as latest_checkout_time, + maxState( toDateTime(0, 'UTC') ) as latest_login_time, + maxState( toDateTime(0, 'UTC') ) as latest_checkout_time, minState( toUInt64(-1) ) as fastest_session, maxState( toUInt64(0) ) as biggest_inactivity_period FROM numbers(50000) @@ -26,7 +26,7 @@ GROUP BY id; CREATE TABLE logins ( id UInt64, - ts DateTime + ts DateTime('UTC') ) Engine=MergeTree ORDER BY id; @@ -37,7 +37,7 @@ AS SELECT id, maxState( ts ) as latest_login_time, - maxState( toDateTime(0) ) as latest_checkout_time, + maxState( toDateTime(0, 'UTC') ) as latest_checkout_time, minState( toUInt64(-1) ) as fastest_session, if(max(current_latest_checkout_time) > 0, maxState(toUInt64(ts - current_latest_checkout_time)), maxState( toUInt64(0) ) ) as biggest_inactivity_period FROM logins @@ -60,14 +60,14 @@ AS -- the same for second pipeline CREATE TABLE checkouts ( id UInt64, - ts DateTime + ts DateTime('UTC') ) Engine=MergeTree ORDER BY id; CREATE MATERIALIZED VIEW mv_checkouts2target TO target_table AS SELECT id, - maxState( toDateTime(0) ) as latest_login_time, + maxState( toDateTime(0, 'UTC') ) as latest_login_time, maxState( ts ) as latest_checkout_time, if(max(current_latest_login_time) > 0, minState( toUInt64(ts - current_latest_login_time)), minState( toUInt64(-1) ) ) as fastest_session, maxState( toUInt64(0) ) as biggest_inactivity_period diff --git a/tests/queries/0_stateless/01127_month_partitioning_consistency_select.reference b/tests/queries/0_stateless/01127_month_partitioning_consistency_select.reference index 1b08e7f2d6f..88d333a20c0 100644 --- a/tests/queries/0_stateless/01127_month_partitioning_consistency_select.reference +++ b/tests/queries/0_stateless/01127_month_partitioning_consistency_select.reference @@ -1,4 +1,4 @@ Q1 2106-02-07 Hello -Q2 0000-00-00 World +Q2 1970-01-01 World Q1 2106-02-07 Hello -Q2 0000-00-00 World +Q2 1970-01-01 World diff --git a/tests/queries/0_stateless/01129_dict_get_join_lose_constness.reference b/tests/queries/0_stateless/01129_dict_get_join_lose_constness.reference index f7263967932..63afaa26b1f 100644 --- a/tests/queries/0_stateless/01129_dict_get_join_lose_constness.reference +++ b/tests/queries/0_stateless/01129_dict_get_join_lose_constness.reference @@ -1 +1 @@ -0 0000-00-00 00:00:00 +0 1970-01-01 00:00:00 diff --git a/tests/queries/0_stateless/01129_dict_get_join_lose_constness.sql b/tests/queries/0_stateless/01129_dict_get_join_lose_constness.sql index 0f8f5cb2a06..b9c233c9382 100644 --- a/tests/queries/0_stateless/01129_dict_get_join_lose_constness.sql +++ b/tests/queries/0_stateless/01129_dict_get_join_lose_constness.sql @@ -12,7 +12,7 @@ LIFETIME(0) LAYOUT(hashed()); SELECT dictGetInt32('system.dict1', 'element_count', toUInt64(dict_key)) AS join_key, - dictGetDateTime('system.dict1', 'loading_start_time', toUInt64(dict_key)) AS datetime + toTimeZone(dictGetDateTime('system.dict1', 'loading_start_time', toUInt64(dict_key)), 'UTC') AS datetime FROM (select 1 AS dict_key) js1 LEFT JOIN (SELECT toInt32(2) AS join_key) js2 USING (join_key) diff --git a/tests/queries/0_stateless/01139_asof_join_types.reference b/tests/queries/0_stateless/01139_asof_join_types.reference index 102064ce772..efb701e7d8d 100644 --- a/tests/queries/0_stateless/01139_asof_join_types.reference +++ b/tests/queries/0_stateless/01139_asof_join_types.reference @@ -9,5 +9,5 @@ 0 1 0 1 0 1 -0 0000-00-00 -0 0000-00-00 00:00:00 +0 1970-01-01 +0 1970-01-01 00:00:00 diff --git a/tests/queries/0_stateless/01139_asof_join_types.sql b/tests/queries/0_stateless/01139_asof_join_types.sql index 45edf8ff06b..4cfde5d3210 100644 --- a/tests/queries/0_stateless/01139_asof_join_types.sql +++ b/tests/queries/0_stateless/01139_asof_join_types.sql @@ -13,6 +13,6 @@ select * from (select 0 as k, toDecimal64(1, 0) as v) t1 asof join (select 0 as select * from (select 0 as k, toDecimal128(1, 0) as v) t1 asof join (select 0 as k, toDecimal128(0, 0) as v) t2 using(k, v); select * from (select 0 as k, toDate(0) as v) t1 asof join (select 0 as k, toDate(0) as v) t2 using(k, v); -select * from (select 0 as k, toDateTime(0) as v) t1 asof join (select 0 as k, toDateTime(0) as v) t2 using(k, v); +select * from (select 0 as k, toDateTime(0, 'UTC') as v) t1 asof join (select 0 as k, toDateTime(0, 'UTC') as v) t2 using(k, v); select * from (select 0 as k, 'x' as v) t1 asof join (select 0 as k, 'x' as v) t2 using(k, v); -- { serverError 169 } diff --git a/tests/queries/0_stateless/01257_dictionary_mismatch_types.reference b/tests/queries/0_stateless/01257_dictionary_mismatch_types.reference index 358922133d7..b90daf8c1bd 100644 --- a/tests/queries/0_stateless/01257_dictionary_mismatch_types.reference +++ b/tests/queries/0_stateless/01257_dictionary_mismatch_types.reference @@ -1,31 +1,31 @@ -0 300 0000-00-00 00:00:00 N1 -0 300 0000-00-00 00:00:00 N1 -0 300 0000-00-00 00:00:00 N1 -0 300 0000-00-00 00:00:00 N1 -0 300 0000-00-00 00:00:00 N1 -0 300 0000-00-00 00:00:00 N1 -0 200 0000-00-00 00:00:00 C2 -0 0 0000-00-00 00:00:00 C3 -0 0 0000-00-00 00:00:00 C3 -0 0 0000-00-00 00:00:00 N1 -0 0 0000-00-00 00:00:00 N1 -0 0 0000-00-00 00:00:00 N1 -0 0 0000-00-00 00:00:00 N1 -0 0 0000-00-00 00:00:00 N1 +0 300 1970-01-01 00:00:00 N1 +0 300 1970-01-01 00:00:00 N1 +0 300 1970-01-01 00:00:00 N1 +0 300 1970-01-01 00:00:00 N1 +0 300 1970-01-01 00:00:00 N1 +0 300 1970-01-01 00:00:00 N1 +0 200 1970-01-01 00:00:00 C2 +0 0 1970-01-01 00:00:00 C3 +0 0 1970-01-01 00:00:00 C3 +0 0 1970-01-01 00:00:00 N1 +0 0 1970-01-01 00:00:00 N1 +0 0 1970-01-01 00:00:00 N1 +0 0 1970-01-01 00:00:00 N1 +0 0 1970-01-01 00:00:00 N1 0 210 2020-02-16 05:22:04 N1 0 210 2020-02-16 05:22:04 N1 0 270 2020-02-16 05:22:04 N1 0 270 2020-02-16 05:22:04 N1 -0 380 0000-00-00 00:00:00 N1 -0 380 0000-00-00 00:00:00 N1 -0 280 0000-00-00 00:00:00 C2 -0 0 0000-00-00 00:00:00 N1 +0 380 1970-01-01 00:00:00 N1 +0 380 1970-01-01 00:00:00 N1 +0 280 1970-01-01 00:00:00 C2 +0 0 1970-01-01 00:00:00 N1 0 190 2020-02-16 05:22:05 N1 0 160 2020-02-14 05:22:13 N1 0 230 2020-02-14 05:22:13 N1 0 130 2020-02-14 05:22:14 N1 -0 300 0000-00-00 00:00:00 N1 -0 300 0000-00-00 00:00:00 N1 -0 0 0000-00-00 00:00:00 C2 -0 0 0000-00-00 00:00:00 N1 -0 0 0000-00-00 00:00:00 N1 +0 300 1970-01-01 00:00:00 N1 +0 300 1970-01-01 00:00:00 N1 +0 0 1970-01-01 00:00:00 C2 +0 0 1970-01-01 00:00:00 N1 +0 0 1970-01-01 00:00:00 N1 diff --git a/tests/queries/0_stateless/01257_dictionary_mismatch_types.sql b/tests/queries/0_stateless/01257_dictionary_mismatch_types.sql index 575dd4b09d0..7116f044391 100644 --- a/tests/queries/0_stateless/01257_dictionary_mismatch_types.sql +++ b/tests/queries/0_stateless/01257_dictionary_mismatch_types.sql @@ -13,18 +13,18 @@ CREATE TABLE test_dict_db.table1 `col5` String, `col6` Nullable(Float64), `col7` Nullable(Float64), - `col8` Nullable(DateTime), + `col8` Nullable(DateTime('UTC')), `col9` Nullable(String), `col10` Nullable(String), `col11` Nullable(String), `col12` Nullable(String), `col13` Nullable(Int32), - `col14` Nullable(DateTime), - `col15` Nullable(DateTime), - `col16` Nullable(DateTime), - `col17` Nullable(DateTime), - `col18` Nullable(DateTime), - `col19` Nullable(DateTime), + `col14` Nullable(DateTime('UTC')), + `col15` Nullable(DateTime('UTC')), + `col16` Nullable(DateTime('UTC')), + `col17` Nullable(DateTime('UTC')), + `col18` Nullable(DateTime('UTC')), + `col19` Nullable(DateTime('UTC')), `col20` Nullable(String) ) ENGINE = MergeTree @@ -41,18 +41,18 @@ CREATE DICTIONARY test_dict_db.table1_dict col5 String, col6 Float64, col7 Float64, - col8 DateTime, + col8 DateTime('UTC'), col9 String, col10 String, col11 String, col12 String, col13 Int32, - col14 DateTime, - col15 DateTime, - col16 DateTime, - col17 DateTime, - col18 DateTime, - col19 DateTime, + col14 DateTime('UTC'), + col15 DateTime('UTC'), + col16 DateTime('UTC'), + col17 DateTime('UTC'), + col18 DateTime('UTC'), + col19 DateTime('UTC'), col20 String ) PRIMARY KEY col1,col2,col3,col4,col5 @@ -77,18 +77,18 @@ CREATE TABLE test_dict_db.table1 `col5` String, `col6` Float64, `col7` Float64, - `col8` DateTime, + `col8` DateTime('UTC'), `col9` String, `col10` String, `col11` String, `col12` String, `col13` Int32, - `col14` DateTime, - `col15` DateTime, - `col16` DateTime, - `col17` DateTime, - `col18` DateTime, - `col19` DateTime, + `col14` DateTime('UTC'), + `col15` DateTime('UTC'), + `col16` DateTime('UTC'), + `col17` DateTime('UTC'), + `col18` DateTime('UTC'), + `col19` DateTime('UTC'), `col20` String ) ENGINE = MergeTree diff --git a/tests/queries/0_stateless/01281_parseDateTime64BestEffort.reference b/tests/queries/0_stateless/01281_parseDateTime64BestEffort.reference index e55e50c15d5..5d2507d2a08 100644 --- a/tests/queries/0_stateless/01281_parseDateTime64BestEffort.reference +++ b/tests/queries/0_stateless/01281_parseDateTime64BestEffort.reference @@ -3,7 +3,7 @@ orNull \N orZero 2020-05-14 03:37:03.253 -0000-00-00 00:00:00.000 +1970-01-01 00:00:00.000 non-const 2020-05-14 03:37:03.253 Timezones diff --git a/tests/queries/0_stateless/01282_system_parts_ttl_info.reference b/tests/queries/0_stateless/01282_system_parts_ttl_info.reference index 1d9fe9eeb36..a007346f9b6 100644 --- a/tests/queries/0_stateless/01282_system_parts_ttl_info.reference +++ b/tests/queries/0_stateless/01282_system_parts_ttl_info.reference @@ -1,2 +1,2 @@ 2 2000-01-11 01:02:03 2000-02-13 04:05:06 [] [] [] -0 0000-00-00 00:00:00 0000-00-00 00:00:00 [] [] [] +0 1970-01-01 00:00:00 1970-01-01 00:00:00 [] [] [] diff --git a/tests/queries/0_stateless/01282_system_parts_ttl_info.sql b/tests/queries/0_stateless/01282_system_parts_ttl_info.sql index 3a1b1cc79ce..d98cb0950b0 100644 --- a/tests/queries/0_stateless/01282_system_parts_ttl_info.sql +++ b/tests/queries/0_stateless/01282_system_parts_ttl_info.sql @@ -5,5 +5,5 @@ INSERT INTO ttl VALUES ('2000-01-01 01:02:03'), ('2000-02-03 04:05:06'); SELECT rows, delete_ttl_info_min, delete_ttl_info_max, move_ttl_info.expression, move_ttl_info.min, move_ttl_info.max FROM system.parts WHERE database = currentDatabase() AND table = 'ttl'; SYSTEM START MERGES; OPTIMIZE TABLE ttl FINAL; -SELECT rows, delete_ttl_info_min, delete_ttl_info_max, move_ttl_info.expression, move_ttl_info.min, move_ttl_info.max FROM system.parts WHERE database = currentDatabase() AND table = 'ttl' AND active; +SELECT rows, toTimeZone(delete_ttl_info_min, 'UTC'), toTimeZone(delete_ttl_info_max, 'UTC'), move_ttl_info.expression, move_ttl_info.min, move_ttl_info.max FROM system.parts WHERE database = currentDatabase() AND table = 'ttl' AND active; DROP TABLE ttl; diff --git a/tests/queries/0_stateless/01313_parse_date_time_best_effort_null_zero.reference b/tests/queries/0_stateless/01313_parse_date_time_best_effort_null_zero.reference index 90bb776ca10..e40fa73c978 100644 --- a/tests/queries/0_stateless/01313_parse_date_time_best_effort_null_zero.reference +++ b/tests/queries/0_stateless/01313_parse_date_time_best_effort_null_zero.reference @@ -1,6 +1,6 @@ \N -0000-00-00 00:00:00 +1970-01-01 00:00:00 \N -0000-00-00 00:00:00.000 +1970-01-01 00:00:00 \N -0000-00-00 00:00:00 +1970-01-01 00:00:00 diff --git a/tests/queries/0_stateless/01313_parse_date_time_best_effort_null_zero.sql b/tests/queries/0_stateless/01313_parse_date_time_best_effort_null_zero.sql index 69b66b46df7..c58eb722327 100644 --- a/tests/queries/0_stateless/01313_parse_date_time_best_effort_null_zero.sql +++ b/tests/queries/0_stateless/01313_parse_date_time_best_effort_null_zero.sql @@ -1,12 +1,12 @@ SELECT parseDateTimeBestEffort(''); -- { serverError 6 } SELECT parseDateTimeBestEffortOrNull(''); -SELECT parseDateTimeBestEffortOrZero(''); +SELECT parseDateTimeBestEffortOrZero('', 'UTC'); SELECT parseDateTime64BestEffort(''); -- { serverError 6 } SELECT parseDateTime64BestEffortOrNull(''); -SELECT parseDateTime64BestEffortOrZero(''); +SELECT parseDateTime64BestEffortOrZero('', 0, 'UTC'); SET date_time_input_format = 'best_effort'; SELECT toDateTime(''); -- { serverError 41 } SELECT toDateTimeOrNull(''); -SELECT toDateTimeOrZero(''); +SELECT toDateTimeOrZero('', 'UTC'); diff --git a/tests/queries/0_stateless/01379_with_fill_several_columns.reference b/tests/queries/0_stateless/01379_with_fill_several_columns.reference index f3362a47aab..477c9adc403 100644 --- a/tests/queries/0_stateless/01379_with_fill_several_columns.reference +++ b/tests/queries/0_stateless/01379_with_fill_several_columns.reference @@ -1,21 +1,21 @@ 1970-01-11 1970-01-02 original -0000-00-00 1970-01-03 -0000-00-00 1970-01-04 +1970-01-01 1970-01-03 +1970-01-01 1970-01-04 1970-02-10 1970-01-05 original -0000-00-00 1970-01-06 -0000-00-00 1970-01-07 +1970-01-01 1970-01-06 +1970-01-01 1970-01-07 1970-03-12 1970-01-08 original =============== 1970-01-11 1970-01-02 original -1970-01-16 0000-00-00 -1970-01-21 0000-00-00 -1970-01-26 0000-00-00 -1970-01-31 0000-00-00 -1970-02-05 0000-00-00 +1970-01-16 1970-01-01 +1970-01-21 1970-01-01 +1970-01-26 1970-01-01 +1970-01-31 1970-01-01 +1970-02-05 1970-01-01 1970-02-10 1970-01-05 original -1970-02-15 0000-00-00 -1970-02-20 0000-00-00 -1970-02-25 0000-00-00 -1970-03-02 0000-00-00 -1970-03-07 0000-00-00 +1970-02-15 1970-01-01 +1970-02-20 1970-01-01 +1970-02-25 1970-01-01 +1970-03-02 1970-01-01 +1970-03-07 1970-01-01 1970-03-12 1970-01-08 original