diff --git a/go/go.mod b/go/go.mod index 1a766566da6..d23872ff0eb 100644 --- a/go/go.mod +++ b/go/go.mod @@ -14,7 +14,7 @@ require ( github.com/dolthub/fslock v0.0.3 github.com/dolthub/ishell v0.0.0-20240701202509-2b217167d718 github.com/dolthub/sqllogictest/go v0.0.0-20201107003712-816f3ae12d81 - github.com/dolthub/vitess v0.0.0-20250423221552-f731ee5c5379 + github.com/dolthub/vitess v0.0.0-20250430180243-0eee73763bc5 github.com/dustin/go-humanize v1.0.1 github.com/fatih/color v1.13.0 github.com/flynn-archive/go-shlex v0.0.0-20150515145356-3f9db97f8568 @@ -60,7 +60,7 @@ require ( github.com/creasty/defaults v1.6.0 github.com/dolthub/aws-sdk-go-ini-parser v0.0.0-20250305001723-2821c37f6c12 github.com/dolthub/flatbuffers/v23 v23.3.3-dh.2 - github.com/dolthub/go-mysql-server v0.19.1-0.20250428224756-b9931b05c831 + github.com/dolthub/go-mysql-server v0.19.1-0.20250430183344-d3b95b2013dd github.com/dolthub/gozstd v0.0.0-20240423170813-23a2903bca63 github.com/esote/minmaxheap v1.0.0 github.com/goccy/go-json v0.10.2 diff --git a/go/go.sum b/go/go.sum index 380eb09a9d9..154d17b2de2 100644 --- a/go/go.sum +++ b/go/go.sum @@ -221,8 +221,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-20250327004329-6799764f2dad h1:66ZPawHszNu37VPQckdhX1BPPVzREsGgNxQeefnlm3g= github.com/dolthub/go-icu-regex v0.0.0-20250327004329-6799764f2dad/go.mod h1:ylU4XjUpsMcvl/BKeRRMXSH7e7WBrPXdSLvnRJYrxEA= -github.com/dolthub/go-mysql-server v0.19.1-0.20250428224756-b9931b05c831 h1:SxQunmO7PM6h7Tp/xaOpBv3YPX2WdZmNAUzW7ywFRio= -github.com/dolthub/go-mysql-server v0.19.1-0.20250428224756-b9931b05c831/go.mod h1:skB7lRdqgWVqDZ/ih/DtX8iSvK15IaxRf2ASliUwgtE= +github.com/dolthub/go-mysql-server v0.19.1-0.20250430183344-d3b95b2013dd h1:WC8c6Wh+kWxw4xNQruFtqkDxTw3PMeFcS57ok3+rUV4= +github.com/dolthub/go-mysql-server v0.19.1-0.20250430183344-d3b95b2013dd/go.mod h1:pj8c/fGAEdKYy1BZWcN0xO+vEgMRI+kWVXhuEy1BN+Q= 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= @@ -231,8 +231,8 @@ github.com/dolthub/jsonpath v0.0.2-0.20240227200619-19675ab05c71 h1:bMGS25NWAGTE github.com/dolthub/jsonpath v0.0.2-0.20240227200619-19675ab05c71/go.mod h1:2/2zjLQ/JOOSbbSboojeg+cAwcRV0fDLzIiWch/lhqI= github.com/dolthub/sqllogictest/go v0.0.0-20201107003712-816f3ae12d81 h1:7/v8q9XGFa6q5Ap4Z/OhNkAMBaK5YeuEzwJt+NZdhiE= github.com/dolthub/sqllogictest/go v0.0.0-20201107003712-816f3ae12d81/go.mod h1:siLfyv2c92W1eN/R4QqG/+RjjX5W2+gCTRjZxBjI3TY= -github.com/dolthub/vitess v0.0.0-20250423221552-f731ee5c5379 h1:3nPFx23Ol0djIPf9rDw/y38yEn1BXqTXOUkYrWfxrEI= -github.com/dolthub/vitess v0.0.0-20250423221552-f731ee5c5379/go.mod h1:1gQZs/byeHLMSul3Lvl3MzioMtOW1je79QYGyi2fd70= +github.com/dolthub/vitess v0.0.0-20250430180243-0eee73763bc5 h1:eyC/UHnNsCham/65hV9p/Si0S+cq774kbgk0/KPFYws= +github.com/dolthub/vitess v0.0.0-20250430180243-0eee73763bc5/go.mod h1:1gQZs/byeHLMSul3Lvl3MzioMtOW1je79QYGyi2fd70= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= diff --git a/go/libraries/doltcore/sqle/enginetest/dolt_engine_test.go b/go/libraries/doltcore/sqle/enginetest/dolt_engine_test.go index dfc0469e23d..5575a8f1ee9 100644 --- a/go/libraries/doltcore/sqle/enginetest/dolt_engine_test.go +++ b/go/libraries/doltcore/sqle/enginetest/dolt_engine_test.go @@ -113,9 +113,57 @@ func TestSchemaOverridesWithAdaptiveEncoding(t *testing.T) { // Convenience test for debugging a single query. Unskip and set to the desired query. func TestSingleScript(t *testing.T) { - t.Skip() - - var scripts = []queries.ScriptTest{} + //t.Skip() + var scripts = []queries.ScriptTest{ + { + Name: "Database syntax properly handles inter-CALL communication", + SetUpScript: []string{ + `CREATE PROCEDURE p1() +BEGIN + DECLARE str VARCHAR(20); + CALL p2(str); + SET str = CONCAT('a', str); + SELECT str; +END`, + `CREATE PROCEDURE p2(OUT param VARCHAR(20)) +BEGIN + SET param = 'b'; +END`, + "CALL DOLT_ADD('-A');", + "CALL DOLT_COMMIT('-m', 'First procedures');", + "CALL DOLT_BRANCH('p12');", + "DROP PROCEDURE p1;", + "DROP PROCEDURE p2;", + `CREATE PROCEDURE p1() +BEGIN + DECLARE str VARCHAR(20); + CALL p2(str); + SET str = CONCAT('c', str); + SELECT str; +END`, + `CREATE PROCEDURE p2(OUT param VARCHAR(20)) +BEGIN + SET param = 'd'; +END`, + "CALL DOLT_ADD('-A');", + "CALL DOLT_COMMIT('-m', 'Second procedures');", + }, + Assertions: []queries.ScriptTestAssertion{ + { + Query: "CALL p1();", + Expected: []sql.Row{{"cd"}}, + }, + { + Query: "CALL `mydb/main`.p1();", + Expected: []sql.Row{{"cd"}}, + }, + { + Query: "CALL `mydb/p12`.p1();", + Expected: []sql.Row{{"ab"}}, + }, + }, + }, + } for _, script := range scripts { harness := newDoltHarness(t) diff --git a/integration-tests/bats/sql.bats b/integration-tests/bats/sql.bats index 395a4cedf32..d16dc84cc9f 100755 --- a/integration-tests/bats/sql.bats +++ b/integration-tests/bats/sql.bats @@ -2227,7 +2227,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 + 10),(test.v1 + 10),(test.v2 + 10)" ]] || false [[ "$output" =~ "11,11,11" ]] || false [[ "$output" =~ "12,12,12" ]] || false [[ "$output" =~ "13,13,13" ]] || false @@ -2238,7 +2238,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 + 20),(test.v1 + 20),(test.v2 + 20)" ]] || false [[ "$output" =~ "21,21,21" ]] || false [[ "$output" =~ "22,22,22" ]] || false [[ "$output" =~ "23,23,23" ]] || false