diff options
author | unknown <marko@hundin.mysql.fi> | 2005-04-12 16:12:34 +0300 |
---|---|---|
committer | unknown <marko@hundin.mysql.fi> | 2005-04-12 16:12:34 +0300 |
commit | dec90f5b36f3977849009031fcd6b1891c08a884 (patch) | |
tree | ec3a9f371d8bab7dc419ea679440283c202ffb34 /innobase/dict/dict0load.c | |
parent | 3fcbdd761c99a83fd48330d4e141fc3d59d53ab2 (diff) | |
download | mariadb-git-dec90f5b36f3977849009031fcd6b1891c08a884.tar.gz |
InnoDB: Ignore character set mismatch in ALTER TABLE and RENAME TABLE
if foreign_key_checks=0. (Bug #9802)
innobase/dict/dict0dict.c:
dict_foreign_add_to_cache(): Add flag check_types.
If the flag is FALSE, ignore character set mismatch.
innobase/dict/dict0load.c:
dict_load_foreign(), dict_load_foreigns(): Add flag check_types.
If the flag is FALSE, differences in character sets will be ignored.
innobase/include/dict0dict.h:
dict_foreign_add_to_cache(): Add flag check_types.
If the flag is FALSE, differences in character sets will be ignored.
innobase/include/dict0load.h:
dict_load_foreigns(): Add flag check_types.
If the flag is FALSE, differences in character sets will be ignored.
innobase/row/row0mysql.c:
row_table_add_foreign_constraints(), row_rename_table_for_mysql():
Pass trx->check_foreigns to dict_load_foreigns()
sql/ha_innodb.cc:
ha_innobase::rename_table(): Clear trx->check_foreign if necessary.
Diffstat (limited to 'innobase/dict/dict0load.c')
-rw-r--r-- | innobase/dict/dict0load.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/innobase/dict/dict0load.c b/innobase/dict/dict0load.c index e5aafcad2c2..0d58823a2ea 100644 --- a/innobase/dict/dict0load.c +++ b/innobase/dict/dict0load.c @@ -873,7 +873,7 @@ dict_load_table( dict_load_indexes(table, heap); - err = dict_load_foreigns(table->name); + err = dict_load_foreigns(table->name, TRUE); /* if (err != DB_SUCCESS) { @@ -1092,8 +1092,9 @@ ulint dict_load_foreign( /*==============*/ /* out: DB_SUCCESS or error code */ - const char* id) /* in: foreign constraint id as a + const char* id, /* in: foreign constraint id as a null-terminated string */ + ibool check_types)/* in: TRUE=check type compatibility */ { dict_foreign_t* foreign; dict_table_t* sys_foreign; @@ -1105,7 +1106,6 @@ dict_load_foreign( rec_t* rec; byte* field; ulint len; - ulint err; mtr_t mtr; #ifdef UNIV_SYNC_DEBUG @@ -1205,9 +1205,7 @@ dict_load_foreign( a new foreign key constraint but loading one from the data dictionary. */ - err = dict_foreign_add_to_cache(foreign); - - return(err); + return(dict_foreign_add_to_cache(foreign, check_types)); } /*************************************************************************** @@ -1221,7 +1219,8 @@ ulint dict_load_foreigns( /*===============*/ /* out: DB_SUCCESS or error code */ - const char* table_name) /* in: table name */ + const char* table_name, /* in: table name */ + ibool check_types) /* in: TRUE=check type compatibility */ { btr_pcur_t pcur; mem_heap_t* heap; @@ -1320,7 +1319,7 @@ loop: /* Load the foreign constraint definition to the dictionary cache */ - err = dict_load_foreign(id); + err = dict_load_foreign(id, check_types); if (err != DB_SUCCESS) { btr_pcur_close(&pcur); |