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

Removed init that crashed BDB

Fixed newly introduced bug in update


BitKeeper/etc/ignore:
  Added libmysql_r/conf_to_src to the ignore list
sql/filesort.cc:
  Removed init that crashed BDB
sql/ha_berkeley.cc:
  Fixed bug in sub AUTO_INCREMENT keys in BDB tables
sql/opt_range.cc:
  Cleanup
sql/sql_update.cc:
  Fixed newly introduced bug in update
This commit is contained in:
unknown
2000-12-11 02:31:09 +02:00
parent 71c02e7646
commit 011f8d0a7d
5 changed files with 23 additions and 25 deletions

View File

@ -20,6 +20,8 @@
#include "mysql_priv.h"
#include "sql_acl.h"
#define MAX_ULONG_BIT ((ulong) 1 << (sizeof(ulong)*8-1));
/* Return 0 if row hasn't changed */
static bool compare_record(TABLE *table)
@ -76,15 +78,11 @@ int mysql_update(THD *thd,TABLE_LIST *table_list,List<Item> &fields,
table->timestamp_field->query_id == thd->query_id)
table->time_stamp=0;
/* Reset the query_id string so that ->used_keys is based on the WHERE */
/* Change query_id so that ->used_keys is based on the WHERE */
table->used_keys=table->keys_in_use;
table->quick_keys=0;
reg2 Item *item;
List_iterator<Item> it(fields);
ulong query_id=thd->query_id-1;
while ((item=it++))
((Item_field*) item)->field->query_id=query_id;
ulong query_id=thd->query_id;
thd->query_id^= MAX_ULONG_BIT;
if (setup_fields(thd,table_list,values,0,0) ||
setup_conds(thd,table_list,&conds))
{
@ -92,6 +90,13 @@ int mysql_update(THD *thd,TABLE_LIST *table_list,List<Item> &fields,
DBUG_RETURN(-1); /* purecov: inspected */
}
old_used_keys=table->used_keys;
/* Restore query_id for compare_record */
thd->query_id=query_id;
List_iterator<Item> it(fields);
Item *item;
while ((item=it++))
((Item_field*) item)->field->query_id=query_id;
// Don't count on usage of 'only index' when calculating which key to use
table->used_keys=0;
select=make_select(table,0,0,conds,&error);