Skip to content

Commit f130a5e

Browse files
committed
MDEV-28266 Crash in Field_string::type_handler when calling procedures
on_table_fill_finished() should always be done at the end of open() even if result is not Select_materialize but (for example) Select_fetch_into_spvars.
1 parent e4835bf commit f130a5e

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

sql/sql_cursor.cc

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff 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();
@@ -334,6 +322,8 @@ int Materialized_cursor::open(JOIN *join __attribute__((unused)))
334322
result->abort_result_set();
335323
}
336324

325+
on_table_fill_finished();
326+
337327
return rc;
338328
}
339329

0 commit comments

Comments
 (0)