Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add datetime comparison test
  • Loading branch information
angelamayxie committed Oct 22, 2025
commit 62efe690ace1363639adc27cfc5858d64413a489
4 changes: 4 additions & 0 deletions enginetest/queries/queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -4281,6 +4281,10 @@ SELECT * FROM cte WHERE d = 2;`,
ExpectedWarningsCount: 1,
Expected: []sql.Row{{time.Date(2020, time.January, 1, 12, 34, 56, 123456000, time.UTC)}},
},
{
Query: "select cast('2020-01-01 12:34:56.123456' as datetime(6)) > cast('2020-01-01 12:34:56' as datetime)",
Expected: []sql.Row{{true}},
},
{
Query: `SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM othertable) othertable_one) othertable_two) othertable_three WHERE s2 = 'first'`,
Expected: []sql.Row{
Expand Down
2 changes: 0 additions & 2 deletions sql/types/datetime.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ var (
Date = MustCreateDatetimeType(sqltypes.Date, 0)
// Datetime is a date and a time with default precision (no fractional seconds).
Datetime = MustCreateDatetimeType(sqltypes.Datetime, 0)
// DatetimeDefaultPrecision is a date and a time without a specified precision
DatetimeDefaultPrecision = MustCreateDatetimeType(sqltypes.Datetime, 0)
// DatetimeMaxPrecision is a date and a time with maximum precision
DatetimeMaxPrecision = MustCreateDatetimeType(sqltypes.Datetime, MaxDatetimePrecision)
// Timestamp is a UNIX timestamp with default precision (no fractional seconds).
Expand Down