Merge lp:~vlad-lesin/percona-server/5.5-bug-1038940-table_cache_speed_up into lp:percona-server/5.5
- 5.5-bug-1038940-table_cache_speed_up
- Merge into 5.5
Status: | Work in progress |
---|---|
Proposed branch: | lp:~vlad-lesin/percona-server/5.5-bug-1038940-table_cache_speed_up |
Merge into: | lp:percona-server/5.5 |
Diff against target: |
320 lines (+116/-34) 10 files modified
Percona-Server/storage/myisam/ha_myisam.cc (+3/-0) Percona-Server/storage/myisam/mi_close.c (+1/-1) Percona-Server/storage/myisam/mi_dbug.c (+3/-3) Percona-Server/storage/myisam/mi_keycache.c (+3/-3) Percona-Server/storage/myisam/mi_open.c (+67/-13) Percona-Server/storage/myisam/mi_panic.c (+24/-8) Percona-Server/storage/myisam/mi_static.c (+1/-1) Percona-Server/storage/myisam/myisamchk.c (+6/-0) Percona-Server/storage/myisam/myisamdef.h (+3/-3) Percona-Server/storage/myisam/myisampack.c (+5/-2) |
To merge this branch: | bzr merge lp:~vlad-lesin/percona-server/5.5-bug-1038940-table_cache_speed_up |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Laurynas Biveinis (community) | Needs Fixing | ||
Stewart Smith | Pending | ||
Review via email: mp+141748@code.launchpad.net |
Commit message
Description of the change
This MP is port of this http://
Jenkins test:
http://
- 387. By Stewart Smith
-
Merge lp:~lp-dev-merge-bot/percona-server/staging-5.1 containing lp:~vlad-lesin/percona-server/5.1-bug1049871-injections-gca to 5.5 - one small conflict
- 388. By Stewart Smith
-
reverse the bad merge from previous revision (r387 - Merge lp:~lp-dev-merge-bot/percona-server/staging-5.1 containing lp:~vlad-lesin/percona-server/5.1-bug1049871-injections-gca to 5.5 - one small conflict
modified). This merge was incorrect and caused rpl.rpl_mdev382 to fail - 389. By <email address hidden>
- 390. By <email address hidden>
-
Merge lp:~laurynas-biveinis/percona-server/BT-16274-bug1087202-10872128-5.5-2
- 391. By <email address hidden>
- 392. By <email address hidden>
-
Empty merge from Percona Server 5.1
- 393. By <email address hidden>
- 394. By <email address hidden>
- 395. By <email address hidden>
- 396. By <email address hidden>
-
Empty merge from Percona Server 5.1
- 397. By <email address hidden>
- 398. By <email address hidden>
- 399. By <email address hidden>
-
Empty merge from Percona Server 5.1
- 400. By <email address hidden>
- 401. By <email address hidden>
-
Empty merge from Percona Server 5.1
- 402. By Stewart Smith
-
merge 5.1.66-14.2 release branch
- 403. By <email address hidden>
- 404. By <email address hidden>
-
Empty merge from Percona Server 5.1
- 405. By <email address hidden>
-
Merge lp:~sergei.glushchenko/percona-server/ST-27220-bug1042946
- 406. By <email address hidden>
-
Empty merge from Percona Server 5.1
Laurynas Biveinis (laurynas-biveinis) wrote : | # |
- 407. By <email address hidden>
- 408. By <email address hidden>
- 409. By <email address hidden>
-
Empty merge from Percona Server 5.1
- 410. By <email address hidden>
-
Merge lp:~laurynas-biveinis/percona-server/BT-16724-xtradb-bmp-requests-5.5
- 411. By <email address hidden>
-
Empty merge from Percona Server 5.1
- 412. By <email address hidden>
-
Merge lp:~laurynas-biveinis/percona-server/BT-16274-bug1082437-5.5
- 413. By <email address hidden>
-
Empty merge from Percona Server 5.1
- 414. By <email address hidden>
-
Merge lp:~laurynas-biveinis/percona-server/BT-16274-bug1083596-5.5
- 415. By <email address hidden>
-
Merge lp:~laurynas-biveinis/percona-server/BT-16274-bug1083669-5.5
- 416. By <email address hidden>
- 417. By <email address hidden>
-
Empty merge from Percona Server 5.1
- 418. By <email address hidden>
-
Merge lp:~stewart/percona-server/5.5-bug986247-remove-optimizer-fix
- 419. By <email address hidden>
- 420. By <email address hidden>
- 421. By <email address hidden>
-
Merge lp:~laurynas-biveinis/percona-server/bug1100178-1100643-5.5
- 422. By <email address hidden>
-
Empty merge from Percona Server 5.1
- 423. By <email address hidden>
- 424. By <email address hidden>
- 425. By <email address hidden>
- 426. By <email address hidden>
- 427. By <email address hidden>
-
Empty merge from Percona Server 5.1
- 428. By <email address hidden>
- 429. By <email address hidden>
-
Empty merge from Percona Server 5.1
- 430. By <email address hidden>
-
Empty merge from Percona Server 5.1
- 431. By <email address hidden>
-
Empty merge from Percona Server 5.1
- 432. By <email address hidden>
- 433. By <email address hidden>
-
Merge lp:~laurynas-biveinis/percona-server/BT-16274-bug1111226-5.5
- 434. By <email address hidden>
- 435. By <email address hidden>
-
Merge lp:~laurynas-biveinis/percona-server/BT-16274-bug1108874-5.5
- 436. By <email address hidden>
-
Empty merge from Percona Server 5.1
- 437. By <email address hidden>
-
Empty merge from Percona Server 5.1
- 438. By <email address hidden>
-
Merge lp:~laurynas-biveinis/percona-server/slow-log-fixes-5.5
- 439. By Stewart Smith
-
null merge 5.1 implementation of slow query log fixes, as 5.5 is sep impl
- 440. By <email address hidden>
-
Merge lp:~laurynas-biveinis/percona-server/BT-16274-bug1105726-5.5
- 441. By <email address hidden>
- 442. By <email address hidden>
-
Empty merge from Percona Server 5.1
- 443. By <email address hidden>
-
Empty merge from Percona Server 5.1
- 444. By <email address hidden>
-
Empty merge from Percona Server 5.1
- 445. By <email address hidden>
- 446. By Alexey Kopytov
-
Bug #1126077: Remove clang warnings
Fixed an annoying warning in the InnoDB code produced by clang.
This is a backport from 5.6.
- 447. By <email address hidden>
- 448. By <email address hidden>
- 449. By <email address hidden>
- 450. By <email address hidden>
- 451. By Vlad Lesin
-
As the number of open tables is increased, table lookup
(testing if a table is already open) and (in particular)
the case when a table is not open, became increasingly more
expensive.The problem was caused by the open table lookup mechanism,
which was based on traversing a linked list comparing the
file names.As the list was replaced by a hash table, the lookup
time dropped significantly when used on systems with
a large number of open tables.The original patch can be found here:
http://lists.mysql. com/commits/ 121507
Vlad Lesin (vlad-lesin) wrote : | # |
> At line 193, "if (my_hash_
> think.
Fixed. As well unnecessary changes from mi_panic.c are removed. Currently 5.1, 5.5 and 5.6 patches are almost the same.
> Also, please make a 5.6 MP (without a bzr merge).
Done. See bug related branches.
Jenkins: http://
Laurynas Biveinis (laurynas-biveinis) wrote : | # |
The patch is OK, but I'll have to ask you to redo it as a GCA involving all three 5.1/5.5/5.6.
Unmerged revisions
- 451. By Vlad Lesin
-
As the number of open tables is increased, table lookup
(testing if a table is already open) and (in particular)
the case when a table is not open, became increasingly more
expensive.The problem was caused by the open table lookup mechanism,
which was based on traversing a linked list comparing the
file names.As the list was replaced by a hash table, the lookup
time dropped significantly when used on systems with
a large number of open tables.The original patch can be found here:
http://lists.mysql. com/commits/ 121507
Preview Diff
1 | === modified file 'Percona-Server/storage/myisam/ha_myisam.cc' | |||
2 | --- Percona-Server/storage/myisam/ha_myisam.cc 2012-10-17 03:47:45 +0000 | |||
3 | +++ Percona-Server/storage/myisam/ha_myisam.cc 2013-02-24 23:11:32 +0000 | |||
4 | @@ -2191,6 +2191,9 @@ | |||
5 | 2191 | myisam_hton->flags= HTON_CAN_RECREATE | HTON_SUPPORT_LOG_TABLES; | 2191 | myisam_hton->flags= HTON_CAN_RECREATE | HTON_SUPPORT_LOG_TABLES; |
6 | 2192 | myisam_hton->is_supported_system_table= myisam_is_supported_system_table; | 2192 | myisam_hton->is_supported_system_table= myisam_is_supported_system_table; |
7 | 2193 | 2193 | ||
8 | 2194 | if (mi_init_open_table_hash(table_cache_size)) | ||
9 | 2195 | return 1; | ||
10 | 2196 | |||
11 | 2194 | return 0; | 2197 | return 0; |
12 | 2195 | } | 2198 | } |
13 | 2196 | 2199 | ||
14 | 2197 | 2200 | ||
15 | === modified file 'Percona-Server/storage/myisam/mi_close.c' | |||
16 | --- Percona-Server/storage/myisam/mi_close.c 2012-02-16 09:48:16 +0000 | |||
17 | +++ Percona-Server/storage/myisam/mi_close.c 2013-02-24 23:11:32 +0000 | |||
18 | @@ -54,7 +54,7 @@ | |||
19 | 54 | info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED); | 54 | info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED); |
20 | 55 | } | 55 | } |
21 | 56 | flag= !--share->reopen; | 56 | flag= !--share->reopen; |
23 | 57 | myisam_open_list=list_delete(myisam_open_list,&info->open_list); | 57 | my_hash_delete(&myisam_open_table_hash, (uchar *) info); |
24 | 58 | mysql_mutex_unlock(&share->intern_lock); | 58 | mysql_mutex_unlock(&share->intern_lock); |
25 | 59 | 59 | ||
26 | 60 | my_free(mi_get_rec_buff_ptr(info, info->rec_buff)); | 60 | my_free(mi_get_rec_buff_ptr(info, info->rec_buff)); |
27 | 61 | 61 | ||
28 | === modified file 'Percona-Server/storage/myisam/mi_dbug.c' | |||
29 | --- Percona-Server/storage/myisam/mi_dbug.c 2011-06-30 15:46:53 +0000 | |||
30 | +++ Percona-Server/storage/myisam/mi_dbug.c 2013-02-24 23:11:32 +0000 | |||
31 | @@ -181,14 +181,14 @@ | |||
32 | 181 | my_bool check_table_is_closed(const char *name, const char *where) | 181 | my_bool check_table_is_closed(const char *name, const char *where) |
33 | 182 | { | 182 | { |
34 | 183 | char filename[FN_REFLEN]; | 183 | char filename[FN_REFLEN]; |
36 | 184 | LIST *pos; | 184 | uint idx; |
37 | 185 | DBUG_ENTER("check_table_is_closed"); | 185 | DBUG_ENTER("check_table_is_closed"); |
38 | 186 | 186 | ||
39 | 187 | (void) fn_format(filename,name,"",MI_NAME_IEXT,4+16+32); | 187 | (void) fn_format(filename,name,"",MI_NAME_IEXT,4+16+32); |
40 | 188 | mysql_mutex_lock(&THR_LOCK_myisam); | 188 | mysql_mutex_lock(&THR_LOCK_myisam); |
42 | 189 | for (pos=myisam_open_list ; pos ; pos=pos->next) | 189 | for (idx= 0; idx < myisam_open_table_hash.records; ++idx) |
43 | 190 | { | 190 | { |
45 | 191 | MI_INFO *info=(MI_INFO*) pos->data; | 191 | MI_INFO *info=(MI_INFO*) my_hash_element(&myisam_open_table_hash, idx); |
46 | 192 | MYISAM_SHARE *share=info->s; | 192 | MYISAM_SHARE *share=info->s; |
47 | 193 | if (!strcmp(share->unique_file_name,filename)) | 193 | if (!strcmp(share->unique_file_name,filename)) |
48 | 194 | { | 194 | { |
49 | 195 | 195 | ||
50 | === modified file 'Percona-Server/storage/myisam/mi_keycache.c' | |||
51 | --- Percona-Server/storage/myisam/mi_keycache.c 2011-06-30 15:46:53 +0000 | |||
52 | +++ Percona-Server/storage/myisam/mi_keycache.c 2013-02-24 23:11:32 +0000 | |||
53 | @@ -138,16 +138,16 @@ | |||
54 | 138 | void mi_change_key_cache(KEY_CACHE *old_key_cache, | 138 | void mi_change_key_cache(KEY_CACHE *old_key_cache, |
55 | 139 | KEY_CACHE *new_key_cache) | 139 | KEY_CACHE *new_key_cache) |
56 | 140 | { | 140 | { |
58 | 141 | LIST *pos; | 141 | uint idx; |
59 | 142 | DBUG_ENTER("mi_change_key_cache"); | 142 | DBUG_ENTER("mi_change_key_cache"); |
60 | 143 | 143 | ||
61 | 144 | /* | 144 | /* |
62 | 145 | Lock list to ensure that no one can close the table while we manipulate it | 145 | Lock list to ensure that no one can close the table while we manipulate it |
63 | 146 | */ | 146 | */ |
64 | 147 | mysql_mutex_lock(&THR_LOCK_myisam); | 147 | mysql_mutex_lock(&THR_LOCK_myisam); |
66 | 148 | for (pos=myisam_open_list ; pos ; pos=pos->next) | 148 | for (idx= 0; idx < myisam_open_table_hash.records; ++idx) |
67 | 149 | { | 149 | { |
69 | 150 | MI_INFO *info= (MI_INFO*) pos->data; | 150 | MI_INFO *info=(MI_INFO*) my_hash_element(&myisam_open_table_hash, idx); |
70 | 151 | MYISAM_SHARE *share= info->s; | 151 | MYISAM_SHARE *share= info->s; |
71 | 152 | if (share->key_cache == old_key_cache) | 152 | if (share->key_cache == old_key_cache) |
72 | 153 | mi_assign_to_key_cache(info, (ulonglong) ~0, new_key_cache); | 153 | mi_assign_to_key_cache(info, (ulonglong) ~0, new_key_cache); |
73 | 154 | 154 | ||
74 | === modified file 'Percona-Server/storage/myisam/mi_open.c' | |||
75 | --- Percona-Server/storage/myisam/mi_open.c 2012-10-31 13:02:53 +0000 | |||
76 | +++ Percona-Server/storage/myisam/mi_open.c 2013-02-24 23:11:32 +0000 | |||
77 | @@ -37,23 +37,76 @@ | |||
78 | 37 | } | 37 | } |
79 | 38 | 38 | ||
80 | 39 | 39 | ||
86 | 40 | /****************************************************************************** | 40 | /* |
87 | 41 | ** Return the shared struct if the table is already open. | 41 | Get the value used as hash key (helper function for the |
88 | 42 | ** In MySQL the server will handle version issues. | 42 | open table hash). Function is used as a callback |
89 | 43 | ******************************************************************************/ | 43 | from the hash table |
90 | 44 | 44 | */ | |
91 | 45 | static uchar *mi_open_table_hash_key(const uchar *record, size_t *length, | ||
92 | 46 | my_bool not_used __attribute__((unused))) | ||
93 | 47 | { | ||
94 | 48 | MI_INFO *info= (MI_INFO *) record; | ||
95 | 49 | *length= info->s->unique_name_length; | ||
96 | 50 | return (uchar*) info->s->unique_file_name; | ||
97 | 51 | } | ||
98 | 52 | |||
99 | 53 | /** | ||
100 | 54 | Initialize open table hash | ||
101 | 55 | |||
102 | 56 | Function is normally called from myisam_init | ||
103 | 57 | with the system variable table_cache_size used | ||
104 | 58 | as hash_size. | ||
105 | 59 | |||
106 | 60 | @param[in] hash_size Initial has size (elements) | ||
107 | 61 | @return inidicates success or failure of initialization | ||
108 | 62 | @retval 0 success | ||
109 | 63 | @retval 1 failure | ||
110 | 64 | |||
111 | 65 | */ | ||
112 | 66 | int mi_init_open_table_hash(ulong hash_size) | ||
113 | 67 | { | ||
114 | 68 | if (hash_size == 0) | ||
115 | 69 | hash_size= 32; /* default hash size */ | ||
116 | 70 | |||
117 | 71 | if (my_hash_init(&myisam_open_table_hash, &my_charset_filename, | ||
118 | 72 | hash_size, 0, 0, mi_open_table_hash_key, 0, 0)) | ||
119 | 73 | return 1; /* error */ | ||
120 | 74 | |||
121 | 75 | return 0; | ||
122 | 76 | } | ||
123 | 77 | |||
124 | 78 | |||
125 | 79 | /** | ||
126 | 80 | Retrieve the shared struct if the table is already | ||
127 | 81 | open (i.e in the open table hash) | ||
128 | 82 | |||
129 | 83 | @param[in] filename table file name | ||
130 | 84 | @return shared struct, 0 if not in the cache | ||
131 | 85 | */ | ||
132 | 45 | MI_INFO *test_if_reopen(char *filename) | 86 | MI_INFO *test_if_reopen(char *filename) |
133 | 46 | { | 87 | { |
135 | 47 | LIST *pos; | 88 | HASH_SEARCH_STATE current_record; |
136 | 89 | int len= strlen(filename); | ||
137 | 48 | 90 | ||
139 | 49 | for (pos=myisam_open_list ; pos ; pos=pos->next) | 91 | MI_INFO *info= (MI_INFO*) my_hash_first(&myisam_open_table_hash, |
140 | 92 | (uchar *) filename, | ||
141 | 93 | len, ¤t_record); | ||
142 | 94 | /* | ||
143 | 95 | There might be more than one instance of a table share for | ||
144 | 96 | a given table in the hash table. We're interested in the one with | ||
145 | 97 | last_version set, so we iterate until we find it | ||
146 | 98 | */ | ||
147 | 99 | while (info) | ||
148 | 50 | { | 100 | { |
149 | 51 | MI_INFO *info=(MI_INFO*) pos->data; | ||
150 | 52 | MYISAM_SHARE *share=info->s; | 101 | MYISAM_SHARE *share=info->s; |
153 | 53 | if (!strcmp(share->unique_file_name,filename) && share->last_version) | 102 | if (share->last_version) |
154 | 54 | return info; | 103 | break; |
155 | 104 | |||
156 | 105 | info= (MI_INFO*) my_hash_next(&myisam_open_table_hash, | ||
157 | 106 | (uchar *) filename, | ||
158 | 107 | len, ¤t_record); | ||
159 | 55 | } | 108 | } |
161 | 56 | return 0; | 109 | return info; |
162 | 57 | } | 110 | } |
163 | 58 | 111 | ||
164 | 59 | 112 | ||
165 | @@ -623,8 +676,9 @@ | |||
166 | 623 | 676 | ||
167 | 624 | *m_info=info; | 677 | *m_info=info; |
168 | 625 | thr_lock_data_init(&share->lock,&m_info->lock,(void*) m_info); | 678 | thr_lock_data_init(&share->lock,&m_info->lock,(void*) m_info); |
171 | 626 | m_info->open_list.data=(void*) m_info; | 679 | |
172 | 627 | myisam_open_list=list_add(myisam_open_list,&m_info->open_list); | 680 | if (my_hash_insert(&myisam_open_table_hash, (uchar *) m_info)) |
173 | 681 | goto err; | ||
174 | 628 | 682 | ||
175 | 629 | mysql_mutex_unlock(&THR_LOCK_myisam); | 683 | mysql_mutex_unlock(&THR_LOCK_myisam); |
176 | 630 | 684 | ||
177 | 631 | 685 | ||
178 | === modified file 'Percona-Server/storage/myisam/mi_panic.c' | |||
179 | --- Percona-Server/storage/myisam/mi_panic.c 2011-06-30 15:46:53 +0000 | |||
180 | +++ Percona-Server/storage/myisam/mi_panic.c 2013-02-24 23:11:32 +0000 | |||
181 | @@ -27,22 +27,36 @@ | |||
182 | 27 | int mi_panic(enum ha_panic_function flag) | 27 | int mi_panic(enum ha_panic_function flag) |
183 | 28 | { | 28 | { |
184 | 29 | int error=0; | 29 | int error=0; |
185 | 30 | LIST *list_element,*next_open; | ||
186 | 31 | MI_INFO *info; | 30 | MI_INFO *info; |
187 | 31 | uint idx; | ||
188 | 32 | DBUG_ENTER("mi_panic"); | 32 | DBUG_ENTER("mi_panic"); |
189 | 33 | 33 | ||
190 | 34 | mysql_mutex_lock(&THR_LOCK_myisam); | 34 | mysql_mutex_lock(&THR_LOCK_myisam); |
192 | 35 | for (list_element=myisam_open_list ; list_element ; list_element=next_open) | 35 | |
193 | 36 | if (!my_hash_inited(&myisam_open_table_hash)) | ||
194 | 37 | goto finish; | ||
195 | 38 | |||
196 | 39 | if (flag == HA_PANIC_CLOSE) | ||
197 | 36 | { | 40 | { |
202 | 37 | next_open=list_element->next; /* Save if close */ | 41 | while (myisam_open_table_hash.records) |
203 | 38 | info=(MI_INFO*) list_element->data; | 42 | { |
204 | 39 | switch (flag) { | 43 | /* |
205 | 40 | case HA_PANIC_CLOSE: | 44 | As long as there are records in the hash, fetch the |
206 | 45 | first, and close it. | ||
207 | 46 | */ | ||
208 | 47 | info=(MI_INFO*) my_hash_element(&myisam_open_table_hash, 0); | ||
209 | 41 | mysql_mutex_unlock(&THR_LOCK_myisam); /* Not exactly right... */ | 48 | mysql_mutex_unlock(&THR_LOCK_myisam); /* Not exactly right... */ |
210 | 42 | if (mi_close(info)) | 49 | if (mi_close(info)) |
212 | 43 | error=my_errno; | 50 | error= my_errno; |
213 | 44 | mysql_mutex_lock(&THR_LOCK_myisam); | 51 | mysql_mutex_lock(&THR_LOCK_myisam); |
215 | 45 | break; | 52 | } |
216 | 53 | } | ||
217 | 54 | |||
218 | 55 | for (idx= 0; idx < myisam_open_table_hash.records; ++idx) | ||
219 | 56 | { | ||
220 | 57 | info=(MI_INFO*) my_hash_element(&myisam_open_table_hash, idx); | ||
221 | 58 | switch (flag) { | ||
222 | 59 | case HA_PANIC_CLOSE: break; | ||
223 | 46 | case HA_PANIC_WRITE: /* Do this to free databases */ | 60 | case HA_PANIC_WRITE: /* Do this to free databases */ |
224 | 47 | #ifdef CANT_OPEN_FILES_TWICE | 61 | #ifdef CANT_OPEN_FILES_TWICE |
225 | 48 | if (info->s->options & HA_OPTION_READ_ONLY_DATA) | 62 | if (info->s->options & HA_OPTION_READ_ONLY_DATA) |
226 | @@ -111,6 +125,8 @@ | |||
227 | 111 | (void) mi_log(0); /* Close log if neaded */ | 125 | (void) mi_log(0); /* Close log if neaded */ |
228 | 112 | ft_free_stopwords(); | 126 | ft_free_stopwords(); |
229 | 113 | } | 127 | } |
230 | 128 | |||
231 | 129 | finish: | ||
232 | 114 | mysql_mutex_unlock(&THR_LOCK_myisam); | 130 | mysql_mutex_unlock(&THR_LOCK_myisam); |
233 | 115 | if (!error) | 131 | if (!error) |
234 | 116 | DBUG_RETURN(0); | 132 | DBUG_RETURN(0); |
235 | 117 | 133 | ||
236 | === modified file 'Percona-Server/storage/myisam/mi_static.c' | |||
237 | --- Percona-Server/storage/myisam/mi_static.c 2011-06-30 15:46:53 +0000 | |||
238 | +++ Percona-Server/storage/myisam/mi_static.c 2013-02-24 23:11:32 +0000 | |||
239 | @@ -22,7 +22,7 @@ | |||
240 | 22 | #include "myisamdef.h" | 22 | #include "myisamdef.h" |
241 | 23 | #endif | 23 | #endif |
242 | 24 | 24 | ||
244 | 25 | LIST *myisam_open_list=0; | 25 | HASH myisam_open_table_hash; |
245 | 26 | uchar myisam_file_magic[]= | 26 | uchar myisam_file_magic[]= |
246 | 27 | { (uchar) 254, (uchar) 254,'\007', '\001', }; | 27 | { (uchar) 254, (uchar) 254,'\007', '\001', }; |
247 | 28 | uchar myisam_pack_file_magic[]= | 28 | uchar myisam_pack_file_magic[]= |
248 | 29 | 29 | ||
249 | === modified file 'Percona-Server/storage/myisam/myisamchk.c' | |||
250 | --- Percona-Server/storage/myisam/myisamchk.c 2012-10-30 14:10:42 +0000 | |||
251 | +++ Percona-Server/storage/myisam/myisamchk.c 2013-02-24 23:11:32 +0000 | |||
252 | @@ -88,6 +88,12 @@ | |||
253 | 88 | get_options(&argc,(char***) &argv); | 88 | get_options(&argc,(char***) &argv); |
254 | 89 | myisam_quick_table_bits=decode_bits; | 89 | myisam_quick_table_bits=decode_bits; |
255 | 90 | error=0; | 90 | error=0; |
256 | 91 | if (mi_init_open_table_hash(0)) | ||
257 | 92 | { | ||
258 | 93 | fprintf(stderr, "Can't initialize MyISAM storage engine\n"); | ||
259 | 94 | exit(-1); | ||
260 | 95 | } | ||
261 | 96 | |||
262 | 91 | while (--argc >= 0) | 97 | while (--argc >= 0) |
263 | 92 | { | 98 | { |
264 | 93 | int new_error=myisamchk(&check_param, *(argv++)); | 99 | int new_error=myisamchk(&check_param, *(argv++)); |
265 | 94 | 100 | ||
266 | === modified file 'Percona-Server/storage/myisam/myisamdef.h' | |||
267 | --- Percona-Server/storage/myisam/myisamdef.h 2012-05-10 07:49:14 +0000 | |||
268 | +++ Percona-Server/storage/myisam/myisamdef.h 2013-02-24 23:11:32 +0000 | |||
269 | @@ -22,6 +22,7 @@ | |||
270 | 22 | #include <my_pthread.h> | 22 | #include <my_pthread.h> |
271 | 23 | #include <thr_lock.h> | 23 | #include <thr_lock.h> |
272 | 24 | #include <mysql/psi/mysql_file.h> | 24 | #include <mysql/psi/mysql_file.h> |
273 | 25 | #include "hash.h" | ||
274 | 25 | 26 | ||
275 | 26 | /* undef map from my_nosys; We need test-if-disk full */ | 27 | /* undef map from my_nosys; We need test-if-disk full */ |
276 | 27 | #if defined(my_write) | 28 | #if defined(my_write) |
277 | @@ -281,7 +282,6 @@ | |||
278 | 281 | uint data_changed; /* Somebody has changed data */ | 282 | uint data_changed; /* Somebody has changed data */ |
279 | 282 | uint save_update; /* When using KEY_READ */ | 283 | uint save_update; /* When using KEY_READ */ |
280 | 283 | int save_lastinx; | 284 | int save_lastinx; |
281 | 284 | LIST open_list; | ||
282 | 285 | IO_CACHE rec_cache; /* When cacheing records */ | 285 | IO_CACHE rec_cache; /* When cacheing records */ |
283 | 286 | uint preload_buff_size; /* When preloading indexes */ | 286 | uint preload_buff_size; /* When preloading indexes */ |
284 | 287 | myf lock_wait; /* is 0 or MY_DONT_WAIT */ | 287 | myf lock_wait; /* is 0 or MY_DONT_WAIT */ |
285 | @@ -465,8 +465,7 @@ | |||
286 | 465 | #endif | 465 | #endif |
287 | 466 | 466 | ||
288 | 467 | /* Some extern variables */ | 467 | /* Some extern variables */ |
291 | 468 | 468 | extern HASH myisam_open_table_hash; | |
290 | 469 | extern LIST *myisam_open_list; | ||
292 | 470 | extern uchar myisam_file_magic[], myisam_pack_file_magic[]; | 469 | extern uchar myisam_file_magic[], myisam_pack_file_magic[]; |
293 | 471 | extern uint myisam_read_vec[], myisam_readnext_vec[]; | 470 | extern uint myisam_read_vec[], myisam_readnext_vec[]; |
294 | 472 | extern uint myisam_quick_table_bits; | 471 | extern uint myisam_quick_table_bits; |
295 | @@ -748,6 +747,7 @@ | |||
296 | 748 | void mi_disable_non_unique_index(MI_INFO *info, ha_rows rows); | 747 | void mi_disable_non_unique_index(MI_INFO *info, ha_rows rows); |
297 | 749 | 748 | ||
298 | 750 | extern MI_INFO *test_if_reopen(char *filename); | 749 | extern MI_INFO *test_if_reopen(char *filename); |
299 | 750 | extern int mi_init_open_table_hash(ulong size); | ||
300 | 751 | my_bool check_table_is_closed(const char *name, const char *where); | 751 | my_bool check_table_is_closed(const char *name, const char *where); |
301 | 752 | int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share, const char *orn_name, | 752 | int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share, const char *orn_name, |
302 | 753 | File file_to_dup); | 753 | File file_to_dup); |
303 | 754 | 754 | ||
304 | === modified file 'Percona-Server/storage/myisam/myisampack.c' | |||
305 | --- Percona-Server/storage/myisam/myisampack.c 2011-06-30 15:46:53 +0000 | |||
306 | +++ Percona-Server/storage/myisam/myisampack.c 2013-02-24 23:11:32 +0000 | |||
307 | @@ -207,9 +207,12 @@ | |||
308 | 207 | char **default_argv; | 207 | char **default_argv; |
309 | 208 | MY_INIT(argv[0]); | 208 | MY_INIT(argv[0]); |
310 | 209 | 209 | ||
312 | 210 | if (load_defaults("my",load_default_groups,&argc,&argv)) | 210 | if (load_defaults("my",load_default_groups,&argc,&argv) || |
313 | 211 | mi_init_open_table_hash(0)) | ||
314 | 212 | { | ||
315 | 213 | fputs("Can't initialize MyISAM storage engine", stderr); | ||
316 | 211 | exit(1); | 214 | exit(1); |
318 | 212 | 215 | } | |
319 | 213 | default_argv= argv; | 216 | default_argv= argv; |
320 | 214 | get_options(&argc,&argv); | 217 | get_options(&argc,&argv); |
321 | 215 | 218 |
At line 193, "if (my_hash_ inited( ...))" should be !my_hash_inited instead I think.
Also, please make a 5.6 MP (without a bzr merge).