diff options
Diffstat (limited to 'storage/maria/ha_maria.cc')
-rw-r--r-- | storage/maria/ha_maria.cc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc index 287c183c830..46e443d33f7 100644 --- a/storage/maria/ha_maria.cc +++ b/storage/maria/ha_maria.cc @@ -1211,7 +1211,7 @@ int ha_maria::repair(THD *thd, HA_CHECK ¶m, bool do_optimize) ulonglong key_map= ((local_testflag & T_CREATE_MISSING_KEYS) ? maria_get_mask_all_keys_active(share->base.keys) : share->state.key_map); - uint testflag= param.testflag; + uint save_testflag= param.testflag; if (maria_test_if_sort_rep(file, file->state->records, key_map, 0) && (local_testflag & T_REP_BY_SORT)) { @@ -1226,6 +1226,7 @@ int ha_maria::repair(THD *thd, HA_CHECK ¶m, bool do_optimize) /* TODO: respect maria_repair_threads variable */ my_snprintf(buf, 40, "Repair with %d threads", my_count_bits(key_map)); thd->proc_info= buf; + param.testflag|= T_REP_PARALLEL; error= maria_repair_parallel(¶m, file, fixed_name, param.testflag & T_QUICK); thd->proc_info= "Repair done"; // to reset proc_info, as @@ -1234,6 +1235,7 @@ int ha_maria::repair(THD *thd, HA_CHECK ¶m, bool do_optimize) else { thd->proc_info= "Repair by sorting"; + param.testflag|= T_REP_BY_SORT; error= maria_repair_by_sort(¶m, file, fixed_name, param.testflag & T_QUICK); } @@ -1241,7 +1243,7 @@ int ha_maria::repair(THD *thd, HA_CHECK ¶m, bool do_optimize) else { thd->proc_info= "Repair with keycache"; - param.testflag &= ~T_REP_BY_SORT; + param.testflag &= ~(T_REP_BY_SORT | T_REP_PARALLEL); error= maria_repair(¶m, file, fixed_name, param.testflag & T_QUICK); /** @todo RECOVERY BUG we do things with the index file @@ -1249,7 +1251,7 @@ int ha_maria::repair(THD *thd, HA_CHECK ¶m, bool do_optimize) record and bumped create_rename_lsn. Is it ok? */ } - param.testflag= testflag; + param.testflag= save_testflag; optimize_done= 1; } if (!error) @@ -2410,13 +2412,14 @@ static int ha_maria_init(void *p) maria_hton->flags= HTON_CAN_RECREATE | HTON_SUPPORT_LOG_TABLES; bzero(maria_log_pagecache, sizeof(*maria_log_pagecache)); maria_data_root= mysql_real_data_home; + maria_tmpdir= &mysql_tmpdir_list; /* For REDO */ res= maria_init() || ma_control_file_create_or_open() || - (init_pagecache(maria_pagecache, + !init_pagecache(maria_pagecache, pagecache_buffer_size, pagecache_division_limit, - pagecache_age_threshold, MARIA_KEY_BLOCK_LENGTH) == 0) || - (init_pagecache(maria_log_pagecache, + pagecache_age_threshold, MARIA_KEY_BLOCK_LENGTH, 0) || + !init_pagecache(maria_log_pagecache, TRANSLOG_PAGECACHE_SIZE, 0, 0, - TRANSLOG_PAGE_SIZE) == 0) || + TRANSLOG_PAGE_SIZE, 0) || translog_init(maria_data_root, TRANSLOG_FILE_SIZE, MYSQL_VERSION_ID, server_id, maria_log_pagecache, TRANSLOG_DEFAULT_FLAGS) || |