Merge lp:~vlad-lesin/percona-server/5.1-table_cache_speed_up into lp:percona-server/5.1

Proposed by Vlad Lesin
Status: Work in progress
Proposed branch: lp:~vlad-lesin/percona-server/5.1-table_cache_speed_up
Merge into: lp:percona-server/5.1
Diff against target: 318 lines (+118/-33)
10 files modified
Percona-Server/storage/myisam/ha_myisam.cc (+4/-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 (+25/-9)
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/-0)
To merge this branch: bzr merge lp:~vlad-lesin/percona-server/5.1-table_cache_speed_up
Reviewer Review Type Date Requested Status
Stewart Smith (community) Needs Fixing
Alexey Kopytov (community) Approve
Review via email: mp+120285@code.launchpad.net

Description of the change

This MP is port of this http://lists.mysql.com/commits/121507 patch to 5.1(see issue #25137). The main idea of this patch is to replace linked list of opened tables with hash-table to improve performance of open table lookup mechanism.

Jenkins build of 5.1 with this patch is:
http://jenkins.percona.com/view/PS%205.1/job/percona-server-5.1-param/367/

Jenkins build of 5.1 without this patch is:
http://jenkins.percona.com/view/PS%205.1/job/percona-server-5.1-param/369/

There are three tests which failed on patched version and were success on original 5.1:
1) innodb_plugin.percona_changed_page_bmp
(I think the trouble is in that "120813 15:38:22 [Warning] '--default-character-set' is deprecated and will be removed in a future release. Please use '--character-set-server' instead." warning and doesn't concern this patch)
2) rpl.percona_bug860910 'stmt'
It doesn't seem to be failed due to the patch. It passed at the second attempt and I can't repeat failure on my local host. I this the success passing of this test depends on host load.
3) rpl.rpl_stop_slave 'stmt'
I don't know how to interpret this failure. Console output shows that the project was not built. But the same log shows that tests were started and this is the only executed test.

There are four tests which failed on original 5.1 and were success on patched version:
1) main.percona_log_slow_slave_statements-innodb
2) rpl.percona_bug860910 'row'
3) rpl.rpl_row_func003 'row'
4) rpl.rpl_start_stop_slave 'mix'

To post a comment you must log in.
465. By Stewart Smith

merge fix for Bug #905334: Intermittent innodb_bug56680 crash

466. By Stewart Smith

merge mysql-5.1.65 from lp:percona-server/upstream-5.1. This was a simple merge, 2 conflicts. One in mysqldump.cc (added code near Percona added code, simple fix) and one in sql_class.cc (new mutex added by PS and upstream, simple merge).

467. By Stewart Smith

fix percona_server_variables_debug from 5.1.65 merge (MySQl 5.1.65 added SLAVE_MAX_ALLOWED_PACKET)

468. By Stewart Smith

fix debug assert in kill_idle_trx. After revid:<email address hidden> we need to use LOCK_thd_kill rather than LOCK_THD_data for kill idle trx. This revid fixed a deadlock bug by introducing a new mutex.

469. By Stewart Smith

post merge fix: new DBUG_ASSERT() assertions in ha_innodb::clone() are incorrect. Confirmed by laurynas, pointing to revid:<email address hidden>

470. By Stewart Smith

merge HandlerSocket fix (fix is due to BZR having an odd bug checking out the repository)

471. By Stewart Smith

merge fix for Bug lp:1040483 UNIV_NONINL build broken

472. By Stewart Smith

merge fix for Bug #1036530: Sporadic innodb_plugin.percona_changed_page_bmp failures in Jenkins

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

Approved after fixing revision comments to reference the bug number.

review: Approve
473. By Stewart Smith

merge fix for Bug #1039384: innodb_adaptive_flushing_method and innodb_flush_neighbor_pages partially broken

474. By Stewart Smith

merge 5.1.63-13.4 release branch

475. By Stewart Smith

merge fix for Bug #1023883: libmysqlclient16-dev 'Replaces' libmysqlclient16-dev but doesn't 'Provides' it

476. By Stewart Smith

