Merge lp:~laurynas-biveinis/percona-server/bug1394357-5.5 into lp:percona-server/5.5

Proposed by Laurynas Biveinis
Status: Merged
Approved by: Laurynas Biveinis
Approved revision: no longer in the source branch.
Merged at revision: 722
Proposed branch: lp:~laurynas-biveinis/percona-server/bug1394357-5.5
Merge into: lp:percona-server/5.5
Diff against target: 41 lines (+7/-2)
3 files modified
storage/innobase/include/univ.i (+4/-0)
storage/innobase/log/log0log.c (+1/-1)
storage/innobase/log/log0recv.c (+2/-1)
To merge this branch: bzr merge lp:~laurynas-biveinis/percona-server/bug1394357-5.5
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) Approve
Review via email: mp+244825@code.launchpad.net

Description of the change

Fix bug 1394357 (innodb_log_block_size patch converted some C arrays
to VLAs).

The problem is that OS_FILE_LOG_BLOCK_SIZE is defined as
srv_log_block_size variable instead of a compile-time constant. That
in turn makes any OS_FILE_LOG_BLOCK_SIZE-sized local array VLAs, which
is non-portable C++ nor C90.

Fix by converting such arrays to alloca-allocated arrays. The fix is
loosely based on the corresponding fix in MariaDB.

    http://jenkins.percona.com/job/percona-server-5.5-param/1077/

To post a comment you must log in.
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'storage/innobase/include/univ.i'
2--- storage/innobase/include/univ.i 2014-09-30 09:04:07 +0000
3+++ storage/innobase/include/univ.i 2014-12-16 07:30:08 +0000
4@@ -122,6 +122,10 @@
5 # include <sched.h>
6 # endif
7
8+# ifdef HAVE_MALLOC_H
9+# include <malloc.h>
10+# endif
11+
12 /* We only try to do explicit inlining of functions with gcc and
13 Sun Studio */
14
15
16=== modified file 'storage/innobase/log/log0log.c'
17--- storage/innobase/log/log0log.c 2014-06-11 09:54:04 +0000
18+++ storage/innobase/log/log0log.c 2014-12-16 07:30:08 +0000
19@@ -252,7 +252,7 @@
20 {
21 ulint move_start;
22 ulint move_end;
23- byte tmp_buf[OS_FILE_LOG_BLOCK_SIZE];
24+ byte* tmp_buf = alloca(OS_FILE_LOG_BLOCK_SIZE);
25
26 mutex_enter(&(log_sys->mutex));
27
28
29=== modified file 'storage/innobase/log/log0recv.c'
30--- storage/innobase/log/log0recv.c 2013-10-23 08:23:08 +0000
31+++ storage/innobase/log/log0recv.c 2014-12-16 07:30:08 +0000
32@@ -2989,7 +2989,8 @@
33 #endif /* UNIV_LOG_ARCHIVE */
34 byte* buf;
35 byte* log_hdr_buf;
36- byte log_hdr_buf_base[LOG_FILE_HDR_SIZE + OS_FILE_LOG_BLOCK_SIZE];
37+ byte* log_hdr_buf_base = alloca(LOG_FILE_HDR_SIZE
38+ + OS_FILE_LOG_BLOCK_SIZE);
39 ulint err;
40
41 log_hdr_buf = ut_align(log_hdr_buf_base, OS_FILE_LOG_BLOCK_SIZE);

Subscribers

People subscribed via source and target branches