Below is the list of changes that have just been committed into a local
5.0 repository of bar. When bar does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2006-11-30 11:08:23+04:00, bar@stripped +3 -0
Bug#24158 SET PASSWORD in binary log fails under ANSI_QUOTES
Problem: ``SET PASSWORD FOR foo@localhost'' was written into
binary log using double quites: ``SET PASSWORD FOR "foo"@"localhost"...''.
If sql_mode was set to ANSI_QUOTES, parser on slave considered
"foo" and "localhost" as identifiers instead of strigns constants,
so it failed to parse, generated syntax error and slave then stopped.
Fix: changing binary log entries to use single quotes:
``SET PASSWORD FOR 'foo'@'localhost'...'' not to depend on ANSI_QUOTES.
mysql-test/r/rpl_do_grant.result@stripped, 2006-11-30 11:08:11+04:00, bar@stripped +11 -0
Adding test case
mysql-test/t/rpl_do_grant.test@stripped, 2006-11-30 11:08:11+04:00, bar@stripped +16 -0
Adding test case
sql/sql_acl.cc@stripped, 2006-11-30 11:08:11+04:00, bar@stripped +1 -1
Using single quotes instead of double quotes,
not to fails when sql_mode=ANSI_QUOTES.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: bar
# Host: bar.intranet.mysql.r18.ru
# Root: /usr/home/bar/mysql-5.0.b24158
--- 1.212/sql/sql_acl.cc 2006-11-30 11:08:33 +04:00
+++ 1.213/sql/sql_acl.cc 2006-11-30 11:08:33 +04:00
@@ -1498,7 +1498,7 @@ bool change_password(THD *thd, const cha
{
query_length=
my_sprintf(buff,
- (buff,"SET PASSWORD FOR \"%-.120s\"@\"%-.120s\"=\"%-.120s\"",
+ (buff,"SET PASSWORD FOR '%-.120s'@'%-.120s'='%-.120s'",
acl_user->user ? acl_user->user : "",
acl_user->host.hostname ? acl_user->host.hostname : "",
new_password));
--- 1.4/mysql-test/r/rpl_do_grant.result 2006-11-30 11:08:34 +04:00
+++ 1.5/mysql-test/r/rpl_do_grant.result 2006-11-30 11:08:34 +04:00
@@ -20,6 +20,17 @@ set password for rpl_do_grant@localhost=
select password<>_binary'' from mysql.user where user=_binary'rpl_do_grant';
password<>_binary''
1
+update mysql.user set password='' where user='rpl_do_grant';
+flush privileges;
+select password<>'' from mysql.user where user='rpl_do_grant';
+password<>''
+0
+set sql_mode='ANSI_QUOTES';
+set password for rpl_do_grant@localhost=password('does it work?');
+set sql_mode='';
+select password<>'' from mysql.user where user='rpl_do_grant';
+password<>''
+1
delete from mysql.user where user=_binary'rpl_do_grant';
delete from mysql.db where user=_binary'rpl_do_grant';
flush privileges;
--- 1.5/mysql-test/t/rpl_do_grant.test 2006-11-30 11:08:34 +04:00
+++ 1.6/mysql-test/t/rpl_do_grant.test 2006-11-30 11:08:34 +04:00
@@ -33,6 +33,22 @@ connection slave;
sync_with_master;
select password<>_binary'' from mysql.user where user=_binary'rpl_do_grant';
+#
+# Bug#24158 SET PASSWORD in binary log fails under ANSI_QUOTES
+#
+connection master;
+update mysql.user set password='' where user='rpl_do_grant';
+flush privileges;
+select password<>'' from mysql.user where user='rpl_do_grant';
+set sql_mode='ANSI_QUOTES';
+set password for rpl_do_grant@localhost=password('does it work?');
+set sql_mode='';
+save_master_pos;
+connection slave;
+sync_with_master;
+select password<>'' from mysql.user where user='rpl_do_grant';
+
+
# clear what we have done, to not influence other tests.
connection master;
delete from mysql.user where user=_binary'rpl_do_grant';
| Thread |
|---|
| • bk commit into 5.0 tree (bar:1.2310) BUG#24158 | bar | 30 Nov |