File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -5273,6 +5273,26 @@ innobase_update_foreign_cache(
5273
5273
DICT_ERR_IGNORE_NONE,
5274
5274
fk_tables);
5275
5275
5276
+ if (err == DB_CANNOT_ADD_CONSTRAINT) {
5277
+ /* It is possible there are existing foreign key are
5278
+ loaded with "foreign_key checks" off,
5279
+ so let's retry the loading with charset_check is off */
5280
+ err = dict_load_foreigns (user_table->name ,
5281
+ ctx->col_names , false , false ,
5282
+ DICT_ERR_IGNORE_NONE,
5283
+ fk_tables);
5284
+
5285
+ /* The load with "charset_check" off is successful, warn
5286
+ the user that the foreign key has loaded with mis-matched
5287
+ charset */
5288
+ if (err == DB_SUCCESS) {
5289
+ ib_logf (IB_LOG_LEVEL_WARN,
5290
+ " Foreign key constraints for table '%s'"
5291
+ " are loaded with charset check off" ,
5292
+ user_table->name );
5293
+ }
5294
+ }
5295
+
5276
5296
ut_ad (fk_tables.empty ());
5277
5297
5278
5298
DBUG_RETURN (err);
You can’t perform that action at this time.
0 commit comments