mirror of
https://github.com/dolthub/dolt.git
synced 2026-05-06 19:35:18 -05:00
Vinai/gms bump fixes (#1714)
Bump gms and change index lookup equality.
This commit is contained in:
@@ -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.9.1-0.20210514133531-631be9f46a1e
|
||||
github.com/dolthub/go-mysql-server v0.9.1-0.20210515004749-c64084a3f5f7
|
||||
github.com/dolthub/ishell v0.0.0-20210205014355-16a4ce758446
|
||||
github.com/dolthub/mmap-go v1.0.4-0.20201107010347-f9f2a9588a66
|
||||
github.com/dolthub/sqllogictest/go v0.0.0-20201105013724-5123fc66e12c
|
||||
|
||||
@@ -142,10 +142,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.9.1-0.20210511220131-6b5298f6fed8 h1:QLhv/dgx8AuJq0Utp0E/OTgcVMk3JPz1IbXzRMrDDgk=
|
||||
github.com/dolthub/go-mysql-server v0.9.1-0.20210511220131-6b5298f6fed8/go.mod h1:raUDli6MJt8QRP7LrXXJqnPrPA0Cjnt4Y/R/HVMGHGw=
|
||||
github.com/dolthub/go-mysql-server v0.9.1-0.20210514133531-631be9f46a1e h1:DDq9rFxCMalA+tlOQT4SXdLkamMbyvcZy3A8QTcUPmA=
|
||||
github.com/dolthub/go-mysql-server v0.9.1-0.20210514133531-631be9f46a1e/go.mod h1:raUDli6MJt8QRP7LrXXJqnPrPA0Cjnt4Y/R/HVMGHGw=
|
||||
github.com/dolthub/go-mysql-server v0.9.1-0.20210515004749-c64084a3f5f7 h1:TGz33UB6N3mxA09Q0OtQRArz2UhwsIallJs0ysZxDGQ=
|
||||
github.com/dolthub/go-mysql-server v0.9.1-0.20210515004749-c64084a3f5f7/go.mod h1:raUDli6MJt8QRP7LrXXJqnPrPA0Cjnt4Y/R/HVMGHGw=
|
||||
github.com/dolthub/ishell v0.0.0-20210205014355-16a4ce758446 h1:0ol5pj+QlKUKAtqs1LiPM3ZJKs+rHPgLSsMXmhTrCAM=
|
||||
github.com/dolthub/ishell v0.0.0-20210205014355-16a4ce758446/go.mod h1:dhGBqcCEfK5kuFmeO5+WOx3hqc1k3M29c1oS/R7N4ms=
|
||||
github.com/dolthub/mmap-go v1.0.4-0.20201107010347-f9f2a9588a66 h1:WRPDbpJWEnPxPmiuOTndT+lUWUeGjx6eoNOK9O4tQQQ=
|
||||
|
||||
@@ -35,6 +35,7 @@ type DoltIndex interface {
|
||||
IndexSchema() schema.Schema
|
||||
TableData() types.Map
|
||||
IndexRowData() types.Map
|
||||
Equals(index DoltIndex) bool
|
||||
}
|
||||
|
||||
type doltIndex struct {
|
||||
@@ -273,3 +274,51 @@ func (di *doltIndex) keysToTuple(keys []interface{}) (types.Tuple, error) {
|
||||
}
|
||||
return types.NewTuple(nbf, vals...)
|
||||
}
|
||||
|
||||
func (di *doltIndex) Equals(oIdx DoltIndex) bool {
|
||||
if !expressionsAreEquals(di.Expressions(), oIdx.Expressions()) {
|
||||
return false
|
||||
}
|
||||
|
||||
if di.Database() != oIdx.Database() {
|
||||
return false
|
||||
}
|
||||
|
||||
if di.Table() != oIdx.Table() {
|
||||
return false
|
||||
}
|
||||
|
||||
if di.ID() != oIdx.ID() {
|
||||
return false
|
||||
}
|
||||
|
||||
if di.IsUnique() != oIdx.IsUnique() {
|
||||
return false
|
||||
}
|
||||
|
||||
if !(schema.SchemasAreEqual(di.IndexSchema(), oIdx.IndexSchema())) {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
func expressionsAreEquals(exprs1, exprs2 []string) bool {
|
||||
if exprs1 == nil && exprs2 == nil {
|
||||
return true
|
||||
} else if exprs1 == nil || exprs2 == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
if len(exprs1) != len(exprs2) {
|
||||
return false
|
||||
}
|
||||
|
||||
for i, expr1 := range exprs1 {
|
||||
if expr1 != exprs2[i] {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -113,7 +113,6 @@ func TestQueryPlans(t *testing.T) {
|
||||
"SELECT opk.c5,pk1,pk2 FROM one_pk opk JOIN two_pk tpk ON pk=pk1 ORDER BY 1,2,3",
|
||||
"SELECT pk,pk1,pk2 FROM one_pk LEFT JOIN two_pk ON pk=pk1 ORDER BY 1,2,3",
|
||||
"SELECT pk,pk1,pk2 FROM one_pk t1, two_pk t2 WHERE pk=1 AND pk2=1 AND pk1=1 ORDER BY 1,2",
|
||||
`SELECT * FROM (SELECT * FROM othertable WHERE i2 = 1) othertable_alias WHERE othertable_alias.i2 = 1`,
|
||||
}
|
||||
|
||||
// Parallelism introduces Exchange nodes into the query plans, so disable.
|
||||
|
||||
@@ -53,7 +53,8 @@ func (il *doltIndexLookup) IsMergeable(indexLookup sql.IndexLookup) bool {
|
||||
if !ok {
|
||||
return false
|
||||
}
|
||||
return il.idx == otherIl.idx
|
||||
|
||||
return il.idx.Equals(otherIl.idx)
|
||||
}
|
||||
|
||||
// Intersection implements sql.MergeableIndexLookup
|
||||
|
||||
@@ -419,7 +419,7 @@ func TestAddColumn(t *testing.T) {
|
||||
name: "alter add column not null with expression default",
|
||||
query: "alter table people add (newColumn int not null default 2+2/2)",
|
||||
expectedSchema: dtestutils.AddColumnToSchema(PeopleTestSchema,
|
||||
schemaNewColumnWDefVal(t, "newColumn", 4435, sql.Int32, false, "(2 + 2 / 2)", schema.NotNullConstraint{})),
|
||||
schemaNewColumnWDefVal(t, "newColumn", 4435, sql.Int32, false, "((2 + (2 / 2)))", schema.NotNullConstraint{})),
|
||||
expectedRows: dtestutils.AddColToRows(t, AllPeopleRows, 4435, types.Int(3)),
|
||||
},
|
||||
{
|
||||
|
||||
@@ -339,7 +339,7 @@ teardown() {
|
||||
[[ "${#lines[@]}" = "4" ]] || false
|
||||
run dolt schema show
|
||||
[ "$status" -eq "0" ]
|
||||
[[ "$output" =~ "\`v2\` bigint DEFAULT (v1y + 1)" ]] || false
|
||||
[[ "$output" =~ "\`v2\` bigint DEFAULT ((v1y + 1))" ]] || false
|
||||
}
|
||||
|
||||
@test "default-values: Invalid literal for column type" {
|
||||
|
||||
@@ -816,7 +816,7 @@ INSERT INTO test VALUES (6, 6, 6)
|
||||
SQL
|
||||
run dolt sql -q "CALL p1(3)" -r=csv
|
||||
[ "$status" -eq "0" ]
|
||||
[[ "$output" =~ "test.pk + x,test.v1 + x,test.v2 + x" ]] || false
|
||||
[[ "$output" =~ "(test.pk + x),(test.v1 + x),(test.v2 + x)" ]] || false
|
||||
[[ "$output" =~ "11,11,11" ]] || false
|
||||
[[ "$output" =~ "12,12,12" ]] || false
|
||||
[[ "$output" =~ "13,13,13" ]] || false
|
||||
@@ -827,7 +827,7 @@ SQL
|
||||
|
||||
run dolt sql -q "CALL p1(20)" -r=csv
|
||||
[ "$status" -eq "0" ]
|
||||
[[ "$output" =~ "test.pk + x,test.v1 + x,test.v2 + x" ]] || false
|
||||
[[ "$output" =~ "(test.pk + x),(test.v1 + x),(test.v2 + x)" ]] || false
|
||||
[[ "$output" =~ "21,21,21" ]] || false
|
||||
[[ "$output" =~ "22,22,22" ]] || false
|
||||
[[ "$output" =~ "23,23,23" ]] || false
|
||||
|
||||
@@ -195,7 +195,7 @@ teardown() {
|
||||
[[ "${lines[3]}" =~ "| view | view1 | SELECT 2+2 FROM dual |" ]] || false
|
||||
run dolt sql -q 'select * from view1'
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "${lines[1]}" =~ "| 2 + 2 |" ]] || false
|
||||
[[ "${lines[2]}" =~ "+-------+" ]] || false
|
||||
[[ "${lines[3]}" =~ "| 4 |" ]] || false
|
||||
[[ "${lines[1]}" =~ "2 + 2" ]] || false
|
||||
[[ "${lines[2]}" =~ "-----" ]] || false
|
||||
[[ "${lines[3]}" =~ " 4 " ]] || false
|
||||
}
|
||||
Reference in New Issue
Block a user