diff --git a/go/go.mod b/go/go.mod index d27d8d10005..83042686cff 100644 --- a/go/go.mod +++ b/go/go.mod @@ -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.20241011074701-f9668b4ea059 + github.com/dolthub/go-mysql-server v0.18.2-0.20241011215835-9ee86c83dd06 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 ab402ab4c4e..6afb1428e54 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.20241011074701-f9668b4ea059 h1:OgZyHBBiQdXIiE4jzIkpOgZjw0MJdbzwmfqZPbszk1c= -github.com/dolthub/go-mysql-server v0.18.2-0.20241011074701-f9668b4ea059/go.mod h1:Z8tket+3sYcU3d4yW90Ggld2d+C2DUgnpB8cBP0+GvI= +github.com/dolthub/go-mysql-server v0.18.2-0.20241011215835-9ee86c83dd06 h1:ChpThUOVwCKA/3DVfrGRnDHQb41njX2MnRVigSJbE8s= +github.com/dolthub/go-mysql-server v0.18.2-0.20241011215835-9ee86c83dd06/go.mod h1:Z8tket+3sYcU3d4yW90Ggld2d+C2DUgnpB8cBP0+GvI= 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= diff --git a/integration-tests/mysql-client-tests/dotnet/MySqlClient/Program.cs b/integration-tests/mysql-client-tests/dotnet/MySqlClient/Program.cs index b40fd872658..af962842906 100644 --- a/integration-tests/mysql-client-tests/dotnet/MySqlClient/Program.cs +++ b/integration-tests/mysql-client-tests/dotnet/MySqlClient/Program.cs @@ -34,6 +34,7 @@ public static int Main(string[] args) conn.Open(); SetupTest(conn); QueryTest(conn); + WarningTest(conn); } catch (Exception ex) { @@ -79,6 +80,49 @@ public static void QueryTest(MySqlConnection conn) } } + public static void WarningTest(MySqlConnection conn) + { + string sql = "SELECT 1/0"; + using (var cmd = new MySqlCommand(sql, conn)) + try + { + object result = cmd.ExecuteScalar(); + if (result != null) + { + if (!DBNull.Value.Equals(result)) + { + TestException ex = new TestException($"Expected NULL, Received {result}"); + throw ex; + } + } + } + catch (Exception ex) + { + Console.WriteLine(ex.ToString()); + } + + sql = "SHOW WARNINGS"; + using (var cmd = new MySqlCommand(sql, conn)) + try + { + using (var reader = cmd.ExecuteReader()) + { + while (reader.Read()) + { + if (reader.GetString(2) != "Division by 0") + { + TestException ex = new TestException($"Expected 'Division by 0', Received {reader.GetString(0)}"); + throw ex; + } + } + } + } + catch (Exception ex) + { + Console.WriteLine(ex.ToString()); + } + } + public static void DoltSqlTest(MySqlConnection conn) { string[] queries = new string[] {