From cf97cbd1db762c443aa3c1412f3e788559aaa5dd Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 18 Mar 2003 02:51:16 +0200 Subject: Fix of 'halloween bug' with UPDATE of InnoDB tables. mysql-test/r/innodb.result: Test of 'halloween bug' mysql-test/t/innodb.test: Test of 'halloween bug' strings/strto.c: Portability fix --- sql/key.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sql/key.cc') diff --git a/sql/key.cc b/sql/key.cc index f2488ab74cb..9f5379487c3 100644 --- a/sql/key.cc +++ b/sql/key.cc @@ -269,5 +269,13 @@ bool check_if_key_used(TABLE *table, uint idx, List &fields) return 1; } } + + /* + If table handler has primary key as part of the index, check that primary + key is not updated + */ + if (idx != table->primary_key && table->primary_key < MAX_KEY && + (table->file->option_flag() & HA_PRIMARY_KEY_IN_READ_INDEX)) + return check_if_key_used(table, table->primary_key, fields); return 0; } -- cgit v1.2.1 From f45236de394523115dfd160a00a42072b6536fc0 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 19 Mar 2003 00:45:44 +0200 Subject: Allow optimzation of multi-table-update also for InnoDB tables MEMORY is alias for HEAP for CREATE TABLE ... TYPE=HEAP Fixed bug in multi-table-update where a row could be updated several times mysql-test/r/heap.result: Test of CREATE TABLE ... type=MEMORY mysql-test/r/innodb.result: Added multi-update-test mysql-test/r/multi_update.result: Added multi-update-test mysql-test/t/heap.test: Test of CREATE TABLE ... type=MEMORY mysql-test/t/innodb.test: Added multi-update-test mysql-test/t/multi_update.test: Added multi-update-test sql/ha_innodb.h: Allow optimzation of multi-table-update also for InnoDB tables sql/handler.h: Allow optimzation of multi-update also for InnoDB tables sql/key.cc: After merge fix sql/lex.h: MEMORY is alias for HEAP sql/sql_test.cc: Fixed wrong printf sql/sql_update.cc: Fixed bug in multi-table-update where a row could be updated several times sql/sql_yacc.yy: MEMORY is alias for HEAP --- sql/key.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/key.cc') diff --git a/sql/key.cc b/sql/key.cc index 8520dee215e..809c5a164b9 100644 --- a/sql/key.cc +++ b/sql/key.cc @@ -275,7 +275,7 @@ bool check_if_key_used(TABLE *table, uint idx, List &fields) key is not updated */ if (idx != table->primary_key && table->primary_key < MAX_KEY && - (table->file->option_flag() & HA_PRIMARY_KEY_IN_READ_INDEX)) + (table->file->table_flags() & HA_PRIMARY_KEY_IN_READ_INDEX)) return check_if_key_used(table, table->primary_key, fields); return 0; } -- cgit v1.2.1