Merge pull request #1285 from dolthub/zachmu/gms-buggy-query

Upgraded to latest go-mysql-server, and added a skip for a new query plan test
This commit is contained in:
Zach Musgrave
2021-02-01 20:41:22 -08:00
committed by GitHub
4 changed files with 11 additions and 11 deletions

View File

@@ -122,9 +122,9 @@ test_mutation() {
run dolt sql -q "explain $dml"
[ "$status" -eq "0" ]
if ! [ -z "$uses_pk" ]; then
[[ "$output" =~ "Indexed table access " ]] || exit 1
[[ "$output" =~ "IndexedTableAccess" ]] || exit 1
else
if [[ "$output" =~ "Indexed table access " ]]; then exit 1; fi
if [[ "$output" =~ "IndexedTableAccess" ]]; then exit 1; fi
fi
}

View File

@@ -18,7 +18,7 @@ require (
github.com/denisbrodbeck/machineid v1.0.1
github.com/dolthub/dolt/go/gen/proto/dolt/services/eventsapi v0.0.0-20201005193433-3ee972b1d078
github.com/dolthub/fslock v0.0.2
github.com/dolthub/go-mysql-server v0.6.1-0.20210128193608-1e05f33bb02a
github.com/dolthub/go-mysql-server v0.8.1-0.20210202023703-b6cd03ffc46c
github.com/dolthub/ishell v0.0.0-20201107004254-1592c0036c8d
github.com/dolthub/mmap-go v1.0.4-0.20201107010347-f9f2a9588a66
github.com/dolthub/sqllogictest/go v0.0.0-20201105013724-5123fc66e12c

View File

@@ -148,8 +148,8 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZm
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
github.com/dolthub/fslock v0.0.2 h1:8vUh47iKovgrtXNrXVIzsIoWLlspoXg+3nslhUzgKSw=
github.com/dolthub/fslock v0.0.2/go.mod h1:0i7bsNkK+XHwFL3dIsSWeXSV7sykVzzVr6+jq8oeEo0=
github.com/dolthub/go-mysql-server v0.6.1-0.20210128193608-1e05f33bb02a h1:D07spJ3nb2FP5CqBqLL1c93Rsyf554pDGybVZgy4Uko=
github.com/dolthub/go-mysql-server v0.6.1-0.20210128193608-1e05f33bb02a/go.mod h1:MRKd4z13XtaT7yLEx2GtR1IIt3WHXVqkzNvYD7WXt3o=
github.com/dolthub/go-mysql-server v0.8.1-0.20210202023703-b6cd03ffc46c h1:1wxazP4VH4IkHmB6VPOiSqu235SqsF7F+N53ejCWiAI=
github.com/dolthub/go-mysql-server v0.8.1-0.20210202023703-b6cd03ffc46c/go.mod h1:MRKd4z13XtaT7yLEx2GtR1IIt3WHXVqkzNvYD7WXt3o=
github.com/dolthub/ishell v0.0.0-20201107004254-1592c0036c8d h1:i0u1Ze9wZF/zLgyOB/aLkG01gDDNQ48PR0/a80mxEyQ=
github.com/dolthub/ishell v0.0.0-20201107004254-1592c0036c8d/go.mod h1:dhGBqcCEfK5kuFmeO5+WOx3hqc1k3M29c1oS/R7N4ms=
github.com/dolthub/mmap-go v1.0.4-0.20201107010347-f9f2a9588a66 h1:WRPDbpJWEnPxPmiuOTndT+lUWUeGjx6eoNOK9O4tQQQ=

View File

@@ -51,12 +51,9 @@ func TestSingleQuery(t *testing.T) {
var test enginetest.QueryTest
test = enginetest.QueryTest{
Query: `SELECT i FROM mytable mt
WHERE (SELECT i FROM mytable where i = mt.i and i > 2) IS NOT NULL
AND (SELECT i2 FROM othertable where i2 = i) IS NOT NULL
ORDER BY i`,
Query: "SELECT s, (select i from mytable mt where sub.i = mt.i) as subi FROM (select i,s,'hello' FROM mytable where s = 'first row') as sub;",
Expected: []sql.Row{
{3},
{"first row", int64(1)},
},
}
@@ -75,7 +72,9 @@ func TestVersionedQueries(t *testing.T) {
// Tests of choosing the correct execution plan independent of result correctness. Mostly useful for confirming that
// the right indexes are being used for joining tables.
func TestQueryPlans(t *testing.T) {
// TODO: FIX THESE TESTS!!!
// TODO: Fix these. Most of them are broken because Dolt tables implement a slightly different set of interfaces
// than the in-memory go-mysql-server tables, so they produce slightly different query plans. It's possible to
// write a set of query plan tests that are robust in the face of these minor differences, but we haven't yet.
skipped := set.NewStrSet([]string{
"SELECT * FROM mytable mt INNER JOIN othertable ot ON mt.i = ot.i2 AND mt.i > 2",
"SELECT pk,i,f FROM one_pk LEFT JOIN niltable ON pk=i WHERE pk > 1",
@@ -99,6 +98,7 @@ func TestQueryPlans(t *testing.T) {
"SELECT pk,pk1,pk2 FROM one_pk,two_pk WHERE one_pk.c1=two_pk.c1 ORDER BY 1,2,3",
"SELECT pk,pk1,pk2,one_pk.c1 AS foo, two_pk.c1 AS bar FROM one_pk JOIN two_pk ON one_pk.c1=two_pk.c1 ORDER BY 1,2,3",
"SELECT pk,pk1,pk2,one_pk.c1 AS foo,two_pk.c1 AS bar FROM one_pk JOIN two_pk ON one_pk.c1=two_pk.c1 WHERE one_pk.c1=10",
"SELECT pk,pk1,pk2 FROM one_pk t1, two_pk t2 WHERE pk=1 AND pk2=1 AND pk1=1 ORDER BY 1,2",
})
tests := make([]enginetest.QueryPlanTest, 0, len(enginetest.PlanTests))