diff options
author | unknown <monty@narttu.mysql.fi> | 2003-03-18 02:51:16 +0200 |
---|---|---|
committer | unknown <monty@narttu.mysql.fi> | 2003-03-18 02:51:16 +0200 |
commit | cf97cbd1db762c443aa3c1412f3e788559aaa5dd (patch) | |
tree | 56e522f3b2b2b8377449166173697dc2e9f1e7ff /sql/key.cc | |
parent | d5292ebfb668db3832ab8808ca5d594a3728de0b (diff) | |
download | mariadb-git-cf97cbd1db762c443aa3c1412f3e788559aaa5dd.tar.gz |
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
Diffstat (limited to 'sql/key.cc')
-rw-r--r-- | sql/key.cc | 8 |
1 files changed, 8 insertions, 0 deletions
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<Item> &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; } |