diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-04-19 12:50:16 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-04-19 12:50:16 +0200 |
commit | b9b3d5330adf00f40e099ab079a0b0be1bcb8875 (patch) | |
tree | e49ca2008eb2b36a30e269b86f4a300bfe97fdc5 /sql/handler.cc | |
parent | 4d78392be5649d06c8d1c6b57c9e4ec95b84df5f (diff) | |
download | mariadb-git-b9b3d5330adf00f40e099ab079a0b0be1bcb8875.tar.gz |
MDEV-260 auditing table accesses
Diffstat (limited to 'sql/handler.cc')
-rw-r--r-- | sql/handler.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sql/handler.cc b/sql/handler.cc index a4505b807c2..355226b0e25 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -43,6 +43,7 @@ #include "myisam.h" #include "probes_mysql.h" #include "debug_sync.h" // DEBUG_SYNC +#include "sql_audit.h" #ifdef WITH_PARTITION_STORAGE_ENGINE #include "ha_partition.h" @@ -3689,7 +3690,6 @@ int handler::ha_delete_table(const char *name) { mark_trx_read_write(); - return delete_table(name); } @@ -3722,8 +3722,11 @@ int handler::ha_create(const char *name, TABLE *form, HA_CREATE_INFO *info) { mark_trx_read_write(); - - return create(name, form, info); + int error= create(name, form, info); + if (!error && + !(info->options & (HA_LEX_CREATE_TMP_TABLE | HA_CREATE_TMP_ALTER))) + mysql_audit_create_table(form); + return error; } @@ -5099,7 +5102,11 @@ int handler::ha_external_lock(THD *thd, int lock_type) int error= external_lock(thd, lock_type); if (error == 0) + { cached_table_flags= table_flags(); + if (table_share->tmp_table == NO_TMP_TABLE) + mysql_audit_external_lock(thd, table_share, lock_type); + } if (MYSQL_HANDLER_RDLOCK_DONE_ENABLED() || MYSQL_HANDLER_WRLOCK_DONE_ENABLED() || |