merge fix for Bug #902472: main.subselect_notembedded fails on Ubuntu Oneiric in Jenkins

477. By Hrvoje Matijakovic

Merged lp:~hrvojem/percona-server/rn-5.1.65-14.0

478. By Stewart Smith

merge fix for Bug #1039931: 64-bit atomic operation Autoconf tests duplicated in regular atomic operation tests

479. By Stewart Smith

merge fix for Bug #902471: Lots of ssl tests failures on oneiric hosts

480. By Stewart Smith

merge Bug #747032: Flashcache throws an error on startup when flashcache is not used

481. By Stewart Smith

merge 5.1.65-14.0 release branch

482. By Hrvoje Matijakovic

Merged lp:~hrvojem/percona-server/bug1034305-5.1

483. By Stewart Smith

merge fix for: Bug #1046389: UNIV_DEBUG build broken

484. By Hrvoje Matijakovic

* bug fix for Bug #1054090

Revision history for this message
Stewart Smith (stewart) wrote :

This will need 5.5 branch before I can merge.

485. By Stewart Smith

merge fix for Bug #978036: Percona server crashes on ALTER TABLE on temporary table

486. By Stewart Smith

merge fix for Bug #1053087: incorrect mutex handling during buf_LRU_file_dump

487. By Stewart Smith

merge fix for Bug #1028240: Postfix crashes using shared dependency(libmysqlclient.so) provided by Percona Server-shared-compat / Percona-Server-shared in CentOS/RHEL 6.x

488. By Stewart Smith

merge fix for Bug #1042517: Custom Percona Server 5.5.27 build crashes when compiled with MAX_INDEXES between 121-128 in config.h.cmake

489. By Stewart Smith

merge fix for Bug #907499: ubuntu packaging: percona-server-client-5.x should conflict (/provides) mysql-client-core-5.x / percona-server-server-5.x should conflict mysql-server-core-5.x

490. By Stewart Smith

merge fix for Bug #805805: attaching to percona-server with gdb disconnects clients and Bug #1060136: safe_process.cc/safe_process.pl should not kill mysqld on SIGSTOP/SIGCONT

491. By Stewart Smith

merge documentation updates

492. By Hrvoje Matijakovic

Added missing release dates, bugfix for Bug #1057029

493. By Hrvoje Matijakovic

Added missing release dates, bugfix for Bug #1057029

494. By Stewart Smith

merge 5.1.66-14.1 release notes

495. By Hrvoje Matijakovic

Bug fix for Bug#1056658

496. By Hrvoje Matijakovic

* bug fix for Bug #1056603
* added missing tables with the description
* fixed already existing I_S tables

497. By <email address hidden>

Merge lp:~laurynas-biveinis/percona-server/bug1076215-5.1

498. By <email address hidden>

Merge lp:~laurynas-biveinis/percona-server/26611-bug917942-5.1

499. By <email address hidden>

Merge lp:~laurynas-biveinis/percona-server/26611-bug1064333-5.1

500. By <email address hidden>

Merge lp:~laurynas-biveinis/percona-server/26611-bug1059738-5.1

501. By <email address hidden>

Merge lp:~akopytov/percona-server/bugs-1039536-1081003-5.1

502. By <email address hidden>

Merge lp:~akopytov/percona-server/bug1070856-5.1

503. By <email address hidden>

Merge lp:~akopytov/percona-server/bug830286-5.1

504. By <email address hidden>

Merge lp:~laurynas-biveinis/percona-server/bug901060-5.1

505. By <email address hidden>

Merge lp:~laurynas-biveinis/percona-server/xtradb-multiple-bmp-files-51

506. By <email address hidden>

Merge lp:~vlad-lesin/percona-server/5.1-bug1083377-gca

507. By <email address hidden>

Merge lp:~stewart/percona-server/5.1-bug1090596

508. By <email address hidden>

Merge lp:~hrvojem/percona-server/bug1057031-5.1

Revision history for this message
Stewart Smith (stewart) wrote :

needs 5.5 branch before I can merge.

review: Needs Fixing
509. By <email address hidden>

