Removed wrong warnings in test suite (This was because select_insert / select_create results was not freed.

Added thd to openfrm() for initialization of TABLE->in_use. This fixed a bug in BDB handling where table->in_use was used early


mysql-test/r/key.result:
  Added new tests that shows a bug in warnings hat
mysql-test/t/key.test:
  Added new tests that shows a bug in warnings hat
sql/handler.cc:
  Added thd to openfrm() for initialization of TABLE->in_use
sql/item.cc:
  New function to avoid warnings when giving field a value
sql/item.h:
  New function to avoid warnings when giving field a value
sql/mysql_priv.h:
  Added thd to openfrm() for initialization of TABLE->in_use
sql/opt_range.cc:
  Don't give warnings in optimizer when internally storing a field value in a field. (Should be ok as we ar checking the feild in the WHERE clause later)
sql/sql_base.cc:
  Give memroot explicitely to open_unireg_entry() and open_table() (Makes code simpler)
  Ensure that table->in_use is set early
  New arguments for openfrm()
sql/sql_insert.cc:
  More debugging & comments
sql/sql_parse.cc:
  Delete results for select_insert and select_create. This fixed a bug that generated warnings in test suite
sql/sql_select.h:
  Don't give warnings in optimizer when internally storing a field value in a field. (Should be ok as we ar checking the feild in the WHERE clause later)
sql/sql_table.cc:
  New arguments to open_table() and openfrm()
sql/table.cc:
  Added thd to openfrm() for initialization of TABLE->in_use
  This fixes some bugs in BDB where table->in_use was used
This commit is contained in:
unknown 2004-09-17 03:08:23 +03:00
commit e74b00bbc9
13 changed files with 53 additions and 27 deletions

View file

@ -2461,6 +2461,7 @@ mysql_execute_command(THD *thd)
select_lex->resolve_mode= SELECT_LEX::SELECT_MODE;
res=handle_select(thd, lex, result);
select_lex->resolve_mode= SELECT_LEX::NOMATTER_MODE;
delete result;
}
/* reset for PS */
lex->create_list.empty();
@ -2818,6 +2819,7 @@ unsent_create_error:
break;
if ((result= new select_insert(first_table, first_table->table,
&lex->field_list, lex->duplicates)))
{
/* Skip first table, which is the table we are inserting in */
lex->select_lex.table_list.first= (byte*) first_table->next_local;
/*
@ -2829,6 +2831,8 @@ unsent_create_error:
/* revert changes for SP */
lex->select_lex.table_list.first= (byte*) first_table;
lex->select_lex.resolve_mode= SELECT_LEX::INSERT_MODE;
delete result;
}
if (thd->net.report_error)
res= -1;
}