From d37fafee410d2c2f52d92b2e3fc059647969c17a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 30 Nov 2006 11:08:23 +0400 Subject: 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: Adding test case mysql-test/t/rpl_do_grant.test: Adding test case sql/sql_acl.cc: Using single quotes instead of double quotes, not to fails when sql_mode=ANSI_QUOTES. --- mysql-test/t/rpl_do_grant.test | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'mysql-test/t/rpl_do_grant.test') diff --git a/mysql-test/t/rpl_do_grant.test b/mysql-test/t/rpl_do_grant.test index 54287a67657..4a9c1554630 100644 --- a/mysql-test/t/rpl_do_grant.test +++ b/mysql-test/t/rpl_do_grant.test @@ -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'; -- cgit v1.2.1