summaryrefslogtreecommitdiff
path: root/mysql-test/main/opt_trace.test
diff options
context:
space:
mode:
authorOleg Smirnov <olernov@gmail.com>2022-05-31 13:47:13 +0400
committerOleg Smirnov <olernov@gmail.com>2022-06-01 14:24:54 +0700
commitc4cf1ad592ab38383d4eb31064f1c8ffaeaada02 (patch)
treeb6a054f57430366f9c232aa27fda405b019f294d /mysql-test/main/opt_trace.test
parent40b8f3ec1a76fc23eb6bf9c5a8fef1debcbf5843 (diff)
downloadmariadb-git-bb-10.4-MDEV-28598.tar.gz
MDEV-28598 Assertion 'got_name == named_item_expected()' failedbb-10.4-MDEV-28598
This assertion triggered on an attempt to write a piece of corrupt JSON to the optimizer trace: "transformation": { "select_id": 2, "from": "IN (SELECT)", "to": "semijoin", { "join_optimization": { "select_id": 3, "steps": [] } } This happened because some parts of the query may be evaluated right during the optimization stage. To handle such cases Json_writer will now implicitly add named members with automatically assigned names "implicitly_added_member_#1", "implicitly_added_member_#2", etc to preserve JSON document correctness. Also the tail of the JSON document will be printed to stderr before abort. Those two improvements only apply for Debug builds, not for Release ones as the Release builds skip JSON correctness checks
Diffstat (limited to 'mysql-test/main/opt_trace.test')
-rw-r--r--mysql-test/main/opt_trace.test10
1 files changed, 10 insertions, 0 deletions
diff --git a/mysql-test/main/opt_trace.test b/mysql-test/main/opt_trace.test
index 855ce11aaf5..ab30b23b743 100644
--- a/mysql-test/main/opt_trace.test
+++ b/mysql-test/main/opt_trace.test
@@ -654,5 +654,15 @@ SELECT a FROM t1 WHERE (a,b) in (SELECT @c,@d);
DROP TABLE t1;
--echo #
+--echo # MDEV-28598: Assertion `got_name == named_item_expected()' failed in Json_writer::on_start_object
+--echo #
+
+CREATE TABLE t1 (a int);
+SET optimizer_trace=1;
+INSERT INTO t1 VALUES (1),(2),(3);
+SELECT * FROM t1 WHERE a IN (SELECT 1 a FROM t1 WHERE EXISTS (select 1));
+DROP TABLE t1;
+
+--echo #
--echo # End of 10.4 tests
--echo #