From 99fa5361c46b5a89280bee7a81e6ebca62d0e6ba Mon Sep 17 00:00:00 2001 From: "sasha@mysql.sashanet.com" <> Date: Fri, 19 Jan 2001 12:12:45 -0700 Subject: [PATCH] fixed coredump in SET PASSWORD in slave thread. --- mysql-test/t/rpl000001.test | 2 ++ sql/sql_acl.cc | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mysql-test/t/rpl000001.test b/mysql-test/t/rpl000001.test index a26580d7ef7..c7b1f817e81 100644 --- a/mysql-test/t/rpl000001.test +++ b/mysql-test/t/rpl000001.test @@ -5,6 +5,8 @@ drop table if exists t1; create table t1 (word char(20) not null); load data infile '../../std_data/words.dat' into table t1; drop table if exists foo; +set password = password('foo'); +set password = password(''); create table foo(n int); insert into foo values(1),(2); save_master_pos; diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 85d57914c78..2317c896dfd 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -781,8 +781,8 @@ bool change_password(THD *thd, const char *host, const char *user, length=(uint) strlen(new_password); new_password[length & 16]=0; - if (!thd || strcmp(thd->user,user) || - my_strcasecmp(host,thd->host ? thd->host : thd->ip)) + if (!thd || (!thd->slave_thread && ( strcmp(thd->user,user) || + my_strcasecmp(host,thd->host ? thd->host : thd->ip)))) { if (check_access(thd, UPDATE_ACL, "mysql",0,1)) return 1;