Skip to content

Commit

Permalink
fix: fix type of timestamptz literal.
Browse files Browse the repository at this point in the history
  • Loading branch information
ashigeru committed Jul 22, 2024
1 parent 3f3feb3 commit 1a3c041
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/mizugaki/analyzer/details/analyze_literal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ class engine {
return context_.create<tscalar::immediate>(
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) {
Expand Down
6 changes: 3 additions & 3 deletions test/mizugaki/analyzer/details/analyze_literal_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand All @@ -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();
}
Expand All @@ -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();
}
Expand Down

0 comments on commit 1a3c041

Please sign in to comment.