#At file:///data0/magnus/mysql/7.0-dist-priv/ based on revid:magnus.blaudd@strippedktc
4256 Magnus Blåudd 2011-03-21
ndb
- mark up MySQL Server part of WL#5482 with MCP tags
- refactor slightly to avoid modifying existing code.
modified:
sql/handler.h
sql/sql_acl.cc
=== modified file 'sql/handler.h'
--- a/sql/handler.h 2011-03-19 13:19:44 +0000
+++ b/sql/handler.h 2011-03-21 12:37:44 +0000
@@ -369,12 +369,14 @@ enum enum_binlog_command {
LOGCOM_DROP_TABLE,
LOGCOM_CREATE_DB,
LOGCOM_ALTER_DB,
- LOGCOM_DROP_DB,
- LOGCOM_CREATE_USER,
+ LOGCOM_DROP_DB
+#ifndef MCP_WL5482
+ , LOGCOM_CREATE_USER,
LOGCOM_DROP_USER,
LOGCOM_RENAME_USER,
LOGCOM_GRANT,
LOGCOM_REVOKE
+#endif
};
/* struct to hold information about the table that should be created */
=== modified file 'sql/sql_acl.cc'
--- a/sql/sql_acl.cc 2011-03-19 13:19:44 +0000
+++ b/sql/sql_acl.cc 2011-03-21 12:37:44 +0000
@@ -3470,9 +3470,12 @@ bool mysql_routine_grant(THD *thd, TABLE
thd->mem_root= old_root;
pthread_mutex_unlock(&acl_cache->lock);
+#ifndef MCP_WL5482
ha_binlog_log_query(thd, 0, LOGCOM_GRANT,
thd->query(), thd->query_length(),
"mysql", "user");
+#endif
+
if (write_to_binlog)
{
if (write_bin_log(thd, FALSE, thd->query(), thd->query_length()))
@@ -5824,13 +5827,15 @@ bool mysql_create_user(THD *thd, List <L
if (result)
my_error(ER_CANNOT_USER, MYF(0), "CREATE USER", wrong_users.c_ptr_safe());
+#ifndef MCP_WL5482
if (some_users_created)
- {
ha_binlog_log_query(thd, 0, LOGCOM_CREATE_USER,
thd->query(), thd->query_length(),
"mysql", "user");
+#endif
+
+ if (some_users_created)
result |= write_bin_log(thd, FALSE, thd->query(), thd->query_length());
- }
rw_unlock(&LOCK_grant);
close_thread_tables(thd);
@@ -5910,13 +5915,15 @@ bool mysql_drop_user(THD *thd, List <LEX
if (result)
my_error(ER_CANNOT_USER, MYF(0), "DROP USER", wrong_users.c_ptr_safe());
+#ifndef MCP_WL5482
if (some_users_deleted)
- {
ha_binlog_log_query(thd, 0, LOGCOM_DROP_USER,
thd->query(), thd->query_length(),
"mysql", "user");
+#endif
+
+ if (some_users_deleted)
result |= write_bin_log(thd, FALSE, thd->query(), thd->query_length());
- }
rw_unlock(&LOCK_grant);
close_thread_tables(thd);
@@ -6008,16 +6015,15 @@ bool mysql_rename_user(THD *thd, List <L
if (result)
my_error(ER_CANNOT_USER, MYF(0), "RENAME USER", wrong_users.c_ptr_safe());
+#ifndef MCP_WL5482
if (some_users_renamed)
- {
ha_binlog_log_query(thd, 0, LOGCOM_RENAME_USER,
thd->query(), thd->query_length(),
"mysql", "user");
- if (mysql_bin_log.is_open())
- {
- result |= write_bin_log(thd, FALSE, thd->query(), thd->query_length());
- }
- }
+#endif
+
+ if (some_users_renamed && mysql_bin_log.is_open())
+ result |= write_bin_log(thd, FALSE, thd->query(), thd->query_length());
rw_unlock(&LOCK_grant);
close_thread_tables(thd);
@@ -6210,9 +6216,12 @@ bool mysql_revoke_all(THD *thd, List <L
if (result)
my_message(ER_REVOKE_GRANTS, ER(ER_REVOKE_GRANTS), MYF(0));
+#ifndef MCP_WL5482
ha_binlog_log_query(thd, 0, LOGCOM_REVOKE,
thd->query(), thd->query_length(),
"mysql", "user");
+#endif
+
result= result |
write_bin_log(thd, FALSE, thd->query(), thd->query_length());
Attachment: [text/bzr-bundle] bzr/magnus.blaudd@oracle.com-20110321123744-bbuveo5bel7r30jc.bundle
| Thread |
|---|
| • bzr commit into mysql-5.1-telco-7.0 branch (magnus.blaudd:4256) WL#5482 | Magnus Blåudd | 21 Mar |