From adc189aecef38fe743f73371da3b9ec229db6521 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Nov 2010 10:18:05 -0500 Subject: [PATCH] Bug57960 - In ha_innodb.cc, get_foreign_key_info() make sure the referenced_table name uses the actual length of the table name. --- mysql-test/suite/innodb/r/innodb_bug57904.result | 4 ++-- storage/innobase/handler/ha_innodb.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mysql-test/suite/innodb/r/innodb_bug57904.result b/mysql-test/suite/innodb/r/innodb_bug57904.result index c3e980a6cf4..84868dcf46b 100755 --- a/mysql-test/suite/innodb/r/innodb_bug57904.result +++ b/mysql-test/suite/innodb/r/innodb_bug57904.result @@ -24,7 +24,7 @@ MATCH_OPTION NONE 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 @@ MATCH_OPTION NONE 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; diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index ed391972a95..ee42d6c6500 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -8358,7 +8358,7 @@ get_foreign_key_info( /* 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 */