diff options
author | Rex <rex.johnston@mariadb.com> | 2023-02-02 06:29:05 +1200 |
---|---|---|
committer | Rex <rex.johnston@mariadb.com> | 2023-02-14 14:46:21 +1200 |
commit | d9395d42273a4ec4742fac528d8ecece1baaa151 (patch) | |
tree | 9d15538184d337a1c6b175fbadc3321ae31e9668 /mysql-test | |
parent | b05218e08f45a17f46d1b73cbb9dcb2969dc04cd (diff) | |
download | mariadb-git-bb-10.4-MDEV-30334.tar.gz |
MDEV-30334 Optimizer trace produces invalid JSON with WHERE subquerybb-10.4-MDEV-30334
Simple code rearrangement to stop it displaying an unsigned int in a String.
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/main/opt_trace.result | 17 | ||||
-rw-r--r-- | mysql-test/main/opt_trace.test | 17 |
2 files changed, 34 insertions, 0 deletions
diff --git a/mysql-test/main/opt_trace.result b/mysql-test/main/opt_trace.result index 2eef0da62bb..a8277070438 100644 --- a/mysql-test/main/opt_trace.result +++ b/mysql-test/main/opt_trace.result @@ -8522,5 +8522,22 @@ SELECT a FROM t1 WHERE (a,b) in (SELECT @c,@d); a DROP TABLE t1; # +# MDEV-30334 Optimizer trace produces invalid JSON with WHERE subquery +# Simple code rearrangement to stop it displaying an unsigned int in a String. +# +SET optimizer_trace= 'enabled=on'; +CREATE TABLE t1 (id INT PRIMARY KEY); +INSERT INTO t1 VALUES (1),(2); +CREATE TABLE t2 (a INT); +INSERT INTO t2 VALUES (3),(4); +SELECT * FROM t1 WHERE id < ( SELECT SUM(a) FROM t2 ); +id +1 +2 +SELECT JSON_VALID(trace) FROM information_schema.optimizer_trace; +JSON_VALID(trace) +1 +DROP TABLE t1, t2; +# # End of 10.4 tests # diff --git a/mysql-test/main/opt_trace.test b/mysql-test/main/opt_trace.test index 0785d828a07..1bc48b6f75a 100644 --- a/mysql-test/main/opt_trace.test +++ b/mysql-test/main/opt_trace.test @@ -678,5 +678,22 @@ SELECT a FROM t1 WHERE (a,b) in (SELECT @c,@d); DROP TABLE t1; --echo # +--echo # MDEV-30334 Optimizer trace produces invalid JSON with WHERE subquery +--echo # Simple code rearrangement to stop it displaying an unsigned int in a String. +--echo # + +SET optimizer_trace= 'enabled=on'; + +CREATE TABLE t1 (id INT PRIMARY KEY); +INSERT INTO t1 VALUES (1),(2); +CREATE TABLE t2 (a INT); +INSERT INTO t2 VALUES (3),(4); + +SELECT * FROM t1 WHERE id < ( SELECT SUM(a) FROM t2 ); +SELECT JSON_VALID(trace) FROM information_schema.optimizer_trace; + +DROP TABLE t1, t2; + +--echo # --echo # End of 10.4 tests --echo # |