Merge remote-tracking branch 'origin/main' into aaron/commit-parents-closure-find-common-ancestor

This commit is contained in:
Aaron Son
2021-10-12 15:39:55 -07:00
4 changed files with 64 additions and 6 deletions
+1 -1
View File
@@ -19,7 +19,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.3
github.com/dolthub/go-mysql-server v0.10.1-0.20211012102349-1303cbaa22b6
github.com/dolthub/go-mysql-server v0.10.1-0.20211012194620-e2581c14ea18
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-20201107003712-816f3ae12d81
+2 -4
View File
@@ -144,10 +144,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.3 h1:iLMpUIvJKMKm92+N1fmHVdxJP5NdyDK5bK7z7Ba2s2U=
github.com/dolthub/fslock v0.0.3/go.mod h1:QWql+P17oAAMLnL4HGB5tiovtDuAjdDTPbuqx7bYfa0=
github.com/dolthub/go-mysql-server v0.10.1-0.20211008193143-057afd473354 h1:EfwF2QAmCD1Uu8kYE0ve9d7Tti/hBTUi//ED9P42Dbk=
github.com/dolthub/go-mysql-server v0.10.1-0.20211008193143-057afd473354/go.mod h1:4a7SUA477voebTtoPb3UIOG1pQYb1yvfmT/IMlGSvCE=
github.com/dolthub/go-mysql-server v0.10.1-0.20211012102349-1303cbaa22b6 h1:tt0F/UXnvjyw8jFML8TehoEJFbjmck+yuCqkEczUfsQ=
github.com/dolthub/go-mysql-server v0.10.1-0.20211012102349-1303cbaa22b6/go.mod h1:4a7SUA477voebTtoPb3UIOG1pQYb1yvfmT/IMlGSvCE=
github.com/dolthub/go-mysql-server v0.10.1-0.20211012194620-e2581c14ea18 h1:XxAn7wVvqVrBT7SMh5A5BFuIM7LPE58ISPR17jhv+v8=
github.com/dolthub/go-mysql-server v0.10.1-0.20211012194620-e2581c14ea18/go.mod h1:4a7SUA477voebTtoPb3UIOG1pQYb1yvfmT/IMlGSvCE=
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/jsonpath v0.0.0-20210609232853-d49537a30474 h1:xTrR+l5l+1Lfq0NvhiEsctylXinUMFhhsqaEcl414p8=
@@ -334,10 +334,17 @@ func TestTransactions(t *testing.T) {
}
}
func TestDoltScripts(t *testing.T) {
harness := newDoltHarness(t)
for _, script := range DoltScripts {
enginetest.TestScript(t, harness, script)
}
}
// TestSingleTransactionScript is a convenience method for debugging a single transaction test. Unskip and set to the
// desired test.
func TestSingleTransactionScript(t *testing.T) {
//t.Skip()
t.Skip()
script := enginetest.TransactionTest{
Name: "rollback",
+53
View File
@@ -0,0 +1,53 @@
// Copyright 2021 Dolthub, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package enginetest
import (
"github.com/dolthub/go-mysql-server/enginetest"
"github.com/dolthub/go-mysql-server/sql"
)
// DoltScripts are script tests specific to Dolt (not the engine in general), e.g. by involving Dolt functions. Break
// this slice into others with good names as it grows.
var DoltScripts = []enginetest.ScriptTest{
{
Name: "test as of indexed join (https://github.com/dolthub/dolt/issues/2189)",
SetUpScript: []string{
"create table a (pk int primary key, c1 int)",
"insert into a values (1,1), (2,2), (3,3)",
"select DOLT_COMMIT('-a', '-m', 'first commit')",
"insert into a values (4,4), (5,5), (6,6)",
"select DOLT_COMMIT('-a', '-m', 'second commit')",
"set @second_commit = (select commit_hash from dolt_log order by date desc limit 1)",
"set @first_commit = (select commit_hash from dolt_log order by date desc limit 1,1)",
},
Assertions: []enginetest.ScriptTestAssertion{
{
Query: "select a1.* from a as of @second_commit a1 " +
"left join a as of @first_commit a2 on a1.pk = a2.pk where a2.pk is null order by 1",
Expected: []sql.Row{
{4, 4},
{5, 5},
{6, 6},
},
},
{
Query: "select a1.* from a as of @second_commit a1 " +
"left join a as of @second_commit a2 on a1.pk = a2.pk where a2.pk is null order by 1",
Expected: []sql.Row{},
},
},
},
}