summaryrefslogtreecommitdiff
path: root/sql/sql_delete.cc
diff options
context:
space:
mode:
authorunknown <Sinisa@sinisa.nasamreza.org>2002-07-31 19:53:06 +0300
committerunknown <Sinisa@sinisa.nasamreza.org>2002-07-31 19:53:06 +0300
commit3e16752ebfb116f624c0d3fcf5ebe16ff0ae6b87 (patch)
treece74aa0fd7486a30df552a5a8bdae47aa1cb93d0 /sql/sql_delete.cc
parent9e65ac47ea5060ebd90832e3804b801a37155b52 (diff)
downloadmariadb-git-3e16752ebfb116f624c0d3fcf5ebe16ff0ae6b87.tar.gz
A bug with tables with different ref_length's whose order is
changed in table initialization
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r--sql/sql_delete.cc27
1 files changed, 14 insertions, 13 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 8788a1576dc..256b03bb1fa 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -215,21 +215,8 @@ multi_delete::multi_delete(THD *thd_arg, TABLE_LIST *dt,
num_of_tables(num_of_tables_arg), error(0), lock_option(lock_option_arg),
do_delete(false)
{
- uint counter=0;
not_trans_safe=false;
tempfiles = (Unique **) sql_calloc(sizeof(Unique *) * (num_of_tables-1));
-
- /* Don't use key read with MULTI-TABLE-DELETE */
- dt->table->used_keys=0;
- for (dt=dt->next ; dt ; dt=dt->next,counter++)
- {
- TABLE *table=dt->table;
- table->used_keys=0;
- tempfiles[counter] = new Unique (refposcmp2,
- (void *) &table->file->ref_length,
- table->file->ref_length,
- MEM_STRIP_BUF_SIZE);
- }
}
@@ -260,6 +247,7 @@ multi_delete::prepare(List<Item> &values)
void
multi_delete::initialize_tables(JOIN *join)
{
+ int counter=0;
TABLE_LIST *walk;
table_map tables_to_delete_from=0;
for (walk= delete_tables ; walk ; walk=walk->next)
@@ -281,6 +269,19 @@ multi_delete::initialize_tables(JOIN *join)
not_trans_safe=true;
}
}
+ walk= delete_tables;
+ walk->table->used_keys=0;
+ for (walk=walk->next ; walk ; walk=walk->next, counter++)
+ {
+ tables_to_delete_from|= walk->table->map;
+ TABLE *table=walk->table;
+ /* Don't use key read with MULTI-TABLE-DELETE */
+ table->used_keys=0;
+ tempfiles[counter] = new Unique (refposcmp2,
+ (void *) &table->file->ref_length,
+ table->file->ref_length,
+ MEM_STRIP_BUF_SIZE);
+ }
init_ftfuncs(thd,1);
}