summaryrefslogtreecommitdiff
path: root/storage/innobase
diff options
context:
space:
mode:
authorPraveenkumar Hulakund <praveenkumar.hulakund@oracle.com>2014-09-10 10:50:17 +0530
committerPraveenkumar Hulakund <praveenkumar.hulakund@oracle.com>2014-09-10 10:50:17 +0530
commitcf4231a7f9760e62f93a323300488ff74e23b530 (patch)
tree30cf43b20d190a1bb22d76c54f0792dff5ce877f /storage/innobase
parent958695b144655d84d405bec3d0bb769a2a84a056 (diff)
downloadmariadb-git-cf4231a7f9760e62f93a323300488ff74e23b530.tar.gz
Bug#18790730 - CROSS-DATABASE FOREIGN KEY WITHOUT PERMISSIONS
CHECK. Analysis: ---------- Issue here is, while creating or altering the InnoDB table, if the foreign key defined on the table references a parent table on which the user has no access privileges then the table is created without reporting any error. Currently the privilege level REFERENCES_ACL is unused and is not used for access evaluation while creating the table with a foreign key constraint or adding the foreign key constraint to a table. But when no privileges are granted to user then also access evaluation on parent table is ignored. Fix: --------- For DMLs, irrelevant of the fact, support does not want any changes to avoid permission checks on every operation. So, as a fix, added a function "check_fk_parent_table_access" to check whether any of the SELECT_ACL, INSERT_ACL, UDPATE_ACL, DELETE_ACL or REFERENCE_ACL privileges are granted for user at table level. If none of them is granted then error is reported. This function is called during the table creation and alter operation.
Diffstat (limited to 'storage/innobase')
-rw-r--r--storage/innobase/handler/ha_innodb.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index adedc4fa961..8f299aed213 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -2251,7 +2251,7 @@ innobase_init(
innobase_hton->start_consistent_snapshot=innobase_start_trx_and_assign_read_view;
innobase_hton->flush_logs=innobase_flush_logs;
innobase_hton->show_status=innobase_show_status;
- innobase_hton->flags=HTON_NO_FLAGS;
+ innobase_hton->flags=HTON_SUPPORTS_FOREIGN_KEYS;
innobase_hton->release_temporary_latches=innobase_release_temporary_latches;
innobase_hton->alter_table_flags = innobase_alter_table_flags;