Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
79078167
Commit
79078167
authored
Dec 19, 2018
by
Sachin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-17753 ALTER USER fail to replicate
Change mysql_alter_user to log alter user command.
parent
7331c661
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
0 deletions
+28
-0
mysql-test/suite/rpl/r/rpl_user.result
mysql-test/suite/rpl/r/rpl_user.result
+11
-0
mysql-test/suite/rpl/t/rpl_user.test
mysql-test/suite/rpl/t/rpl_user.test
+11
-0
sql/sql_acl.cc
sql/sql_acl.cc
+6
-0
No files found.
mysql-test/suite/rpl/r/rpl_user.result
View file @
79078167
...
...
@@ -31,6 +31,13 @@ Host User
fakehost barbar
fakehost foofoo
connection master;
alter user 'foofoo'@'fakehost' identified by 'foo';
alter user 'non_exist_user1'@'fakehost' identified by 'foo', 'barbar'@'fakehost' identified by 'bar';
ERROR HY000: Operation ALTER USER failed for 'non_exist_user1'@'fakehost'
alter user 'non_exist_user1'@'fakehost' identified by 'foo', 'non_exist_user2'@'fakehost' identified by 'bar';
ERROR HY000: Operation ALTER USER failed for 'non_exist_user1'@'fakehost','non_exist_user2'@'fakehost'
connection slave;
connection master;
drop user 'foofoo'@'fakehost';
drop user 'not_exist_user1'@'fakehost', 'barbar'@'fakehost';
ERROR HY000: Operation DROP USER failed for 'not_exist_user1'@'fakehost'
...
...
@@ -51,6 +58,10 @@ master-bin.000001 # Query # # use `test`; rename user 'foo'@'fakehost' to 'foofo
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; rename user 'not_exist_user1'@'fakehost' to 'foobar'@'fakehost', 'bar'@'fakehost' to 'barbar'@'fakehost'
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; alter user 'foofoo'@'fakehost' identified by 'foo'
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; alter user 'non_exist_user1'@'fakehost' identified by 'foo', 'barbar'@'fakehost' identified by 'bar'
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; drop user 'foofoo'@'fakehost'
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; drop user 'not_exist_user1'@'fakehost', 'barbar'@'fakehost'
...
...
mysql-test/suite/rpl/t/rpl_user.test
View file @
79078167
...
...
@@ -41,6 +41,17 @@ rename user 'not_exist_user1'@'fakehost' to 'foobar'@'fakehost', 'not_exist_user
sync_slave_with_master
;
select
Host
,
User
from
mysql
.
user
where
Host
=
'fakehost'
;
#
# Test alter user
#
connection
master
;
alter
user
'foofoo'
@
'fakehost'
identified
by
'foo'
;
--
error
ER_CANNOT_USER
alter
user
'non_exist_user1'
@
'fakehost'
identified
by
'foo'
,
'barbar'
@
'fakehost'
identified
by
'bar'
;
--
error
ER_CANNOT_USER
alter
user
'non_exist_user1'
@
'fakehost'
identified
by
'foo'
,
'non_exist_user2'
@
'fakehost'
identified
by
'bar'
;
sync_slave_with_master
;
#
# Test drop user
#
...
...
sql/sql_acl.cc
View file @
79078167
...
...
@@ -10478,6 +10478,7 @@ int mysql_alter_user(THD* thd, List<LEX_USER> &users_list)
DBUG_ENTER
(
"mysql_alter_user"
);
int
result
=
0
;
String
wrong_users
;
bool
some_users_altered
=
false
;
/* The only table we're altering is the user table. */
Grant_tables
tables
(
Table_user
,
TL_WRITE
);
...
...
@@ -10503,6 +10504,7 @@ int mysql_alter_user(THD* thd, List<LEX_USER> &users_list)
result
=
TRUE
;
continue
;
}
some_users_altered
=
true
;
}
/* Unlock ACL data structures. */
...
...
@@ -10527,6 +10529,10 @@ int mysql_alter_user(THD* thd, List<LEX_USER> &users_list)
wrong_users
.
c_ptr_safe
());
}
}
if
(
some_users_altered
)
result
|=
write_bin_log
(
thd
,
FALSE
,
thd
->
query
(),
thd
->
query_length
());
DBUG_RETURN
(
result
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment