Current Path : /home/usr.opt/mysql57/mysql-test/t/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : /home/usr.opt/mysql57/mysql-test/t/mysql_upgrade_with_session_user.test |
# ==== Purpose ==== # # This test intends to test that the MySQL upgrade process will create the # default user for the server session service. # If such a user already exists we test to see if it has the valid privileges # # ==== Implementation ==== # # 1) Delete the user. See that MySQL upgrade re-creates it # 2) Remove the user Super privileges, The MySQL upgrade process errors out. # 3) Remove the user Select privileges on performance schema. Again an error # 4) Clean up # # ==== References ==== # # Bug#25642343: THE SERVER SHOULD HAVE A DEFAULT USER FOR THE SERVER SESION SERVICE # -- source include/no_valgrind_without_big.inc -- source include/mysql_upgrade_preparation.inc let $date_to_restore=`SELECT password_last_changed from mysql.user where user='mysql.session'`; let $date_to_restore_priv=`SELECT timestamp from mysql.tables_priv where user='mysql.session'`; --echo # --echo # Delete the user --echo # Check that upgrade recreates it --echo # DELETE FROM mysql.user WHERE user='mysql.session'; --echo Run mysql_upgrade --exec $MYSQL_UPGRADE --skip-verbose --force 2>&1 --let $assert_text= The session user should exist after upgrade --let $assert_cond= "[SELECT COUNT(*) FROM mysql.user WHERE user=\'mysql.session\']" = 1 --source include/assert.inc --echo # --echo # Change some user privileges, making it invalid --echo # # No super privileges UPDATE mysql.user SET Super_priv ='N' WHERE USER= 'mysql.session'; --echo Run mysql_upgrade --error 5 --exec $MYSQL_UPGRADE --skip-verbose --force 2>&1 UPDATE mysql.user SET Super_priv ='Y' WHERE USER= 'mysql.session'; # No privileges on performance schema UPDATE mysql.tables_priv SET Table_priv ='' WHERE USER= 'mysql.session'; --echo Run mysql_upgrade --error 5 --exec $MYSQL_UPGRADE --skip-verbose --force 2>&1 --echo # --echo # Clean up --echo # UPDATE mysql.tables_priv SET Table_priv ='Select' WHERE USER= 'mysql.session'; --disable_query_log ONCE --eval UPDATE mysql.tables_priv SET timestamp ='$date_to_restore_priv' WHERE USER= 'mysql.session' --disable_query_log ONCE --eval UPDATE mysql.user SET password_last_changed= '$date_to_restore' WHERE USER= 'mysql.session' --source include/mysql_upgrade_cleanup.inc --echo --echo End of tests