~ignacio-nin/percona-server/5.1-issue26684

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
# name       : innodb_swap_builtin_plugin.patch
# introduced : 11 or before
# maintainer : Yasufumi
#
#!!! notice !!!
# Any small change to this file in the main branch
# should be done or reviewed by the maintainer!
diff -ruN a/configure b/configure
--- a/configure	2010-04-06 23:13:20.000000000 +0900
+++ b/configure	2010-04-28 19:12:59.000000000 +0900
@@ -2056,13 +2056,13 @@
    === InnoDB Storage Engine ===
   Plugin Name:      innobase
   Description:      Transactional Tables using InnoDB
-  Supports build:   static and dynamic
+  Supports build:   dynamic
   Configurations:   max, max-no-ndb
 
    === InnoDB Storage Engine ===
   Plugin Name:      innodb_plugin
   Description:      Transactional Tables using InnoDB
-  Supports build:   dynamic
+  Supports build:   static and dynamic
   Configurations:   max, max-no-ndb
 
    === MyISAM Storage Engine ===
@@ -42172,7 +42172,8 @@
 
 
 
-      mysql_plugin_innobase=yes
+      { $as_echo "$as_me:$LINENO: WARNING: InnoDB Storage Engine can only be built as a plugin" >&5
+$as_echo "$as_me: WARNING: InnoDB Storage Engine can only be built as a plugin" >&2;}
 
 
 
@@ -42184,8 +42185,7 @@
 
 
 
-      { $as_echo "$as_me:$LINENO: WARNING: InnoDB Storage Engine can only be built as a plugin" >&5
-$as_echo "$as_me: WARNING: InnoDB Storage Engine can only be built as a plugin" >&2;}
+      mysql_plugin_innodb_plugin=yes
 
 
 
