~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to mysql-test/t/plugin.test

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--source include/not_windows_embedded.inc
 
2
--source include/have_example_plugin.inc
 
3
 
 
4
CREATE TABLE t1(a int) ENGINE=EXAMPLE;
 
5
DROP TABLE t1;
 
6
 
 
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;
 
12
 
 
13
UNINSTALL PLUGIN example;
 
14
 
 
15
--replace_regex /\.dll/.so/
 
16
eval INSTALL PLUGIN example SONAME $HA_EXAMPLE_SO;
 
17
 
 
18
CREATE TABLE t1(a int) ENGINE=EXAMPLE;
 
19
 
 
20
# Let's do some advanced ops with the example engine :)
 
21
SELECT * FROM t1;
 
22
 
 
23
DROP TABLE t1;
 
24
 
 
25
UNINSTALL PLUGIN example;
 
26
--error 1305
 
27
UNINSTALL PLUGIN EXAMPLE;
 
28
 
 
29
--error 1305
 
30
UNINSTALL PLUGIN non_exist;
 
31
 
 
32
 
 
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;
 
39
 
 
40
SET GLOBAL example_enum_var= e1;
 
41
SET GLOBAL example_enum_var= e2;
 
42
--error 1231
 
43
SET GLOBAL example_enum_var= impossible;
 
44
 
 
45
UNINSTALL PLUGIN example;
 
46
 
 
47
 
 
48
 
 
49
#
 
50
# Bug #32757 hang with sql_mode set when setting some global variables
 
51
#
 
52
--replace_regex /\.dll/.so/
 
53
eval INSTALL PLUGIN example SONAME $HA_EXAMPLE_SO;
 
54
 
 
55
select @@session.sql_mode into @old_sql_mode;
 
56
 
 
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;
 
64
 
 
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;
 
73
 
 
74
set session sql_mode=@old_sql_mode;
 
75
 
 
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;
 
80
 
 
81
UNINSTALL PLUGIN example;