From 1a3c0410f1926f0ecb38682bd60766ec5eef40bd Mon Sep 17 00:00:00 2001 From: Suguru ARAKAWA Date: Mon, 22 Jul 2024 09:21:42 +0900 Subject: [PATCH] fix: fix type of timestamptz literal. --- src/mizugaki/analyzer/details/analyze_literal.cpp | 2 +- test/mizugaki/analyzer/details/analyze_literal_test.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mizugaki/analyzer/details/analyze_literal.cpp b/src/mizugaki/analyzer/details/analyze_literal.cpp index 3055d08..3a25e1c 100644 --- a/src/mizugaki/analyzer/details/analyze_literal.cpp +++ b/src/mizugaki/analyzer/details/analyze_literal.cpp @@ -518,7 +518,7 @@ class engine { return context_.create( value.region(), context_.values().get(tvalue::time_point { convert(info) }), - context_.types().get(ttype::time_point {})); + context_.types().get(ttype::time_point { ttype::with_time_zone_t { with_tz } })); } ::takatori::datetime::time_point convert(::takatori::datetime::datetime_info const& info) { diff --git a/test/mizugaki/analyzer/details/analyze_literal_test.cpp b/test/mizugaki/analyzer/details/analyze_literal_test.cpp index 3708088..920ef1d 100644 --- a/test/mizugaki/analyzer/details/analyze_literal_test.cpp +++ b/test/mizugaki/analyzer/details/analyze_literal_test.cpp @@ -750,7 +750,7 @@ TEST_F(analyze_literal_test, timestamp_with_time_zone) { ASSERT_TRUE(r) << diagnostics(); EXPECT_EQ(*r, (tscalar::immediate { tvalue::time_point { 1969, 12, 31, 15, 0, 0 }, - ttype::time_point {}, + ttype::time_point { ttype::with_time_zone }, })); expect_no_error(); } @@ -765,7 +765,7 @@ TEST_F(analyze_literal_test, timestamp_with_time_zone_z) { ASSERT_TRUE(r) << diagnostics(); EXPECT_EQ(*r, (tscalar::immediate { tvalue::time_point { 1970, 1, 1, 0, 0, 0 }, - ttype::time_point {}, + ttype::time_point { ttype::with_time_zone }, })); expect_no_error(); } @@ -781,7 +781,7 @@ TEST_F(analyze_literal_test, timestamp_with_time_zone_default) { ASSERT_TRUE(r) << diagnostics(); EXPECT_EQ(*r, (tscalar::immediate { tvalue::time_point { 1970, 1, 1, 9, 0, 0 }, - ttype::time_point {}, + ttype::time_point { ttype::with_time_zone }, })); expect_no_error(); }