Merge lp:~percona-dev/percona-server/release-5.1.49-12-fix-bug-610525 into lp:percona-server/release-5.1.49-12

Proposed by Oleg Tsarev
Status: Merged
Approved by: Vadim Tkachenko
Approved revision: no longer in the source branch.
Merged at revision: 94
Proposed branch: lp:~percona-dev/percona-server/release-5.1.49-12-fix-bug-610525
Merge into: lp:percona-server/release-5.1.49-12
Diff against target: 931 lines (+300/-149) (has conflicts)
17 files modified
i_s_innodb_buffer_pool_pages.patch (+1/-5)
innodb_admin_command_base.patch (+2/-3)
innodb_buffer_pool_shm.patch (+1/-1)
innodb_expand_import.patch (+5/-3)
innodb_extend_slow.patch (+2/-2)
innodb_files_extend.patch (+15/-3)
innodb_io_patches.patch (+1/-1)
innodb_pass_corrupt_table.patch (+52/-1)
innodb_recovery_patches.patch (+1/-2)
innodb_separate_doublewrite.patch (+1/-5)
innodb_show_status.patch (+1/-2)
innodb_split_buf_pool_mutex.patch (+10/-5)
innodb_stats.patch (+2/-3)
mysql-test/percona_query_response_time.result (+12/-12)
response-time-distribution.patch (+2/-2)
slow_extended.patch (+170/-1)
userstat.patch (+22/-98)
Text conflict in slow_extended.patch
Text conflict in userstat.patch
To merge this branch: bzr merge lp:~percona-dev/percona-server/release-5.1.49-12-fix-bug-610525
Reviewer Review Type Date Requested Status
Percona developers Pending
Review via email: mp+32081@code.launchpad.net