Merge lp:~hrvojem/percona-server/rn-5.1.66-14.2

510. By <email address hidden>

Merge lp:~vlad-lesin/percona-server/5.1-bug1049871-injections-gca

Revision history for this message
Vlad Lesin (vlad-lesin) wrote :

> needs 5.5 branch before I can merge.

This branch can be used by customer. I ported the patch to 5.1 gca clone and made new MP here https://code.launchpad.net/~vlad-lesin/percona-server/5.1-gca-bug-1038940-table_cache_speed_up/+merge/141711 .

511. By <email address hidden>

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

512. By <email address hidden>

Merge lp:~hrvojem/percona-server/rn-5.1.66-14.2-r2

513. By <email address hidden>

Merge lp:~hrvojem/percona-server/bug1092106-5.1

514. By <email address hidden>

Merge lp:~percona-core/percona-server/release-5.1.66-14.1

515. By Stewart Smith

merge 5.1.66-14.2 release branch

516. By <email address hidden>

Merge lp:~hrvojem/percona-server/rn-5.1.67-14.3

517. By <email address hidden>

Merge lp:~sergei.glushchenko/percona-server/51-ST-27220-bug1042946

518. By <email address hidden>

Merge lp:~laurynas-biveinis/percona-server/bug110159-5.1

519. By <email address hidden>

Merge lp:~laurynas-biveinis/percona-server/BT-16724-xtradb-bmp-requests-5.1

520. By <email address hidden>

Merge lp:~laurynas-biveinis/percona-server/BT-16274-bug1082437-5.1

521. By <email address hidden>

Merge lp:~laurynas-biveinis/percona-server/BT-16274-bug1083596-5.1

522. By <email address hidden>

Merge lp:~laurynas-biveinis/percona-server/BT-16274-bug1083669-5.1

523. By <email address hidden>

Merge lp:~laurynas-biveinis/percona-server/bug1083058-5.1

524. By <email address hidden>

Merge lp:~laurynas-biveinis/percona-server/bug1100178-1100643-5.1

525. By <email address hidden>

Merge lp:~hrvojem/percona-server/bug1065771-5.1

526. By <email address hidden>

Merge lp:~laurynas-biveinis/percona-server/bug1105709-5.1

527. By <email address hidden>

Merge lp:~laurynas-biveinis/percona-server/BT-16274-bug1111226-5.1

528. By <email address hidden>

Merge lp:~laurynas-biveinis/percona-server/bug1114612-5.1

529. By Stewart Smith

merge slow query log bugfixes from Laurynas

530. By <email address hidden>

Merge lp:~hrvojem/percona-server/bug1092189-5.1

531. By <email address hidden>

Merge lp:~laurynas-biveinis/percona-server/BT-16274-bug1105726-5.1

532. By <email address hidden>

Merge lp:~laurynas-biveinis/percona-server/BT-16274-bug1108874-5.1

533. 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

Unmerged revisions