@@ -43473,7 +43473,7 @@
     { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
   else
-
+    with_plugin_innobase=''
     if test "X$mysql_plugin_innobase" != Xyes -a \
             "X$with_plugin_innobase" != Xyes; then
 
@@ -43499,20 +43499,11 @@
     else
 
 
-
-         mysql_use_plugin_dir="storage/innobase"
-         mysql_plugin_libs="$mysql_plugin_libs \$(top_builddir)/storage/innobase/libinnobase.a"
-
-
-
-        cat >>confdefs.h <<\_ACEOF
-#define WITH_INNOBASE_STORAGE_ENGINE 1
-_ACEOF
-
-
-       plugin_innobase_static_target="libinnobase.a"
-
-       plugin_innobase_shared_target=""
+        { $as_echo "$as_me:$LINENO: result: error" >&5
+$as_echo "error" >&6; }
+        { { $as_echo "$as_me:$LINENO: error: Plugin innobase does not support static linking" >&5
+$as_echo "$as_me: error: Plugin innobase does not support static linking" >&2;}
+   { (exit 1); exit 1; }; }
 
 
       mysql_plugin_defs="$mysql_plugin_defs, builtin_innobase_plugin"
@@ -43600,7 +43591,7 @@
     { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
   else
-    with_plugin_innodb_plugin=''
+
     if test "X$mysql_plugin_innodb_plugin" != Xyes -a \
             "X$with_plugin_innodb_plugin" != Xyes; then
 
@@ -43626,11 +43617,20 @@
     else
 
 
-        { $as_echo "$as_me:$LINENO: result: error" >&5
-$as_echo "error" >&6; }
-        { { $as_echo "$as_me:$LINENO: error: Plugin innodb_plugin does not support static linking" >&5
-$as_echo "$as_me: error: Plugin innodb_plugin does not support static linking" >&2;}
-   { (exit 1); exit 1; }; }
+
+         mysql_use_plugin_dir="storage/innodb_plugin"
+         mysql_plugin_libs="$mysql_plugin_libs \$(top_builddir)/storage/innodb_plugin/libinnobase.a"
+
+
+
+        cat >>confdefs.h <<\_ACEOF
+#define WITH_INNODB_PLUGIN_STORAGE_ENGINE 1
+_ACEOF
+
+
+       plugin_innodb_plugin_static_target="libinnobase.a"
+
+       plugin_innodb_plugin_shared_target=""
 
 
       mysql_plugin_defs="$mysql_plugin_defs, builtin_innodb_plugin_plugin"
diff -ruN a/mysql-test/include/have_innodb_plugin.inc b/mysql-test/include/have_innodb_plugin.inc
--- a/mysql-test/include/have_innodb_plugin.inc	2010-05-07 00:59:10.000000000 +0900
+++ b/mysql-test/include/have_innodb_plugin.inc	2010-05-25 18:12:49.000000000 +0900
@@ -1,5 +1,5 @@
 --source include/not_embedded.inc
 disable_query_log;
 --require r/true.require
-SELECT (plugin_library LIKE 'ha_innodb_plugin%') AS `TRUE` FROM information_schema.plugins WHERE LOWER(plugin_name) = 'innodb' AND LOWER(plugin_status) = 'active';
+select (support = 'YES' or support = 'DEFAULT' or support = 'ENABLED') as `TRUE` from information_schema.engines where engine = 'innodb';
 enable_query_log;
diff -ruN a/mysql-test/include/read_many_rows.inc b/mysql-test/include/read_many_rows.inc
--- a/mysql-test/include/read_many_rows.inc	2010-04-06 23:37:12.000000000 +0900
+++ b/mysql-test/include/read_many_rows.inc	2010-05-18 15:39:02.000000000 +0900
@@ -112,8 +112,12 @@
 insert into t1 values(1);
 
 connection con2;
---error 1213
+#InnoDB Plugin treats this situation as "timeout" not "deadlock"
+#So, we need to rollback
+#--error 1213
+--error 1205
 reap;
+rollback;
 select @a;
 # check that the whole transaction was rolled back
 select * from t2;
@@ -134,6 +138,9 @@
 
 connection con2;
 reap;
+#InnoDB Plugin treats this situation as "timeout" not "deadlock"
+#So, we need to rollback
+rollback;
 select @a,@b;
 # check that the whole transaction was rolled back
 select * from t2;
@@ -155,6 +162,9 @@
 
 connection con2;
 reap;
+#InnoDB Plugin treats this situation as "timeout" not "deadlock"
+#So, we need to rollback
+rollback;
 # check that the whole transaction was rolled back
 select * from t2;
 
diff -ruN a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm
--- a/mysql-test/lib/mtr_cases.pm	2010-07-09 21:34:53.000000000 +0900
+++ b/mysql-test/lib/mtr_cases.pm	2010-07-26 21:23:05.378120605 +0900
@@ -944,7 +944,7 @@
     push(@{$tinfo->{'slave_opt'}}, "--loose-federated");
   }
 
-  if ( $tinfo->{'innodb_test'} )
+  if ( $tinfo->{'innodb_test'} || $tinfo->{'innodb_plugin_test'} )
   {
     # This is a test that needs innodb
     if ( $::mysqld_variables{'innodb'} eq "OFF" ||
@@ -956,36 +956,6 @@
       return $tinfo;
     }
   }
-  elsif ( $tinfo->{'innodb_plugin_test'} )
-  {
-    # This is a test that needs the innodb plugin
-    if (!&find_innodb_plugin)
-    {
-      # innodb plugin is not supported, skip it
-      $tinfo->{'skip'}= 1;
-      $tinfo->{'comment'}= "No innodb plugin support";
-      return $tinfo;
-    }
-
-    my $sep= (IS_WINDOWS) ? ';' : ':';
-    my $plugin_filename= basename($lib_innodb_plugin);
-    my $plugin_list=
-      "innodb=$plugin_filename$sep" .
-      "innodb_trx=$plugin_filename$sep" .
-      "innodb_locks=$plugin_filename$sep" .
-      "innodb_lock_waits=$plugin_filename$sep" .
-      "innodb_cmp=$plugin_filename$sep" .
-      "innodb_cmp_reset=$plugin_filename$sep" .
-      "innodb_cmpmem=$plugin_filename$sep" .
-      "innodb_cmpmem_reset=$plugin_filename";
-
-    foreach my $k ('master_opt', 'slave_opt') 
-    {
-      push(@{$tinfo->{$k}}, '--ignore-builtin-innodb');
-      push(@{$tinfo->{$k}}, '--plugin-dir=' . dirname($lib_innodb_plugin));
-      push(@{$tinfo->{$k}}, "--plugin-load=$plugin_list");
-    }
-  }
   else
   {
     push(@{$tinfo->{'master_opt'}}, "--loose-skip-innodb");
diff -ruN a/mysql-test/r/read_many_rows_innodb.result b/mysql-test/r/read_many_rows_innodb.result
--- a/mysql-test/r/read_many_rows_innodb.result	2010-04-06 23:36:58.000000000 +0900
+++ b/mysql-test/r/read_many_rows_innodb.result	2010-05-18 15:39:24.000000000 +0900
@@ -64,7 +64,8 @@
 insert into t2 values(123);
 insert into t1 values(1);
 insert into t1 values(1);
-ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+rollback;
 select @a;
 @a
 NULL
@@ -77,9 +78,10 @@
 insert into t2 values(123);
 call proc24989();
 insert into t1 values(1);
+rollback;
 select @a,@b;
 @a	@b
-exception	deadlock
+exception	NULL
 select * from t2;
 f2
 commit;
@@ -90,10 +92,9 @@
 call proc24989_2();
 insert into t1 values(1);
 commit;
-exception
-Outer handler
 continued
 continued
+rollback;
 select * from t2;
 f2
 drop procedure proc24989;
diff -ruN a/storage/innobase/plug.in b/storage/innobase/plug.in
--- a/storage/innobase/plug.in	2010-04-06 23:07:11.000000000 +0900
+++ b/storage/innobase/plug.in	2010-04-28 19:12:59.000000000 +0900
@@ -1,7 +1,6 @@
 MYSQL_STORAGE_ENGINE(innobase, innodb, [InnoDB Storage Engine],
         [Transactional Tables using InnoDB], [max,max-no-ndb])
 MYSQL_PLUGIN_DIRECTORY(innobase, [storage/innobase])
-MYSQL_PLUGIN_STATIC(innobase,   [libinnobase.a])
 MYSQL_PLUGIN_DYNAMIC(innobase,  [ha_innodb.la])
 MYSQL_PLUGIN_ACTIONS(innobase,  [
   AC_CHECK_LIB(rt, aio_read, [innodb_system_libs="-lrt"])
diff -ruN a/storage/innodb_plugin/plug.in b/storage/innodb_plugin/plug.in
--- a/storage/innodb_plugin/plug.in	2010-04-06 23:07:14.000000000 +0900
+++ b/storage/innodb_plugin/plug.in	2010-04-28 19:12:59.000000000 +0900
@@ -19,7 +19,7 @@
 MYSQL_PLUGIN_DIRECTORY(innodb_plugin, [storage/innodb_plugin])
 # Enable if you know what you are doing (trying to link both InnoDB and
 # InnoDB Plugin statically into MySQL does not work).
-#MYSQL_PLUGIN_STATIC(innodb_plugin, [libinnobase.a])
+MYSQL_PLUGIN_STATIC(innodb_plugin,   [libinnobase.a])
 MYSQL_PLUGIN_DYNAMIC(innodb_plugin,  [ha_innodb_plugin.la])
 MYSQL_PLUGIN_ACTIONS(innodb_plugin,  [
   AC_CHECK_HEADERS(sched.h)