Skip to content

Commit 62efe69

Browse files
committed
add datetime comparison test
1 parent 8a1d37e commit 62efe69

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

enginetest/queries/queries.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4281,6 +4281,10 @@ SELECT * FROM cte WHERE d = 2;`,
42814281
ExpectedWarningsCount: 1,
42824282
Expected: []sql.Row{{time.Date(2020, time.January, 1, 12, 34, 56, 123456000, time.UTC)}},
42834283
},
4284+
{
4285+
Query: "select cast('2020-01-01 12:34:56.123456' as datetime(6)) > cast('2020-01-01 12:34:56' as datetime)",
4286+
Expected: []sql.Row{{true}},
4287+
},
42844288
{
42854289
Query: `SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM othertable) othertable_one) othertable_two) othertable_three WHERE s2 = 'first'`,
42864290
Expected: []sql.Row{

sql/types/datetime.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,6 @@ var (
104104
Date = MustCreateDatetimeType(sqltypes.Date, 0)
105105
// Datetime is a date and a time with default precision (no fractional seconds).
106106
Datetime = MustCreateDatetimeType(sqltypes.Datetime, 0)
107-
// DatetimeDefaultPrecision is a date and a time without a specified precision
108-
DatetimeDefaultPrecision = MustCreateDatetimeType(sqltypes.Datetime, 0)
109107
// DatetimeMaxPrecision is a date and a time with maximum precision
110108
DatetimeMaxPrecision = MustCreateDatetimeType(sqltypes.Datetime, MaxDatetimePrecision)
111109
// Timestamp is a UNIX timestamp with default precision (no fractional seconds).

0 commit comments

Comments
 (0)