summaryrefslogtreecommitdiff
path: root/mysql-test/suite/json
diff options
context:
space:
mode:
authorSergei Petrunia <psergey@askmonty.org>2021-03-16 17:06:28 +0300
committerAlexey Botchkov <holyfoot@askmonty.org>2021-04-21 10:21:43 +0400
commit99fc076fea2901a29ec6886d9d2a7a18690c7198 (patch)
treeacc6c418ae16bf20734dc2ada78cfe1d508ecc68 /mysql-test/suite/json
parent98556ef84a96f071db5f1514c36f2facf3f619d7 (diff)
downloadmariadb-git-99fc076fea2901a29ec6886d9d2a7a18690c7198.tar.gz
MDEV-25145: JSON_TABLE: Assertion fixed == 1 failed .. on 2nd execution
Diffstat (limited to 'mysql-test/suite/json')
-rw-r--r--mysql-test/suite/json/r/json_table.result17
-rw-r--r--mysql-test/suite/json/t/json_table.test7
2 files changed, 24 insertions, 0 deletions
diff --git a/mysql-test/suite/json/r/json_table.result b/mysql-test/suite/json/r/json_table.result
index 97743b3288e..0b0b1aa1ca6 100644
--- a/mysql-test/suite/json/r/json_table.result
+++ b/mysql-test/suite/json/r/json_table.result
@@ -491,5 +491,22 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE jt1 ALL NULL NULL NULL NULL 40 Table function: json_table
drop table t20,t21,t31,t32;
#
+# MDEV-25142: JSON_TABLE: CREATE VIEW involving EXISTS PATH ends up with invalid frm
+#
+drop view if exists v1;
+CREATE VIEW v1 AS SELECT * FROM JSON_TABLE('[]', '$' COLUMNS (f INT EXISTS PATH '$')) a ;
+show create view v1;
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `a`.`f` AS `f` from JSON_TABLE('[]', '$' COLUMNS (`f` int(11) EXISTS PATH '$')) `a` latin1 latin1_swedish_ci
+drop view v1;
+#
+# MDEV-25145: JSON_TABLE: Assertion `fixed == 1' failed in Item_load_file::val_str on 2nd execution of PS
+#
+PREPARE stmt FROM "SELECT * FROM (SELECT * FROM JSON_TABLE(LOAD_FILE('x'), '$' COLUMNS (a FOR ORDINALITY)) AS t) AS sq";
+EXECUTE stmt;
+a
+EXECUTE stmt;
+a
+#
# End of 10.6 tests
#
diff --git a/mysql-test/suite/json/t/json_table.test b/mysql-test/suite/json/t/json_table.test
index 9d26ac267b4..8da1a5e3865 100644
--- a/mysql-test/suite/json/t/json_table.test
+++ b/mysql-test/suite/json/t/json_table.test
@@ -389,5 +389,12 @@ show create view v1;
drop view v1;
--echo #
+--echo # MDEV-25145: JSON_TABLE: Assertion `fixed == 1' failed in Item_load_file::val_str on 2nd execution of PS
+--echo #
+PREPARE stmt FROM "SELECT * FROM (SELECT * FROM JSON_TABLE(LOAD_FILE('x'), '$' COLUMNS (a FOR ORDINALITY)) AS t) AS sq";
+EXECUTE stmt;
+EXECUTE stmt;
+
+--echo #
--echo # End of 10.6 tests
--echo #