From 6b614c620ec32cd8d96be880bbc8ff7c45bac7ce Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Tue, 9 Feb 2016 13:50:48 +0100 Subject: MDEV-7765: Crash (Assertion `!table || (!table->write_set || bitmap_is_set(table->write_set, field_index) || bitmap_is_set(table->vcol_set, field_index))' fails) on using function over not created table Problem was that created table was not marked as used (not set query_id) and so opening tables for stored function pick it up (as opened place holder for it) and used changing TABLE internals. --- sql/sql_insert.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sql/sql_insert.cc') diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 52e059b5ef8..a089f5202aa 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -4151,6 +4151,8 @@ select_create::prepare(List &values, SELECT_LEX_UNIT *u) DBUG_RETURN(1); table->mark_columns_needed_for_insert(); table->file->extra(HA_EXTRA_WRITE_CACHE); + // Mark table as used + table->query_id= thd->query_id; DBUG_RETURN(0); } -- cgit v1.2.1