Merge lp:~laurynas-biveinis/percona-server/BT-16274-bug1087202-1087218-5.5 into lp:percona-server/5.5

Proposed by Laurynas Biveinis on 2012-12-07
Status: Merged
Approved by: Stewart Smith on 2012-12-17
Approved revision: 361
Merged at revision: 383
Proposed branch: lp:~laurynas-biveinis/percona-server/BT-16274-bug1087202-1087218-5.5
Merge into: lp:percona-server/5.5
Diff against target: 143 lines (+36/-12)
6 files modified
Percona-Server/storage/innobase/handler/i_s.cc (+2/-2)
Percona-Server/storage/innobase/include/ut0ut.h (+9/-0)
Percona-Server/storage/innobase/include/ut0ut.ic (+13/-0)
Percona-Server/storage/innobase/log/log0log.c (+2/-2)
Percona-Server/storage/innobase/log/log0online.c (+6/-6)
Percona-Server/storage/innobase/os/os0file.c (+4/-2)
To merge this branch: bzr merge lp:~laurynas-biveinis/percona-server/BT-16274-bug1087202-1087218-5.5
Reviewer Review Type Date Requested Status
Stewart Smith (community) Approve on 2012-12-17
Sergei Glushchenko (community) g2 2012-12-07 Approve on 2012-12-11
Review via email: mp+138731@code.launchpad.net

Description of the change

To post a comment you must log in.

Approve

