------------------------------------------------------------ revno: 3225 committer: kevin.lewis@oracle.com branch nick: mysql-5.5-innodb timestamp: Thu 2010-11-04 10:18:05 -0500 message: Bug57960 - In ha_innodb.cc, get_foreign_key_info() make sure the referenced_table name uses the actual length of the table name. diff: === modified file 'mysql-test/suite/innodb/r/innodb_bug57904.result' --- mysql-test/suite/innodb/r/innodb_bug57904.result revid:marko.makela@oracle.com-20101104132028-0eumhlqu5ij2ok7q +++ mysql-test/suite/innodb/r/innodb_bug57904.result revid:kevin.lewis@oracle.com-20101104151805-6ou1ilyw4jx6ym1n @@ -24,7 +24,7 @@ UPDATE_RULE CASCADE DELETE_RULE RESTRICT TABLE_NAME product_order -REFERENCED_TABLE_NAME pro +REFERENCED_TABLE_NAME product CONSTRAINT_CATALOG def CONSTRAINT_SCHEMA test CONSTRAINT_NAME product_order_ibfk_2 @@ -35,7 +35,7 @@ UPDATE_RULE RESTRICT DELETE_RULE RESTRICT TABLE_NAME product_order -REFERENCED_TABLE_NAME cus +REFERENCED_TABLE_NAME customer DROP TABLE product_order; DROP TABLE product; DROP TABLE customer; === modified file 'storage/innobase/handler/ha_innodb.cc' --- storage/innobase/handler/ha_innodb.cc revid:marko.makela@oracle.com-20101104132028-0eumhlqu5ij2ok7q +++ storage/innobase/handler/ha_innodb.cc revid:kevin.lewis@oracle.com-20101104151805-6ou1ilyw4jx6ym1n @@ -8358,7 +8358,7 @@ /* Referenced (parent) table name */ ptr = dict_remove_db_name(foreign->referenced_table_name); - len = filename_to_tablename(ptr, name_buff, sizeof(name)); + len = filename_to_tablename(ptr, name_buff, sizeof(name_buff)); f_key_info.referenced_table = thd_make_lex_string(thd, 0, name_buff, len, 1); /* Dependent (child) database name */