summaryrefslogtreecommitdiff
path: root/sql/key.cc
diff options
context:
space:
mode:
authorunknown <monty@narttu.mysql.fi>2003-03-18 03:19:20 +0200
committerunknown <monty@narttu.mysql.fi>2003-03-18 03:19:20 +0200
commit21b0873a3ce5ee079b120199eb0423bdcff78c22 (patch)
treeda8cf393b1fa3a8b2096289ccb606a372e734759 /sql/key.cc
parent53bb7b6801d19a275933b4ec8308823699c30fbd (diff)
parentcf97cbd1db762c443aa3c1412f3e788559aaa5dd (diff)
downloadmariadb-git-21b0873a3ce5ee079b120199eb0423bdcff78c22.tar.gz
Merge with 3.23 to get fix for halloween problem on Update of InnoDB tables
innobase/row/row0mysql.c: Auto merged innobase/row/row0sel.c: Auto merged sql/key.cc: Auto merged configure.in: Merge with 3.23 mysql-test/r/innodb.result: Merge with 3.23 mysql-test/t/innodb.test: Merge with 3.23 strings/strto.c: Merge with 3.23
Diffstat (limited to 'sql/key.cc')
-rw-r--r--sql/key.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/sql/key.cc b/sql/key.cc
index d103c07eb72..8520dee215e 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;
}