mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / mysql-test / r / init_connect.result
blob0ff6c2064228f68e81bd06bb9fa36f028eb46337
1 select hex(@a);
2 hex(@a)
3 NULL
4 select hex(@a);
5 hex(@a)
6 610063
7 set global init_connect="set @a=2;set @b=3";
8 select @a, @b;
9 @a      @b
10 2       3
11 set GLOBAL init_connect=DEFAULT;
12 select @a;
14 NULL
15 set global init_connect="drop table if exists t1; create table t1(a char(10));\
16 insert into t1 values ('\0');insert into t1 values('abc')";
17 select hex(a) from t1;
18 hex(a)
20 616263
21 set GLOBAL init_connect="adsfsdfsdfs";
22 select @a;
23 ERROR 08S01: Aborted connection to db: 'test' user: 'user_1' host: 'localhost' (init_connect command failed)
24 select @a;
25 Got one of the listed errors
26 drop table t1;
27 End of 4.1 tests
28 create table t1 (x int);
29 insert into t1 values (3), (5), (7);
30 create table t2 (y int);
31 create user mysqltest1@localhost;
32 grant all privileges on test.* to mysqltest1@localhost;
33 set global init_connect="create procedure p1() select * from t1";
34 call p1();
39 drop procedure p1;
40 set global init_connect="create procedure p1(x int)\
41 begin\
42   select count(*) from t1;\
43   select * from t1;\
44   set @x = x;
45 end";
46 call p1(42);
47 count(*)
53 select @x;
56 set global init_connect="call p1(4711)";
57 select @x;
59 4711
60 set global init_connect="drop procedure if exists p1";
61 call p1();
62 ERROR 42000: PROCEDURE test.p1 does not exist
63 create procedure p1(out sum int)
64 begin
65 declare n int default 0;
66 declare c cursor for select * from t1;
67 declare exit handler for not found
68 begin
69 close c;
70 set sum = n;
71 end;
72 open c;
73 loop
74 begin
75 declare x int;
76 fetch c into x;
77 if x > 3 then
78 set n = n + x;
79 end if;
80 end;
81 end loop;
82 end|
83 set global init_connect="call p1(@sum)";
84 select @sum;
85 @sum
87 drop procedure p1;
88 create procedure p1(tbl char(10), v int)
89 begin
90 set @s = concat('insert into ', tbl, ' values (?)');
91 set @v = v;
92 prepare stmt1 from @s;
93 execute stmt1 using @v;
94 deallocate prepare stmt1;
95 end|
96 set global init_connect="call p1('t1', 11)";
97 select * from t1;
103 drop procedure p1;
104 create function f1() returns int
105 begin
106 declare n int;
107 select count(*) into n from t1;
108 return n;
109 end|
110 set global init_connect="set @x = f1()";
111 select @x;
114 set global init_connect="create view v1 as select f1()";
115 select * from v1;
116 f1()
118 set global init_connect="drop view v1";
119 select * from v1;
120 ERROR 42S02: Table 'test.v1' doesn't exist
121 drop function f1;
122 create trigger trg1
123 after insert on t2
124 for each row
125 insert into t1 values (new.y);
126 set global init_connect="insert into t2 values (13), (17), (19)";
127 select * from t1;
136 drop trigger trg1;
137 set global init_connect="set @a='a\\0c'";
138 revoke all privileges, grant option from mysqltest1@localhost;
139 drop user mysqltest1@localhost;
140 drop table t1, t2;