Commit 3e1c743d authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-7656 init_file option does not allow changing passwords

allow SET PASSWORD from  bootstrap and init-file
parent e257b8b9
create user foo@localhost;
select user,host,password from mysql.user where user='foo';
user host password
foo localhost
select user,host,password from mysql.user where user='foo';
user host password
foo localhost *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29
drop user foo@localhost;
#
# MDEV-7656 init_file option does not allow changing passwords
#
--source include/not_embedded.inc
create user foo@localhost;
select user,host,password from mysql.user where user='foo';
--write_file $MYSQLTEST_VARDIR/init.file
grant all on *.* to foo@localhost identified by 'test';
EOF
--enable_reconnect
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server 10
--source include/wait_until_disconnected.inc
--exec echo "restart:--init-file=$MYSQLTEST_VARDIR/init.file " > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--source include/wait_until_connected_again.inc
select user,host,password from mysql.user where user='foo';
drop user foo@localhost;
......@@ -2558,7 +2558,8 @@ int check_change_password(THD *thd, const char *host, const char *user,
my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--skip-grant-tables");
return(1);
}
if (!thd->slave_thread && !thd->security_ctx->priv_user[0])
if (!thd->slave_thread && !thd->security_ctx->priv_user[0] &&
!in_bootstrap)
{
my_message(ER_PASSWORD_ANONYMOUS_USER, ER(ER_PASSWORD_ANONYMOUS_USER),
MYF(0));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment