File tree Expand file tree Collapse file tree 3 files changed +36
-13
lines changed Expand file tree Collapse file tree 3 files changed +36
-13
lines changed Original file line number Diff line number Diff line change @@ -800,3 +800,15 @@ drop procedure test_proc;
800800drop view v1;
801801drop function get_name;
802802drop table t1;
803+ #
804+ # MDEV-28266: Crash in Field_string::type_handler when calling procedures
805+ #
806+ CREATE TABLE t (f INT);
807+ CREATE TRIGGER tr AFTER INSERT ON t FOR EACH ROW
808+ FOR x IN (SELECT * FROM json_table(NULL, '$' COLUMNS(a CHAR(1) path '$.*')) tmp)
809+ DO set @a=1; END FOR $
810+ INSERT INTO t () values ();
811+ DROP TABLE t;
812+ #
813+ # End of 10.6 tests
814+ #
Original file line number Diff line number Diff line change @@ -800,3 +800,24 @@ drop procedure test_proc;
800800drop view v1;
801801drop function get_name;
802802drop table t1;
803+
804+ --echo #
805+ --echo # MDEV-28266: Crash in Field_string::type_handler when calling procedures
806+ --echo #
807+
808+ CREATE TABLE t (f INT);
809+
810+ --delimiter $
811+ CREATE TRIGGER tr AFTER INSERT ON t FOR EACH ROW
812+ FOR x IN (SELECT * FROM json_table(NULL, '$' COLUMNS(a CHAR(1) path '$.*')) tmp)
813+ DO set @a=1; END FOR $
814+ --delimiter ;
815+
816+ INSERT INTO t () values ();
817+
818+ # Cleanup
819+ DROP TABLE t;
820+
821+ --echo #
822+ --echo # End of 10.6 tests
823+ --echo #
Original file line number Diff line number Diff line change @@ -80,19 +80,7 @@ class Select_materialize: public select_unit
8080 Select_materialize (THD *thd_arg, select_result *result_arg):
8181 select_unit (thd_arg), result(result_arg), materialized_cursor(0 ) {}
8282 virtual bool send_result_set_metadata (List<Item> &list, uint flags);
83- bool send_eof ()
84- {
85- if (materialized_cursor)
86- materialized_cursor->on_table_fill_finished ();
87- return false ;
88- }
89-
90- void abort_result_set ()
91- {
92- if (materialized_cursor)
93- materialized_cursor->on_table_fill_finished ();
94- }
95-
83+ bool send_eof () { return false ; }
9684 bool view_structure_only () const
9785 {
9886 return result->view_structure_only ();
@@ -333,6 +321,8 @@ int Materialized_cursor::open(JOIN *join __attribute__((unused)))
333321 result->abort_result_set ();
334322 }
335323
324+ on_table_fill_finished ();
325+
336326 return rc;
337327}
338328
You can’t perform that action at this time.
0 commit comments