--source include/have_ndb.inc # Bug#34626727 Password for stored user is expired on remote SQL nodes # when the password is not set CREATE USER t346; GRANT NDB_STORED_USER ON *.* TO t346; SELECT password_expired FROM mysql.user WHERE USER = 't346'; connect(mysqld2,127.0.0.1,root,,test,$MASTER_MYPORT1); --echo server 2: SELECT password_expired FROM mysql.user WHERE USER = 't346'; connection default; # Bug#33172887 password_last_changed is geting updated on sql node restart # for user with NDB_STORED_USER privilege --disable_result_log --disable_query_log # Create a stored user CREATE USER t331@localhost IDENTIFIED BY "i_did_not_change_my_password"; GRANT NDB_STORED_USER ON *.* to "t331"@"localhost"; # Check the password mod time let $mt1=`SELECT password_last_changed from mysql.user WHERE User = "t331"`; # Restart the server --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.1.expect --enable_reconnect --shutdown_server --source include/wait_until_connected_again.inc # Check the password mod time again let $mt2=`SELECT password_last_changed from mysql.user WHERE User = "t331"`; # It should not have changed since the first time assert ($mt1 == $mt2); --enable_query_log --enable_result_log --result_format 2 ## When a MySQL server starts up, it has to catch up on all the changes ## to NDB stored users as recorded in the ndb_sql_metadata table. The snapshots ## in the table include the output of SHOW CREATE USER. If the local result ## from SHOW CREATE USER is identical to the one stored in the snapshot, it ## can mark a user as synchronized without touching their password_last_changed ## timestamp. ## ## We are going to record some output from SHOW CREATE USER in the result file ## here, so that this test will fail whenever that output changes. Any time ## that output changes from one release to the next we should respond, either ## by writing code that expects the change, or by writing a release note to ## tell users that upgrading will cause password timestamps to get bumped. set print_identified_with_as_hex = true; replace_regex /0x[0123456789ABCDEF]*/'0x_hashed_password_'/ /AS '.*'/AS 'encrypted_password'/; query_vertical SHOW CREATE USER t331@localhost; set print_identified_with_as_hex = false; ## Cleanup DROP USER t346; DROP USER t331@localhost;