Merge lp:~sergei.glushchenko/percona-server/ps55-128-max-index into lp:percona-server/5.5

Proposed by Sergei Glushchenko
Status: Merged
Approved by: Alexey Kopytov
Approved revision: no longer in the source branch.
Merged at revision: 304
Proposed branch: lp:~sergei.glushchenko/percona-server/ps55-128-max-index
Merge into: lp:percona-server/5.5
Diff against target: 201 lines (+70/-5)
12 files modified
Percona-Server/CMakeLists.txt (+5/-0)
Percona-Server/config.h.cmake (+1/-1)
Percona-Server/mysql-test/include/have_64_keys.inc (+12/-0)
Percona-Server/mysql-test/r/have_64_keys.require (+14/-0)
Percona-Server/mysql-test/t/create.test (+5/-0)
Percona-Server/mysql-test/t/ps_1general.test (+5/-0)
Percona-Server/mysql-test/t/ps_2myisam.test (+5/-0)
Percona-Server/mysql-test/t/ps_3innodb.test (+5/-0)
Percona-Server/mysql-test/t/ps_4heap.test (+5/-0)
Percona-Server/mysql-test/t/ps_5merge.test (+5/-0)
Percona-Server/mysys/my_bitmap.c (+1/-1)
Percona-Server/sql/sql_bitmap.h (+7/-3)
To merge this branch: bzr merge lp:~sergei.glushchenko/percona-server/ps55-128-max-index
Reviewer Review Type Date Requested Status
Alexey Kopytov (community) Approve
Laurynas Biveinis (community) Needs Fixing
Review via email: mp+122521@code.launchpad.net

Description of the change

This is a port from
http://bazaar.launchpad.net/~percona-core/percona-server/rnt-5.1/revision/166

Been tested locally and the only failed tests were
main.create
main.ps_1general
main.ps_2myisam
main.ps_4heap
main.ps_5merge
main.ps_3innodb

which are designed with the assumption that MAX_INDEXES=64.

To post a comment you must log in.
Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote :

#25824

Revision history for this message
Alexey Kopytov (akopytov) wrote :

As discussed on IRC we should look into making the failing test cases pass (or be skipped) with all --with-max-indexes values.

review: Needs Fixing
Revision history for this message
Alexey Kopytov (akopytov) wrote :

And add a CMake option to control the max. index limit for 5.5.

review: Needs Fixing
Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote :

include/have_64_keys.inc been added to check whether we have exactly 64 max indexes or not. If we have not
main.create
main.ps_1general
main.ps_2myisam
main.ps_4heap
main.ps_5merge
main.ps_3innodb
are skipped.

Also MAX_INDEXES=N option been added to cmake to produce build with non-default MAX_INDEXES value.

http://jenkins.percona.com/view/PS%205.5/job/percona-server-5.5-param/490/

More than a half of debug Jenkins builds are failed because of known issue in upstream MySQL. This is reported in http://bugs.mysql.com/bug.php?id=65946, https://bugs.launchpad.net/percona-server/+bug/1050758.

Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

Same comments as for 5.1.

review: Needs Fixing
Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote :

Branch is updated now.

Revision history for this message
Alexey Kopytov (akopytov) wrote :

Sergei,

Can you add a docstring for the MAX_INDEXES option, so it appears in "cmake -L .", "cmake -LH .", etc?

You can copy it from the autoconf macro in 5.1: "Sets the maximum number of indexes per table, default 64".

review: Needs Fixing
Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote :

> Sergei,
>
> Can you add a docstring for the MAX_INDEXES option, so it appears in "cmake -L
> .", "cmake -LH .", etc?
>
> You can copy it from the autoconf macro in 5.1: "Sets the maximum number of
> indexes per table, default 64".
Done.

