diff options
Diffstat (limited to 'mysql-test/main/connect.test')
-rw-r--r-- | mysql-test/main/connect.test | 38 |
1 files changed, 8 insertions, 30 deletions
diff --git a/mysql-test/main/connect.test b/mysql-test/main/connect.test index 560f29e840d..b0461a5afac 100644 --- a/mysql-test/main/connect.test +++ b/mysql-test/main/connect.test @@ -14,10 +14,6 @@ SET global secure_auth=0; ---disable_warnings -drop table if exists t1,t2; ---enable_warnings - #connect (con1,localhost,root,,""); #show tables; connect (con1,localhost,root,,mysql); @@ -66,8 +62,8 @@ connect (fail_con,localhost,test,zorro,test2); connect (fail_con,localhost,test,zorro,); # check if old password version also works -select user,host,password,plugin,authentication_string from mysql.user where user='test'; -update mysql.user set password=old_password("gambling2") where user=_binary"test"; +source include/switch_to_mysql_user.inc; +update mysql.user set plugin="", authentication_string="", password=old_password("gambling2") where user=_binary"test"; flush privileges; show grants for test@localhost; update mysql.user set plugin='mysql_old_password' where user='test'; @@ -76,7 +72,6 @@ show grants for test@localhost; connect (con10,localhost,test,gambling2,); connect (con5,localhost,test,gambling2,mysql); -connection con5; set password=""; --error ER_PASSWD_LENGTH set password='gambling3'; @@ -103,17 +98,15 @@ connect (fail_con,localhost,test,zorro,test2); --error ER_ACCESS_DENIED_ERROR connect (fail_con,localhost,test,zorro,); - +source include/switch_to_mysql_global_priv.inc; # remove user 'test' so that other tests which may use 'test' # do not depend on this test. delete from mysql.user where user=_binary"test"; -flush privileges; # # Bug#12517 Clear user variables and replication events before # closing temp tables in thread cleanup. connect (con7,localhost,root,,test); -connection con7; let $connection_id= `select connection_id()`; create table t1 (id integer not null auto_increment primary key); create temporary table t2(id integer not null auto_increment primary key); @@ -316,11 +309,9 @@ SET GLOBAL event_scheduler = OFF; # Test connections to the extra port. connect(extracon,127.0.0.1,root,,test,$MASTER_EXTRA_PORT,); -connection extracon; SELECT 'Connection on extra port ok'; connect(extracon2,127.0.0.1,root,,test,$MASTER_EXTRA_PORT,); -connection extracon2; SELECT 'Connection on extra port 2 ok'; --disable_abort_on_error @@ -351,7 +342,6 @@ GRANT ALL ON test.* TO 'O1234567890123456789012345678901234567890123456789012345 FLUSH PRIVILEGES; ---replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT connect (con1,localhost,O1234567890123456789012345678901234567890123456789012345678901234567890123456789x,test123,test); disconnect con1; @@ -382,18 +372,14 @@ CREATE USER mysqltest_up2 IDENTIFIED VIA mysql_old_password using '09301740536db --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT --error ER_ACCESS_DENIED_ERROR connect(pcon1,localhost,mysqltest_up1,foo,,$MASTER_MYPORT,); ---replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT connect(pcon2,localhost,mysqltest_up1,bar,,$MASTER_MYPORT,); -connection pcon2; select user(), current_user(); disconnect pcon2; --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT --error ER_ACCESS_DENIED_ERROR connect(pcon3,localhost,mysqltest_up2,newpw,,$MASTER_MYPORT,); ---replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT connect(pcon4,localhost,mysqltest_up2,oldpw,,$MASTER_MYPORT,); -connection pcon4; select user(), current_user(); disconnect pcon4; @@ -417,34 +403,32 @@ connection default; # # cannot connect when password is set and plugin=mysql_native_password # +source include/switch_to_mysql_user.inc; update mysql.user set plugin='mysql_native_password' where user = 'mysqltest_up1'; update mysql.user set plugin='mysql_old_password' where user = 'mysqltest_up2'; select user, password, plugin, authentication_string from mysql.user where user like 'mysqltest_up_'; -flush privileges; +flush privileges; ---replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT connect(pcon6,localhost,mysqltest_up1,bar,,$MASTER_MYPORT,); -connection pcon6; select user(), current_user(); disconnect pcon6; ---replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT connect(pcon7,localhost,mysqltest_up2,oldpw,,$MASTER_MYPORT,); -connection pcon7; select user(), current_user(); disconnect pcon7; connection default; +source include/switch_to_mysql_global_priv.inc; + DROP USER mysqltest_up1@'%'; DROP USER mysqltest_up2@'%'; # Wait till all disconnects are completed --source include/wait_until_count_sessions.inc - --echo # ---echo # BUG#1010351: New "via" keyword in 5.2+ can't be used as identifier anymore +--echo # BUG#1010351: New "via" keyword in 5.2+ can't be used as identifier anymore --echo # create table t1 (via int); alter table t1 add key(via); @@ -454,10 +438,6 @@ create table t1 (col1 int); alter table t1 add via int not null; drop table t1; ---disable_warnings -drop procedure if exists p1; ---enable_warnings - delimiter |; create procedure p1(x int) foo: loop @@ -472,6 +452,4 @@ delimiter ;| call p1(2); drop procedure p1; - - SET global secure_auth=default; |