Skip to content
Merged
Changes from all commits
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
21 changes: 21 additions & 0 deletions enginetest/queries/time_queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,25 @@ var TimeQueryTests = []ScriptTest{
},
},
},
{
Name: "set time zone from table value",
SetUpScript: []string{
"create table timezones(pk int primary key, tz varchar(20))",
"insert into timezones values (1, 'invalid time zone'), (2, '-5:00')",
},
Assertions: []ScriptTestAssertion{
{
Query: "set time_zone=(select tz from timezones where pk = 1)",
ExpectedErr: sql.ErrInvalidTimeZone,
},
{
Query: "set time_zone=(select tz from timezones where pk = 2)",
Expected: []sql.Row{{types.NewOkResult(0)}},
},
{
Query: "select now()",
Expected: []sql.Row{{time.Date(2025, time.July, 23, 11, 43, 21, 0, time.UTC)}},
},
},
},
}
Loading