summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorVasil Dimov <vasil.dimov@oracle.com>2011-10-25 16:48:23 +0300
committerVasil Dimov <vasil.dimov@oracle.com>2011-10-25 16:48:23 +0300
commit1af865e49fe502e1da660f57733badaa04825620 (patch)
treebcacf8db95258439dfe3dbcd8b324e3e3135dd69 /sql/handler.cc
parent484280a1fa3cc5445950eada4bd1fb79a4ba2141 (diff)
parentdce337406ea07b4581bf724133d5262fddd365f3 (diff)
downloadmariadb-git-1af865e49fe502e1da660f57733badaa04825620.tar.gz
Merge mysql-5.1-security -> mysql-5.5-security (Fix Bug#12661768)
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index 6f7cf2c3456..b6df46ed48d 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -2738,7 +2738,13 @@ void handler::print_error(int error, myf errflag)
char key[MAX_KEY_LENGTH];
String str(key,sizeof(key),system_charset_info);
/* Table is opened and defined at this point */
- key_unpack(&str,table,(uint) key_nr);
+ key_unpack(&str,table,0 /* Use 0 instead of key_nr because key_nr
+ is a key number in the child FK table, not in our 'table'. See
+ Bug#12661768 UPDATE IGNORE CRASHES SERVER IF TABLE IS INNODB
+ AND IT IS PARENT FOR OTHER ONE
+ This bug gets a better fix in MySQL 5.6, but it is too risky
+ to get that in 5.1 and 5.5 (extending the handler interface
+ and adding new error message codes */);
max_length= (MYSQL_ERRMSG_SIZE-
(uint) strlen(ER(ER_FOREIGN_DUPLICATE_KEY)));
if (str.length() >= max_length)