Skip to content

Commit b2cc5fe

Browse files
committed
mv tests
1 parent ed44bbd commit b2cc5fe

File tree

2 files changed

+35
-17
lines changed

2 files changed

+35
-17
lines changed

enginetest/memory_engine_test.go

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -200,29 +200,23 @@ func TestSingleQueryPrepared(t *testing.T) {
200200

201201
// Convenience test for debugging a single query. Unskip and set to the desired query.
202202
func TestSingleScript(t *testing.T) {
203-
//t.Skip()
203+
t.Skip()
204204
var scripts = []queries.ScriptTest{
205205
{
206-
// https://github.com/dolthub/dolt/issues/9987
207-
Name: "GROUP BY nil pointer dereference in Dispose when Next() never called",
208-
SetUpScript: []string{
209-
"CREATE TABLE test_table (id INT PRIMARY KEY, value INT, category VARCHAR(50))",
210-
"INSERT INTO test_table VALUES (1, 100, 'A'), (2, 200, 'B'), (3, 300, 'A')",
211-
},
206+
Name: "AS OF propagates to nested CALLs",
207+
SetUpScript: []string{},
212208
Assertions: []queries.ScriptTestAssertion{
213209
{
214-
// LIMIT 0 causes the iterator to close without ever calling Next() on groupByIter
215-
// This leaves all buffer elements as nil, causing panic in Dispose()
216-
Query: "SELECT category, SUM(value) FROM test_table GROUP BY category LIMIT 0",
217-
Expected: []sql.Row{},
218-
},
219-
{
220-
Query: "SELECT category, COUNT(*) FROM test_table GROUP BY category LIMIT 0",
221-
Expected: []sql.Row{},
210+
Query: "create procedure create_proc() create table t (i int primary key, j int);",
211+
Expected: []sql.Row{
212+
{types.NewOkResult(0)},
213+
},
222214
},
223215
{
224-
Query: "SELECT SUM(value) FROM test_table LIMIT 0",
225-
Expected: []sql.Row{},
216+
Query: "call create_proc()",
217+
Expected: []sql.Row{
218+
{types.NewOkResult(0)},
219+
},
226220
},
227221
},
228222
},

enginetest/queries/script_queries.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,30 @@ type ScriptTestAssertion struct {
122122
// Unlike other engine tests, ScriptTests must be self-contained. No other tables are created outside the definition of
123123
// the tests.
124124
var ScriptTests = []ScriptTest{
125+
{
126+
// https://github.com/dolthub/dolt/issues/9987
127+
Name: "GROUP BY nil pointer dereference in Dispose when Next() never called",
128+
SetUpScript: []string{
129+
"CREATE TABLE test_table (id INT PRIMARY KEY, value INT, category VARCHAR(50))",
130+
"INSERT INTO test_table VALUES (1, 100, 'A'), (2, 200, 'B'), (3, 300, 'A')",
131+
},
132+
Assertions: []queries.ScriptTestAssertion{
133+
{
134+
// LIMIT 0 causes the iterator to close without ever calling Next() on groupByIter
135+
// This leaves all buffer elements as nil, causing panic in Dispose()
136+
Query: "SELECT category, SUM(value) FROM test_table GROUP BY category LIMIT 0",
137+
Expected: []sql.Row{},
138+
},
139+
{
140+
Query: "SELECT category, COUNT(*) FROM test_table GROUP BY category LIMIT 0",
141+
Expected: []sql.Row{},
142+
},
143+
{
144+
Query: "SELECT SUM(value) FROM test_table LIMIT 0",
145+
Expected: []sql.Row{},
146+
},
147+
},
148+
},
125149
{
126150
// https://github.com/dolthub/dolt/issues/9935
127151
Dialect: "mysql",

0 commit comments

Comments
 (0)