From a40fc6716c2692d2111dc059711215fb71549a4b Mon Sep 17 00:00:00 2001 From: Taylor Bantle Date: Wed, 4 Sep 2024 14:32:41 -0700 Subject: [PATCH 01/14] Add tests for schema bugs --- testing/go/schemas_test.go | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/testing/go/schemas_test.go b/testing/go/schemas_test.go index ca61869d0b..555121734b 100755 --- a/testing/go/schemas_test.go +++ b/testing/go/schemas_test.go @@ -545,10 +545,10 @@ var SchemaTests = []ScriptTest{ { Name: "with branches", SetUpScript: []string{ + `USE "postgres/main"`, "CREATE SCHEMA myschema", "SET search_path = 'myschema'", "CREATE TABLE mytbl (pk BIGINT PRIMARY KEY, v1 BIGINT);", - "set dolt_show_branch_databases to 1;", // TODO: Use `use db/branch` instead of dolt_checkout for these tests and remove this }, Assertions: []ScriptTestAssertion{ { @@ -591,32 +591,36 @@ var SchemaTests = []ScriptTest{ }, }, { - Query: "SELECT dolt_checkout('-b', 'newbranch')", - Expected: []sql.Row{{"{0,\"Switched to branch 'newbranch'\"}"}}, + Query: "SELECT * FROM dolt_status;", + Expected: []sql.Row{{"mytbl", 0, "new table"}}, }, { - Skip: true, // TODO: ERROR: no schema has been selected to create in - Query: "CREATE TABLE mytbl2 (pk BIGINT PRIMARY KEY, v1 BIGINT);", - Expected: []sql.Row{}, + Query: "SELECT dolt_commit('-A', '-m', 'Add mytbl');", // TODO: This is failing with "nothing to commit" + Expected: []sql.Row{{"{0}"}}, }, { - Query: "CREATE SCHEMA newbranchschema;", + Query: "SELECT * FROM dolt_status;", Expected: []sql.Row{}, }, { - Query: "SET search_path = 'newbranchschema';", - Expected: []sql.Row{}, + Query: "SELECT dolt_branch('newbranch')", + Expected: []sql.Row{{"{0}"}}, }, { - Query: "CREATE TABLE mytbl2 (pk BIGINT PRIMARY KEY, v1 BIGINT);", + Query: "USE 'postgres/newbranch'", Expected: []sql.Row{}, }, { - Query: "SELECT current_schemas(true)", + Query: "SELECT current_schemas(true);", Expected: []sql.Row{ - {"{pg_catalog,newbranchschema}"}, + {"{pg_catalog,myschema}"}, }, }, + { + // Skip: true, // TODO: ERROR: no schema has been selected to create in + Query: "CREATE TABLE mytbl2 (pk BIGINT PRIMARY KEY, v1 BIGINT);", + Expected: []sql.Row{}, + }, { Skip: true, // TODO: pg_catalog and public are not showing up Query: "SELECT schema_name FROM information_schema.schemata WHERE catalog_name = 'postgres/newbranch';", From 135185577d5d82f5636748755c2af9c4935638a6 Mon Sep 17 00:00:00 2001 From: Zach Musgrave Date: Wed, 4 Sep 2024 17:33:37 -0700 Subject: [PATCH 02/14] Tests --- testing/go/schemas_test.go | 41 ++++++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/testing/go/schemas_test.go b/testing/go/schemas_test.go index bd3815234e..eb2b17277d 100755 --- a/testing/go/schemas_test.go +++ b/testing/go/schemas_test.go @@ -543,7 +543,41 @@ var SchemaTests = []ScriptTest{ }, }, { - Name: "with branches", // TODO: Use `use db/branch` instead of dolt_checkout for these tests + Name: "add, commit, status", + Focus: true, + SetUpScript: []string{ + // "call dolt_commit('-m', 'initial commit')", + "CREATE SCHEMA myschema", + "Create table myschema.mytbl (pk BIGINT PRIMARY KEY, v1 BIGINT);", + }, + Assertions: []ScriptTestAssertion{ + { + Query: "SELECT * FROM dolt_status;", + Expected: []sql.Row{{"myschema", 0, "new schema"}}, + }, + { + Query: "select dolt_add('.')", + Expected: []sql.Row{ + {"{0}"}, + }, + }, + { + Query: "SELECT * FROM dolt_status;", + Expected: []sql.Row{{"myschema", 1, "new schema"}}, + }, + { + Query: "select dolt_commit('-m', 'new schema')", + SkipResultsCheck: true, + }, + { + Query: "SELECT * FROM dolt_status;", + Expected: []sql.Row{}, + }, + }, + }, + { + Name: "with branches", + // Focus: true, SetUpScript: []string{ `USE "postgres/main"`, "CREATE SCHEMA myschema", @@ -607,8 +641,8 @@ var SchemaTests = []ScriptTest{ Expected: []sql.Row{{"mytbl", 0, "new table"}}, }, { - Query: "SELECT dolt_commit('-A', '-m', 'Add mytbl');", // TODO: This is failing with "nothing to commit" - Expected: []sql.Row{{"{0}"}}, + Query: "SELECT dolt_commit('-A', '-m', 'Add mytbl');", + SkipResultsCheck: true, }, { Query: "SELECT * FROM dolt_status;", @@ -629,7 +663,6 @@ var SchemaTests = []ScriptTest{ }, }, { - // Skip: true, // TODO: ERROR: no schema has been selected to create in Query: "CREATE TABLE mytbl2 (pk BIGINT PRIMARY KEY, v1 BIGINT);", Expected: []sql.Row{}, }, From 78a5a86ad1275651187b3b11506fb1e95bb00f80 Mon Sep 17 00:00:00 2001 From: Zach Musgrave Date: Thu, 5 Sep 2024 17:06:31 -0700 Subject: [PATCH 03/14] Betting testing --- testing/go/schemas_test.go | 44 ++++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/testing/go/schemas_test.go b/testing/go/schemas_test.go index eb2b17277d..4e94b792af 100755 --- a/testing/go/schemas_test.go +++ b/testing/go/schemas_test.go @@ -543,17 +543,15 @@ var SchemaTests = []ScriptTest{ }, }, { - Name: "add, commit, status", - Focus: true, + Name: "add new table in new schema, commit, status", SetUpScript: []string{ - // "call dolt_commit('-m', 'initial commit')", "CREATE SCHEMA myschema", "Create table myschema.mytbl (pk BIGINT PRIMARY KEY, v1 BIGINT);", }, Assertions: []ScriptTestAssertion{ { Query: "SELECT * FROM dolt_status;", - Expected: []sql.Row{{"myschema", 0, "new schema"}}, + Expected: []sql.Row{{"mytbl", 0, "new table"}}, }, { Query: "select dolt_add('.')", @@ -563,21 +561,53 @@ var SchemaTests = []ScriptTest{ }, { Query: "SELECT * FROM dolt_status;", - Expected: []sql.Row{{"myschema", 1, "new schema"}}, + Expected: []sql.Row{{"mytbl", 1, "new table"}}, + }, + { + Query: "select dolt_commit('-m', 'new table in new schema')", + SkipResultsCheck: true, + }, + { + Query: "SELECT * FROM dolt_status;", + Expected: []sql.Row{}, + }, + { + Query: "select message from dolt_log order by date desc limit 1", + Expected: []sql.Row{ + {"new table in new schema"}, + }, + }, + }, + }, + { + Name: "add new table in new schema, commit -Am", + SetUpScript: []string{ + "CREATE SCHEMA myschema", + "Create table myschema.mytbl (pk BIGINT PRIMARY KEY, v1 BIGINT);", + }, + Assertions: []ScriptTestAssertion{ + { + Query: "SELECT * FROM dolt_status;", + Expected: []sql.Row{{"mytbl", 0, "new table"}}, }, { - Query: "select dolt_commit('-m', 'new schema')", + Query: "select dolt_commit('-Am', 'new table in new schema')", SkipResultsCheck: true, }, { Query: "SELECT * FROM dolt_status;", Expected: []sql.Row{}, }, + { + Query: "select message from dolt_log order by date desc limit 1", + Expected: []sql.Row{ + {"new table in new schema"}, + }, + }, }, }, { Name: "with branches", - // Focus: true, SetUpScript: []string{ `USE "postgres/main"`, "CREATE SCHEMA myschema", From ca46a69e6eb3a355a2ef249deaf1496867a81103 Mon Sep 17 00:00:00 2001 From: Zach Musgrave Date: Fri, 6 Sep 2024 09:41:08 -0700 Subject: [PATCH 04/14] Tests of merging a table in a new schema --- testing/go/schemas_test.go | 75 +++++++++++++++++++++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/testing/go/schemas_test.go b/testing/go/schemas_test.go index 4e94b792af..f509404772 100755 --- a/testing/go/schemas_test.go +++ b/testing/go/schemas_test.go @@ -579,6 +579,43 @@ var SchemaTests = []ScriptTest{ }, }, }, + { + Name: "merge new table in new schema", + SetUpScript: []string{ + "call dolt_checkout('-b', 'branch1')", + "CREATE SCHEMA branchschema", + "Create table branchschema.mytbl (pk BIGINT PRIMARY KEY, v1 BIGINT);", + "INSERT INTO branchschema.mytbl VALUES (1, 1), (2, 2)", + "select dolt_commit('-Am', 'new table in new schema')", + "call dolt_checkout('main')", + "create schema mainschema", + "create table mainschema.maintable (pk BIGINT PRIMARY KEY, v1 BIGINT);", + "insert into mainschema.maintable values (3, 3), (4, 4)", + "select dolt_commit('-Am', 'new table in main')", + }, + Assertions: []ScriptTestAssertion{ + { + Query: "call dolt_merge('branch1')", + Expected: []sql.Row{ + {"{0}"}, + }, + }, + { + Query: "SELECT * from mainschema.maintable", + Expected: []sql.Row{ + {3, 3}, + {4, 4}, + }, + }, + { + Query: "SELECT * from branchschema.mytbl", + Expected: []sql.Row{ + {1, 1}, + {2, 2}, + }, + }, + }, + }, { Name: "add new table in new schema, commit -Am", SetUpScript: []string{ @@ -607,7 +644,43 @@ var SchemaTests = []ScriptTest{ }, }, { - Name: "with branches", + Name: "create new schema with no tables, add and commit", + SetUpScript: []string{ + "CREATE SCHEMA myschema", + }, + Assertions: []ScriptTestAssertion{ + { + Query: "SELECT * FROM dolt_status;", + Expected: []sql.Row{{"myschema", 0, "new schema"}}, + }, + { + Query: "select dolt_add('.')", + Expected: []sql.Row{ + {"{0}"}, + }, + }, + { + Query: "SELECT * FROM dolt_status;", + Expected: []sql.Row{{"myschema", 1, "new schema"}}, + }, + { + Query: "select dolt_commit('-m', 'new schema')", + SkipResultsCheck: true, + }, + { + Query: "SELECT * FROM dolt_status;", + Expected: []sql.Row{}, + }, + { + Query: "select message from dolt_log order by date desc limit 1", + Expected: []sql.Row{ + {"new schema"}, + }, + }, + }, + }, + { + Name: "USE branches", SetUpScript: []string{ `USE "postgres/main"`, "CREATE SCHEMA myschema", From f3e2719c28aa0aa54a96de752ab7948f4aecfb34 Mon Sep 17 00:00:00 2001 From: Zach Musgrave Date: Fri, 6 Sep 2024 17:32:39 -0700 Subject: [PATCH 05/14] Slightly better test --- testing/go/schemas_test.go | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/testing/go/schemas_test.go b/testing/go/schemas_test.go index f509404772..39af8382a8 100755 --- a/testing/go/schemas_test.go +++ b/testing/go/schemas_test.go @@ -586,25 +586,24 @@ var SchemaTests = []ScriptTest{ "CREATE SCHEMA branchschema", "Create table branchschema.mytbl (pk BIGINT PRIMARY KEY, v1 BIGINT);", "INSERT INTO branchschema.mytbl VALUES (1, 1), (2, 2)", + "Create table branchschema.mytbl2 (pk BIGINT PRIMARY KEY, v1 BIGINT);", + "INSERT INTO branchschema.mytbl2 VALUES (3, 3), (4, 4)", "select dolt_commit('-Am', 'new table in new schema')", "call dolt_checkout('main')", "create schema mainschema", "create table mainschema.maintable (pk BIGINT PRIMARY KEY, v1 BIGINT);", - "insert into mainschema.maintable values (3, 3), (4, 4)", + "insert into mainschema.maintable values (5, 5), (6, 6)", "select dolt_commit('-Am', 'new table in main')", }, Assertions: []ScriptTestAssertion{ { Query: "call dolt_merge('branch1')", - Expected: []sql.Row{ - {"{0}"}, - }, }, { Query: "SELECT * from mainschema.maintable", Expected: []sql.Row{ - {3, 3}, - {4, 4}, + {5, 5}, + {6, 6}, }, }, { @@ -614,6 +613,13 @@ var SchemaTests = []ScriptTest{ {2, 2}, }, }, + { + Query: "SELECT * from branchschema.mytbl2", + Expected: []sql.Row{ + {3, 3}, + {4, 4}, + }, + }, }, }, { From 12a680e9e8a2c7082fab12ff225a4f97820f7aa5 Mon Sep 17 00:00:00 2001 From: Zach Musgrave Date: Mon, 9 Sep 2024 16:28:40 -0700 Subject: [PATCH 06/14] Test fixes --- testing/go/schemas_test.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/testing/go/schemas_test.go b/testing/go/schemas_test.go index 39af8382a8..2daeb7953f 100755 --- a/testing/go/schemas_test.go +++ b/testing/go/schemas_test.go @@ -623,15 +623,20 @@ var SchemaTests = []ScriptTest{ }, }, { - Name: "add new table in new schema, commit -Am", + Name: "add new table in new schema, commit -Am", + Focus: true, SetUpScript: []string{ + "call dolt_commit('-Am', 'initial commit')", "CREATE SCHEMA myschema", "Create table myschema.mytbl (pk BIGINT PRIMARY KEY, v1 BIGINT);", }, Assertions: []ScriptTestAssertion{ { - Query: "SELECT * FROM dolt_status;", - Expected: []sql.Row{{"mytbl", 0, "new table"}}, + Query: "SELECT * FROM dolt_status;", + Expected: []sql.Row{ + {"mytbl", 0, "new table"}, + {"myschema", 0, "new schema"}, + }, }, { Query: "select dolt_commit('-Am', 'new table in new schema')", From ea14cf7aa08d0dd125fbbefe56374eb2d6889b41 Mon Sep 17 00:00:00 2001 From: Zach Musgrave Date: Tue, 10 Sep 2024 16:37:13 -0700 Subject: [PATCH 07/14] Fixed tests --- testing/go/schemas_test.go | 89 +++++++++++++++++++++----------------- 1 file changed, 49 insertions(+), 40 deletions(-) diff --git a/testing/go/schemas_test.go b/testing/go/schemas_test.go index 2daeb7953f..a4b52c68f3 100755 --- a/testing/go/schemas_test.go +++ b/testing/go/schemas_test.go @@ -483,10 +483,9 @@ var SchemaTests = []ScriptTest{ }, { Name: "create new database and new schema", - Skip: true, SetUpScript: []string{ "CREATE DATABASE db2;", - "USE db2;", // TODO: not a real postgres statement + "USE db2;", "create schema schema2;", "use postgres", }, @@ -494,6 +493,9 @@ var SchemaTests = []ScriptTest{ { Query: "CREATE TABLE db2.schema2.test (pk BIGINT PRIMARY KEY, v1 BIGINT);", }, + { + Query: "INSERT INTO db2.schema2.test VALUES (1, 1), (2, 2);", + }, { Query: "SELECT * FROM db2.schema2.test;", Expected: []sql.Row{ @@ -550,8 +552,11 @@ var SchemaTests = []ScriptTest{ }, Assertions: []ScriptTestAssertion{ { - Query: "SELECT * FROM dolt_status;", - Expected: []sql.Row{{"mytbl", 0, "new table"}}, + Query: "SELECT * FROM dolt_status;", + Expected: []sql.Row{ + {"mytbl", 0, "new table"}, + {"myschema", 0, "new schema"}, + }, }, { Query: "select dolt_add('.')", @@ -560,8 +565,11 @@ var SchemaTests = []ScriptTest{ }, }, { - Query: "SELECT * FROM dolt_status;", - Expected: []sql.Row{{"mytbl", 1, "new table"}}, + Query: "SELECT * FROM dolt_status;", + Expected: []sql.Row{ + {"mytbl", 1, "new table"}, + {"myschema", 1, "new schema"}, + }, }, { Query: "select dolt_commit('-m', 'new table in new schema')", @@ -579,6 +587,36 @@ var SchemaTests = []ScriptTest{ }, }, }, + { + Name: "add new table in new schema, commit -Am", + SetUpScript: []string{ + "CREATE SCHEMA myschema", + "Create table myschema.mytbl (pk BIGINT PRIMARY KEY, v1 BIGINT);", + }, + Assertions: []ScriptTestAssertion{ + { + Query: "SELECT * FROM dolt_status;", + Expected: []sql.Row{ + {"mytbl", 0, "new table"}, + {"myschema", 0, "new schema"}, + }, + }, + { + Query: "select dolt_commit('-Am', 'new table in new schema')", + SkipResultsCheck: true, + }, + { + Query: "SELECT * FROM dolt_status;", + Expected: []sql.Row{}, + }, + { + Query: "select message from dolt_log order by date desc limit 1", + Expected: []sql.Row{ + {"new table in new schema"}, + }, + }, + }, + }, { Name: "merge new table in new schema", SetUpScript: []string{ @@ -622,38 +660,6 @@ var SchemaTests = []ScriptTest{ }, }, }, - { - Name: "add new table in new schema, commit -Am", - Focus: true, - SetUpScript: []string{ - "call dolt_commit('-Am', 'initial commit')", - "CREATE SCHEMA myschema", - "Create table myschema.mytbl (pk BIGINT PRIMARY KEY, v1 BIGINT);", - }, - Assertions: []ScriptTestAssertion{ - { - Query: "SELECT * FROM dolt_status;", - Expected: []sql.Row{ - {"mytbl", 0, "new table"}, - {"myschema", 0, "new schema"}, - }, - }, - { - Query: "select dolt_commit('-Am', 'new table in new schema')", - SkipResultsCheck: true, - }, - { - Query: "SELECT * FROM dolt_status;", - Expected: []sql.Row{}, - }, - { - Query: "select message from dolt_log order by date desc limit 1", - Expected: []sql.Row{ - {"new table in new schema"}, - }, - }, - }, - }, { Name: "create new schema with no tables, add and commit", SetUpScript: []string{ @@ -751,8 +757,11 @@ var SchemaTests = []ScriptTest{ }, }, { - Query: "SELECT * FROM dolt_status;", - Expected: []sql.Row{{"mytbl", 0, "new table"}}, + Query: "SELECT * FROM dolt_status;", + Expected: []sql.Row{ + {"mytbl", 0, "new table"}, + {"myschema", 0, "new schema"}, + }, }, { Query: "SELECT dolt_commit('-A', '-m', 'Add mytbl');", From 61051a3851dc08d3b1c8e5b3e61d566dd94e17b8 Mon Sep 17 00:00:00 2001 From: Zach Musgrave Date: Tue, 10 Sep 2024 18:08:44 -0700 Subject: [PATCH 08/14] Schemas in debug output --- core/rootvalue.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/rootvalue.go b/core/rootvalue.go index d939ecd623..8c2f5ce402 100644 --- a/core/rootvalue.go +++ b/core/rootvalue.go @@ -107,6 +107,17 @@ func (root *RootValue) DebugString(ctx context.Context, transitive bool) string return false, nil }) + + buf.WriteString("\nSchemas:") + schemas, err := root.GetDatabaseSchemas(ctx) + if err != nil { + return "" + } + + for _, schema := range schemas { + buf.WriteString("\nSchema ") + buf.WriteString(schema.Name) + } } return buf.String() From 164a6df0e90fb90bc197cc510a6b8e2960808fc3 Mon Sep 17 00:00:00 2001 From: Zach Musgrave Date: Tue, 10 Sep 2024 18:10:11 -0700 Subject: [PATCH 09/14] New dolt --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index cf453b35b0..bcdb487a05 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/PuerkitoBio/goquery v1.8.1 github.com/cockroachdb/apd/v2 v2.0.3-0.20200518165714-d020e156310a github.com/cockroachdb/errors v1.7.5 - github.com/dolthub/dolt/go v0.40.5-0.20240904171854-b9cd0fc7fe0f + github.com/dolthub/dolt/go v0.40.5-0.20240911010519-635952ea8b02 github.com/dolthub/dolt/go/gen/proto/dolt/services/eventsapi v0.0.0-20240827111219-e4bb9ca3442d github.com/dolthub/flatbuffers/v23 v23.3.3-dh.2 github.com/dolthub/go-mysql-server v0.18.2-0.20240903182359-a3835e642ec4 diff --git a/go.sum b/go.sum index 71300ff30b..6a6c8974f5 100644 --- a/go.sum +++ b/go.sum @@ -214,8 +214,8 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZm github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/dolthub/dolt/go v0.40.5-0.20240904171854-b9cd0fc7fe0f h1:0sI8yDnZ446AvYWKT6GKKnhcTWD58yf6PqPy5lEzcvA= -github.com/dolthub/dolt/go v0.40.5-0.20240904171854-b9cd0fc7fe0f/go.mod h1:v8Ja5if8o9f5HbX6rf34elmMM61x7EQHktCzcBmLfdE= +github.com/dolthub/dolt/go v0.40.5-0.20240911010519-635952ea8b02 h1:70dp7RdTnR5yIOGsey/6lr+VjAgjqlTpBgPUdWcI1/Y= +github.com/dolthub/dolt/go v0.40.5-0.20240911010519-635952ea8b02/go.mod h1:v8Ja5if8o9f5HbX6rf34elmMM61x7EQHktCzcBmLfdE= github.com/dolthub/dolt/go/gen/proto/dolt/services/eventsapi v0.0.0-20240827111219-e4bb9ca3442d h1:RZkQeYOrDrOWzCxaP2ttkvg4E2TM9n8lnEsIBLKjqkM= github.com/dolthub/dolt/go/gen/proto/dolt/services/eventsapi v0.0.0-20240827111219-e4bb9ca3442d/go.mod h1:L5RDYZbC9BBWmoU2+TjTekeqqhFXX5EqH9ln00O0stY= github.com/dolthub/flatbuffers/v23 v23.3.3-dh.2 h1:u3PMzfF8RkKd3lB9pZ2bfn0qEG+1Gms9599cr0REMww= From cbdcfda7b48a1d938c1d1763a1bcd2015a812012 Mon Sep 17 00:00:00 2001 From: Zach Musgrave Date: Tue, 10 Sep 2024 18:12:11 -0700 Subject: [PATCH 10/14] New dolt --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index dff484662a..de3fcd266d 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/PuerkitoBio/goquery v1.8.1 github.com/cockroachdb/apd/v2 v2.0.3-0.20200518165714-d020e156310a github.com/cockroachdb/errors v1.7.5 - github.com/dolthub/dolt/go v0.40.5-0.20240910164014-9450b292cecb + github.com/dolthub/dolt/go v0.40.5-0.20240911010519-635952ea8b02 github.com/dolthub/dolt/go/gen/proto/dolt/services/eventsapi v0.0.0-20240827111219-e4bb9ca3442d github.com/dolthub/flatbuffers/v23 v23.3.3-dh.2 github.com/dolthub/go-mysql-server v0.18.2-0.20240910155935-794fc14e9d02 diff --git a/go.sum b/go.sum index 6eec183f06..ab52df164d 100644 --- a/go.sum +++ b/go.sum @@ -214,8 +214,8 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZm github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/dolthub/dolt/go v0.40.5-0.20240910164014-9450b292cecb h1:s60+aSIc9g8NqlMr4kkUjwTSeuoO5Eq43i5m540+UOs= -github.com/dolthub/dolt/go v0.40.5-0.20240910164014-9450b292cecb/go.mod h1:g+p8vcX/PJxVQ6cXMWkkhmI6KoEMgV+u/ar4/kg79XM= +github.com/dolthub/dolt/go v0.40.5-0.20240911010519-635952ea8b02 h1:70dp7RdTnR5yIOGsey/6lr+VjAgjqlTpBgPUdWcI1/Y= +github.com/dolthub/dolt/go v0.40.5-0.20240911010519-635952ea8b02/go.mod h1:v8Ja5if8o9f5HbX6rf34elmMM61x7EQHktCzcBmLfdE= github.com/dolthub/dolt/go/gen/proto/dolt/services/eventsapi v0.0.0-20240827111219-e4bb9ca3442d h1:RZkQeYOrDrOWzCxaP2ttkvg4E2TM9n8lnEsIBLKjqkM= github.com/dolthub/dolt/go/gen/proto/dolt/services/eventsapi v0.0.0-20240827111219-e4bb9ca3442d/go.mod h1:L5RDYZbC9BBWmoU2+TjTekeqqhFXX5EqH9ln00O0stY= github.com/dolthub/flatbuffers/v23 v23.3.3-dh.2 h1:u3PMzfF8RkKd3lB9pZ2bfn0qEG+1Gms9599cr0REMww= From fb9f12e3e3f30fe9497525f02984440bf44c35d6 Mon Sep 17 00:00:00 2001 From: Zach Musgrave Date: Wed, 11 Sep 2024 10:00:09 -0700 Subject: [PATCH 11/14] Fixed test --- testing/go/dolt_functions_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testing/go/dolt_functions_test.go b/testing/go/dolt_functions_test.go index 533be8a30a..8575c663af 100755 --- a/testing/go/dolt_functions_test.go +++ b/testing/go/dolt_functions_test.go @@ -35,19 +35,19 @@ func TestDoltFunctions(t *testing.T) { }, }, { - Query: "select dolt_commit('-am', 'initial commit')", + Query: "select dolt_commit('-am', 'new table')", SkipResultsCheck: true, }, { Query: "select count(*) from dolt_log", Expected: []sql.Row{ - {2}, + {3}, // initial commit, CREATE DATABASE commit, CREATE TABLE commit }, }, { Query: "select message from dolt_log order by date desc limit 1", Expected: []sql.Row{ - {"initial commit"}, + {"new table"}, }, }, }, From 4b2d472a69618989d91f8d761dfd8f624a03c1a8 Mon Sep 17 00:00:00 2001 From: Zach Musgrave Date: Wed, 11 Sep 2024 12:01:07 -0700 Subject: [PATCH 12/14] Fixed test --- testing/postgres-client-tests/java/PostgresTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testing/postgres-client-tests/java/PostgresTest.java b/testing/postgres-client-tests/java/PostgresTest.java index 97a92760fe..bc53e481e2 100644 --- a/testing/postgres-client-tests/java/PostgresTest.java +++ b/testing/postgres-client-tests/java/PostgresTest.java @@ -46,13 +46,13 @@ public String[] getExpectedResults() { new PostgresTest("select * from test", null, "c1", new String[]{"hi ","hello "}), new PostgresTest("call dolt_add('-A')", 0, null, null), new PostgresTest("call dolt_commit('-m', 'my commit')", 0, null, null), - new PostgresTest("select COUNT(*) FROM dolt_log", null, 1, new String[]{"2"}), + new PostgresTest("select COUNT(*) FROM dolt_log", null, 1, new String[]{"3"}), new PostgresTest("call dolt_checkout('-b', 'mybranch')", 0, null, null), new PostgresTest("insert into test (pk, value, d1, c1) values (1,1,12.34,'bye')", 1, null, null), new PostgresTest("call dolt_commit('-a', '-m', 'my commit2')", 0, null, null), new PostgresTest("call dolt_checkout('main')", 0, null, null), new PostgresTest("call dolt_merge('mybranch')", 0, null, null), - new PostgresTest("select COUNT(*) FROM dolt_log", null, "COUNT", new String[]{"3"}), // returns res + new PostgresTest("select COUNT(*) FROM dolt_log", null, "COUNT", new String[]{"4"}), // returns res }; public static void main(String[] args) { From c05e161a673587177ff0efc78743b04a34d70320 Mon Sep 17 00:00:00 2001 From: Zach Musgrave Date: Wed, 11 Sep 2024 12:29:15 -0700 Subject: [PATCH 13/14] Fixed test --- testing/postgres-client-tests/node/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testing/postgres-client-tests/node/index.js b/testing/postgres-client-tests/node/index.js index 404416242d..0fe4bbd6a9 100644 --- a/testing/postgres-client-tests/node/index.js +++ b/testing/postgres-client-tests/node/index.js @@ -126,7 +126,7 @@ const tests = [ command: "SELECT", rowCount: 1, oid: null, - rows: [{ count: "2" }], + rows: [{ count: "3" }], fields: [ { name: "count", @@ -214,7 +214,7 @@ const tests = [ command: "SELECT", rowCount: 1, oid: null, - rows: [{ count: "3" }], + rows: [{ count: "4" }], fields: [ { name: "count", From 2aa7d022db0db9fdb5febd0ac255391e82af83d9 Mon Sep 17 00:00:00 2001 From: Zach Musgrave Date: Wed, 11 Sep 2024 15:52:17 -0700 Subject: [PATCH 14/14] new dolt --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index de3fcd266d..7dd7915316 100644 --- a/go.mod +++ b/go.mod @@ -8,12 +8,12 @@ require ( github.com/PuerkitoBio/goquery v1.8.1 github.com/cockroachdb/apd/v2 v2.0.3-0.20200518165714-d020e156310a github.com/cockroachdb/errors v1.7.5 - github.com/dolthub/dolt/go v0.40.5-0.20240911010519-635952ea8b02 + github.com/dolthub/dolt/go v0.40.5-0.20240911224757-01bd3404af99 github.com/dolthub/dolt/go/gen/proto/dolt/services/eventsapi v0.0.0-20240827111219-e4bb9ca3442d github.com/dolthub/flatbuffers/v23 v23.3.3-dh.2 - github.com/dolthub/go-mysql-server v0.18.2-0.20240910155935-794fc14e9d02 + github.com/dolthub/go-mysql-server v0.18.2-0.20240910184443-01d3c5f0e2b9 github.com/dolthub/sqllogictest/go v0.0.0-20240618184124-ca47f9354216 - github.com/dolthub/vitess v0.0.0-20240807181005-71d735078e24 + github.com/dolthub/vitess v0.0.0-20240910182452-9291457d0a98 github.com/fatih/color v1.13.0 github.com/goccy/go-json v0.10.2 github.com/gogo/protobuf v1.3.2 diff --git a/go.sum b/go.sum index ab52df164d..a8e1ca337f 100644 --- a/go.sum +++ b/go.sum @@ -214,8 +214,8 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZm github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/dolthub/dolt/go v0.40.5-0.20240911010519-635952ea8b02 h1:70dp7RdTnR5yIOGsey/6lr+VjAgjqlTpBgPUdWcI1/Y= -github.com/dolthub/dolt/go v0.40.5-0.20240911010519-635952ea8b02/go.mod h1:v8Ja5if8o9f5HbX6rf34elmMM61x7EQHktCzcBmLfdE= +github.com/dolthub/dolt/go v0.40.5-0.20240911224757-01bd3404af99 h1:OlepJCBrG9z1esN3WmOhGn3dISwG791YOMspOOKcROw= +github.com/dolthub/dolt/go v0.40.5-0.20240911224757-01bd3404af99/go.mod h1:kvgmqrHyCZyBMO5sOeQQloIpslPQ1JlufMhHy7ig7c4= github.com/dolthub/dolt/go/gen/proto/dolt/services/eventsapi v0.0.0-20240827111219-e4bb9ca3442d h1:RZkQeYOrDrOWzCxaP2ttkvg4E2TM9n8lnEsIBLKjqkM= github.com/dolthub/dolt/go/gen/proto/dolt/services/eventsapi v0.0.0-20240827111219-e4bb9ca3442d/go.mod h1:L5RDYZbC9BBWmoU2+TjTekeqqhFXX5EqH9ln00O0stY= github.com/dolthub/flatbuffers/v23 v23.3.3-dh.2 h1:u3PMzfF8RkKd3lB9pZ2bfn0qEG+1Gms9599cr0REMww= @@ -224,8 +224,8 @@ 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-icu-regex v0.0.0-20230524105445-af7e7991c97e h1:kPsT4a47cw1+y/N5SSCkma7FhAPw7KeGmD6c9PBZW9Y= github.com/dolthub/go-icu-regex v0.0.0-20230524105445-af7e7991c97e/go.mod h1:KPUcpx070QOfJK1gNe0zx4pA5sicIK1GMikIGLKC168= -github.com/dolthub/go-mysql-server v0.18.2-0.20240910155935-794fc14e9d02 h1:MNfPsg9Lt2R07nM1sAeScVKx5Bw/sKPmS0Ek73IwoZw= -github.com/dolthub/go-mysql-server v0.18.2-0.20240910155935-794fc14e9d02/go.mod h1:nbdOzd0ceWONE80vbfwoRBjut7z3CIj69ZgDF/cKuaA= +github.com/dolthub/go-mysql-server v0.18.2-0.20240910184443-01d3c5f0e2b9 h1:gD3dWoUy8W1JKUAhJV6BdvKtA7GDAFL6uynPLmKu6Z0= +github.com/dolthub/go-mysql-server v0.18.2-0.20240910184443-01d3c5f0e2b9/go.mod h1:qG/flwaEzJaI/ZvwlEZyNljSU9UOO54r1Yhv0GnxNgk= github.com/dolthub/gozstd v0.0.0-20240423170813-23a2903bca63 h1:OAsXLAPL4du6tfbBgK0xXHZkOlos63RdKYS3Sgw/dfI= github.com/dolthub/gozstd v0.0.0-20240423170813-23a2903bca63/go.mod h1:lV7lUeuDhH5thVGDCKXbatwKy2KW80L4rMT46n+Y2/Q= github.com/dolthub/ishell v0.0.0-20240701202509-2b217167d718 h1:lT7hE5k+0nkBdj/1UOSFwjWpNxf+LCApbRHgnCA17XE= @@ -238,8 +238,8 @@ github.com/dolthub/sqllogictest/go v0.0.0-20240618184124-ca47f9354216 h1:JWkKRE4 github.com/dolthub/sqllogictest/go v0.0.0-20240618184124-ca47f9354216/go.mod h1:e/FIZVvT2IR53HBCAo41NjqgtEnjMJGKca3Y/dAmZaA= github.com/dolthub/swiss v0.1.0 h1:EaGQct3AqeP/MjASHLiH6i4TAmgbG/c4rA6a1bzCOPc= github.com/dolthub/swiss v0.1.0/go.mod h1:BeucyB08Vb1G9tumVN3Vp/pyY4AMUnr9p7Rz7wJ7kAQ= -github.com/dolthub/vitess v0.0.0-20240807181005-71d735078e24 h1:/zCd98CLZURqK85jQ+qRmEMx/dpXz85F1/Et7gqMGkk= -github.com/dolthub/vitess v0.0.0-20240807181005-71d735078e24/go.mod h1:uBvlRluuL+SbEWTCZ68o0xvsdYZER3CEG/35INdzfJM= +github.com/dolthub/vitess v0.0.0-20240910182452-9291457d0a98 h1:f4Y0ZUO3SPsgS88w5X377tYSHVLlA8JzvKbNu2C5uks= +github.com/dolthub/vitess v0.0.0-20240910182452-9291457d0a98/go.mod h1:uBvlRluuL+SbEWTCZ68o0xvsdYZER3CEG/35INdzfJM= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=