mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / mysql-test / t / plugin.test
blob788a7b336ef513fd8388fad4fec2feab2e3256dc
1 --source include/not_windows_embedded.inc
2 --source include/have_example_plugin.inc
4 CREATE TABLE t1(a int) ENGINE=EXAMPLE;
5 DROP TABLE t1;
7 --replace_regex /\.dll/.so/
8 eval INSTALL PLUGIN example SONAME $HA_EXAMPLE_SO;
9 --replace_regex /\.dll/.so/
10 --error 1125
11 eval INSTALL PLUGIN EXAMPLE SONAME $HA_EXAMPLE_SO;
13 UNINSTALL PLUGIN example;
15 --replace_regex /\.dll/.so/
16 eval INSTALL PLUGIN example SONAME $HA_EXAMPLE_SO;
18 CREATE TABLE t1(a int) ENGINE=EXAMPLE;
20 # Let's do some advanced ops with the example engine :)
21 SELECT * FROM t1;
23 DROP TABLE t1;
25 UNINSTALL PLUGIN example;
26 --error 1305
27 UNINSTALL PLUGIN EXAMPLE;
29 --error 1305
30 UNINSTALL PLUGIN non_exist;
33 --echo #
34 --echo # Bug#32034: check_func_enum() does not check correct values but set it
35 --echo #            to impossible int val
36 --echo #
37 --replace_regex /\.dll/.so/
38 eval INSTALL PLUGIN example SONAME $HA_EXAMPLE_SO;
40 SET GLOBAL example_enum_var= e1;
41 SET GLOBAL example_enum_var= e2;
42 --error 1231
43 SET GLOBAL example_enum_var= impossible;
45 UNINSTALL PLUGIN example;
50 # Bug #32757 hang with sql_mode set when setting some global variables
52 --replace_regex /\.dll/.so/
53 eval INSTALL PLUGIN example SONAME $HA_EXAMPLE_SO;
55 select @@session.sql_mode into @old_sql_mode;
57 # first, try normal sql_mode (no error, send OK)
58 set session sql_mode='';
59 set global example_ulong_var=500;
60 select @@global.example_ulong_var;
61 # overflow -- correct value, but throw warning
62 set global example_ulong_var=1111;
63 select @@global.example_ulong_var;
65 # now, try STRICT (error occurrs, no message is sent, so send default)
66 set session sql_mode='STRICT_ALL_TABLES';
67 set global example_ulong_var=500;
68 select @@global.example_ulong_var;
69 # overflow -- throw warning, do NOT change value
70 --error ER_WRONG_VALUE_FOR_VAR
71 set global example_ulong_var=1111;
72 select @@global.example_ulong_var;
74 set session sql_mode=@old_sql_mode;
76 # finally, show that conditions that already raised an error are not
77 # adversely affected (error was already sent, do nothing)
78 --error ER_INCORRECT_GLOBAL_LOCAL_VAR
79 set session old=bla;
81 UNINSTALL PLUGIN example;