1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-9142 :Adding Constraint with no database reference

results in ERROR 1046 (3D000) at line 13: No database selected.

Use database from create table to foreign key database if
nothing else is given.
This commit is contained in:
Jan Lindström
2016-04-07 10:47:46 +03:00
parent 0ea4c73dae
commit 19e3597e0c
5 changed files with 113 additions and 7 deletions

View File

@@ -6305,7 +6305,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
till this point for the alter operation.
*/
if ((alter_info->flags & ALTER_FOREIGN_KEY) &&
check_fk_parent_table_access(thd, create_info, alter_info))
check_fk_parent_table_access(thd, create_info, alter_info, new_db))
goto err;
/*