summaryrefslogtreecommitdiff
path: root/sql/sql_acl.cc
diff options
context:
space:
mode:
authorunknown <cmiller@zippy.cornsilk.net>2006-10-11 16:49:59 -0400
committerunknown <cmiller@zippy.cornsilk.net>2006-10-11 16:49:59 -0400
commit21e525c5aea5618387ad968e878b7aef076b0747 (patch)
treebe0a74988ae2a39ac3c1d5faddb39b5954a3e0fb /sql/sql_acl.cc
parent247f85f7edc611e4659c2378492fd4474f08f0f6 (diff)
parent25393e391be033a1f32b11f4ea1405f427930725 (diff)
downloadmariadb-git-21e525c5aea5618387ad968e878b7aef076b0747.tar.gz
Merge zippy.cornsilk.net:/home/cmiller/work/mysql/bug14262/my50-bug14262
into zippy.cornsilk.net:/home/cmiller/work/mysql/bug14262/my51 BitKeeper/deleted/.del-collapsed~66d21d0d6c19df3d: Delete: BitKeeper/etc/collapsed BitKeeper/etc/collapsed: 'Auto converge' sql/sp.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_db.cc: Auto merged sql/sql_trigger.cc: Auto merged sql/sql_view.h: Auto merged sql/sql_parse.cc: Manual merge. sql/sql_table.cc: Manual merge. sql/sql_view.cc: Manual merge. vio/viosocket.c: Manual merge.
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r--sql/sql_acl.cc67
1 files changed, 66 insertions, 1 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index c55fc744cd0..66e07c8cf46 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -3140,9 +3140,22 @@ bool mysql_table_grant(THD *thd, TABLE_LIST *table_list,
grant_option=TRUE;
thd->mem_root= old_root;
pthread_mutex_unlock(&acl_cache->lock);
+
+ if (!result) /* success */
+ {
+ if (mysql_bin_log.is_open())
+ {
+ thd->clear_error();
+ Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE);
+ mysql_bin_log.write(&qinfo);
+ }
+ }
+
rw_unlock(&LOCK_grant);
- if (!result)
+
+ if (!result) /* success */
send_ok(thd);
+
/* Tables are automatically closed */
DBUG_RETURN(result);
}
@@ -3294,9 +3307,21 @@ bool mysql_routine_grant(THD *thd, TABLE_LIST *table_list, bool is_proc,
grant_option=TRUE;
thd->mem_root= old_root;
pthread_mutex_unlock(&acl_cache->lock);
+ if (!result && !no_error)
+ {
+ if (mysql_bin_log.is_open())
+ {
+ thd->clear_error();
+ Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE);
+ mysql_bin_log.write(&qinfo);
+ }
+ }
+
rw_unlock(&LOCK_grant);
+
if (!result && !no_error)
send_ok(thd);
+
/* Tables are automatically closed */
DBUG_RETURN(result);
}
@@ -3394,11 +3419,23 @@ bool mysql_grant(THD *thd, const char *db, List <LEX_USER> &list,
}
}
VOID(pthread_mutex_unlock(&acl_cache->lock));
+
+ if (!result)
+ {
+ if (mysql_bin_log.is_open())
+ {
+ thd->clear_error();
+ Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE);
+ mysql_bin_log.write(&qinfo);
+ }
+ }
+
rw_unlock(&LOCK_grant);
close_thread_tables(thd);
if (!result)
send_ok(thd);
+
DBUG_RETURN(result);
}
@@ -5398,6 +5435,13 @@ bool mysql_create_user(THD *thd, List <LEX_USER> &list)
}
VOID(pthread_mutex_unlock(&acl_cache->lock));
+
+ if (mysql_bin_log.is_open())
+ {
+ Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE);
+ mysql_bin_log.write(&qinfo);
+ }
+
rw_unlock(&LOCK_grant);
close_thread_tables(thd);
if (result)
@@ -5454,6 +5498,13 @@ bool mysql_drop_user(THD *thd, List <LEX_USER> &list)
rebuild_check_host();
VOID(pthread_mutex_unlock(&acl_cache->lock));
+
+ if (mysql_bin_log.is_open())
+ {
+ Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE);
+ mysql_bin_log.write(&qinfo);
+ }
+
rw_unlock(&LOCK_grant);
close_thread_tables(thd);
if (result)
@@ -5523,6 +5574,13 @@ bool mysql_rename_user(THD *thd, List <LEX_USER> &list)
rebuild_check_host();
VOID(pthread_mutex_unlock(&acl_cache->lock));
+
+ if (mysql_bin_log.is_open())
+ {
+ Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE);
+ mysql_bin_log.write(&qinfo);
+ }
+
rw_unlock(&LOCK_grant);
close_thread_tables(thd);
if (result)
@@ -5697,6 +5755,13 @@ bool mysql_revoke_all(THD *thd, List <LEX_USER> &list)
}
VOID(pthread_mutex_unlock(&acl_cache->lock));
+
+ if (mysql_bin_log.is_open())
+ {
+ Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE);
+ mysql_bin_log.write(&qinfo);
+ }
+
rw_unlock(&LOCK_grant);
close_thread_tables(thd);