Revision history for this message
Alexey Kopytov (akopytov) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Percona-Server/CMakeLists.txt'
2--- Percona-Server/CMakeLists.txt 2012-04-19 16:51:34 +0000
3+++ Percona-Server/CMakeLists.txt 2012-09-26 13:24:24 +0000
4@@ -202,6 +202,11 @@
5 OPTION(WITH_FAST_MUTEXES "Compile with fast mutexes" OFF)
6 MARK_AS_ADVANCED(WITH_FAST_MUTEXES)
7
8+IF (NOT MAX_INDEXES)
9+ SET(MAX_INDEXES 64)
10+ENDIF()
11+SET(MAX_INDEXES ${MAX_INDEXES} CACHE STRING "Sets the maximum number of indexes per table, default 64")
12+
13 # Set DBUG_OFF and other optional release-only flags for non-debug project types
14 FOREACH(BUILD_TYPE RELEASE RELWITHDEBINFO MINSIZEREL)
15 FOREACH(LANG C CXX)
16
17=== modified file 'Percona-Server/config.h.cmake'
18--- Percona-Server/config.h.cmake 2011-08-09 08:03:29 +0000
19+++ Percona-Server/config.h.cmake 2012-09-26 13:24:24 +0000
20@@ -381,7 +381,7 @@
21
22 #cmakedefine HAVE_MBSTATE_T
23
24-#define MAX_INDEXES 64
25+#cmakedefine MAX_INDEXES @MAX_INDEXES@
26
27 #cmakedefine QSORT_TYPE_IS_VOID 1
28 #cmakedefine RETQSORTTYPE @RETQSORTTYPE@
29
30=== added file 'Percona-Server/mysql-test/include/have_64_keys.inc'
31--- Percona-Server/mysql-test/include/have_64_keys.inc 1970-01-01 00:00:00 +0000
32+++ Percona-Server/mysql-test/include/have_64_keys.inc 2012-09-26 13:24:24 +0000
33@@ -0,0 +1,12 @@
34+# Check that we have MAX_INDEXES=64
35+
36+--require r/have_64_keys.require
37+
38+# Check that maximum length of possible_keys and key_len fields is 4096
39+# They are defined in THD::send_explain_fields as NAME_CHAR_LEN*MAX_KEY
40+# where NAME_CHAR_LEN is always 64 (mysql_com.h) and MAX_KEY is
41+# a synonym of MAX_INDEXES
42+
43+--enable_metadata
44+EXPLAIN SELECT 1;
45+--disable_metadata
46
47=== added file 'Percona-Server/mysql-test/r/have_64_keys.require'
48--- Percona-Server/mysql-test/r/have_64_keys.require 1970-01-01 00:00:00 +0000
49+++ Percona-Server/mysql-test/r/have_64_keys.require 2012-09-26 13:24:24 +0000
50@@ -0,0 +1,14 @@
51+EXPLAIN SELECT 1;
52+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
53+def id 8 3 1 N 32929 0 63
54+def select_type 253 19 6 N 1 31 8
55+def table 253 64 0 Y 0 31 8
56+def type 253 10 0 Y 0 31 8
57+def possible_keys 253 4096 0 Y 0 31 8
58+def key 253 64 0 Y 0 31 8
59+def key_len 253 4096 0 Y 0 31 8
60+def ref 253 1024 0 Y 0 31 8
61+def rows 8 10 0 Y 32928 0 63
62+def Extra 253 255 14 N 1 31 8
63+id select_type table type possible_keys key key_len ref rows Extra
64+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
65
66=== modified file 'Percona-Server/mysql-test/t/create.test'
67--- Percona-Server/mysql-test/t/create.test 2012-04-18 23:26:28 +0000
68+++ Percona-Server/mysql-test/t/create.test 2012-09-26 13:24:24 +0000
69@@ -2,6 +2,11 @@
70 # Check some special create statements.
71 #
72
73+# This test checks some limits which are related to MAX_INDEXES constant
74+# which could be set to non-default value at build time.
75+# We just skip the test in this case.
76+--source include/have_64_keys.inc
77+
78 --disable_warnings
79 drop table if exists t1,t2,t3,t4,t5;
80 drop database if exists mysqltest;
81
82=== modified file 'Percona-Server/mysql-test/t/ps_1general.test'
83--- Percona-Server/mysql-test/t/ps_1general.test 2009-11-04 12:28:20 +0000
84+++ Percona-Server/mysql-test/t/ps_1general.test 2012-09-26 13:24:24 +0000
85@@ -4,6 +4,11 @@
86 # #
87 ##############################################################
88
89+# This test checks some limits which are related to MAX_INDEXES constant
90+# which could be set to non-default value at build time.
91+# We just skip the test in this case.
92+--source include/have_64_keys.inc
93+
94 #
95 # NOTE: PLEASE SEE THE DETAILED DESCRIPTION AT THE BOTTOM OF THIS FILE
96 # BEFORE ADDING NEW TEST CASES HERE !!!
97
98=== modified file 'Percona-Server/mysql-test/t/ps_2myisam.test'
99--- Percona-Server/mysql-test/t/ps_2myisam.test 2005-07-28 00:22:47 +0000
100+++ Percona-Server/mysql-test/t/ps_2myisam.test 2012-09-26 13:24:24 +0000
101@@ -4,6 +4,11 @@
102 # #
103 ###############################################
104
105+# This test checks some limits which are related to MAX_INDEXES constant
106+# which could be set to non-default value at build time.
107+# We just skip the test in this case.
108+--source include/have_64_keys.inc
109+
110 #
111 # NOTE: PLEASE SEE ps_1general.test (bottom)
112 # BEFORE ADDING NEW TEST CASES HERE !!!
113
114=== modified file 'Percona-Server/mysql-test/t/ps_3innodb.test'
115--- Percona-Server/mysql-test/t/ps_3innodb.test 2010-07-04 07:30:04 +0000
116+++ Percona-Server/mysql-test/t/ps_3innodb.test 2012-09-26 13:24:24 +0000
117@@ -4,6 +4,11 @@
118 # #
119 ###############################################
120
121+# This test checks some limits which are related to MAX_INDEXES constant
122+# which could be set to non-default value at build time.
123+# We just skip the test in this case.
124+--source include/have_64_keys.inc
125+
126 #
127 # NOTE: PLEASE SEE ps_1general.test (bottom)
128 # BEFORE ADDING NEW TEST CASES HERE !!!
129
130=== modified file 'Percona-Server/mysql-test/t/ps_4heap.test'
131--- Percona-Server/mysql-test/t/ps_4heap.test 2005-07-28 14:09:54 +0000
132+++ Percona-Server/mysql-test/t/ps_4heap.test 2012-09-26 13:24:24 +0000
133@@ -4,6 +4,11 @@
134 # #
135 ###############################################
136
137+# This test checks some limits which are related to MAX_INDEXES constant
138+# which could be set to non-default value at build time.
139+# We just skip the test in this case.
140+--source include/have_64_keys.inc
141+
142 #
143 # NOTE: PLEASE SEE ps_1general.test (bottom)
144 # BEFORE ADDING NEW TEST CASES HERE !!!
145
146=== modified file 'Percona-Server/mysql-test/t/ps_5merge.test'
147--- Percona-Server/mysql-test/t/ps_5merge.test 2005-07-28 14:09:54 +0000
148+++ Percona-Server/mysql-test/t/ps_5merge.test 2012-09-26 13:24:24 +0000
149@@ -4,6 +4,11 @@
150 # #
151 ###############################################
152
153+# This test checks some limits which are related to MAX_INDEXES constant
154+# which could be set to non-default value at build time.
155+# We just skip the test in this case.
156+--source include/have_64_keys.inc
157+
158 #
159 # NOTE: PLEASE SEE ps_1general.test (bottom)
160 # BEFORE ADDING NEW TEST CASES HERE !!!
161
162=== modified file 'Percona-Server/mysys/my_bitmap.c'
163--- Percona-Server/mysys/my_bitmap.c 2011-07-03 23:48:19 +0000
164+++ Percona-Server/mysys/my_bitmap.c 2012-09-26 13:24:24 +0000
165@@ -294,7 +294,7 @@
166 m+= prefix_bytes;
167 if ((prefix_bits= prefix_size & 7))
168 *(m++)= (1 << prefix_bits)-1;
169- if ((d= no_bytes_in_map(map)-prefix_bytes))
170+ if ((d= no_bytes_in_map(map) - (m - (uchar *) map->bitmap)))
171 bzero(m, d);
172 }
173
174
175=== modified file 'Percona-Server/sql/sql_bitmap.h'
176--- Percona-Server/sql/sql_bitmap.h 2011-06-30 15:46:53 +0000
177+++ Percona-Server/sql/sql_bitmap.h 2012-09-26 13:24:24 +0000
178@@ -51,7 +51,11 @@
179 void intersect(ulonglong map2buff)
180 {
181 MY_BITMAP map2;
182- bitmap_init(&map2, (uint32 *)&map2buff, sizeof(ulonglong)*8, 0);
183+ ulonglong buf;
184+
185+ /* bitmap_init() zeroes the supplied buffer */
186+ bitmap_init(&map2, (uint32 *)&buf, sizeof(ulonglong)*8, 0);
187+ buf= map2buff;
188 bitmap_intersect(&map, &map2);
189 }
190 /* Use highest bit for all bits above sizeof(ulonglong)*8. */
191@@ -91,9 +95,9 @@
192 ulonglong to_ulonglong() const
193 {
194 if (sizeof(buffer) >= 8)
195- return uint8korr(buffer);
196+ return uint8korr((uchar *) buffer);
197 DBUG_ASSERT(sizeof(buffer) >= 4);
198- return (ulonglong) uint4korr(buffer);
199+ return (ulonglong) uint4korr((uchar *) buffer);
200 }
201 };
202

Subscribers

People subscribed via source and target branches