From 85de222334f89a95bb60554b537d84c3bdc5a627 Mon Sep 17 00:00:00 2001 From: "monty@narttu.mysql.fi" <> Date: Tue, 18 Mar 2003 02:51:16 +0200 Subject: Fix of 'halloween bug' with UPDATE of InnoDB tables. --- 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