init_connect.test 814 Bytes
Newer Older
gluh@gluh.mysql.r18.ru's avatar
gluh@gluh.mysql.r18.ru committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#
# Test of init_connect variable
#

connect (con0,localhost,root,,);
connection con0;
select hex(@a);
connect (con1,localhost,user_1,,);
connection con1;
select hex(@a);
connection con0;
set global init_connect="set @a=2;set @b=3";
connect (con2,localhost,user_1,,);
connection con2;
select @a, @b;
connection con0;
set GLOBAL init_connect=DEFAULT;
connect (con3,localhost,user_1,,);
connection con3;
select @a;
connection con0;
22
set global init_connect="drop table if exists t1; create table t1(a char(10));\
gluh@gluh.mysql.r18.ru's avatar
gluh@gluh.mysql.r18.ru committed
23 24 25 26 27 28 29 30
insert into t1 values ('\0');insert into t1 values('abc')";
connect (con4,localhost,user_1,,);
connection con4;
select hex(a) from t1;
connection con0;
set GLOBAL init_connect="adsfsdfsdfs";
connect (con5,localhost,user_1,,);
connection con5;
31
--error 2013,2006
gluh@gluh.mysql.r18.ru's avatar
gluh@gluh.mysql.r18.ru committed
32 33 34
select @a;
connection con0;
drop table t1;