Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
f7c8dee
comment
Nov 21, 2023
7b6b755
update exprs progress
Nov 22, 2023
7fd385e
something
Nov 24, 2023
3912b47
Merge branch 'main' into james/update
Nov 27, 2023
4d2b4c9
asdfasdf
Nov 27, 2023
9a6cffb
fix for replacing update default
Nov 27, 2023
752c233
fix update set col = default
Nov 27, 2023
e87d967
adding tests
Nov 27, 2023
0fc5ef6
fix and tests for update with null default
Nov 27, 2023
0a9af02
remove todos
Nov 27, 2023
a3f06f5
update default merge
Nov 27, 2023
9965a47
merge with update default
Nov 28, 2023
ce836d6
working, but need to serialize onupdate
Nov 28, 2023
ee59c31
comment
Nov 29, 2023
c88954b
Merge branch 'main' into james/update
Nov 29, 2023
76de2c0
print on update
Nov 30, 2023
fa3f4f8
Merge branch 'main' into james/update
Dec 6, 2023
336aa5a
on update
Dec 6, 2023
fddc4d5
some tests
Dec 6, 2023
4b5cf2e
adding enginetests
Dec 6, 2023
9f1963d
more tests
Dec 6, 2023
895d704
[ga-format-pr] Run ./format_repo.sh to fix formatting
jcor11599 Dec 6, 2023
572de4c
prevent blocking updates and clean up
Dec 6, 2023
375935e
Merge branch 'james/update' of https://github.com/dolthub/go-mysql-se…
Dec 6, 2023
2ce8b9d
working?
Dec 6, 2023
6d137c4
use now func
Dec 6, 2023
3d3e9f6
Merge branch 'main' into james/update
Dec 6, 2023
c94cc20
dsafadfgdasg
Dec 6, 2023
e32f7a9
remove TODO
Dec 6, 2023
75c8406
remove todo
Dec 7, 2023
de26a99
trigger test and block on bad column types
Dec 8, 2023
9e017a8
another type test
Dec 8, 2023
9065b9a
[ga-format-pr] Run ./format_repo.sh to fix formatting
jcor11599 Dec 8, 2023
9419557
Merge branch 'main' into james/update
Dec 8, 2023
f73661d
Merge branch 'main' into james/update
Dec 8, 2023
5a077f2
more tests
Dec 8, 2023
86dff89
stored procedure test
Dec 9, 2023
0a0ae0a
[ga-format-pr] Run ./format_repo.sh to fix formatting
jcor11599 Dec 9, 2023
d59714b
Merge branch 'main' into james/update
Dec 11, 2023
f889fac
merge with main
Dec 12, 2023
2fdbed6
code feedback
Dec 12, 2023
976a598
rename
Dec 12, 2023
d5f0085
adding script tests
Dec 13, 2023
72de364
[ga-format-pr] Run ./format_repo.sh to fix formatting
jcor11599 Dec 13, 2023
de51a08
Merge branch 'main' into james/update
Dec 13, 2023
e8d27b9
Merge branch 'james/update' of https://github.com/dolthub/go-mysql-se…
Dec 13, 2023
c790c6a
convert some test
Dec 13, 2023
fdcab48
[ga-format-pr] Run ./format_repo.sh to fix formatting
jcor11599 Dec 13, 2023
68ef5c7
trigger tests
Dec 13, 2023
e13d765
final tests and removing old tests
Dec 13, 2023
c8edc89
Merge branch 'main' into james/update
Dec 13, 2023
2cc12b7
is this the problem?
Dec 13, 2023
3d33a11
????
Dec 13, 2023
48befe9
asddfgdfg
Dec 13, 2023
971cc9b
copy paste
Dec 13, 2023
25cf79f
skip result check for zero time for server enginetests
Dec 13, 2023
32426b0
[ga-format-pr] Run ./format_repo.sh to fix formatting
jcor11599 Dec 13, 2023
95355c5
skip stored procedure result checking on server engine
Dec 13, 2023
b6fe0e5
[ga-format-pr] Run ./format_repo.sh to fix formatting
jcor11599 Dec 13, 2023
4fbff2a
move tests and rename times
Dec 13, 2023
9d460ff
[ga-format-pr] Run ./format_repo.sh to fix formatting
jcor11599 Dec 13, 2023
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
67 changes: 67 additions & 0 deletions enginetest/enginetests.go
Original file line number Diff line number Diff line change
Expand Up @@ -4243,6 +4243,73 @@ func TestCurrentTimestamp(t *testing.T, harness Harness) {
}
}

func TestOnUpdateExprScripts(t *testing.T, harness Harness) {
harness.Setup(setup.MydbData)
for _, script := range queries.OnUpdateExprScripts {
if sh, ok := harness.(SkippingHarness); ok {
if sh.SkipQueryTest(script.Name) {
t.Run(script.Name, func(t *testing.T) {
t.Skip(script.Name)
})
continue
}
}
e := mustNewEngine(t, harness)
ctx := NewContext(harness)
err := CreateNewConnectionForServerEngine(ctx, e)
require.NoError(t, err, nil)

t.Run(script.Name, func(t *testing.T) {
for _, statement := range script.SetUpScript {
sql.RunWithNowFunc(func() time.Time { return queries.Jan1Noon }, func() error {
ctx.WithQuery(statement)
ctx.SetQueryTime(queries.Jan1Noon)
RunQueryWithContext(t, e, harness, ctx, statement)
return nil
})
}

assertions := script.Assertions
if len(assertions) == 0 {
assertions = []queries.ScriptTestAssertion{
{
Query: script.Query,
Expected: script.Expected,
ExpectedErr: script.ExpectedErr,
ExpectedIndexes: script.ExpectedIndexes,
},
}
}

for _, assertion := range script.Assertions {
t.Run(assertion.Query, func(t *testing.T) {
if assertion.Skip {
t.Skip()
}
sql.RunWithNowFunc(func() time.Time { return queries.Dec15_1_30 }, func() error {
ctx.SetQueryTime(queries.Dec15_1_30)
if assertion.ExpectedErr != nil {
AssertErr(t, e, harness, assertion.Query, assertion.ExpectedErr)
} else if assertion.ExpectedErrStr != "" {
AssertErr(t, e, harness, assertion.Query, nil, assertion.ExpectedErrStr)
} else {
var expected = assertion.Expected
if IsServerEngine(e) && assertion.SkipResultCheckOnServerEngine {
// TODO: remove this check in the future
expected = nil
}
TestQueryWithContext(t, ctx, e, harness, assertion.Query, expected, assertion.ExpectedColumns, assertion.Bindings)
}
return nil
})
})
}
})

e.Close()
}
}

func TestAddDropPks(t *testing.T, harness Harness) {
for _, tt := range queries.AddDropPrimaryKeyScripts {
TestScript(t, harness, tt)
Expand Down
4 changes: 4 additions & 0 deletions enginetest/memory_engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,10 @@ func TestUpdateErrors(t *testing.T) {
enginetest.TestUpdateErrors(t, enginetest.NewMemoryHarness("default", 1, testNumPartitions, true, mergableIndexDriver))
}

func TestOnUpdateExprScripts(t *testing.T) {
enginetest.TestOnUpdateExprScripts(t, enginetest.NewMemoryHarness("default", 1, testNumPartitions, true, mergableIndexDriver))
}

func TestSpatialUpdate(t *testing.T) {
enginetest.TestSpatialUpdate(t, enginetest.NewMemoryHarness("default", 1, testNumPartitions, true, mergableIndexDriver))
}
Expand Down
Loading