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

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