533. 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

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Percona-Server/storage/myisam/ha_myisam.cc'
--- Percona-Server/storage/myisam/ha_myisam.cc 2011-11-24 16:33:30 +0000
+++ Percona-Server/storage/myisam/ha_myisam.cc 2013-02-24 23:14:22 +0000
@@ -2201,6 +2201,10 @@
2201 myisam_hton->create= myisam_create_handler;2201 myisam_hton->create= myisam_create_handler;
2202 myisam_hton->panic= myisam_panic;2202 myisam_hton->panic= myisam_panic;
2203 myisam_hton->flags= HTON_CAN_RECREATE | HTON_SUPPORT_LOG_TABLES;2203 myisam_hton->flags= HTON_CAN_RECREATE | HTON_SUPPORT_LOG_TABLES;
2204
2205 if (mi_init_open_table_hash(table_cache_size))
2206 return 1;
2207
2204 return 0;2208 return 0;
2205}2209}
22062210
22072211
=== modified file 'Percona-Server/storage/myisam/mi_close.c'
--- Percona-Server/storage/myisam/mi_close.c 2012-02-15 16:21:38 +0000
+++ Percona-Server/storage/myisam/mi_close.c 2013-02-24 23:14:22 +0000
@@ -56,7 +56,7 @@
56 info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED);56 info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED);
57 }57 }
58 flag= !--share->reopen;58 flag= !--share->reopen;
59 myisam_open_list=list_delete(myisam_open_list,&info->open_list);59 my_hash_delete(&myisam_open_table_hash, (uchar *) info);
60 pthread_mutex_unlock(&share->intern_lock);60 pthread_mutex_unlock(&share->intern_lock);
6161
62 my_free(mi_get_rec_buff_ptr(info, info->rec_buff), MYF(MY_ALLOW_ZERO_PTR));62 my_free(mi_get_rec_buff_ptr(info, info->rec_buff), MYF(MY_ALLOW_ZERO_PTR));
6363
=== modified file 'Percona-Server/storage/myisam/mi_dbug.c'
--- Percona-Server/storage/myisam/mi_dbug.c 2011-06-30 15:37:13 +0000
+++ Percona-Server/storage/myisam/mi_dbug.c 2013-02-24 23:14:22 +0000
@@ -172,13 +172,13 @@
172my_bool check_table_is_closed(const char *name, const char *where)172my_bool check_table_is_closed(const char *name, const char *where)
173{173{
174 char filename[FN_REFLEN];174 char filename[FN_REFLEN];
175 LIST *pos;175 uint idx;
176 DBUG_ENTER("check_table_is_closed");176 DBUG_ENTER("check_table_is_closed");
177177
178 (void) fn_format(filename,name,"",MI_NAME_IEXT,4+16+32);178 (void) fn_format(filename,name,"",MI_NAME_IEXT,4+16+32);
179 for (pos=myisam_open_list ; pos ; pos=pos->next)179 for (idx= 0; idx < myisam_open_table_hash.records; ++idx)
180 {180 {
181 MI_INFO *info=(MI_INFO*) pos->data;181 MI_INFO *info=(MI_INFO*) my_hash_element(&myisam_open_table_hash, idx);
182 MYISAM_SHARE *share=info->s;182 MYISAM_SHARE *share=info->s;
183 if (!strcmp(share->unique_file_name,filename))183 if (!strcmp(share->unique_file_name,filename))
184 {184 {
185185
=== modified file 'Percona-Server/storage/myisam/mi_keycache.c'
--- Percona-Server/storage/myisam/mi_keycache.c 2008-03-29 15:56:33 +0000
+++ Percona-Server/storage/myisam/mi_keycache.c 2013-02-24 23:14:22 +0000
@@ -137,16 +137,16 @@
137void mi_change_key_cache(KEY_CACHE *old_key_cache,137void mi_change_key_cache(KEY_CACHE *old_key_cache,
138 KEY_CACHE *new_key_cache)138 KEY_CACHE *new_key_cache)
139{139{
140 LIST *pos;140 uint idx;
141 DBUG_ENTER("mi_change_key_cache");141 DBUG_ENTER("mi_change_key_cache");
142142
143 /*143 /*
144 Lock list to ensure that no one can close the table while we manipulate it144 Lock list to ensure that no one can close the table while we manipulate it
145 */145 */
146 pthread_mutex_lock(&THR_LOCK_myisam);146 pthread_mutex_lock(&THR_LOCK_myisam);
147 for (pos=myisam_open_list ; pos ; pos=pos->next)147 for (idx= 0; idx < myisam_open_table_hash.records; ++idx)
148 {148 {
149 MI_INFO *info= (MI_INFO*) pos->data;149 MI_INFO *info=(MI_INFO*) my_hash_element(&myisam_open_table_hash, idx);
150 MYISAM_SHARE *share= info->s;150 MYISAM_SHARE *share= info->s;
151 if (share->key_cache == old_key_cache)151 if (share->key_cache == old_key_cache)
152 mi_assign_to_key_cache(info, (ulonglong) ~0, new_key_cache);152 mi_assign_to_key_cache(info, (ulonglong) ~0, new_key_cache);
153153
=== modified file 'Percona-Server/storage/myisam/mi_open.c'
--- Percona-Server/storage/myisam/mi_open.c 2011-06-30 15:37:13 +0000
+++ Percona-Server/storage/myisam/mi_open.c 2013-02-24 23:14:22 +0000
@@ -46,23 +46,76 @@
46}46}
4747
4848
49/******************************************************************************49/*
50** Return the shared struct if the table is already open.50 Get the value used as hash key (helper function for the
51** In MySQL the server will handle version issues.51 open table hash). Function is used as a callback
52******************************************************************************/52 from the hash table
5353*/
54static uchar *mi_open_table_hash_key(const uchar *record, size_t *length,
55 my_bool not_used __attribute__((unused)))
56{
57 MI_INFO *info= (MI_INFO *) record;
58 *length= info->s->unique_name_length;
59 return (uchar*) info->s->unique_file_name;
60}
61
62/**
63 Initialize open table hash
64
65 Function is normally called from myisam_init
66 with the system variable table_cache_size used
67 as hash_size.
68
69 @param[in] hash_size Initial has size (elements)
70 @return inidicates success or failure of initialization
71 @retval 0 success
72 @retval 1 failure
73
74*/
75int mi_init_open_table_hash(ulong hash_size)
76{
77 if (hash_size == 0)
78 hash_size= 32; /* default hash size */
79
80 if (my_hash_init(&myisam_open_table_hash, &my_charset_filename,
81 hash_size, 0, 0, mi_open_table_hash_key, 0, 0))
82 return 1; /* error */
83
84 return 0;
85}
86
87
88/**
89 Retrieve the shared struct if the table is already
90 open (i.e in the open table hash)
91
92 @param[in] filename table file name
93 @return shared struct, 0 if not in the cache
94*/
54MI_INFO *test_if_reopen(char *filename)95MI_INFO *test_if_reopen(char *filename)
55{96{
56 LIST *pos;97 HASH_SEARCH_STATE current_record;
98 int len= strlen(filename);
5799
58 for (pos=myisam_open_list ; pos ; pos=pos->next)100 MI_INFO *info= (MI_INFO*) my_hash_first(&myisam_open_table_hash,
101 (uchar *) filename,
102 len, &current_record);
103 /*
104 There might be more than one instance of a table share for
105 a given table in the hash table. We're interested in the one with
106 last_version set, so we iterate until we find it
107 */
108 while (info)
59 {109 {
60 MI_INFO *info=(MI_INFO*) pos->data;
61 MYISAM_SHARE *share=info->s;110 MYISAM_SHARE *share=info->s;
62 if (!strcmp(share->unique_file_name,filename) && share->last_version)111 if (share->last_version)
63 return info;112 break;
113
114 info= (MI_INFO*) my_hash_next(&myisam_open_table_hash,
115 (uchar *) filename,
116 len, &current_record);
64 }117 }
65 return 0;118 return info;
66}119}
67120
68121
@@ -650,8 +703,9 @@
650#ifdef THREAD703#ifdef THREAD
651 thr_lock_data_init(&share->lock,&m_info->lock,(void*) m_info);704 thr_lock_data_init(&share->lock,&m_info->lock,(void*) m_info);
652#endif705#endif
653 m_info->open_list.data=(void*) m_info;706
654 myisam_open_list=list_add(myisam_open_list,&m_info->open_list);707 if (my_hash_insert(&myisam_open_table_hash, (uchar *) m_info))
708 goto err;
655709
656 pthread_mutex_unlock(&THR_LOCK_myisam);710 pthread_mutex_unlock(&THR_LOCK_myisam);
657711
658712
=== modified file 'Percona-Server/storage/myisam/mi_panic.c'
--- Percona-Server/storage/myisam/mi_panic.c 2006-12-31 00:32:21 +0000
+++ Percona-Server/storage/myisam/mi_panic.c 2013-02-24 23:14:22 +0000
@@ -26,22 +26,36 @@
26int mi_panic(enum ha_panic_function flag)26int mi_panic(enum ha_panic_function flag)
27{27{
28 int error=0;28 int error=0;
29 LIST *list_element,*next_open;
30 MI_INFO *info;29 MI_INFO *info;
30 uint idx;
31 DBUG_ENTER("mi_panic");31 DBUG_ENTER("mi_panic");
3232
33 pthread_mutex_lock(&THR_LOCK_myisam);33 pthread_mutex_lock(&THR_LOCK_myisam);
34 for (list_element=myisam_open_list ; list_element ; list_element=next_open)34
35 if (!my_hash_inited(&myisam_open_table_hash))
36 goto finish;
37
38 if (flag == HA_PANIC_CLOSE)
35 {39 {
36 next_open=list_element->next; /* Save if close */40 while (myisam_open_table_hash.records)
37 info=(MI_INFO*) list_element->data;41 {
38 switch (flag) {42 /*
39 case HA_PANIC_CLOSE:43 As long as there are records in the hash, fetch the
40 pthread_mutex_unlock(&THR_LOCK_myisam); /* Not exactly right... */44 first, and close it.
45 */
46 info=(MI_INFO*) my_hash_element(&myisam_open_table_hash, 0);
47 pthread_mutex_unlock(&THR_LOCK_myisam); /* Not exactly right... */
41 if (mi_close(info))48 if (mi_close(info))
42 error=my_errno;49 error= my_errno;
43 pthread_mutex_lock(&THR_LOCK_myisam);50 pthread_mutex_lock(&THR_LOCK_myisam);
44 break;51 }
52 }
53
54 for (idx= 0; idx < myisam_open_table_hash.records; ++idx)
55 {
56 info=(MI_INFO*) my_hash_element(&myisam_open_table_hash, idx);
57 switch (flag) {
58 case HA_PANIC_CLOSE: break;
45 case HA_PANIC_WRITE: /* Do this to free databases */59 case HA_PANIC_WRITE: /* Do this to free databases */
46#ifdef CANT_OPEN_FILES_TWICE60#ifdef CANT_OPEN_FILES_TWICE
47 if (info->s->options & HA_OPTION_READ_ONLY_DATA)61 if (info->s->options & HA_OPTION_READ_ONLY_DATA)
@@ -106,6 +120,8 @@
106 VOID(mi_log(0)); /* Close log if neaded */120 VOID(mi_log(0)); /* Close log if neaded */
107 ft_free_stopwords();121 ft_free_stopwords();
108 }122 }
123
124finish:
109 pthread_mutex_unlock(&THR_LOCK_myisam);125 pthread_mutex_unlock(&THR_LOCK_myisam);
110 if (!error)126 if (!error)
111 DBUG_RETURN(0);127 DBUG_RETURN(0);
112128
=== modified file 'Percona-Server/storage/myisam/mi_static.c'
--- Percona-Server/storage/myisam/mi_static.c 2011-06-30 15:37:13 +0000
+++ Percona-Server/storage/myisam/mi_static.c 2013-02-24 23:14:22 +0000
@@ -25,7 +25,7 @@
25#include "myisamdef.h"25#include "myisamdef.h"
26#endif26#endif
2727
28LIST *myisam_open_list=0;28HASH myisam_open_table_hash;
29uchar NEAR myisam_file_magic[]=29uchar NEAR myisam_file_magic[]=
30{ (uchar) 254, (uchar) 254,'\007', '\001', };30{ (uchar) 254, (uchar) 254,'\007', '\001', };
31uchar NEAR myisam_pack_file_magic[]=31uchar NEAR myisam_pack_file_magic[]=
3232
=== modified file 'Percona-Server/storage/myisam/myisamchk.c'
--- Percona-Server/storage/myisam/myisamchk.c 2011-06-30 15:37:13 +0000
+++ Percona-Server/storage/myisam/myisamchk.c 2013-02-24 23:14:22 +0000
@@ -96,6 +96,12 @@
96 get_options(&argc,(char***) &argv);96 get_options(&argc,(char***) &argv);
97 myisam_quick_table_bits=decode_bits;97 myisam_quick_table_bits=decode_bits;
98 error=0;98 error=0;
99 if (mi_init_open_table_hash(0))
100 {
101 fprintf(stderr, "Can't initialize MyISAM storage engine\n");
102 exit(-1);
103 }
104
99 while (--argc >= 0)105 while (--argc >= 0)
100 {106 {
101 int new_error=myisamchk(&check_param, *(argv++));107 int new_error=myisamchk(&check_param, *(argv++));
102108
=== modified file 'Percona-Server/storage/myisam/myisamdef.h'
--- Percona-Server/storage/myisam/myisamdef.h 2011-11-24 02:01:56 +0000
+++ Percona-Server/storage/myisam/myisamdef.h 2013-02-24 23:14:22 +0000
@@ -26,6 +26,7 @@
26#else26#else
27#include <my_no_pthread.h>27#include <my_no_pthread.h>
28#endif28#endif
29#include "hash.h"
2930
30#if defined(my_write) && !defined(MAP_TO_USE_RAID)31#if defined(my_write) && !defined(MAP_TO_USE_RAID)
31#undef my_write /* undef map from my_nosys; We need test-if-disk full */32#undef my_write /* undef map from my_nosys; We need test-if-disk full */
@@ -286,7 +287,6 @@
286 uint data_changed; /* Somebody has changed data */287 uint data_changed; /* Somebody has changed data */
287 uint save_update; /* When using KEY_READ */288 uint save_update; /* When using KEY_READ */
288 int save_lastinx;289 int save_lastinx;
289 LIST open_list;
290 IO_CACHE rec_cache; /* When cacheing records */290 IO_CACHE rec_cache; /* When cacheing records */
291 uint preload_buff_size; /* When preloading indexes */291 uint preload_buff_size; /* When preloading indexes */
292 myf lock_wait; /* is 0 or MY_DONT_WAIT */292 myf lock_wait; /* is 0 or MY_DONT_WAIT */
@@ -472,8 +472,7 @@
472#endif472#endif
473473
474 /* Some extern variables */474 /* Some extern variables */
475475extern HASH myisam_open_table_hash;
476extern LIST *myisam_open_list;
477extern uchar NEAR myisam_file_magic[],NEAR myisam_pack_file_magic[];476extern uchar NEAR myisam_file_magic[],NEAR myisam_pack_file_magic[];
478extern uint NEAR myisam_read_vec[],NEAR myisam_readnext_vec[];477extern uint NEAR myisam_read_vec[],NEAR myisam_readnext_vec[];
479extern uint myisam_quick_table_bits;478extern uint myisam_quick_table_bits;
@@ -759,6 +758,7 @@
759void mi_disable_non_unique_index(MI_INFO *info, ha_rows rows);758void mi_disable_non_unique_index(MI_INFO *info, ha_rows rows);
760759
761extern MI_INFO *test_if_reopen(char *filename);760extern MI_INFO *test_if_reopen(char *filename);
761extern int mi_init_open_table_hash(ulong size);
762my_bool check_table_is_closed(const char *name, const char *where);762my_bool check_table_is_closed(const char *name, const char *where);
763int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share, const char *orn_name,763int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share, const char *orn_name,
764 File file_to_dup);764 File file_to_dup);
765765
=== modified file 'Percona-Server/storage/myisam/myisampack.c'
--- Percona-Server/storage/myisam/myisampack.c 2011-06-30 15:37:13 +0000
+++ Percona-Server/storage/myisam/myisampack.c 2013-02-24 23:14:22 +0000
@@ -210,6 +210,11 @@
210 MY_INIT(argv[0]);210 MY_INIT(argv[0]);
211211
212 load_defaults("my",load_default_groups,&argc,&argv);212 load_defaults("my",load_default_groups,&argc,&argv);
213 if (mi_init_open_table_hash(0))
214 {
215 fputs("Can't initialize MyISAM storage engine", stderr);
216 exit(1);
217 }
213 default_argv= argv;218 default_argv= argv;
214 get_options(&argc,&argv);219 get_options(&argc,&argv);
215220

Subscribers

People subscribed via source and target branches