This proposal supersedes a proposal from 2010-08-08.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'i_s_innodb_buffer_pool_pages.patch'
2--- i_s_innodb_buffer_pool_pages.patch 2010-07-26 16:29:05 +0000
3+++ i_s_innodb_buffer_pool_pages.patch 2010-08-09 10:51:47 +0000
4@@ -40,7 +40,7 @@
5 }
6
7 static const char plugin_author[] = "Innobase Oy";
8-@@ -380,6 +381,709 @@
9+@@ -380,6 +381,705 @@
10 };
11
12
13@@ -397,10 +397,6 @@
14 + ulint n_chunks, n_blocks;
15 + dulint index_id;
16 +
17-+ const char *p;
18-+ char db_name_raw[NAME_LEN*5+1], db_name[NAME_LEN+1];
19-+ char table_name_raw[NAME_LEN*5+1], table_name[NAME_LEN+1];
20-+
21 + buf_chunk_t* chunk;
22 +
23 + DBUG_ENTER("i_s_innodb_buffer_pool_pages_index_fill");
24
25=== modified file 'innodb_admin_command_base.patch'
26--- innodb_admin_command_base.patch 2010-07-26 16:29:05 +0000
27+++ innodb_admin_command_base.patch 2010-08-09 10:51:47 +0000
28@@ -12,7 +12,7 @@
29 diff -ruN a/storage/innodb_plugin/handler/i_s.cc b/storage/innodb_plugin/handler/i_s.cc
30 --- a/storage/innodb_plugin/handler/i_s.cc 2010-04-30 10:49:58.000000000 +0900
31 +++ b/storage/innodb_plugin/handler/i_s.cc 2010-04-30 14:36:22.000000000 +0900
32-@@ -2951,3 +2951,140 @@
33+@@ -2951,3 +2951,139 @@
34 STRUCT_FLD(system_vars, NULL),
35 STRUCT_FLD(__reserved1, NULL)
36 };
37@@ -49,11 +49,10 @@
38 + COND* cond)
39 +{
40 + TABLE* i_s_table = (TABLE *) tables->table;
41-+ CHARSET_INFO *cs= system_charset_info;
42 + char** query_str;
43 + char* ptr;
44 + char quote = '\0';
45-+ char* command_head = "XTRA_";
46++ const char* command_head = "XTRA_";
47 +
48 + DBUG_ENTER("i_s_innodb_admin_command_fill");
49 +
50
51=== modified file 'innodb_buffer_pool_shm.patch'
52--- innodb_buffer_pool_shm.patch 2010-07-26 16:29:05 +0000
53+++ innodb_buffer_pool_shm.patch 2010-08-09 10:51:47 +0000
54@@ -95,7 +95,7 @@
55 byte* frame;
56 + ulint zip_hash_n = 0;
57 + ulint zip_hash_mem_size = 0;
58-+ hash_table_t* zip_hash_tmp;
59++ hash_table_t* zip_hash_tmp = NULL;
60 ulint i;
61 + buf_shm_info_t* shm_info = NULL;
62
63
64=== modified file 'innodb_expand_import.patch'
65--- innodb_expand_import.patch 2010-07-26 16:29:05 +0000
66+++ innodb_expand_import.patch 2010-08-09 10:51:47 +0000
67@@ -1,7 +1,7 @@
68 diff -ruN a/storage/innodb_plugin/fil/fil0fil.c b/storage/innodb_plugin/fil/fil0fil.c
69 --- a/storage/innodb_plugin/fil/fil0fil.c 2010-04-29 15:44:28.000000000 +0900
70 +++ b/storage/innodb_plugin/fil/fil0fil.c 2010-04-30 10:43:13.000000000 +0900
71-@@ -40,6 +40,10 @@
72+@@ -40,6 +40,12 @@
73 #include "dict0dict.h"
74 #include "page0page.h"
75 #include "page0zip.h"
76@@ -9,6 +9,8 @@
77 +#include "trx0sys.h"
78 +#include "pars0pars.h"
79 +#include "row0mysql.h"
80++#include "row0row.h"
81++#include "que0que.h"
82 #ifndef UNIV_HOTBACKUP
83 # include "buf0lru.h"
84 # include "ibuf0ibuf.h"
85@@ -109,7 +111,7 @@
86 + for (i = 0; i < n_index; i++) {
87 + new_id[i] =
88 + dict_table_get_index_on_name(table,
89-+ (page + (i + 1) * 512 + 12))->id;
90++ (char*)(page + (i + 1) * 512 + 12))->id;
91 + old_id[i] = mach_read_from_8(page + (i + 1) * 512);
92 + root_page[i] = mach_read_from_4(page + (i + 1) * 512 + 8);
93 + }
94@@ -133,7 +135,7 @@
95 + /* over write space id of all pages */
96 + rec_offs_init(offsets_);
97 +
98-+ fprintf(stderr, "InnoDB: Progress in %:");
99++ fprintf(stderr, "InnoDB: Progress in %%:");
100 +
101 + for (offset = 0; offset < size_bytes; offset += UNIV_PAGE_SIZE) {
102 + ulint checksum_field;
103
104=== modified file 'innodb_extend_slow.patch'
105--- innodb_extend_slow.patch 2010-07-27 11:21:00 +0000
106+++ innodb_extend_slow.patch 2010-08-09 10:51:47 +0000
107@@ -31,9 +31,9 @@
108 + block_hash_byte = block_hash >> 3;
109 + block_hash_offset = (byte) block_hash & 0x07;
110 + if (block_hash_byte < 0 || block_hash_byte >= DPAH_SIZE)
111-+ fprintf(stderr, "!!! block_hash_byte = %lu block_hash_offset = %lu !!!\n", block_hash_byte, block_hash_offset);
112++ fprintf(stderr, "!!! block_hash_byte = %lu block_hash_offset = %d !!!\n", block_hash_byte, block_hash_offset);
113 + if (block_hash_offset < 0 || block_hash_offset > 7)
114-+ fprintf(stderr, "!!! block_hash_byte = %lu block_hash_offset = %lu !!!\n", block_hash_byte, block_hash_offset);
115++ fprintf(stderr, "!!! block_hash_byte = %lu block_hash_offset = %d !!!\n", block_hash_byte, block_hash_offset);
116 + if ((trx->distinct_page_access_hash[block_hash_byte] & ((byte) 0x01 << block_hash_offset)) == 0)
117 + trx->distinct_page_access++;
118 + trx->distinct_page_access_hash[block_hash_byte] |= (byte) 0x01 << block_hash_offset;
119
120=== modified file 'innodb_files_extend.patch'
121--- innodb_files_extend.patch 2010-07-27 11:21:00 +0000
122+++ innodb_files_extend.patch 2010-08-09 10:51:47 +0000
123@@ -37,7 +37,7 @@
124 - + (UNIV_PAGE_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE
125 -# error
126 -# endif
127-+//# if UNIV_PAGE_SIZE <= XDES_ARR_OFFSET \
128++//# if UNIV_PAGE_SIZE <= XDES_ARR_OFFSET
129 +// + (UNIV_PAGE_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE
130 +//# error
131 +//# endif
132@@ -89,12 +89,12 @@
133 + srv_page_size_shift = 0;
134 +
135 + if (innobase_page_size != (1 << 14)) {
136-+ int n_shift;
137++ uint n_shift;
138 +
139 + fprintf(stderr,
140 + "InnoDB: Warning: innodb_page_size has been changed from default value 16384. (###EXPERIMENTAL### operation)\n");
141 + for (n_shift = 12; n_shift <= UNIV_PAGE_SIZE_SHIFT_MAX; n_shift++) {
142-+ if (innobase_page_size == (1 << n_shift)) {
143++ if (innobase_page_size == ((ulong)1 << n_shift)) {
144 + srv_page_size_shift = n_shift;
145 + srv_page_size = (1 << srv_page_size_shift);
146 + fprintf(stderr,
147@@ -203,6 +203,18 @@
148 /*!< number of buddy sizes */
149
150 /** twice the maximum block size of the buddy system;
151+diff -ruN a/storage/innodb_plugin/include/mtr0log.ic b/storage/innodb_plugin/include/mtr0log.ic
152+--- a/storage/innodb_plugin/include/mtr0log.ic 2010-08-02 17:53:38.107904828 +0900
153++++ b/storage/innodb_plugin/include/mtr0log.ic 2010-08-02 17:55:56.452879919 +0900
154+@@ -203,7 +203,7 @@
155+ system tablespace */
156+ if ((space == TRX_SYS_SPACE
157+ || (srv_doublewrite_file && space == TRX_DOUBLEWRITE_SPACE))
158+- && offset >= FSP_EXTENT_SIZE && offset < 3 * FSP_EXTENT_SIZE) {
159++ && offset >= (ulint)FSP_EXTENT_SIZE && offset < 3 * (ulint)FSP_EXTENT_SIZE) {
160+ if (trx_doublewrite_buf_is_being_created) {
161+ /* Do nothing: we only come to this branch in an
162+ InnoDB database creation. We do not redo log
163 diff -ruN a/storage/innodb_plugin/include/page0types.h b/storage/innodb_plugin/include/page0types.h
164 --- a/storage/innodb_plugin/include/page0types.h 2010-04-06 23:07:13.000000000 +0900
165 +++ b/storage/innodb_plugin/include/page0types.h 2010-04-30 16:35:09.000000000 +0900
166
167=== modified file 'innodb_io_patches.patch'
168--- innodb_io_patches.patch 2010-07-26 16:29:05 +0000
169+++ innodb_io_patches.patch 2010-08-09 10:51:47 +0000
170@@ -555,7 +555,7 @@
171 +/* Per thread buffer used for merged IO requests. Used by
172 +os_aio_simulated_handle so that a buffer doesn't have to be allocated
173 +for each request. */
174-+static char* os_aio_thread_buffer[SRV_MAX_N_IO_THREADS];
175++static byte* os_aio_thread_buffer[SRV_MAX_N_IO_THREADS];
176 +static ulint os_aio_thread_buffer_size[SRV_MAX_N_IO_THREADS];
177 +
178 /** Number of asynchronous I/O segments. Set by os_aio_init(). */
179
180=== modified file 'innodb_pass_corrupt_table.patch'
181--- innodb_pass_corrupt_table.patch 2010-07-26 16:29:05 +0000
182+++ innodb_pass_corrupt_table.patch 2010-08-09 10:51:47 +0000
183@@ -384,7 +384,7 @@
184 + if (srv_pass_corrupt_table && !trx_sys_sys_space(bpage->space)
185 + && bpage->space < SRV_LOG_SPACE_FIRST_ID) {
186 + fprintf(stderr,
187-+ "InnoDB: space %lu will be treated as corrupt.\n",
188++ "InnoDB: space %u will be treated as corrupt.\n",
189 + bpage->space);
190 + fil_space_set_corrupt(bpage->space);
191 + if (trx && trx->dict_operation_lock_mode == 0) {
192@@ -1212,6 +1212,43 @@
193 ptr = buf_block_get_frame(block) + addr.boffset;
194
195 buf_block_dbg_add_level(block, SYNC_NO_ORDER_CHECK);
196+diff -ruN a/storage/innodb_plugin/include/page0page.h b/storage/innodb_plugin/include/page0page.h
197+--- a/storage/innodb_plugin/include/page0page.h 2010-07-09 21:34:54.000000000 +0900
198++++ b/storage/innodb_plugin/include/page0page.h 2010-08-02 19:05:07.080258292 +0900
199+@@ -500,7 +500,7 @@
200+ page_is_leaf(
201+ /*=========*/
202+ const page_t* page) /*!< in: page */
203+- __attribute__((nonnull, pure));
204++ __attribute__((pure));
205+ /************************************************************//**
206+ Gets the pointer to the next record on the page.
207+ @return pointer to next record */
208+diff -ruN a/storage/innodb_plugin/include/page0page.ic b/storage/innodb_plugin/include/page0page.ic
209+--- a/storage/innodb_plugin/include/page0page.ic 2010-07-09 21:34:54.000000000 +0900
210++++ b/storage/innodb_plugin/include/page0page.ic 2010-08-02 19:05:42.015905567 +0900
211+@@ -275,6 +275,9 @@
212+ /*=========*/
213+ const page_t* page) /*!< in: page */
214+ {
215++ if (!page) {
216++ return(FALSE);
217++ }
218+ return(!*(const uint16*) (page + (PAGE_HEADER + PAGE_LEVEL)));
219+ }
220+
221+diff -ruN a/storage/innodb_plugin/include/page0zip.h b/storage/innodb_plugin/include/page0zip.h
222+--- a/storage/innodb_plugin/include/page0zip.h 2010-07-09 21:34:54.000000000 +0900
223++++ b/storage/innodb_plugin/include/page0zip.h 2010-08-02 19:05:58.348879795 +0900
224+@@ -114,7 +114,7 @@
225+ const page_t* page, /*!< in: uncompressed page */
226+ dict_index_t* index, /*!< in: index of the B-tree node */
227+ mtr_t* mtr) /*!< in: mini-transaction, or NULL */
228+- __attribute__((nonnull(1,2,3)));
229++ __attribute__((nonnull(1,3)));
230+
231+ /**********************************************************************//**
232+ Decompress a page. This function should tolerate errors on the compressed
233 diff -ruN a/storage/innodb_plugin/include/srv0srv.h b/storage/innodb_plugin/include/srv0srv.h
234 --- a/storage/innodb_plugin/include/srv0srv.h 2010-04-30 15:46:35.000000000 +0900
235 +++ b/storage/innodb_plugin/include/srv0srv.h 2010-04-30 15:49:22.000000000 +0900
236@@ -1223,6 +1260,20 @@
237
238 extern ulint srv_extra_rsegments;
239 extern ulint srv_dict_size_limit;
240+diff -ruN a/storage/innodb_plugin/page/page0zip.c b/storage/innodb_plugin/page/page0zip.c
241+--- a/storage/innodb_plugin/page/page0zip.c 2010-07-09 21:34:57.000000000 +0900
242++++ b/storage/innodb_plugin/page/page0zip.c 2010-08-02 19:06:34.347851182 +0900
243+@@ -1153,6 +1153,10 @@
244+ FILE* logfile = NULL;
245+ #endif
246+
247++ if (!page) {
248++ return(FALSE);
249++ }
250++
251+ ut_a(page_is_comp(page));
252+ ut_a(fil_page_get_type(page) == FIL_PAGE_INDEX);
253+ ut_ad(page_simple_validate_new((page_t*) page));
254 diff -ruN a/storage/innodb_plugin/row/row0ins.c b/storage/innodb_plugin/row/row0ins.c
255 --- a/storage/innodb_plugin/row/row0ins.c 2010-04-06 23:07:14.000000000 +0900
256 +++ b/storage/innodb_plugin/row/row0ins.c 2010-04-30 15:49:22.000000000 +0900
257
258=== modified file 'innodb_recovery_patches.patch'
259--- innodb_recovery_patches.patch 2010-07-26 16:29:05 +0000
260+++ innodb_recovery_patches.patch 2010-08-09 10:51:47 +0000
261@@ -349,12 +349,11 @@
262 }
263
264 mutex_exit(&(recv_sys->mutex));
265-@@ -3255,6 +3313,84 @@
266+@@ -3255,6 +3313,83 @@
267 }
268 #endif /* UNIV_DEBUG */
269
270 + if (recv_needed_recovery && srv_recovery_stats) {
271-+ FILE* file = stderr;
272 + ulint i;
273 +
274 + fprintf(stderr,
275
276=== modified file 'innodb_separate_doublewrite.patch'
277--- innodb_separate_doublewrite.patch 2010-07-27 11:21:00 +0000
278+++ innodb_separate_doublewrite.patch 2010-08-09 10:51:47 +0000
279@@ -840,7 +840,7 @@
280 && ((page_no >= block1
281 && page_no
282 < block1 + TRX_SYS_DOUBLEWRITE_BLOCK_SIZE)
283-@@ -980,6 +1133,87 @@
284+@@ -980,6 +1133,83 @@
285 }
286
287 /*****************************************************************//**
288@@ -852,12 +852,8 @@
289 + ulint space,
290 + mtr_t* mtr)
291 +{
292-+ trx_sysf_t* sys_header;
293-+ ulint slot_no;
294 + buf_block_t* block;
295 + page_t* page;
296-+ ulint page_no;
297-+ ulint i;
298 +
299 + ut_ad(mtr);
300 +
301
302=== modified file 'innodb_show_status.patch'
303--- innodb_show_status.patch 2010-07-26 16:29:05 +0000
304+++ innodb_show_status.patch 2010-08-09 10:51:47 +0000
305@@ -211,14 +211,13 @@
306 /** Maximum number of times allowed to conditionally acquire
307 mutex before switching to blocking wait on the mutex */
308 #define MAX_MUTEX_NOWAIT 20
309-@@ -1700,6 +1703,14 @@
310+@@ -1700,6 +1703,13 @@
311 ulint n_reserved;
312 ibool ret;
313
314 + ulint btr_search_sys_subtotal;
315 + ulint lock_sys_subtotal;
316 + ulint recv_sys_subtotal;
317-+ ulint io_counter_subtotal;
318 +
319 + ulint i;
320 + trx_t* trx;
321
322=== modified file 'innodb_split_buf_pool_mutex.patch'
323--- innodb_split_buf_pool_mutex.patch 2010-07-26 16:29:05 +0000
324+++ innodb_split_buf_pool_mutex.patch 2010-08-09 10:51:47 +0000
325@@ -4081,18 +4081,23 @@
326 #ifdef UNIV_DEBUG
327 mutex->magic_n = MUTEX_MAGIC_N;
328 #endif /* UNIV_DEBUG */
329-@@ -436,10 +436,18 @@
330- the value is stored to memory */
331- ut_ad(mutex);
332-
333+@@ -432,6 +432,15 @@
334+ mutex_t* mutex, /*!< in: mutex */
335+ ulint n) /*!< in: value to set */
336+ {
337 +#ifdef INNODB_RW_LOCKS_USE_ATOMICS
338++ ut_ad(mutex);
339++
340 + if (n) {
341 + os_compare_and_swap_ulint(&mutex->waiters, 0, 1);
342 + } else {
343 + os_compare_and_swap_ulint(&mutex->waiters, 1, 0);
344 + }
345 +#else
346- ptr = &(mutex->waiters);
347+ volatile ulint* ptr; /* declared volatile to ensure that
348+ the value is stored to memory */
349+ ut_ad(mutex);
350+@@ -440,6 +449,7 @@
351
352 *ptr = n; /* Here we assume that the write of a single
353 word in memory is atomic */
354
355=== modified file 'innodb_stats.patch'
356--- innodb_stats.patch 2010-07-27 11:21:00 +0000
357+++ innodb_stats.patch 2010-08-09 10:51:47 +0000
358@@ -133,7 +133,7 @@
359 + ibool diverged_lot;
360 + ulint divergence_level;
361 + ulint n_pages;
362-+ ulint i,j;
363++ ulint i;
364 + mtr_t mtr;
365 + mem_heap_t* heap;
366 +
367@@ -2056,7 +2056,7 @@
368 }
369 }
370
371-@@ -2012,6 +2015,46 @@
372+@@ -2012,6 +2015,45 @@
373 }
374
375 /*********************************************************************//**
376@@ -2072,7 +2072,6 @@
377 + mem_heap_t* heap;
378 + que_thr_t* thr;
379 + ulint err;
380-+ ulint i;
381 +
382 + ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
383 +
384
385=== modified file 'mysql-test/percona_query_response_time.result'
386--- mysql-test/percona_query_response_time.result 2010-07-20 13:16:43 +0000
387+++ mysql-test/percona_query_response_time.result 2010-08-09 10:51:47 +0000
388@@ -59,10 +59,10 @@
389 131072.000000
390 262144.000000
391 524288.000000
392-1048576.000000
393-2097152.000000
394-4194304.000000
395-8388608.000000
396+ 1048576.00000
397+ 2097152.00000
398+ 4194304.00000
399+ 8388608.00000
400 TOO LONG QUERY
401 SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
402 SELECT SLEEP(0.31);
403@@ -178,10 +178,10 @@
404 131072.000000
405 262144.000000
406 524288.000000
407-1048576.000000
408-2097152.000000
409-4194304.000000
410-8388608.000000
411+ 1048576.00000
412+ 2097152.00000
413+ 4194304.00000
414+ 8388608.00000
415 TOO LONG QUERY
416 SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
417 Variable_name Value
418@@ -276,7 +276,7 @@
419 1000.000000
420 10000.000000
421 100000.000000
422-1000000.000000
423+ 1000000.00000
424 TOO LONG QUERY
425 SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
426 Variable_name Value
427@@ -374,7 +374,7 @@
428 16807.000000
429 117649.000000
430 823543.000000
431-5764801.000000
432+ 5764801.00000
433 TOO LONG QUERY
434 SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
435 Variable_name Value
436@@ -462,7 +462,7 @@
437 1.000000
438 156.000000
439 24336.000000
440-3796416.000000
441+ 3796416.00000
442 TOO LONG QUERY
443 SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
444 Variable_name Value
445@@ -549,7 +549,7 @@
446 0.001000
447 1.000000
448 1000.000000
449-1000000.000000
450+ 1000000.00000
451 TOO LONG QUERY
452 SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
453 Variable_name Value
454
455=== modified file 'response-time-distribution.patch'
456--- response-time-distribution.patch 2010-08-03 12:39:09 +0000
457+++ response-time-distribution.patch 2010-08-09 10:51:47 +0000
458@@ -203,7 +203,7 @@
459 +
460 +#define do_xstr(s) do_str(s)
461 +#define do_str(s) #s
462-+#define do_format(filler,width) "%" filler width "llu"
463++#define do_format(filler,width) "%" filler width "lld"
464 +/*
465 + Format strings for snprintf. Generate from:
466 + POSITIVE_POWER_FILLER and STRING_POSITIVE_POWER_LENGTH
467@@ -340,7 +340,7 @@
468 +
469 + for(int i= 0, count= m_utility->bound_count(); i < count; ++i)
470 + {
471-+ ulonglong value = m_utility->bound(i);
472++ longlong value = (longlong)m_utility->bound(i);
473 + char* result = (char*)m_bound[i];
474 + if(0 > snprintf(result,STRING_BUFFER_LENGTH,STRING_FORMAT,(value / million),(value % million)))
475 + {
476
477=== modified file 'slow_extended.patch'
478--- slow_extended.patch 2010-08-03 13:22:23 +0000
479+++ slow_extended.patch 2010-08-09 10:51:47 +0000
480@@ -389,6 +389,7 @@
481 /*
482 As a disk space optimization, future masters will not log an event for
483 LAST_INSERT_ID() if that function returned 0 (and thus they will be able
484+<<<<<<< TREE
485 diff -Nur a/sql/log.h b/sql/log.h
486 --- a/sql/log.h 2010-08-03 16:24:06.609042572 +0400
487 +++ b/sql/log.h 2010-08-03 16:24:22.637800704 +0400
488@@ -428,6 +429,47 @@
489 time_t query_start_arg, const char *user_host,
490 uint user_host_len, ulonglong query_utime,
491 ulonglong lock_utime, bool is_command,
492+=======
493+diff -Nur a/sql/log.h b/sql/log.h
494+--- a/sql/log.h 2010-07-09 21:34:57.000000000 +0900
495++++ b/sql/log.h 2010-07-26 18:04:33.879030230 +0900
496+@@ -211,7 +211,7 @@
497+ uint user_host_len, int thread_id,
498+ const char *command_type, uint command_type_len,
499+ const char *sql_text, uint sql_text_len);
500+- bool write(THD *thd, time_t current_time, time_t query_start_arg,
501++ bool write(THD *thd, ulonglong current_utime, time_t query_start_arg,
502+ const char *user_host, uint user_host_len,
503+ ulonglong query_utime, ulonglong lock_utime, bool is_command,
504+ const char *sql_text, uint sql_text_len);
505+@@ -424,7 +424,7 @@
506+ virtual bool init()= 0;
507+ virtual void cleanup()= 0;
508+
509+- virtual bool log_slow(THD *thd, time_t current_time,
510++ virtual bool log_slow(THD *thd, ulonglong current_utime,
511+ time_t query_start_arg, const char *user_host,
512+ uint user_host_len, ulonglong query_utime,
513+ ulonglong lock_utime, bool is_command,
514+@@ -453,7 +453,7 @@
515+ virtual bool init();
516+ virtual void cleanup();
517+
518+- virtual bool log_slow(THD *thd, time_t current_time,
519++ virtual bool log_slow(THD *thd, ulonglong current_utime,
520+ time_t query_start_arg, const char *user_host,
521+ uint user_host_len, ulonglong query_utime,
522+ ulonglong lock_utime, bool is_command,
523+@@ -485,7 +485,7 @@
524+ virtual bool init();
525+ virtual void cleanup();
526+
527+- virtual bool log_slow(THD *thd, time_t current_time,
528++ virtual bool log_slow(THD *thd, ulonglong current_utime,
529+ time_t query_start_arg, const char *user_host,
530+ uint user_host_len, ulonglong query_utime,
531+ ulonglong lock_utime, bool is_command,
532+>>>>>>> MERGE-SOURCE
533 diff -Nur a/sql/mysqld.cc b/sql/mysqld.cc
534 --- a/sql/mysqld.cc 2010-08-03 16:24:06.599042136 +0400
535 +++ b/sql/mysqld.cc 2010-08-03 16:24:23.947815330 +0400
536@@ -554,6 +596,7 @@
537 case OPT_SERVER_ID:
538 server_id_supplied = 1;
539 break;
540+<<<<<<< TREE
541 diff -Nur a/sql/mysql_priv.h b/sql/mysql_priv.h
542 --- a/sql/mysql_priv.h 2010-08-03 16:24:06.619042449 +0400
543 +++ b/sql/mysql_priv.h 2010-08-03 16:24:23.867829161 +0400
544@@ -675,6 +718,129 @@
545 extern my_bool sp_automatic_privileges, opt_noacl;
546 extern my_bool opt_old_style_user_limits, trust_function_creators;
547 extern uint opt_crash_binlog_innodb;
548+=======
549+diff -Nur a/sql/mysql_priv.h b/sql/mysql_priv.h
550+--- a/sql/mysql_priv.h 2010-07-26 18:04:18.711114116 +0900
551++++ b/sql/mysql_priv.h 2010-07-26 18:04:33.901113370 +0900
552+@@ -613,6 +613,106 @@
553+
554+ #define STRING_BUFFER_USUAL_SIZE 80
555+
556++/* Slow log */
557++
558++struct msl_opts
559++{
560++ ulong val;
561++ const char *name;
562++};
563++
564++/* use global log slow control */
565++#define SLOG_UG_NONE 1 << 0
566++#define SLOG_UG_LOG_SLOW_FILTER 1 << 1
567++#define SLOG_UG_LOG_SLOW_RATE_LIMIT 1 << 2
568++#define SLOG_UG_LOG_SLOW_VERBOSITY 1 << 3
569++#define SLOG_UG_LONG_QUERY_TIME 1 << 4
570++#define SLOG_UG_MIN_EXAMINED_ROW_LIMIT 1 << 5
571++#define SLOG_UG_ALL SLOG_UG_LOG_SLOW_FILTER | SLOG_UG_LOG_SLOW_RATE_LIMIT | SLOG_UG_LOG_SLOW_VERBOSITY | SLOG_UG_LONG_QUERY_TIME | SLOG_UG_MIN_EXAMINED_ROW_LIMIT
572++/* ... */
573++#define SLOG_UG_INVALID 1##UL << 31
574++
575++static const struct msl_opts slog_use_global[]=
576++ {
577++ /* Basic flags */
578++ { SLOG_UG_NONE , "none" },
579++ { SLOG_UG_LOG_SLOW_FILTER , "log_slow_filter" },
580++ { SLOG_UG_LOG_SLOW_RATE_LIMIT , "log_slow_rate_limit" },
581++ { SLOG_UG_LOG_SLOW_VERBOSITY , "log_slow_verbosity" },
582++ { SLOG_UG_LONG_QUERY_TIME , "long_query_time" },
583++ { SLOG_UG_MIN_EXAMINED_ROW_LIMIT , "min_examined_row_limit" },
584++ /* ... */
585++ { 0, "" },
586++ /* Complex flags */
587++ { SLOG_UG_ALL , "all" },
588++ /* ... */
589++ { SLOG_UG_INVALID , (char*)0 }
590++ };
591++
592++#define SLOG_V_MICROTIME 1 << 0
593++#define SLOG_V_QUERY_PLAN 1 << 1
594++#define SLOG_V_INNODB 1 << 2
595++/* ... */
596++#define SLOG_V_INVALID 1##UL << 31
597++#define SLOG_V_NONE SLOG_V_MICROTIME
598++
599++static const struct msl_opts slog_verb[]=
600++{
601++ /* Basic flags */
602++
603++ { SLOG_V_MICROTIME, "microtime" },
604++ { SLOG_V_QUERY_PLAN, "query_plan" },
605++ { SLOG_V_INNODB, "innodb" },
606++
607++ /* End of baisc flags */
608++
609++ { 0, "" },
610++
611++ /* Complex flags */
612++
613++ { SLOG_V_MICROTIME, "minimal" },
614++ { SLOG_V_MICROTIME|SLOG_V_QUERY_PLAN, "standard" },
615++ { SLOG_V_MICROTIME|SLOG_V_QUERY_PLAN|SLOG_V_INNODB, "full" },
616++
617++ /* End of complex flags */
618++
619++ { SLOG_V_INVALID, (char *)0 }
620++};
621++
622++#define QPLAN_NONE 0
623++#define QPLAN_QC 1 << 0
624++#define QPLAN_QC_NO 1 << 1
625++#define QPLAN_FULL_SCAN 1 << 2
626++#define QPLAN_FULL_JOIN 1 << 3
627++#define QPLAN_TMP_TABLE 1 << 4
628++#define QPLAN_TMP_DISK 1 << 5
629++#define QPLAN_FILESORT 1 << 6
630++#define QPLAN_FILESORT_DISK 1 << 7
631++/* ... */
632++#define QPLAN_MAX 1 << 31
633++
634++#define SLOG_F_QC_NO QPLAN_QC_NO
635++#define SLOG_F_FULL_SCAN QPLAN_FULL_SCAN
636++#define SLOG_F_FULL_JOIN QPLAN_FULL_JOIN
637++#define SLOG_F_TMP_TABLE QPLAN_TMP_TABLE
638++#define SLOG_F_TMP_DISK QPLAN_TMP_DISK
639++#define SLOG_F_FILESORT QPLAN_FILESORT
640++#define SLOG_F_FILESORT_DISK QPLAN_FILESORT_DISK
641++#define SLOG_F_INVALID 1##UL << 31
642++#define SLOG_F_NONE 0
643++
644++static const struct msl_opts slog_filter[]=
645++{
646++ { SLOG_F_QC_NO, "qc_miss" },
647++ { SLOG_F_FULL_SCAN, "full_scan" },
648++ { SLOG_F_FULL_JOIN, "full_join" },
649++ { SLOG_F_TMP_TABLE, "tmp_table" },
650++ { SLOG_F_TMP_DISK, "tmp_table_on_disk" },
651++ { SLOG_F_FILESORT, "filesort" },
652++ { SLOG_F_FILESORT_DISK, "filesort_on_disk" },
653++ { SLOG_F_INVALID, (char *)0 }
654++};
655++
656+ /*
657+ Some defines for exit codes for ::is_equal class functions.
658+ */
659+@@ -1971,6 +2071,10 @@
660+ extern my_bool opt_secure_auth;
661+ extern char* opt_secure_file_priv;
662+ extern my_bool opt_log_slow_admin_statements, opt_log_slow_slave_statements;
663++extern my_bool opt_log_slow_sp_statements;
664++extern my_bool opt_log_slow_timestamp_every;
665++extern my_bool opt_use_global_long_query_time;
666++extern my_bool opt_slow_query_log_microseconds_timestamp;
667+ extern my_bool sp_automatic_privileges, opt_noacl;
668+ extern my_bool opt_old_style_user_limits, trust_function_creators;
669+ extern uint opt_crash_binlog_innodb;
670+>>>>>>> MERGE-SOURCE
671 diff -Nur a/sql/set_var.cc b/sql/set_var.cc
672 --- a/sql/set_var.cc 2010-08-03 16:24:06.599042136 +0400
673 +++ b/sql/set_var.cc 2010-08-03 16:24:23.979041934 +0400
674@@ -1424,7 +1590,7 @@
675 share->db_record_offset= 1;
676 DBUG_RETURN(0);
677 err:
678-@@ -10847,6 +10855,14 @@
679+@@ -10847,5 +10855,13 @@
680 save_proc_info=thd->proc_info;
681 thd_proc_info(thd, "removing tmp table");
682
683@@ -1438,6 +1604,7 @@
684 +
685 // Release latches since this can take a long time
686 ha_release_temporary_latches(thd);
687+<<<<<<< TREE
688
689 diff -Nur a/sql/sql_show.cc b/sql/sql_show.cc
690 --- a/sql/sql_show.cc 2010-08-03 16:24:06.609042572 +0400
691@@ -1458,3 +1625,5 @@
692 /* STATE */
693 #ifndef EMBEDDED_LIBRARY
694 val= (char*) (tmp->locked ? "Locked" :
695+=======
696+>>>>>>> MERGE-SOURCE
697
698=== modified file 'userstat.patch'
699--- userstat.patch 2010-08-03 14:08:54 +0000
700+++ userstat.patch 2010-08-09 10:51:47 +0000
701@@ -207,13 +207,13 @@
702 + if (!table->s || !table->s->table_cache_key.str || !table->s->table_name.str) return;
703 +
704 + if (!opt_userstat_running) {
705-+ for (int x = 0; x < table->s->keys; x++) {
706++ for (uint x = 0; x < table->s->keys; x++) {
707 + index_rows_read[x] = 0;
708 + }
709 + return;
710 + }
711 +
712-+ for (int x = 0; x < table->s->keys; x++) {
713++ for (uint x = 0; x < table->s->keys; x++) {
714 + if (index_rows_read[x]) {
715 + // Rows were read using this index.
716 + KEY* key_info = &table->key_info[x];
717@@ -282,13 +282,14 @@
718 /**
719 next_insert_id is the next value which should be inserted into the
720 auto_increment column: in a inserting-multi-row statement (like INSERT
721-@@ -1156,8 +1163,10 @@
722+@@ -1155,9 +1162,11 @@
723+ ref_length(sizeof(my_off_t)),
724 ft_handler(0), inited(NONE),
725 locked(FALSE), implicit_emptied(0),
726- pushed_cond(0), next_insert_id(0), insert_id_for_cur_row(0),
727-- auto_inc_intervals_count(0)
728+- pushed_cond(0), next_insert_id(0), insert_id_for_cur_row(0),
729++ pushed_cond(0), rows_read(0), rows_changed(0), next_insert_id(0), insert_id_for_cur_row(0),
730+ auto_inc_intervals_count(0)
731 - {}
732-+ auto_inc_intervals_count(0), rows_read(0), rows_changed(0)
733 + {
734 + memset(index_rows_read, 0, sizeof(index_rows_read));
735 + }
736@@ -2440,92 +2441,15 @@
737 my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),
738 sctx->priv_user, sctx->host_or_ip, dbname);
739 general_log_print(thd,COM_INIT_DB,ER(ER_DBACCESS_DENIED_ERROR),
740+<<<<<<< TREE
741 @@ -2371,6 +2401,360 @@
742+=======
743+@@ -2366,6 +2401,279 @@
744+>>>>>>> MERGE-SOURCE
745 DBUG_RETURN(res);
746 }
747
748 +/*
749-+ Aggregate values for mapped_user entries by their role.
750-+
751-+ SYNOPSIS
752-+ aggregate_user_stats
753-+ all_user_stats - input to aggregate
754-+ agg_user_stats - returns aggregated values
755-+
756-+ RETURN
757-+ 0 - OK
758-+ 1 - error
759-+ */
760-+static int
761-+aggregate_user_stats(HASH *all_user_stats, HASH *agg_user_stats)
762-+{
763-+ DBUG_ENTER("aggregate_user_stats");
764-+ if (hash_init(agg_user_stats, system_charset_info,
765-+ max(all_user_stats->records, 1),
766-+ 0, 0, (hash_get_key)get_key_user_stats,
767-+ (hash_free_key)free_user_stats, 0))
768-+ {
769-+ sql_print_error("Malloc in aggregate_user_stats failed");
770-+ DBUG_RETURN(1);
771-+ }
772-+
773-+ for (int i = 0; i < all_user_stats->records; ++i) {
774-+ USER_STATS *user = (USER_STATS*)hash_element(all_user_stats, i);
775-+ USER_STATS *agg_user;
776-+ if (!(agg_user = (USER_STATS*)hash_search(agg_user_stats,
777-+ (uchar*)user->priv_user,
778-+ strlen(user->priv_user))))
779-+ {
780-+ // First entry for this role.
781-+ if (!(agg_user =
782-+ (USER_STATS*) my_malloc(sizeof(USER_STATS), MYF(MY_WME | MY_ZEROFILL))))
783-+ {
784-+ sql_print_error("Malloc in aggregate_user_stats failed");
785-+ DBUG_RETURN(1);
786-+ }
787-+
788-+ init_user_stats(agg_user, user->priv_user, user->priv_user,
789-+ user->total_connections, user->concurrent_connections,
790-+ user->connected_time, user->busy_time, user->cpu_time,
791-+ user->bytes_received, user->bytes_sent,
792-+ user->binlog_bytes_written,
793-+ user->rows_fetched, user->rows_updated, user->rows_read,
794-+ user->select_commands, user->update_commands,
795-+ user->other_commands,
796-+ user->commit_trans, user->rollback_trans,
797-+ user->denied_connections, user->lost_connections,
798-+ user->access_denied_errors, user->empty_queries);
799-+
800-+ if (my_hash_insert(agg_user_stats, (uchar*)agg_user))
801-+ {
802-+ // Out of memory.
803-+ my_free((char*)agg_user, 0);
804-+ sql_print_error("Malloc in aggregate_user_stats failed");
805-+ DBUG_RETURN(1);
806-+ }
807-+ }
808-+ else
809-+ {
810-+ // Aggregate with existing values for this role.
811-+ add_user_stats(agg_user,
812-+ user->total_connections, user->concurrent_connections,
813-+ user->connected_time, user->busy_time, user->cpu_time,
814-+ user->bytes_received, user->bytes_sent,
815-+ user->binlog_bytes_written,
816-+ user->rows_fetched, user->rows_updated, user->rows_read,
817-+ user->select_commands, user->update_commands,
818-+ user->other_commands,
819-+ user->commit_trans, user->rollback_trans,
820-+ user->denied_connections, user->lost_connections,
821-+ user->access_denied_errors, user->empty_queries);
822-+ }
823-+ }
824-+ DBUG_PRINT("exit", ("aggregated %d input into %d output entries",
825-+ all_user_stats->records, agg_user_stats->records));
826-+ DBUG_RETURN(0);
827-+}
828-+
829-+/*
830 + Write result to network for SHOW USER_STATISTICS
831 +
832 + SYNOPSIS
833@@ -2540,7 +2464,7 @@
834 +int send_user_stats(THD* thd, HASH *all_user_stats, TABLE *table)
835 +{
836 + DBUG_ENTER("send_user_stats");
837-+ for (int i = 0; i < all_user_stats->records; ++i) {
838++ for (uint i = 0; i < all_user_stats->records; ++i) {
839 + restore_record(table, s->default_values);
840 + USER_STATS *user_stats = (USER_STATS*)hash_element(all_user_stats, i);
841 + table->field[0]->store(user_stats->user, strlen(user_stats->user), system_charset_info);
842@@ -2576,7 +2500,7 @@
843 +int send_thread_stats(THD* thd, HASH *all_thread_stats, TABLE *table)
844 +{
845 + DBUG_ENTER("send_thread_stats");
846-+ for (int i = 0; i < all_thread_stats->records; ++i) {
847++ for (uint i = 0; i < all_thread_stats->records; ++i) {
848 + restore_record(table, s->default_values);
849 + THREAD_STATS *user_stats = (THREAD_STATS*)hash_element(all_thread_stats, i);
850 + table->field[0]->store((longlong)user_stats->id);
851@@ -2721,7 +2645,7 @@
852 + char *table_full_name, *table_schema;
853 +
854 + pthread_mutex_lock(&LOCK_global_table_stats);
855-+ for (int i = 0; i < global_table_stats.records; ++i) {
856++ for (uint i = 0; i < global_table_stats.records; ++i) {
857 + restore_record(table, s->default_values);
858 + TABLE_STATS *table_stats =
859 + (TABLE_STATS*)hash_element(&global_table_stats, i);
860@@ -2764,7 +2688,7 @@
861 + char *index_full_name, *table_schema, *table_name;
862 +
863 + pthread_mutex_lock(&LOCK_global_index_stats);
864-+ for (int i = 0; i < global_index_stats.records; ++i) {
865++ for (uint i = 0; i < global_index_stats.records; ++i) {
866 + restore_record(table, s->default_values);
867 + INDEX_STATS *index_stats =
868 + (INDEX_STATS*)hash_element(&global_index_stats, i);
869@@ -3421,7 +3345,7 @@
870 + if (!error) {
871 + rows_read++;
872 +
873-+ int inx = (active_index == -1) ? file->lastinx : active_index;
874++ int inx = (active_index == MAX_KEY) ? file->lastinx : active_index;
875 + if (inx >= 0 && inx < MAX_KEY)
876 + index_rows_read[inx]++;
877 + }
878@@ -3449,7 +3373,7 @@
879 + if (!error) {
880 + rows_read++;
881 +
882-+ int inx = (active_index == -1) ? file->lastinx : active_index;
883++ int inx = (active_index == MAX_KEY) ? file->lastinx : active_index;
884 + if (inx >= 0 && inx < MAX_KEY)
885 + index_rows_read[inx]++;
886 + }
887@@ -3463,7 +3387,7 @@
888 + if (!error) {
889 + rows_read++;
890 +
891-+ int inx = (active_index == -1) ? file->lastinx : active_index;
892++ int inx = (active_index == MAX_KEY) ? file->lastinx : active_index;
893 + if (inx >= 0 && inx < MAX_KEY)
894 + index_rows_read[inx]++;
895 + }
896@@ -3477,7 +3401,7 @@
897 + if (!error) {
898 + rows_read++;
899 +
900-+ int inx = (active_index == -1) ? file->lastinx : active_index;
901++ int inx = (active_index == MAX_KEY) ? file->lastinx : active_index;
902 + if (inx >= 0 && inx < MAX_KEY)
903 + index_rows_read[inx]++;
904 + }
905@@ -3491,7 +3415,7 @@
906 + if (!error) {
907 + rows_read++;
908 +
909-+ int inx = (active_index == -1) ? file->lastinx : active_index;
910++ int inx = (active_index == MAX_KEY) ? file->lastinx : active_index;
911 + if (inx >= 0 && inx < MAX_KEY)
912 + index_rows_read[inx]++;
913 + }
914@@ -3505,7 +3429,7 @@
915 + if (!error) {
916 + rows_read++;
917 +
918-+ int inx = (active_index == -1) ? file->lastinx : active_index;
919++ int inx = (active_index == MAX_KEY) ? file->lastinx : active_index;
920 + if (inx >= 0 && inx < MAX_KEY)
921 + index_rows_read[inx]++;
922 + }
923@@ -3519,7 +3443,7 @@
924 + if (!error) {
925 + rows_read++;
926 +
927-+ int inx = (active_index == -1) ? file->lastinx : active_index;
928++ int inx = (active_index == MAX_KEY) ? file->lastinx : active_index;
929 + if (inx >= 0 && inx < MAX_KEY)
930 + index_rows_read[inx]++;
931 + }

Subscribers

People subscribed via source and target branches

to all changes: