From 9c5eab69a03d47e9acaf020fb33c43838f94f0cf Mon Sep 17 00:00:00 2001 From: Jason Fulghum Date: Mon, 25 Nov 2024 14:51:04 -0800 Subject: [PATCH 1/3] Added testing for the `show slave status` statement --- .../binlog_replication_test.go | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/go/libraries/doltcore/sqle/binlogreplication/binlog_replication_test.go b/go/libraries/doltcore/sqle/binlogreplication/binlog_replication_test.go index f07873c6a2..9231185dcd 100644 --- a/go/libraries/doltcore/sqle/binlogreplication/binlog_replication_test.go +++ b/go/libraries/doltcore/sqle/binlogreplication/binlog_replication_test.go @@ -315,6 +315,14 @@ func TestResetReplica(t *testing.T) { require.Equal(t, "No", status["Replica_IO_Running"]) require.Equal(t, "No", status["Replica_SQL_Running"]) + // Now try querying the status using the older, deprecated 'show slave status' statement + // and spot check that the data is the same, but the column names have changed + status = querySlaveStatus(t) + require.Equal(t, "", status["Master_Host"]) + require.Equal(t, "", status["Master_User"]) + require.Equal(t, "No", status["Slave_IO_Running"]) + require.Equal(t, "No", status["Slave_SQL_Running"]) + rows, err = replicaDatabase.Queryx("select * from mysql.slave_master_info;") require.NoError(t, err) require.False(t, rows.Next()) @@ -1227,6 +1235,19 @@ func queryReplicaStatus(t *testing.T) map[string]any { return status } +// querySlaveStatus returns the results of `SHOW SLAVE STATUS` as a map, for the replica +// database. If any errors are encountered, this function will fail the current test. +// The queryReplicaStatus() function should generally be favored over this function for +// getting the status of a replica. This function exists only to help test that the +// deprecated 'show slave status' statement works. +func querySlaveStatus(t *testing.T) map[string]any { + rows, err := replicaDatabase.Queryx("SHOW SLAVE STATUS;") + require.NoError(t, err) + status := convertMapScanResultToStrings(readNextRow(t, rows)) + require.NoError(t, rows.Close()) + return status +} + // mustListDatabases returns a string slice of the databases (i.e. schemas) available on the specified |db|. If // any errors are encountered, this function will fail the current test. func mustListDatabases(t *testing.T, db *sqlx.DB) []string { From e60b76be151a4f62204a3265dd64b39c42b0a49a Mon Sep 17 00:00:00 2001 From: Jason Fulghum Date: Mon, 25 Nov 2024 14:54:56 -0800 Subject: [PATCH 2/3] Bumping Vitess and GMS dependencies to latest from fulghum/show_slave_status dev branches --- go/go.mod | 4 ++-- go/go.sum | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/go/go.mod b/go/go.mod index 8aef531305..a56ca2205e 100644 --- a/go/go.mod +++ b/go/go.mod @@ -15,7 +15,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-20241121221517-3e7b5ffc22b0 + github.com/dolthub/vitess v0.0.0-20241125223808-07f6e12611ec 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 @@ -57,7 +57,7 @@ require ( github.com/cespare/xxhash/v2 v2.2.0 github.com/creasty/defaults v1.6.0 github.com/dolthub/flatbuffers/v23 v23.3.3-dh.2 - github.com/dolthub/go-mysql-server v0.18.2-0.20241125210950-6625ccc05305 + github.com/dolthub/go-mysql-server v0.18.2-0.20241125225118-7c3d81120e3e github.com/dolthub/gozstd v0.0.0-20240423170813-23a2903bca63 github.com/dolthub/swiss v0.1.0 github.com/goccy/go-json v0.10.2 diff --git a/go/go.sum b/go/go.sum index 26111f13d8..b050a3a533 100644 --- a/go/go.sum +++ b/go/go.sum @@ -185,6 +185,8 @@ github.com/dolthub/go-icu-regex v0.0.0-20240916130659-0118adc6b662 h1:aC17hZD6iw github.com/dolthub/go-icu-regex v0.0.0-20240916130659-0118adc6b662/go.mod h1:KPUcpx070QOfJK1gNe0zx4pA5sicIK1GMikIGLKC168= github.com/dolthub/go-mysql-server v0.18.2-0.20241125210950-6625ccc05305 h1:T1nzDqzpk0K64wHG5nwdKhGMgT0Yp1qBya7RMZNGWz4= github.com/dolthub/go-mysql-server v0.18.2-0.20241125210950-6625ccc05305/go.mod h1:2mA/v84EOCe8TQIKR8TN8ZRIQSbOqThGQHyevGRmawU= +github.com/dolthub/go-mysql-server v0.18.2-0.20241125225118-7c3d81120e3e h1:d1Dh7G456udovQLfhhaiJ+9BMywckL+uveCM09Tm+Nw= +github.com/dolthub/go-mysql-server v0.18.2-0.20241125225118-7c3d81120e3e/go.mod h1:CSp6i24qfW6JleRNYlR7LLJwO7aHlPrCnFoXivzTSZ4= 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= @@ -199,6 +201,8 @@ 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-20241121221517-3e7b5ffc22b0 h1:C8X4RkkWKcrJG6rG+MsdFINX2PhB7ObpbBvFcWsI8K8= github.com/dolthub/vitess v0.0.0-20241121221517-3e7b5ffc22b0/go.mod h1:alcJgfdyIhFaAiYyEmuDCFSLCzedz3KCaIclLoCUtJg= +github.com/dolthub/vitess v0.0.0-20241125223808-07f6e12611ec h1:4EpyVnCleDMSuIqg8oCHf5IpwW7DPhjSQEgYCWkKpTo= +github.com/dolthub/vitess v0.0.0-20241125223808-07f6e12611ec/go.mod h1:alcJgfdyIhFaAiYyEmuDCFSLCzedz3KCaIclLoCUtJg= 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= From ab2895ad51b93e770584070c14432e9839434dba Mon Sep 17 00:00:00 2001 From: fulghum Date: Mon, 25 Nov 2024 23:59:45 +0000 Subject: [PATCH 3/3] [ga-bump-dep] Bump dependency in Dolt by fulghum --- go/go.mod | 4 ++-- go/go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go/go.mod b/go/go.mod index 8aef531305..bbf64770c6 100644 --- a/go/go.mod +++ b/go/go.mod @@ -15,7 +15,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-20241121221517-3e7b5ffc22b0 + github.com/dolthub/vitess v0.0.0-20241125233820-b4036b797518 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 @@ -57,7 +57,7 @@ require ( github.com/cespare/xxhash/v2 v2.2.0 github.com/creasty/defaults v1.6.0 github.com/dolthub/flatbuffers/v23 v23.3.3-dh.2 - github.com/dolthub/go-mysql-server v0.18.2-0.20241125210950-6625ccc05305 + github.com/dolthub/go-mysql-server v0.18.2-0.20241125235746-b2756d7abd88 github.com/dolthub/gozstd v0.0.0-20240423170813-23a2903bca63 github.com/dolthub/swiss v0.1.0 github.com/goccy/go-json v0.10.2 diff --git a/go/go.sum b/go/go.sum index 26111f13d8..04a09aaa82 100644 --- a/go/go.sum +++ b/go/go.sum @@ -183,8 +183,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-20240916130659-0118adc6b662 h1:aC17hZD6iwzBwwfO5M+3oBT5E5gGRiQPdn+vzpDXqIA= github.com/dolthub/go-icu-regex v0.0.0-20240916130659-0118adc6b662/go.mod h1:KPUcpx070QOfJK1gNe0zx4pA5sicIK1GMikIGLKC168= -github.com/dolthub/go-mysql-server v0.18.2-0.20241125210950-6625ccc05305 h1:T1nzDqzpk0K64wHG5nwdKhGMgT0Yp1qBya7RMZNGWz4= -github.com/dolthub/go-mysql-server v0.18.2-0.20241125210950-6625ccc05305/go.mod h1:2mA/v84EOCe8TQIKR8TN8ZRIQSbOqThGQHyevGRmawU= +github.com/dolthub/go-mysql-server v0.18.2-0.20241125235746-b2756d7abd88 h1:40pfBNjKGTZ+IdALZoDw54R0y/pNMfaW+I2ECjNHV1g= +github.com/dolthub/go-mysql-server v0.18.2-0.20241125235746-b2756d7abd88/go.mod h1:eiQ0i6kLtFE/1WDfqckiJJ/n3B8MWVZ+kkl/XdYSdiw= 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= @@ -197,8 +197,8 @@ github.com/dolthub/sqllogictest/go v0.0.0-20201107003712-816f3ae12d81 h1:7/v8q9X github.com/dolthub/sqllogictest/go v0.0.0-20201107003712-816f3ae12d81/go.mod h1:siLfyv2c92W1eN/R4QqG/+RjjX5W2+gCTRjZxBjI3TY= 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-20241121221517-3e7b5ffc22b0 h1:C8X4RkkWKcrJG6rG+MsdFINX2PhB7ObpbBvFcWsI8K8= -github.com/dolthub/vitess v0.0.0-20241121221517-3e7b5ffc22b0/go.mod h1:alcJgfdyIhFaAiYyEmuDCFSLCzedz3KCaIclLoCUtJg= +github.com/dolthub/vitess v0.0.0-20241125233820-b4036b797518 h1:aXx3d3vpAg9/E7oB2AsadnRbBkwQn6Kza7l8JrBjHLE= +github.com/dolthub/vitess v0.0.0-20241125233820-b4036b797518/go.mod h1:alcJgfdyIhFaAiYyEmuDCFSLCzedz3KCaIclLoCUtJg= 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=