summaryrefslogtreecommitdiff
path: root/sql/table.cc
diff options
context:
space:
mode:
authorunknown <monty@mishka.local>2004-09-17 03:08:23 +0300
committerunknown <monty@mishka.local>2004-09-17 03:08:23 +0300
commite74b00bbc98c1082086422dc9c8578dade9d4a11 (patch)
treea8b336253346895e427b74008617db6d076f5fa3 /sql/table.cc
parent6c3e66510c29abb4a935483a711b55f3ff8607ab (diff)
downloadmariadb-git-e74b00bbc98c1082086422dc9c8578dade9d4a11.tar.gz
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
Diffstat (limited to 'sql/table.cc')
-rw-r--r--sql/table.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/sql/table.cc b/sql/table.cc
index 1c216c44f66..946dbc0766a 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -61,8 +61,8 @@ static byte* get_field_name(Field **buff,uint *length,
5 It is new format of .frm file
*/
-int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
- uint ha_open_flags, TABLE *outparam)
+int openfrm(THD *thd, const char *name, const char *alias, uint db_stat,
+ uint prgflag, uint ha_open_flags, TABLE *outparam)
{
reg1 uint i;
reg2 uchar *strpos;
@@ -119,6 +119,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
}
bzero((char*) outparam,sizeof(*outparam));
+ outparam->in_use= thd;
outparam->blob_ptr_size=sizeof(char*);
outparam->db_stat = db_stat;
init_sql_alloc(&outparam->mem_root, TABLE_ALLOC_BLOCK_SIZE, 0);
@@ -733,7 +734,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
outparam->db_low_byte_first=outparam->file->low_byte_first();
my_pthread_setspecific_ptr(THR_MALLOC,old_root);
- current_thd->status_var.opened_tables++;
+ thd->status_var.opened_tables++;
#ifndef DBUG_OFF
if (use_hash)
(void) hash_check(&outparam->name_hash);