Merge lp:~percona-dev/percona-xtradb/fix-bug547230-bug548442 into lp:~percona-dev/percona-xtradb/extensions-1.0.6

Proposed by Yasufumi Kinoshita
Status: Merged
Approved by: Vadim Tkachenko
Approved revision: 154
Merged at revision: not available
Proposed branch: lp:~percona-dev/percona-xtradb/fix-bug547230-bug548442
Merge into: lp:~percona-dev/percona-xtradb/extensions-1.0.6
Diff against target: 676 lines (+151/-63)
14 files modified
innodb_1.0.6_fix.patch (+2/-2)
innodb_adjust_defaults.patch (+5/-5)
innodb_admin_command_base.patch (+2/-2)
innodb_extend_slow.patch (+1/-1)
innodb_fast_checksum.patch (+2/-2)
innodb_files_extend.patch (+3/-3)
innodb_lru_dump_restore.patch (+1/-1)
innodb_pass_corrupt_table.patch (+20/-20)
innodb_purge_thread.patch (+2/-2)
innodb_recovery_patches.patch (+2/-2)
innodb_relax_table_creation.patch (+2/-2)
innodb_show_lock_name.patch (+2/-2)
innodb_show_sys_tables.patch (+2/-2)
innodb_stats.patch (+105/-17)
To merge this branch: bzr merge lp:~percona-dev/percona-xtradb/fix-bug547230-bug548442
Reviewer Review Type Date Requested Status
Vadim Tkachenko Approve
Review via email: mp+22206@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Vadim Tkachenko (vadim-tk) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'innodb_1.0.6_fix.patch'
2--- innodb_1.0.6_fix.patch 2010-03-18 02:11:14 +0000
3+++ innodb_1.0.6_fix.patch 2010-03-26 10:04:29 +0000
4@@ -60,7 +60,7 @@
5 | HA_ONLINE_DROP_UNIQUE_INDEX_NO_WRITES
6 | HA_ONLINE_ADD_PK_INDEX_NO_WRITES);
7 }
8-@@ -4798,24 +4768,29 @@
9+@@ -4802,24 +4772,29 @@
10 update the table upper limit. Note: last_value
11 will be 0 if get_auto_increment() was not called.*/
12
13@@ -107,7 +107,7 @@
14 }
15 }
16 break;
17-@@ -9840,6 +9815,20 @@
18+@@ -9857,6 +9832,20 @@
19 return(COMPATIBLE_DATA_NO);
20 }
21
22
23=== modified file 'innodb_adjust_defaults.patch'
24--- innodb_adjust_defaults.patch 2010-03-18 02:11:14 +0000
25+++ innodb_adjust_defaults.patch 2010-03-26 10:04:29 +0000
26@@ -1,7 +1,7 @@
27 diff -ruN innodb_plugin-1.0.6_orig/handler/ha_innodb.cc innodb_plugin-1.0.6_tmp/handler/ha_innodb.cc
28 --- innodb_plugin-1.0.6_orig/handler/ha_innodb.cc 2010-03-01 12:19:14.000000000 +0900
29 +++ innodb_plugin-1.0.6_tmp/handler/ha_innodb.cc 2010-03-01 12:19:56.000000000 +0900
30-@@ -10346,7 +10346,7 @@
31+@@ -10363,7 +10363,7 @@
32 static MYSQL_SYSVAR_BOOL(fast_recovery, innobase_fast_recovery,
33 PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
34 "Enable to use speed hack of recovery avoiding flush list sorting.",
35@@ -10,7 +10,7 @@
36
37 static MYSQL_SYSVAR_BOOL(recovery_stats, innobase_recovery_stats,
38 PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
39-@@ -10356,7 +10356,7 @@
40+@@ -10373,7 +10373,7 @@
41 static MYSQL_SYSVAR_ULONG(use_purge_thread, srv_use_purge_thread,
42 PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
43 "Number of purge devoted threads. #### over 1 is EXPERIMENTAL ####",
44@@ -19,7 +19,7 @@
45
46 static MYSQL_SYSVAR_BOOL(overwrite_relay_log_info, innobase_overwrite_relay_log_info,
47 PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
48-@@ -10456,7 +10456,7 @@
49+@@ -10473,7 +10473,7 @@
50 static MYSQL_SYSVAR_BOOL(adaptive_flushing, srv_adaptive_flushing,
51 PLUGIN_VAR_NOCMDARG,
52 "Attempt flushing dirty pages to avoid IO bursts at checkpoints.",
53@@ -28,7 +28,7 @@
54
55 static MYSQL_SYSVAR_ULONG(max_purge_lag, srv_max_purge_lag,
56 PLUGIN_VAR_RQCMDARG,
57-@@ -10681,7 +10681,7 @@
58+@@ -10698,7 +10698,7 @@
59 static MYSQL_SYSVAR_ULONG(ibuf_active_contract, srv_ibuf_active_contract,
60 PLUGIN_VAR_RQCMDARG,
61 "Enable/Disable active_contract of insert buffer. 0:disable 1:enable",
62@@ -37,7 +37,7 @@
63
64 static MYSQL_SYSVAR_ULONG(ibuf_accel_rate, srv_ibuf_accel_rate,
65 PLUGIN_VAR_RQCMDARG,
66-@@ -10759,8 +10759,8 @@
67+@@ -10776,8 +10776,8 @@
68 };
69 static MYSQL_SYSVAR_ENUM(adaptive_checkpoint, srv_adaptive_checkpoint,
70 PLUGIN_VAR_RQCMDARG,
71
72=== modified file 'innodb_admin_command_base.patch'
73--- innodb_admin_command_base.patch 2009-12-10 11:05:35 +0000
74+++ innodb_admin_command_base.patch 2010-03-26 10:04:29 +0000
75@@ -1,7 +1,7 @@
76 diff -ruN innodb_plugin-1.0.6_orig/handler/ha_innodb.cc innodb_plugin-1.0.6_tmp/handler/ha_innodb.cc
77 --- innodb_plugin-1.0.6_orig/handler/ha_innodb.cc 2009-12-04 14:03:58.000000000 +0900
78 +++ innodb_plugin-1.0.6_tmp/handler/ha_innodb.cc 2009-12-04 14:07:28.000000000 +0900
79-@@ -10704,6 +10704,7 @@
80+@@ -10721,6 +10721,7 @@
81 i_s_innodb_cmpmem_reset,
82 i_s_innodb_table_stats,
83 i_s_innodb_index_stats,
84@@ -12,7 +12,7 @@
85 diff -ruN innodb_plugin-1.0.6_orig/handler/i_s.cc innodb_plugin-1.0.6_tmp/handler/i_s.cc
86 --- innodb_plugin-1.0.6_orig/handler/i_s.cc 2009-12-04 12:20:43.000000000 +0900
87 +++ innodb_plugin-1.0.6_tmp/handler/i_s.cc 2009-12-04 14:07:28.000000000 +0900
88-@@ -2954,3 +2954,140 @@
89+@@ -2997,3 +2997,140 @@
90 STRUCT_FLD(system_vars, NULL),
91 STRUCT_FLD(__reserved1, NULL)
92 };
93
94=== modified file 'innodb_extend_slow.patch'
95--- innodb_extend_slow.patch 2009-12-10 11:05:35 +0000
96+++ innodb_extend_slow.patch 2010-03-26 10:04:29 +0000
97@@ -421,7 +421,7 @@
98 /*********************************************************************//**
99 Construct ha_innobase handler. */
100 UNIV_INTERN
101-@@ -8271,6 +8307,23 @@
102+@@ -8288,6 +8324,23 @@
103 statement has ended */
104
105 if (trx->n_mysql_tables_in_use == 0) {
106
107=== modified file 'innodb_fast_checksum.patch'
108--- innodb_fast_checksum.patch 2010-03-18 01:38:16 +0000
109+++ innodb_fast_checksum.patch 2010-03-26 10:04:29 +0000
110@@ -171,7 +171,7 @@
111
112 #ifdef HAVE_LARGE_PAGES
113 if ((os_use_large_pages = (ibool) my_use_large_pages))
114-@@ -10294,6 +10296,15 @@
115+@@ -10311,6 +10313,15 @@
116 "Disable with --skip-innodb-checksums.",
117 NULL, NULL, TRUE);
118
119@@ -187,7 +187,7 @@
120 static MYSQL_SYSVAR_STR(data_home_dir, innobase_data_home_dir,
121 PLUGIN_VAR_READONLY,
122 "The common part for InnoDB table spaces.",
123-@@ -10763,6 +10774,7 @@
124+@@ -10780,6 +10791,7 @@
125 MYSQL_SYSVAR(autoextend_increment),
126 MYSQL_SYSVAR(buffer_pool_size),
127 MYSQL_SYSVAR(checksums),
128
129=== modified file 'innodb_files_extend.patch'
130--- innodb_files_extend.patch 2010-03-18 02:11:14 +0000
131+++ innodb_files_extend.patch 2010-03-26 10:04:29 +0000
132@@ -118,7 +118,7 @@
133 #ifndef MYSQL_SERVER
134 innodb_overwrite_relay_log_info = FALSE;
135 #endif
136-@@ -6597,9 +6629,9 @@
137+@@ -6614,9 +6646,9 @@
138 | DICT_TF_COMPACT
139 | DICT_TF_FORMAT_ZIP
140 << DICT_TF_FORMAT_SHIFT;
141@@ -131,7 +131,7 @@
142 }
143 }
144
145-@@ -10305,6 +10337,11 @@
146+@@ -10322,6 +10354,11 @@
147 "#### Attention: The checksum is not compatible for normal or disabled version! ####",
148 NULL, NULL, FALSE);
149
150@@ -143,7 +143,7 @@
151 static MYSQL_SYSVAR_STR(data_home_dir, innobase_data_home_dir,
152 PLUGIN_VAR_READONLY,
153 "The common part for InnoDB table spaces.",
154-@@ -10770,6 +10807,7 @@
155+@@ -10787,6 +10824,7 @@
156 NULL, NULL, 0, 0, 1, 0);
157
158 static struct st_mysql_sys_var* innobase_system_variables[]= {
159
160=== modified file 'innodb_lru_dump_restore.patch'
161--- innodb_lru_dump_restore.patch 2009-12-17 02:30:01 +0000
162+++ innodb_lru_dump_restore.patch 2010-03-26 10:04:29 +0000
163@@ -325,7 +325,7 @@
164 /* from buf0buf.c */
165 struct buf_chunk_struct{
166 ulint mem_size; /* allocated size of the chunk */
167-@@ -3048,6 +3049,36 @@
168+@@ -3091,6 +3092,36 @@
169 "Hello!");
170 goto end_func;
171 }
172
173=== modified file 'innodb_pass_corrupt_table.patch'
174--- innodb_pass_corrupt_table.patch 2010-03-08 05:10:48 +0000
175+++ innodb_pass_corrupt_table.patch 2010-03-26 10:04:29 +0000
176@@ -803,7 +803,7 @@
177 if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)
178 table->timestamp_field->set_time();
179
180-@@ -4775,6 +4798,10 @@
181+@@ -4779,6 +4802,10 @@
182 func_exit:
183 innobase_active_small();
184
185@@ -814,7 +814,7 @@
186 DBUG_RETURN(error_result);
187 }
188
189-@@ -4951,6 +4978,10 @@
190+@@ -4955,6 +4982,10 @@
191
192 ha_statistic_increment(&SSV::ha_update_count);
193
194@@ -825,7 +825,7 @@
195 if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
196 table->timestamp_field->set_time();
197
198-@@ -5036,6 +5067,10 @@
199+@@ -5044,6 +5075,10 @@
200
201 innobase_active_small();
202
203@@ -836,7 +836,7 @@
204 DBUG_RETURN(error);
205 }
206
207-@@ -5057,6 +5092,10 @@
208+@@ -5065,6 +5100,10 @@
209
210 ha_statistic_increment(&SSV::ha_delete_count);
211
212@@ -847,7 +847,7 @@
213 if (!prebuilt->upd_node) {
214 row_get_prebuilt_update_vector(prebuilt);
215 }
216-@@ -5079,6 +5118,10 @@
217+@@ -5091,6 +5130,10 @@
218
219 innobase_active_small();
220
221@@ -858,7 +858,7 @@
222 DBUG_RETURN(error);
223 }
224
225-@@ -5318,6 +5361,10 @@
226+@@ -5330,6 +5373,10 @@
227
228 ha_statistic_increment(&SSV::ha_read_key_count);
229
230@@ -869,7 +869,7 @@
231 index = prebuilt->index;
232
233 if (UNIV_UNLIKELY(index == NULL)) {
234-@@ -5380,6 +5427,10 @@
235+@@ -5392,6 +5439,10 @@
236 ret = DB_UNSUPPORTED;
237 }
238
239@@ -880,7 +880,7 @@
240 switch (ret) {
241 case DB_SUCCESS:
242 error = 0;
243-@@ -5474,6 +5525,10 @@
244+@@ -5486,6 +5537,10 @@
245 {
246 DBUG_ENTER("change_active_index");
247
248@@ -891,7 +891,7 @@
249 ut_ad(user_thd == ha_thd());
250 ut_a(prebuilt->trx == thd_to_trx(user_thd));
251
252-@@ -5564,6 +5619,10 @@
253+@@ -5576,6 +5631,10 @@
254
255 DBUG_ENTER("general_fetch");
256
257@@ -902,7 +902,7 @@
258 ut_a(prebuilt->trx == thd_to_trx(user_thd));
259
260 innodb_srv_conc_enter_innodb(prebuilt->trx);
261-@@ -5573,6 +5632,10 @@
262+@@ -5585,6 +5644,10 @@
263
264 innodb_srv_conc_exit_innodb(prebuilt->trx);
265
266@@ -913,7 +913,7 @@
267 switch (ret) {
268 case DB_SUCCESS:
269 error = 0;
270-@@ -6794,6 +6857,10 @@
271+@@ -6811,6 +6874,10 @@
272 DBUG_RETURN(my_errno=HA_ERR_WRONG_COMMAND);
273 }
274
275@@ -924,7 +924,7 @@
276 /* Truncate the table in InnoDB */
277
278 error = row_truncate_table_for_mysql(prebuilt->table, prebuilt->trx);
279-@@ -6802,6 +6869,10 @@
280+@@ -6819,6 +6886,10 @@
281 goto fallback;
282 }
283
284@@ -935,7 +935,7 @@
285 error = convert_error_code_to_mysql(error, prebuilt->table->flags,
286 NULL);
287
288-@@ -7303,6 +7374,16 @@
289+@@ -7320,6 +7391,16 @@
290 return(ranges + (double) rows / (double) total_rows * time_for_scan);
291 }
292
293@@ -952,7 +952,7 @@
294 /*********************************************************************//**
295 Returns statistics information of the table to the MySQL interpreter,
296 in various fields of the handle object. */
297-@@ -7353,9 +7434,9 @@
298+@@ -7370,9 +7451,9 @@
299 ib_table = prebuilt->table;
300
301 if (flag & HA_STATUS_TIME) {
302@@ -965,7 +965,7 @@
303 /* In sql_show we call with this flag: update
304 then statistics so that they are up-to-date */
305
306-@@ -7582,6 +7663,10 @@
307+@@ -7599,6 +7680,10 @@
308 THD* thd, /*!< in: connection thread handle */
309 HA_CHECK_OPT* check_opt) /*!< in: currently ignored */
310 {
311@@ -976,7 +976,7 @@
312 /* Serialize ANALYZE TABLE inside InnoDB, see
313 Bug#38996 Race condition in ANALYZE TABLE */
314 pthread_mutex_lock(&analyze_mutex);
315-@@ -7591,6 +7676,10 @@
316+@@ -7608,6 +7693,10 @@
317
318 pthread_mutex_unlock(&analyze_mutex);
319
320@@ -987,7 +987,7 @@
321 return(0);
322 }
323
324-@@ -7636,6 +7725,10 @@
325+@@ -7653,6 +7742,10 @@
326
327 ret = row_check_table_for_mysql(prebuilt);
328
329@@ -998,7 +998,7 @@
330 switch (ret) {
331 case DB_SUCCESS:
332 return(HA_ADMIN_OK);
333-@@ -8369,6 +8462,10 @@
334+@@ -8386,6 +8479,10 @@
335
336 update_thd(thd);
337
338@@ -1009,7 +1009,7 @@
339 if (prebuilt->table->ibd_file_missing && !thd_tablespace_op(thd)) {
340 ut_print_timestamp(stderr);
341 fprintf(stderr,
342-@@ -10653,6 +10750,14 @@
343+@@ -10670,6 +10767,14 @@
344 "Relax limitation of column size at table creation as builtin InnoDB.",
345 NULL, NULL, 0, 0, 1, 0);
346
347@@ -1024,7 +1024,7 @@
348 static struct st_mysql_sys_var* innobase_system_variables[]= {
349 MYSQL_SYSVAR(additional_mem_pool_size),
350 MYSQL_SYSVAR(autoextend_increment),
351-@@ -10732,6 +10837,7 @@
352+@@ -10749,6 +10854,7 @@
353 MYSQL_SYSVAR(io_capacity),
354 MYSQL_SYSVAR(use_purge_thread),
355 MYSQL_SYSVAR(relax_table_creation),
356
357=== modified file 'innodb_purge_thread.patch'
358--- innodb_purge_thread.patch 2010-01-18 09:39:06 +0000
359+++ innodb_purge_thread.patch 2010-03-26 10:04:29 +0000
360@@ -1,7 +1,7 @@
361 diff -ruN innodb_plugin-1.0.6_orig/handler/ha_innodb.cc innodb_plugin-1.0.6_tmp/handler/ha_innodb.cc
362 --- innodb_plugin-1.0.6_orig/handler/ha_innodb.cc 2009-12-10 17:27:16.000000000 +0900
363 +++ innodb_plugin-1.0.6_tmp/handler/ha_innodb.cc 2009-12-10 17:34:06.000000000 +0900
364-@@ -10166,6 +10166,11 @@
365+@@ -10183,6 +10183,11 @@
366 "Output statistics of recovery process after it.",
367 NULL, NULL, FALSE);
368
369@@ -13,7 +13,7 @@
370 static MYSQL_SYSVAR_BOOL(overwrite_relay_log_info, innobase_overwrite_relay_log_info,
371 PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
372 "During InnoDB crash recovery on slave overwrite relay-log.info "
373-@@ -10667,6 +10672,7 @@
374+@@ -10684,6 +10689,7 @@
375 MYSQL_SYSVAR(change_buffering),
376 MYSQL_SYSVAR(read_ahead_threshold),
377 MYSQL_SYSVAR(io_capacity),
378
379=== modified file 'innodb_recovery_patches.patch'
380--- innodb_recovery_patches.patch 2009-12-14 08:56:37 +0000
381+++ innodb_recovery_patches.patch 2010-03-26 10:04:29 +0000
382@@ -116,7 +116,7 @@
383 srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite;
384 srv_use_checksums = (ibool) innobase_use_checksums;
385
386-@@ -10151,6 +10156,16 @@
387+@@ -10168,6 +10173,16 @@
388 "don't use the datafile for normal mysqld or ibbackup! ####",
389 NULL, NULL, FALSE);
390
391@@ -133,7 +133,7 @@
392 static MYSQL_SYSVAR_BOOL(overwrite_relay_log_info, innobase_overwrite_relay_log_info,
393 PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
394 "During InnoDB crash recovery on slave overwrite relay-log.info "
395-@@ -10586,6 +10601,8 @@
396+@@ -10603,6 +10618,8 @@
397 MYSQL_SYSVAR(data_home_dir),
398 MYSQL_SYSVAR(doublewrite),
399 MYSQL_SYSVAR(extra_undoslots),
400
401=== modified file 'innodb_relax_table_creation.patch'
402--- innodb_relax_table_creation.patch 2009-12-10 11:05:35 +0000
403+++ innodb_relax_table_creation.patch 2010-03-26 10:04:29 +0000
404@@ -16,7 +16,7 @@
405 diff -ruN innodb_plugin-1.0.6_orig/handler/ha_innodb.cc innodb_plugin-1.0.6_tmp/handler/ha_innodb.cc
406 --- innodb_plugin-1.0.6_orig/handler/ha_innodb.cc 2009-12-04 14:16:35.000000000 +0900
407 +++ innodb_plugin-1.0.6_tmp/handler/ha_innodb.cc 2009-12-04 14:17:22.000000000 +0900
408-@@ -10648,6 +10648,11 @@
409+@@ -10665,6 +10665,11 @@
410 "Limit the allocated memory for dictionary cache. (0: unlimited)",
411 NULL, NULL, 0, 0, LONG_MAX, 0);
412
413@@ -28,7 +28,7 @@
414 static struct st_mysql_sys_var* innobase_system_variables[]= {
415 MYSQL_SYSVAR(additional_mem_pool_size),
416 MYSQL_SYSVAR(autoextend_increment),
417-@@ -10726,6 +10731,7 @@
418+@@ -10743,6 +10748,7 @@
419 MYSQL_SYSVAR(read_ahead_threshold),
420 MYSQL_SYSVAR(io_capacity),
421 MYSQL_SYSVAR(use_purge_thread),
422
423=== modified file 'innodb_show_lock_name.patch'
424--- innodb_show_lock_name.patch 2009-12-10 11:05:35 +0000
425+++ innodb_show_lock_name.patch 2010-03-26 10:04:29 +0000
426@@ -1,7 +1,7 @@
427 diff -ruN innodb_plugin-1.0.6_orig/handler/ha_innodb.cc innodb_plugin-1.0.6_tmp/handler/ha_innodb.cc
428 --- innodb_plugin-1.0.6_orig/handler/ha_innodb.cc 2009-12-04 14:11:33.000000000 +0900
429 +++ innodb_plugin-1.0.6_tmp/handler/ha_innodb.cc 2009-12-04 14:12:07.000000000 +0900
430-@@ -8558,8 +8558,8 @@
431+@@ -8575,8 +8575,8 @@
432 rw_lock_wait_time += mutex->lspent_time;
433 }
434 #else /* UNIV_DEBUG */
435@@ -12,7 +12,7 @@
436 buf2len= (uint) my_snprintf(buf2, sizeof(buf2), "os_waits=%lu",
437 mutex->count_os_wait);
438
439-@@ -8584,8 +8584,8 @@
440+@@ -8601,8 +8601,8 @@
441 while (lock != NULL) {
442 if (lock->count_os_wait
443 && !buf_pool_is_block_lock(lock)) {
444
445=== modified file 'innodb_show_sys_tables.patch'
446--- innodb_show_sys_tables.patch 2010-03-18 03:57:02 +0000
447+++ innodb_show_sys_tables.patch 2010-03-26 10:04:29 +0000
448@@ -1,7 +1,7 @@
449 diff -r fe0d29604baa handler/ha_innodb.cc
450 --- a/handler/ha_innodb.cc Wed Mar 17 20:50:32 2010 -0700
451 +++ b/handler/ha_innodb.cc Wed Mar 17 20:54:30 2010 -0700
452-@@ -10909,6 +10909,8 @@
453+@@ -10937,6 +10937,8 @@
454 i_s_innodb_table_stats,
455 i_s_innodb_index_stats,
456 i_s_innodb_admin_command,
457@@ -21,7 +21,7 @@
458 #include "buf0lru.h" /* for XTRA_LRU_[DUMP/RESTORE] */
459 /* from buf0buf.c */
460 struct buf_chunk_struct{
461-@@ -3122,3 +3123,505 @@
462+@@ -3165,3 +3166,505 @@
463 STRUCT_FLD(system_vars, NULL),
464 STRUCT_FLD(__reserved1, NULL)
465 };
466
467=== modified file 'innodb_stats.patch'
468--- innodb_stats.patch 2010-03-01 04:28:32 +0000
469+++ innodb_stats.patch 2010-03-26 10:04:29 +0000
470@@ -425,7 +425,52 @@
471 diff -ruN innodb_plugin-1.0.6_orig/handler/ha_innodb.cc innodb_plugin-1.0.6_tmp/handler/ha_innodb.cc
472 --- innodb_plugin-1.0.6_orig/handler/ha_innodb.cc 2009-12-04 12:15:57.000000000 +0900
473 +++ innodb_plugin-1.0.6_tmp/handler/ha_innodb.cc 2009-12-04 12:16:38.000000000 +0900
474-@@ -7312,7 +7312,9 @@
475+@@ -4644,6 +4644,10 @@
476+
477+ error = row_insert_for_mysql((byte*) record, prebuilt);
478+
479++#ifdef EXTENDED_FOR_USERSTAT
480++ if (error == DB_SUCCESS) rows_changed++;
481++#endif
482++
483+ /* Handle duplicate key errors */
484+ if (auto_inc_used) {
485+ ulint err;
486+@@ -4975,6 +4979,10 @@
487+ }
488+ }
489+
490++#ifdef EXTENDED_FOR_USERSTAT
491++ if (error == DB_SUCCESS) rows_changed++;
492++#endif
493++
494+ innodb_srv_conc_exit_innodb(trx);
495+
496+ error = convert_error_code_to_mysql(error,
497+@@ -5028,6 +5036,10 @@
498+
499+ error = row_update_for_mysql((byte*) record, prebuilt);
500+
501++#ifdef EXTENDED_FOR_USERSTAT
502++ if (error == DB_SUCCESS) rows_changed++;
503++#endif
504++
505+ innodb_srv_conc_exit_innodb(trx);
506+
507+ error = convert_error_code_to_mysql(
508+@@ -5536,6 +5548,11 @@
509+ case DB_SUCCESS:
510+ error = 0;
511+ table->status = 0;
512++#ifdef EXTENDED_FOR_USERSTAT
513++ rows_read++;
514++ if (active_index >= 0 && active_index < MAX_KEY)
515++ index_rows_read[active_index]++;
516++#endif
517+ break;
518+ case DB_RECORD_NOT_FOUND:
519+ error = HA_ERR_END_OF_FILE;
520+@@ -7312,7 +7329,9 @@
521 ib_table = prebuilt->table;
522
523 if (flag & HA_STATUS_TIME) {
524@@ -436,7 +481,7 @@
525 /* In sql_show we call with this flag: update
526 then statistics so that they are up-to-date */
527
528-@@ -7394,7 +7396,7 @@
529+@@ -7394,7 +7413,7 @@
530 We do not update delete_length if no locking is requested
531 so the "old" value can remain. delete_length is initialized
532 to 0 in the ha_statistics' constructor. */
533@@ -445,7 +490,7 @@
534
535 /* lock the data dictionary to avoid races with
536 ibd_file_missing and tablespace_discarded */
537-@@ -10274,6 +10276,37 @@
538+@@ -10274,6 +10293,37 @@
539 "The number of index pages to sample when calculating statistics (default 8)",
540 NULL, NULL, 8, 1, ~0ULL, 0);
541
542@@ -483,7 +528,7 @@
543 static MYSQL_SYSVAR_BOOL(adaptive_hash_index, btr_search_enabled,
544 PLUGIN_VAR_OPCMDARG,
545 "Enable InnoDB adaptive hash index (enabled by default). "
546-@@ -10583,6 +10616,9 @@
547+@@ -10583,6 +10633,9 @@
548 MYSQL_SYSVAR(overwrite_relay_log_info),
549 MYSQL_SYSVAR(rollback_on_timeout),
550 MYSQL_SYSVAR(stats_on_metadata),
551@@ -493,7 +538,7 @@
552 MYSQL_SYSVAR(stats_sample_pages),
553 MYSQL_SYSVAR(adaptive_hash_index),
554 MYSQL_SYSVAR(replication_delay),
555-@@ -10643,6 +10679,8 @@
556+@@ -10643,6 +10696,8 @@
557 i_s_innodb_cmp_reset,
558 i_s_innodb_cmpmem,
559 i_s_innodb_cmpmem_reset,
560@@ -513,7 +558,7 @@
561 /* from buf0buf.c */
562 struct buf_chunk_struct{
563 ulint mem_size; /* allocated size of the chunk */
564-@@ -2657,3 +2658,299 @@
565+@@ -2657,3 +2658,342 @@
566 /* void* */
567 STRUCT_FLD(__reserved1, NULL)
568 };
569@@ -522,6 +567,14 @@
570 +*/
571 +static ST_FIELD_INFO i_s_innodb_table_stats_info[] =
572 +{
573++ {STRUCT_FLD(field_name, "table_schema"),
574++ STRUCT_FLD(field_length, NAME_LEN),
575++ STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
576++ STRUCT_FLD(value, 0),
577++ STRUCT_FLD(field_flags, 0),
578++ STRUCT_FLD(old_name, ""),
579++ STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
580++
581 + {STRUCT_FLD(field_name, "table_name"),
582 + STRUCT_FLD(field_length, NAME_LEN),
583 + STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
584@@ -567,6 +620,14 @@
585 +
586 +static ST_FIELD_INFO i_s_innodb_index_stats_info[] =
587 +{
588++ {STRUCT_FLD(field_name, "table_schema"),
589++ STRUCT_FLD(field_length, NAME_LEN),
590++ STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
591++ STRUCT_FLD(value, 0),
592++ STRUCT_FLD(field_flags, 0),
593++ STRUCT_FLD(old_name, ""),
594++ STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
595++
596 + {STRUCT_FLD(field_name, "table_name"),
597 + STRUCT_FLD(field_length, NAME_LEN),
598 + STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
599@@ -642,16 +703,30 @@
600 + table = UT_LIST_GET_FIRST(dict_sys->table_LRU);
601 +
602 + while (table) {
603++ char buf[NAME_LEN * 2 + 2];
604++ char* ptr;
605++
606 + if (table->stat_clustered_index_size == 0) {
607 + table = UT_LIST_GET_NEXT(table_LRU, table);
608 + continue;
609 + }
610 +
611-+ field_store_string(i_s_table->field[0], table->name);
612-+ i_s_table->field[1]->store(table->stat_n_rows);
613-+ i_s_table->field[2]->store(table->stat_clustered_index_size);
614-+ i_s_table->field[3]->store(table->stat_sum_of_other_index_sizes);
615-+ i_s_table->field[4]->store(table->stat_modified_counter);
616++ buf[NAME_LEN * 2 + 1] = 0;
617++ strncpy(buf, table->name, NAME_LEN * 2 + 1);
618++ ptr = strchr(buf, '/');
619++ if (ptr) {
620++ *ptr = '\0';
621++ ++ptr;
622++ } else {
623++ ptr = buf;
624++ }
625++
626++ field_store_string(i_s_table->field[0], buf);
627++ field_store_string(i_s_table->field[1], ptr);
628++ i_s_table->field[2]->store(table->stat_n_rows);
629++ i_s_table->field[3]->store(table->stat_clustered_index_size);
630++ i_s_table->field[4]->store(table->stat_sum_of_other_index_sizes);
631++ i_s_table->field[5]->store(table->stat_modified_counter);
632 +
633 + if (schema_table_store_record(thd, i_s_table)) {
634 + status = 1;
635@@ -707,11 +782,24 @@
636 + while (index) {
637 + char buff[256+1];
638 + char row_per_keys[256+1];
639++ char buf[NAME_LEN * 2 + 2];
640++ char* ptr;
641 + ulint i;
642 +
643-+ field_store_string(i_s_table->field[0], table->name);
644-+ field_store_string(i_s_table->field[1], index->name);
645-+ i_s_table->field[2]->store(index->n_uniq);
646++ buf[NAME_LEN * 2 + 1] = 0;
647++ strncpy(buf, table->name, NAME_LEN * 2 + 1);
648++ ptr = strchr(buf, '/');
649++ if (ptr) {
650++ *ptr = '\0';
651++ ++ptr;
652++ } else {
653++ ptr = buf;
654++ }
655++
656++ field_store_string(i_s_table->field[0], buf);
657++ field_store_string(i_s_table->field[1], ptr);
658++ field_store_string(i_s_table->field[2], index->name);
659++ i_s_table->field[3]->store(index->n_uniq);
660 +
661 + row_per_keys[0] = '\0';
662 + if (index->stat_n_diff_key_vals) {
663@@ -727,10 +815,10 @@
664 + strncat(row_per_keys, buff, 256 - strlen(row_per_keys));
665 + }
666 + }
667-+ field_store_string(i_s_table->field[3], row_per_keys);
668++ field_store_string(i_s_table->field[4], row_per_keys);
669 +
670-+ i_s_table->field[4]->store(index->stat_index_size);
671-+ i_s_table->field[5]->store(index->stat_n_leaf_pages);
672++ i_s_table->field[5]->store(index->stat_index_size);
673++ i_s_table->field[6]->store(index->stat_n_leaf_pages);
674 +
675 + if (schema_table_store_record(thd, i_s_table)) {
676 + status = 1;

Subscribers

No one subscribed via source and target branches