diff -pu mysql-5.1-bk/storage/innobase/handler/ha_innodb.cc mysql-5.1-bug21704/storage/innobase/handler/ha_innodb.cc --- mysql-5.1-bk/storage/innobase/handler/ha_innodb.cc 2007-12-11 16:32:09.000000000 +0200 +++ mysql-5.1-bug21704/storage/innobase/handler/ha_innodb.cc 2008-01-02 15:43:18.000000000 +0200 @@ -7865,6 +7865,15 @@ bool ha_innobase::check_if_incompatible_ return COMPATIBLE_DATA_NO; } + /* Check that columns were not renamed, because there is no + mechanism for updating column names in the InnoDB data + dictionary (and in InnoDB foreign key definitions) when + column names are updated in the MySQL data dictionary. */ + if (info->used_fields & HA_CREATE_USED_NEW_COLUMN_NAME) { + + return(COMPATIBLE_DATA_NO); + } + /* Check that auto_increment value was not changed */ if ((info->used_fields & HA_CREATE_USED_AUTO) && info->auto_increment_value != 0) { diff -pu mysql-5.1-bk/sql/handler.h mysql-5.1-bug21704/sql/handler.h --- mysql-5.1-bk/sql/handler.h 2007-12-11 16:32:09.000000000 +0200 +++ mysql-5.1-bug21704/sql/handler.h 2008-01-02 15:43:18.000000000 +0200 @@ -322,6 +322,7 @@ enum enum_binlog_command { #define HA_CREATE_USED_CONNECTION (1L << 18) #define HA_CREATE_USED_KEY_BLOCK_SIZE (1L << 19) #define HA_CREATE_USED_TRANSACTIONAL (1L << 20) +#define HA_CREATE_USED_NEW_COLUMN_NAME (1L << 21) typedef ulonglong my_xid; // this line is the same as in log_event.h #define MYSQL_XID_PREFIX "MySQLXid" diff -pu mysql-5.1-bk/sql/sql_table.cc mysql-5.1-bug21704/sql/sql_table.cc --- mysql-5.1-bk/sql/sql_table.cc 2007-12-17 14:39:54.000000000 +0200 +++ mysql-5.1-bug21704/sql/sql_table.cc 2008-01-02 15:44:32.000000000 +0200 @@ -5191,7 +5191,10 @@ compare_tables(TABLE *table, if (my_strcasecmp(system_charset_info, field->field_name, new_field->field_name)) - field->flags|= FIELD_IS_RENAMED; + { + field->flags|= FIELD_IS_RENAMED; + create_info->used_fields|= HA_CREATE_USED_NEW_COLUMN_NAME; + } /* Evaluate changes bitmap and send to check_if_incompatible_data() */ if (!(tmp= field->is_equal(new_field)))