Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
data: Don't add a timezone when coercing to a date
If we're coercing a timestamp that has no timezone to a date, make sure that the resulting date also doesn't have a timezone. This fixes a bug where we wouldn't be able to do lookups into a date field using timestamps that had the same date Refs: ENG-2997 Change-Id: I86bc165fe40c2e19c650df707e852da4c9968526 Reviewed-on: https://gerrit.readyset.name/c/readyset/+/4868 Tested-by: Buildkite CI Reviewed-by: Fran Noriega <fran@readyset.io>
- Loading branch information
1 parent
3090ad9
commit 33990c7
Showing
2 changed files
with
24 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
statement ok | ||
CREATE TABLE `table_1` (`column_2` INT, `column_1` DATE, PRIMARY KEY (`column_2`)) | ||
|
||
|
||
statement ok | ||
INSERT INTO `table_1` (`column_2`, `column_1`) VALUES (0, '2020-01-01') | ||
|
||
onlyif readyset | ||
statement ok | ||
create cache from SELECT dayofweek(`table_1`.`column_1`) AS `alias_1` FROM `table_1` WHERE (`table_1`.`column_1` = ?) | ||
|
||
graphviz | ||
|
||
query rowsort | ||
SELECT count(*) AS `alias_1` FROM `table_1` WHERE (`table_1`.`column_1` = ?) | ||
? = 2020-01-01 00:00:00 | ||
---- | ||
1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters