Skip to content
Merged
Show file tree
Hide file tree
Changes from 63 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
e558457
tmp
Aug 20, 2026
a66ece1
testing
Aug 21, 2026
bf15c82
regex for delimiter datetime
Aug 21, 2026
0dfeac3
convert dates to string
Aug 24, 2026
ef07afd
support string to date conversions
Aug 25, 2026
32249d0
[ga-format-pr] Run ./format_repo.sh to fix formatting
jycor Aug 25, 2026
0620aa2
better regex
Aug 25, 2026
404da2c
implement without warnings
Aug 25, 2026
4197953
fix every except for warnings
Aug 26, 2026
929ddd0
fix a ton of string conversion issues
Aug 26, 2026
b47b19b
refactoring
Aug 27, 2026
530039c
greatly simplified conversion functions
Aug 27, 2026
4bc9517
more test fixes
Aug 27, 2026
367de3b
more fixing
Aug 27, 2026
c1f5636
fixing arithmetic
Aug 27, 2026
ffea211
fix insert tests
Aug 27, 2026
091cfa1
resolve truncated vs incorrect error discrepancy
Aug 27, 2026
0975ede
fix warnings
Aug 27, 2026
17577b6
fixing more tests
Aug 27, 2026
bf56d94
fix remaining tests
Aug 28, 2026
b4697fa
[ga-format-pr] Run ./format_repo.sh to fix formatting
jycor Aug 28, 2026
c2299fd
fix functions?
Aug 28, 2026
d4bc768
fix non constant warnings
Aug 28, 2026
14e6ce2
more warning fixes
Aug 28, 2026
9dd5aa0
fix sql_mode
Aug 28, 2026
83b2227
fixing tests
Aug 28, 2026
7078366
more fixes
Aug 28, 2026
e933b6f
time fixes
Aug 31, 2026
f6cdf45
fixing
Aug 31, 2026
31fba2a
fix server enginetests for year < 1000
Aug 31, 2026
c8dec19
fix now?
Aug 31, 2026
96eb4da
add utc
Aug 31, 2026
4ecbcb7
fixup tests
Aug 31, 2026
e5ae09c
more sql mode fixes
Aug 31, 2026
08c3ccb
more
Sep 1, 2026
d84f30d
fix quarter func
Sep 1, 2026
09c299d
fix last day
Sep 1, 2026
228e6bf
fixing more functions
Sep 1, 2026
6c3824d
more function fixes
Sep 1, 2026
c8fb724
fixing up remaining datetime functions
Sep 1, 2026
e422c05
cleaning up debug
Sep 1, 2026
bbfba25
[ga-format-pr] Run ./format_repo.sh to fix formatting
jycor Sep 1, 2026
af6ebb1
prevent disabling NO_ZERO_IN_DATE
Sep 2, 2026
64cf03a
remove unused error
Sep 3, 2026
b159621
moving over some refactorings
Sep 3, 2026
ef7f96b
update errors
Sep 3, 2026
0ebdc29
refactor
Sep 3, 2026
5f206a8
revert
Sep 3, 2026
6175544
???
Sep 3, 2026
c74721b
more refactoring
Sep 3, 2026
64e20e9
[ga-format-pr] Run ./format_repo.sh to fix formatting
jycor Sep 3, 2026
d3bbc54
fixing double digit year logic
Sep 3, 2026
4272ff6
moving queries over
Sep 3, 2026
071f481
revert unsupported datetime format
Sep 3, 2026
299bd05
more extra parsing fixes
Sep 3, 2026
8379176
revert timetosec
Sep 3, 2026
9414a19
fixing bad merge
Sep 4, 2026
e56fb7a
fixing some tests
Sep 4, 2026
9b0b7e9
asdf
Sep 4, 2026
c9e26e0
test this
Sep 4, 2026
f898ccd
restoring deleted queries
Sep 4, 2026
aad353e
fixing a plethora of tests
Sep 4, 2026
e02c016
[ga-format-pr] Run ./format_repo.sh to fix formatting
jycor Sep 4, 2026
aca6cd6
fixing functions
Sep 6, 2026
4339875
bump
Sep 6, 2026
e5c3e58
clean up
Sep 6, 2026
88d25d1
asdfasdf
Sep 6, 2026
1f16cec
rename error
Sep 8, 2026
dfb2ee6
feedback
Sep 8, 2026
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
8 changes: 3 additions & 5 deletions enginetest/enginetests.go
Original file line number Diff line number Diff line change
Expand Up @@ -4792,19 +4792,17 @@ func TestColumnDefaults(t *testing.T, harness Harness) {
}, nil, nil, nil)
})

// TODO: zero timestamps work slightly differently than they do in MySQL, where the zero time is "0000-00-00 00:00:00"
// We use "0000-01-01 00:00:00"
t.Run("DATETIME/TIMESTAMP NOW/CURRENT_TIMESTAMP literals", func(t *testing.T) {
if IsServerEngine(e) {
t.Skip("TODO: fix result formatting for server engine tests")
}
TestQueryWithContext(t, ctx, e, harness, "CREATE TABLE t10zero(pk BIGINT PRIMARY KEY, v1 DATETIME DEFAULT '2020-01-01 01:02:03', v2 DATETIME DEFAULT 0,"+
"v3 TIMESTAMP DEFAULT '2020-01-01 01:02:03', v4 TIMESTAMP DEFAULT 0)", []sql.Row{{types.NewOkResult(0)}}, nil, nil, nil)
TestQueryWithContext(t, ctx, e, harness, "CREATE TABLE t10zero(pk BIGINT PRIMARY KEY, v1 DATETIME DEFAULT '2020-01-01 01:02:03', "+
"v2 TIMESTAMP DEFAULT '2020-01-01 01:02:03')", []sql.Row{{types.NewOkResult(0)}}, nil, nil, nil)

RunQueryWithContext(t, e, harness, ctx, "insert into t10zero(pk) values (1)")

// TODO: the string conversion does not transform to UTC like other NOW() calls, fix this
TestQueryWithContext(t, ctx, e, harness, "select * from t10zero order by 1", []sql.Row{{1, time.Date(2020, 1, 1, 1, 2, 3, 0, time.UTC), types.Datetime.Zero(), time.Date(2020, 1, 1, 1, 2, 3, 0, time.UTC), types.Timestamp.Zero()}}, nil, nil, nil)
TestQueryWithContext(t, ctx, e, harness, "select * from t10zero order by 1", []sql.Row{{1, time.Date(2020, 1, 1, 1, 2, 3, 0, time.UTC), time.Date(2020, 1, 1, 1, 2, 3, 0, time.UTC)}}, nil, nil, nil)
})

t.Run("Non-DATETIME/TIMESTAMP NOW/CURRENT_TIMESTAMP expression", func(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions enginetest/evaluation.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func TestScriptWithEngine(t *testing.T, e QueryEngine, harness Harness, script q
AssertErr(t, e, harness, assertion.Query, assertion.Bindings, assertion.ExpectedErr)
} else if assertion.ExpectedErrStr != "" {
AssertErrWithCtx(t, e, harness, ctx, assertion.Query, assertion.Bindings, nil, assertion.ExpectedErrStr)
} else if assertion.ExpectedWarning != 0 {
} else if !assertion.SkipWarnings && assertion.ExpectedWarning != 0 {
if IsServerEngine(e) && assertion.SkipResultCheckOnServerEngine {
t.Skip()
}
Expand Down Expand Up @@ -425,7 +425,7 @@ func TestQueryWithEngine(t *testing.T, harness Harness, e QueryEngine, tt querie
AssertErr(t, e, harness, tt.Query, tt.Bindings, tt.ExpectedErr)
} else if tt.ExpectedErrStr != "" {
AssertErrWithCtx(t, e, harness, ctx, tt.Query, tt.Bindings, nil, tt.ExpectedErrStr)
} else if tt.ExpectedWarning != 0 {
} else if !tt.SkipWarnings && tt.ExpectedWarning != 0 {
AssertWarningAndTestQuery(t, e, ctx, harness,
tt.Query,
tt.Expected,
Expand Down Expand Up @@ -574,7 +574,7 @@ func TestPreparedQueryWithEngine(t *testing.T, harness Harness, e QueryEngine, t
AssertErr(t, e, harness, tt.Query, tt.Bindings, tt.ExpectedErr)
} else if tt.ExpectedErrStr != "" {
AssertErrWithCtx(t, e, harness, ctx, tt.Query, tt.Bindings, nil, tt.ExpectedErrStr)
} else if tt.ExpectedWarning != 0 {
} else if !tt.SkipWarnings && tt.ExpectedWarning != 0 {
AssertWarningAndTestPreparedQuery(t, e, ctx, harness, tt.Query, tt.Expected, tt.ExpectedColumns,
tt.ExpectedWarning, tt.ExpectedWarningsCount, tt.ExpectedWarningMessageSubstring, false)
} else {
Expand Down
27 changes: 6 additions & 21 deletions enginetest/memory_engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,30 +193,15 @@ func TestSingleQueryPrepared(t *testing.T) {

// Convenience test for debugging a single query. Unskip and set to the desired query.
func TestSingleScript(t *testing.T) {
t.Skip()
//t.Skip()
var scripts = []queries.ScriptTest{
{
Name: "Parse table name as column",
SetUpScript: []string{
`CREATE TABLE test (pk INT PRIMARY KEY, v1 VARCHAR(255));`,
`INSERT INTO test VALUES (1, 'a'), (2, 'b');`,
},
Name: "Parse table name as column",
SetUpScript: []string{},
Assertions: []queries.ScriptTestAssertion{
{
Query: "SELECT temporarytesting(t) FROM test AS t;",
Expected: []sql.Row{},
},
{
Query: "SELECT temporarytesting(test) FROM test;",
Expected: []sql.Row{},
},
{
Query: "SELECT temporarytesting(pk, test) FROM test;",
Expected: []sql.Row{},
},
{
Query: "SELECT temporarytesting(v1, test, pk) FROM test;",
Expected: []sql.Row{},
Query: `SELECT STR_TO_DATE(FIRST_VALUE(NULL) OVER (), '%Y-%m-%d')`,
Expected: []sql.Row{{nil}},
},
},
},
Expand All @@ -233,7 +218,7 @@ func TestSingleScript(t *testing.T) {
// engine.EngineAnalyzer().Debug = true
// engine.EngineAnalyzer().Verbose = true

enginetest.TestScriptWithEngine(t, engine, harness, test)
enginetest.TestScriptWithEnginePrepared(t, engine, harness, test)
}
}

Expand Down
Loading
Loading