review: Approve (g2)
Stewart Smith (stewart) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Percona-Server/storage/innobase/handler/i_s.cc'
2--- Percona-Server/storage/innobase/handler/i_s.cc 2012-11-25 09:30:58 +0000
3+++ Percona-Server/storage/innobase/handler/i_s.cc 2012-12-07 13:35:37 +0000
4@@ -7532,10 +7532,10 @@
5 LOG_BITMAP_ITERATOR_PAGE_NUM(i));
6 /* START_LSN */
7 table->field[2]->store(
8- LOG_BITMAP_ITERATOR_START_LSN(i));
9+ LOG_BITMAP_ITERATOR_START_LSN(i), true);
10 /* END_LSN */
11 table->field[3]->store(
12- LOG_BITMAP_ITERATOR_END_LSN(i));
13+ LOG_BITMAP_ITERATOR_END_LSN(i), true);
14
15 /*
16 I_S tables are in-memory tables. If bitmap file is big enough
17
18=== modified file 'Percona-Server/storage/innobase/include/ut0ut.h'
19--- Percona-Server/storage/innobase/include/ut0ut.h 2011-04-06 06:22:36 +0000
20+++ Percona-Server/storage/innobase/include/ut0ut.h 2012-12-07 13:35:37 +0000
21@@ -122,6 +122,15 @@
22 /*===*/
23 ulint n1, /*!< in: first number */
24 ulint n2); /*!< in: second number */
25+/******************************************************//**
26+Calculates the maximum of two ib_uint64_t values.
27+@return the maximum */
28+UNIV_INLINE
29+ib_uint64_t
30+ut_max_uint64(
31+/*==========*/
32+ ib_uint64_t n1, /*!< in: first number */
33+ ib_uint64_t n2); /*!< in: second number */
34 /****************************************************************//**
35 Calculates minimum of two ulint-pairs. */
36 UNIV_INLINE
37
38=== modified file 'Percona-Server/storage/innobase/include/ut0ut.ic'
39--- Percona-Server/storage/innobase/include/ut0ut.ic 2010-06-22 15:58:28 +0000
40+++ Percona-Server/storage/innobase/include/ut0ut.ic 2012-12-07 13:35:37 +0000
41@@ -49,6 +49,19 @@
42 return((n1 <= n2) ? n2 : n1);
43 }
44
45+/******************************************************//**
46+Calculates the maximum of two ib_uint64_t values.
47+@return the maximum */
48+UNIV_INLINE
49+ib_uint64_t
50+ut_max_uint64(
51+/*==========*/
52+ ib_uint64_t n1, /*!< in: first number */
53+ ib_uint64_t n2) /*!< in: second number */
54+{
55+ return((n1 <= n2) ? n2 : n1);
56+}
57+
58 /****************************************************************//**
59 Calculates minimum of two ulint-pairs. */
60 UNIV_INLINE
61
62=== modified file 'Percona-Server/storage/innobase/log/log0log.c'
63--- Percona-Server/storage/innobase/log/log0log.c 2012-08-22 07:21:28 +0000
64+++ Percona-Server/storage/innobase/log/log0log.c 2012-12-07 13:35:37 +0000
65@@ -246,7 +246,7 @@
66 checked for the already-written log. */
67 {
68 ib_uint64_t tracked_lsn;
69- ulint tracked_lsn_age;
70+ ib_uint64_t tracked_lsn_age;
71
72 if (!srv_track_changed_pages) {
73 return FALSE;
74@@ -458,7 +458,7 @@
75 ib_uint64_t oldest_lsn;
76 ib_uint64_t lsn;
77 ib_uint64_t tracked_lsn;
78- ulint tracked_lsn_age;
79+ ib_uint64_t tracked_lsn_age;
80 log_t* log = log_sys;
81 ib_uint64_t checkpoint_age;
82
83
84=== modified file 'Percona-Server/storage/innobase/log/log0online.c'
85--- Percona-Server/storage/innobase/log/log0online.c 2012-11-25 09:30:58 +0000
86+++ Percona-Server/storage/innobase/log/log0online.c 2012-12-07 13:35:37 +0000
87@@ -401,7 +401,7 @@
88 {
89 /* last_tracked_lsn might be < MIN_TRACKED_LSN in the case of empty
90 bitmap file, handle this too. */
91- last_tracked_lsn = ut_max(last_tracked_lsn, MIN_TRACKED_LSN);
92+ last_tracked_lsn = ut_max_uint64(last_tracked_lsn, MIN_TRACKED_LSN);
93
94 if (last_tracked_lsn > tracking_start_lsn) {
95 fprintf(stderr,
96@@ -443,8 +443,8 @@
97 fprintf(stderr,
98 "Reading the log to advance the last tracked LSN.\n");
99
100- log_bmp_sys->start_lsn = ut_max(last_tracked_lsn,
101- MIN_TRACKED_LSN);
102+ log_bmp_sys->start_lsn = ut_max_uint64(last_tracked_lsn,
103+ MIN_TRACKED_LSN);
104 log_set_tracked_lsn(log_bmp_sys->start_lsn);
105 log_online_follow_redo_log();
106 ut_ad(log_bmp_sys->end_lsn >= tracking_start_lsn);
107@@ -561,7 +561,7 @@
108 {
109 ibool success;
110 ib_uint64_t tracking_start_lsn
111- = ut_max(log_sys->last_checkpoint_lsn, MIN_TRACKED_LSN);
112+ = ut_max_uint64(log_sys->last_checkpoint_lsn, MIN_TRACKED_LSN);
113 os_file_dir_t bitmap_dir;
114 os_file_stat_t bitmap_dir_file_info;
115 ib_uint64_t last_file_start_lsn = MIN_TRACKED_LSN;
116@@ -932,8 +932,8 @@
117 /* The next parse LSN is inside the current block, skip
118 data preceding it. */
119 skip_already_parsed_len
120- = log_bmp_sys->next_parse_lsn
121- - block_start_lsn;
122+ = (ulint)(log_bmp_sys->next_parse_lsn
123+ - block_start_lsn);
124 }
125 else {
126
127
128=== modified file 'Percona-Server/storage/innobase/os/os0file.c'
129--- Percona-Server/storage/innobase/os/os0file.c 2012-08-22 07:21:28 +0000
130+++ Percona-Server/storage/innobase/os/os0file.c 2012-12-07 13:35:37 +0000
131@@ -2057,8 +2057,10 @@
132 ib_uint64_t new_len)/*!< in: new file length */
133 {
134 #ifdef __WIN__
135- /* TODO: untested! */
136- return(!_chsize_s(file, new_len));
137+ LARGE_INTEGER li, li2;
138+ li.QuadPart = new_len;
139+ return(SetFilePointerEx(file, li, &li2,FILE_BEGIN)
140+ && SetEndOfFile(file));
141 #else
142 /* TODO: works only with -D_FILE_OFFSET_BITS=64 ? */
143 return(!ftruncate(file, new_len));

Subscribers

People subscribed via source and target branches