1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Added SQL_SELECT::cleanup() to make it easier to reuse SQL_SELECT item's for sub selects. Needed for proper fix for bug #2479.

Added 'select_to_file' class to be able to merge identical code for select_export and select_dump


client/mysql.cc:
  Print mysql_insert_id() in 'status'
mysys/charset.c:
  after merge fixup
sql/item_func.cc:
  Code cleanup + new comments
sql/opt_range.cc:
  Added SQL_SELECT::cleanup() to make it easier to reuse SQL_SELECT item's for sub selects.
sql/opt_range.h:
  Added SQL_SELECT::cleanup() to make it easier to reuse SQL_SELECT item's for sub selects.
sql/sql_class.cc:
  Added 'select_to_file' class to be able to merge identical code for select_export and select_dump
sql/sql_class.h:
  Added 'select_to_file' class to be able to merge identical code for select_export and select_dump
sql/sql_select.cc:
  Fixed bug when calling 'delete select' in sub selects. (Bug 2479)
  (Test case is already commited to global source repository)
This commit is contained in:
unknown
2004-02-05 10:22:08 +01:00
parent e44a7da25f
commit 0db0b601ab
8 changed files with 131 additions and 95 deletions

View File

@ -369,14 +369,25 @@ SQL_SELECT::SQL_SELECT() :quick(0),cond(0),free_cond(0)
}
SQL_SELECT::~SQL_SELECT()
void SQL_SELECT::cleanup()
{
delete quick;
quick= 0;
if (free_cond)
{
free_cond=0;
delete cond;
cond= 0;
}
close_cached_file(&file);
}
SQL_SELECT::~SQL_SELECT()
{
cleanup();
}
#undef index // Fix for Unixware 7
QUICK_SELECT::QUICK_SELECT(THD *thd, TABLE *table, uint key_nr, bool no_alloc)
@ -2180,6 +2191,7 @@ check_quick_select(PARAM *param,uint idx,SEL_ARG *tree)
param->table->quick_rows[key]=records;
param->table->quick_key_parts[key]=param->max_key_part+1;
}
DBUG_PRINT("exit", ("Records: %lu", (ulong) records));
DBUG_RETURN(records);
}
@ -2532,12 +2544,7 @@ int QUICK_SELECT::get_next()
int result;
if (range)
{ // Already read through key
/* result=((range->flag & EQ_RANGE) ?
file->index_next_same(record, (byte*) range->min_key,
range->min_length) :
file->index_next(record));
*/
result=((range->flag & (EQ_RANGE | GEOM_FLAG) ) ?
result=((range->flag & (EQ_RANGE | GEOM_FLAG)) ?
file->index_next_same(record, (byte*) range->min_key,
range->min_length) :
file->index_next(record));