Commit 394c88df authored by unknown's avatar unknown
Browse files

BUG#16893: Crash in test 'fulltext_order_by'

Fixed that fulltext query + union results in unexpected behaviour.


sql/item_func.h:
  Remove access to table object from cleanup() as the table object
  may have been dropped earlier (In case of temporary tables or of
  close_thread_tables() is run before cleanup())
  This fixed a bug with access to already freed memory
sql/sql_base.cc:
  Reset variables used by fulltext
parent 1e686ae7
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -1057,9 +1057,6 @@ class Item_func_match :public Item_real_func
    {
      ft_handler->please->close_search(ft_handler);
      ft_handler=0;
      if (join_key)
	table->file->ft_handler=0;
      table->fulltext_searched=0;
    }
    if (concat)
    {
+2 −0
Original line number Diff line number Diff line
@@ -988,6 +988,8 @@ TABLE *open_table(THD *thd,const char *db,const char *table_name,
  table->status=STATUS_NO_RECORD;
  table->keys_in_use_for_query= table->keys_in_use;
  table->used_keys= table->keys_for_keyread;
  table->file->ft_handler=0;
  table->fulltext_searched=0;
  if (table->timestamp_field)
    table->timestamp_field_type= table->timestamp_field->get_auto_set_type();
  DBUG_ASSERT(table->key_read == 0);