diff options
author | unknown <bar@mysql.com/bar.intranet.mysql.r18.ru> | 2006-11-30 11:08:23 +0400 |
---|---|---|
committer | unknown <bar@mysql.com/bar.intranet.mysql.r18.ru> | 2006-11-30 11:08:23 +0400 |
commit | fa46c80340e13c76bcab21d2eef9b5dd8f539a7e (patch) | |
tree | 7902bcc87fa67d48bce0393ddefb24a8af1bef62 /sql | |
parent | d553728bfbf4ea4cbdf0532326c4873f4cdcae78 (diff) | |
download | mariadb-git-fa46c80340e13c76bcab21d2eef9b5dd8f539a7e.tar.gz |
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.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_acl.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 724cf88d373..be5591ce3d7 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1498,7 +1498,7 @@ bool change_password(THD *thd, const char *host, const char *user, { 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)); |