diff options
author | Sergei Golubchik <sergii@pisem.net> | 2014-12-19 11:35:44 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2014-12-19 11:35:44 +0100 |
commit | a978bdda1e2de35c79e432f026869e163657a263 (patch) | |
tree | 73e36b02fe3b8515c1f05bf4d43ecfa0bbf7c420 /sql/sql_table.cc | |
parent | 724dbaabc0d06c4446417eb217d8536f193461f9 (diff) | |
parent | 0773c7f422c426e5693fc901df9999092e56aef3 (diff) | |
download | mariadb-git-a978bdda1e2de35c79e432f026869e163657a263.tar.gz |
mysql-5.5.41 merge
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r-- | sql/sql_table.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 9a0a64151d5..77dbc765809 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -6246,6 +6246,18 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, } /* + If foreign key is added then check permission to access parent table. + + In function "check_fk_parent_table_access", create_info->db_type is used + to identify whether engine supports FK constraint or not. Since + create_info->db_type is set here, check to parent table access is delayed + till this point for the alter operation. + */ + if ((alter_info->flags & ALTER_FOREIGN_KEY) && + check_fk_parent_table_access(thd, create_info, alter_info)) + goto err; + + /* If this is an ALTER TABLE and no explicit row type specified reuse the table's row type. Note: this is the same as if the row type was specified explicitly and |