diff --git a/enginetest/enginetests.go b/enginetest/enginetests.go index 8d887ee531..dec40e9b5a 100644 --- a/enginetest/enginetests.go +++ b/enginetest/enginetests.go @@ -426,6 +426,9 @@ func TestQueryPlans(t *testing.T, harness Harness, planTests []queries.QueryPlan TestQueryPlanWithName(t, options.String(), harness, e, query, expectedPlan, options) } for _, tt := range planTests { + if tt.Skip { + t.Skip() + } t.Run(tt.Query, func(t *testing.T) { runTestWithDescribeOptions(t, tt.Query, tt.ExpectedPlan, sql.DescribeOptions{ Debug: true, @@ -442,7 +445,6 @@ func TestQueryPlans(t *testing.T, harness Harness, planTests []queries.QueryPlan }) } }) - } } diff --git a/enginetest/join_op_tests.go b/enginetest/join_op_tests.go index d656ce3d64..512f50b469 100644 --- a/enginetest/join_op_tests.go +++ b/enginetest/join_op_tests.go @@ -539,7 +539,6 @@ SELECT SUM(x) FROM xy WHERE x IN ( Expected: []sql.Row{ {"testing", 3}, }, - Skip: true, }, { Query: `SELECT @@ -555,7 +554,6 @@ SELECT SUM(x) FROM xy WHERE x IN ( Expected: []sql.Row{ {"testing", 4}, }, - Skip: true, }, { Query: "SELECT substring(mytable.s, 1, 5) AS s FROM mytable INNER JOIN othertable ON (substring(mytable.s, 1, 5) = SUBSTRING(othertable.s2, 1, 5)) GROUP BY 1", diff --git a/enginetest/memory_engine_test.go b/enginetest/memory_engine_test.go index bfbd9946a3..c62c2e2ec0 100644 --- a/enginetest/memory_engine_test.go +++ b/enginetest/memory_engine_test.go @@ -136,8 +136,7 @@ func TestJSONTableScripts(t *testing.T) { // TestBrokenJSONTableScripts runs the canonical test queries against a single threaded index enabled harness. func TestBrokenJSONTableScripts(t *testing.T) { - t.Skip("incorrect errors and unsupported json_table functionality") - enginetest.TestBrokenJSONTableScripts(t, enginetest.NewDefaultMemoryHarness()) + enginetest.TestBrokenJSONTableScripts(t, enginetest.NewSkippingMemoryHarness()) } // Convenience test for debugging a single query. Unskip and set to the desired query. @@ -346,8 +345,6 @@ func TestQueryPlans(t *testing.T) { for _, indexInit := range indexBehaviors { t.Run(indexInit.name, func(t *testing.T) { harness := enginetest.NewMemoryHarness(indexInit.name, 1, 2, indexInit.nativeIndexes, indexInit.driverInitializer) - // The IN expression requires mergeable indexes meaning that an unmergeable index returns a different result, so we skip this test - harness.QueriesToSkip("SELECT a.* FROM mytable a inner join mytable b on (a.i = b.s) WHERE a.i in (1, 2, 3, 4)") enginetest.TestQueryPlans(t, harness, queries.PlanTests) }) } @@ -464,11 +461,6 @@ func TestColumnAliases(t *testing.T) { func TestDerivedTableOuterScopeVisibility(t *testing.T) { harness := enginetest.NewDefaultMemoryHarness() - harness.QueriesToSkip( - "SELECT max(val), (select max(dt.a) from (SELECT val as a) as dt(a)) as a1 from numbers group by a1;", // memoization to fix - "select 'foo' as foo, (select dt.b from (select 1 as a, foo as b) dt);", // need to error - "SELECT n1.val as a1 from numbers n1, (select n1.val, n2.val * -1 from numbers n2 where n1.val = n2.val) as dt;", // different OK error - ) enginetest.TestDerivedTableOuterScopeVisibility(t, harness) } @@ -483,11 +475,6 @@ func TestAmbiguousColumnResolution(t *testing.T) { func TestInsertInto(t *testing.T) { harness := enginetest.NewDefaultMemoryHarness() - harness.QueriesToSkip( - // should be column not found error - "insert into a (select * from b) on duplicate key update b.i = a.i", - "insert into a (select * from b as t) on duplicate key update a.i = b.j + 100", - ) enginetest.TestInsertInto(t, harness) } @@ -820,7 +807,6 @@ func TestDateParse(t *testing.T) { } func TestJsonScripts(t *testing.T) { - // TODO different error messages enginetest.TestJsonScripts(t, enginetest.NewDefaultMemoryHarness()) } diff --git a/enginetest/queries/column_alias_queries.go b/enginetest/queries/column_alias_queries.go index b611cba87f..1c4134a605 100644 --- a/enginetest/queries/column_alias_queries.go +++ b/enginetest/queries/column_alias_queries.go @@ -249,14 +249,13 @@ var ColumnAliasQueries = []ScriptTest{ { // The second query in the union subquery returns "x" instead of mytable.i // https://github.com/dolthub/dolt/issues/4256 - Skip: true, - Query: `SELECT *, (select i union select i) as a from mytable;`, - Expected: []sql.Row{{1, "first row", 1}, {2, "second row", 2}, {3, "third row", 3}}, + Query: `SELECT *, (select i union select i) as a from mytable;`, + Expected: []sql.Row{ + {1, "first row", 1}, + {2, "second row", 2}, + {3, "third row", 3}}, }, { - // Fails with an unresolved *plan.Project node error - // The second Project in the union subquery doens't seem to get its alias reference resolved - Skip: true, Query: `SELECT 1 as a, (select a union select a) as b;`, Expected: []sql.Row{{1, 1}}, }, @@ -270,14 +269,12 @@ var ColumnAliasQueries = []ScriptTest{ { // GMS returns "expression 'dt.two' doesn't appear in the group by expressions", but MySQL will execute // this query. - Skip: true, Query: "select 1 as a, one + 1 as mod1, dt.* from mytable as t1, (select 1, 2 from mytable) as dt (one, two) where dt.one > 0 group by one;", // column names: a, mod1, one, two Expected: []sql.Row{{1, 2, 1, 2}}, }, { // GMS returns `ambiguous column or alias name "b"` on both cases of `group by b` and `group by 1` inside subquery, but MySQL executes. - Skip: true, Query: "select 1 as b, (select b group by b order by b) order by 1;", Expected: []sql.Row{{1, 1}}, }, diff --git a/enginetest/queries/derived_table_outer_scope_visibility_queries.go b/enginetest/queries/derived_table_outer_scope_visibility_queries.go index 48fa028e1e..2cb1624ff9 100644 --- a/enginetest/queries/derived_table_outer_scope_visibility_queries.go +++ b/enginetest/queries/derived_table_outer_scope_visibility_queries.go @@ -69,6 +69,7 @@ var DerivedTableOuterScopeVisibilityQueries = []ScriptTest{ { // A subquery containing a derived table, used in the GROUP BY clause of a top-level query as a grouping // expression, has visibility to tables and columns in the top-level query. + Skip: true, // memoization to fix Query: "SELECT max(val), (select max(dt.a) from (SELECT val as a) as dt(a)) as a1 from numbers group by a1;", Expected: []sql.Row{{1, 1}, {2, 2}, {3, 3}, {4, 4}, {5, 5}, {6, 6}}, }, @@ -94,11 +95,13 @@ var DerivedTableOuterScopeVisibilityQueries = []ScriptTest{ Assertions: []ScriptTestAssertion{ { // expression aliases are NOT visible from outer scopes to derived tables + Skip: true, // need to error Query: "select 'foo' as foo, (select dt.b from (select 1 as a, foo as b) dt);", ExpectedErr: sql.ErrColumnNotFound, }, { // a derived table NOT inside a subquery expression does NOT have access to any lateral scope tables. + Skip: true, // different OK error Query: "SELECT n1.val as a1 from numbers n1, (select n1.val, n2.val * -1 from numbers n2 where n1.val = n2.val) as dt;", ExpectedErr: sql.ErrTableNotFound, }, @@ -113,7 +116,6 @@ var DerivedTableOuterScopeVisibilityQueries = []ScriptTest{ // to the top level of the query, and not directly inside the subquery expression, which would explain // why MySQL does NOT give this query visibility to the 'opk' table alias. We should match MySQL's // behavior, but this is a small edge case we can follow up on. - Skip: true, // CTEs and Recursive CTEs may receive outer scope visibility, but only when they are contained in a // subquery expression. The CTE in this query should NOT have visibility to the 'opk' table alias. diff --git a/enginetest/queries/information_schema_queries.go b/enginetest/queries/information_schema_queries.go index a9a829475c..fbe5e29ac7 100644 --- a/enginetest/queries/information_schema_queries.go +++ b/enginetest/queries/information_schema_queries.go @@ -1186,7 +1186,7 @@ FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_schema = 'mydb'`, { // TODO: cardinality not supported Skip: true, - Query: `select index_name, seq_in_index, column_name, cardinality, sub_part from information_schema.statistics where table_schema = 'mydb' and table_name = 'ptable' ORDER BY INDEX_NAME`, + Query: `select cardinality from information_schema.statistics where table_schema = 'mydb' and table_name = 'ptable' ORDER BY INDEX_NAME`, Expected: []sql.Row{{2}, {2}, {2}, {2}, {2}}, }, { diff --git a/enginetest/queries/insert_queries.go b/enginetest/queries/insert_queries.go index bd04695167..512e84d86a 100644 --- a/enginetest/queries/insert_queries.go +++ b/enginetest/queries/insert_queries.go @@ -1680,7 +1680,6 @@ var InsertScripts = []ScriptTest{ Assertions: []ScriptTestAssertion{ { Query: `insert into a with cte as (select * from b) select * from cte on duplicate key update a.i = cte.j + 100`, - Skip: true, Expected: []sql.Row{ {types.OkResult{RowsAffected: 4}}, }, diff --git a/enginetest/queries/join_queries.go b/enginetest/queries/join_queries.go index 252ec141a6..ab7aef1901 100644 --- a/enginetest/queries/join_queries.go +++ b/enginetest/queries/join_queries.go @@ -566,7 +566,6 @@ inner join pq on true order by 1,2,3,4,5,6,7,8 limit 5;`, }, }, { - //SkipPrepared: true, Query: `SELECT pk as pk, nt.i as i, nt2.i as i FROM one_pk RIGHT JOIN niltable nt ON pk=nt.i RIGHT JOIN niltable nt2 ON pk=nt2.i - 1 diff --git a/enginetest/queries/logic_test_scripts.go b/enginetest/queries/logic_test_scripts.go index 1871027e36..7e3a37825a 100644 --- a/enginetest/queries/logic_test_scripts.go +++ b/enginetest/queries/logic_test_scripts.go @@ -31,7 +31,7 @@ var SQLLogicJoinTests = []ScriptTest{ }, Assertions: []ScriptTestAssertion{ { - // This panics somewhere in the memo + // get field index error Skip: true, Query: "SELECT * FROM foo JOIN bar ON max(foo.c) < 2", ExpectedErrStr: "invalid use of group function", @@ -106,15 +106,15 @@ var SQLLogicJoinTests = []ScriptTest{ { Name: "case insensitive join with using clause", SetUpScript: []string{ - "CREATE TABLE str1 (a INT PRIMARY KEY, s TEXT COLLATE utf8mb4_0900_ai_ci)", - "INSERT INTO str1 VALUES (1, 'a' COLLATE utf8mb4_0900_ai_ci), (2, 'A' COLLATE utf8mb4_0900_ai_ci), (3, 'c' COLLATE utf8mb4_0900_ai_ci), (4, 'D' COLLATE utf8mb4_0900_ai_ci)", - "CREATE TABLE str2 (a INT PRIMARY KEY, s TEXT COLLATE utf8mb4_0900_ai_ci)", - "INSERT INTO str2 VALUES (1, 'A' COLLATE utf8mb4_0900_ai_ci), (2, 'B' COLLATE utf8mb4_0900_ai_ci), (3, 'C' COLLATE utf8mb4_0900_ai_ci), (4, 'E' COLLATE utf8mb4_0900_ai_ci)", + "CREATE TABLE str1 (a INT PRIMARY KEY, s TEXT COLLATE utf8mb4_0900_ai_ci);", + "INSERT INTO str1 VALUES (1, 'a' COLLATE utf8mb4_0900_ai_ci), (2, 'A' COLLATE utf8mb4_0900_ai_ci), (3, 'c' COLLATE utf8mb4_0900_ai_ci), (4, 'D' COLLATE utf8mb4_0900_ai_ci);", + "CREATE TABLE str2 (a INT PRIMARY KEY, s TEXT COLLATE utf8mb4_0900_ai_ci);", + "INSERT INTO str2 VALUES (1, 'A' COLLATE utf8mb4_0900_ai_ci), (2, 'B' COLLATE utf8mb4_0900_ai_ci), (3, 'C' COLLATE utf8mb4_0900_ai_ci), (4, 'E' COLLATE utf8mb4_0900_ai_ci);", }, Assertions: []ScriptTestAssertion{ { Skip: true, - Query: "SELECT s, str1.s, str2.s FROM str1 INNER JOIN str2 USING(s)", + Query: "SELECT s, str1.s, str2.s FROM str1 INNER JOIN str2 USING(s);", Expected: []sql.Row{ {"A", "A", "A"}, {"a", "a", "A"}, @@ -122,7 +122,6 @@ var SQLLogicJoinTests = []ScriptTest{ }, }, { - Skip: true, Query: "SELECT s, str1.s, str2.s FROM str1 LEFT OUTER JOIN str2 USING(s)", Expected: []sql.Row{ {"a", "a", "A"}, @@ -132,7 +131,6 @@ var SQLLogicJoinTests = []ScriptTest{ }, }, { - Skip: true, Query: "SELECT s, str1.s, str2.s FROM str1 RIGHT OUTER JOIN str2 USING(s)", Expected: []sql.Row{ {"A", "A", "A"},