diff options
Diffstat (limited to 'sql')
-rw-r--r-- | sql/ha_myisam.cc | 5 | ||||
-rw-r--r-- | sql/item_sum.cc | 5 | ||||
-rw-r--r-- | sql/mysqld.cc | 7 | ||||
-rw-r--r-- | sql/sql_analyse.h | 16 | ||||
-rw-r--r-- | sql/uniques.cc | 2 |
5 files changed, 21 insertions, 14 deletions
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index bec465a5c5c..91c837e8023 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -644,7 +644,10 @@ void ha_myisam::deactivate_non_unique_index(ha_rows rows) if (rows==HA_POS_ERROR) mi_extra(file, HA_EXTRA_NO_KEYS); else + { mi_disable_non_unique_index(file,rows); + mi_extra(file, HA_EXTRA_BULK_INSERT_BEGIN); + } enable_activate_all_index=1; } else @@ -658,6 +661,8 @@ bool ha_myisam::activate_all_index(THD *thd) MI_CHECK param; MYISAM_SHARE* share = file->s; DBUG_ENTER("activate_all_index"); + + mi_extra(file, HA_EXTRA_BULK_INSERT_END); if (enable_activate_all_index && share->state.key_map != ((ulonglong) 1L << share->base.keys)-1) { diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 879c27178e5..40fe52a12e5 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -931,9 +931,8 @@ bool Item_sum_count_distinct::setup(THD *thd) rec_offset = table->reclength - key_len; } - init_tree(&tree, min(max_heap_table_size, sortbuff_size/16), - key_len, compare_key, 0, 0); - tree.cmp_arg = cmp_arg; + init_tree(&tree, min(max_heap_table_size, sortbuff_size/16), 0, + key_len, compare_key, 0, NULL, cmp_arg); use_tree = 1; // the only time key_len could be 0 is if someone does diff --git a/sql/mysqld.cc b/sql/mysqld.cc index f25174896ac..91fde2b9131 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2730,13 +2730,15 @@ CHANGEABLE_VAR changeable_vars[] = { 0, 1, ~0L, 0, 1 }, { "max_write_lock_count", (long*) &max_write_lock_count, ~0L, 1, ~0L, 0, 1 }, - { "myisam_sort_buffer_size", (long*) &myisam_sort_buffer_size, + { "myisam_bulk_insert_tree_size", (long*) &myisam_bulk_insert_tree_size, 8192*1024, 4, ~0L, 0, 1 }, { "myisam_max_extra_sort_file_size", (long*) &myisam_max_extra_sort_file_size, (long) (MI_MAX_TEMP_LENGTH/(1024L*1024L)), 0, ~0L, 0, 1 }, { "myisam_max_sort_file_size", (long*) &myisam_max_sort_file_size, (long) (LONG_MAX/(1024L*1024L)), 0, ~0L, 0, 1 }, + { "myisam_sort_buffer_size", (long*) &myisam_sort_buffer_size, + 8192*1024, 4, ~0L, 0, 1 }, { "net_buffer_length", (long*) &net_buffer_length, 16384, 1024, 1024*1024L, MALLOC_OVERHEAD, 1024 }, { "net_retry_count", (long*) &mysqld_net_retry_count, @@ -2853,11 +2855,12 @@ struct show_var_st init_vars[]= { {"max_user_connections", (char*) &max_user_connections, SHOW_LONG}, {"max_tmp_tables", (char*) &max_tmp_tables, SHOW_LONG}, {"max_write_lock_count", (char*) &max_write_lock_count, SHOW_LONG}, - {"myisam_recover_options", (char*) &myisam_recover_options_str, SHOW_CHAR_PTR}, + {"myisam_bulk_insert_tree_size", (char*) &myisam_bulk_insert_tree_size, SHOW_INT}, {"myisam_max_extra_sort_file_size", (char*) &myisam_max_extra_sort_file_size, SHOW_LONG}, {"myisam_max_sort_file_size",(char*) &myisam_max_sort_file_size, SHOW_LONG}, {"myisam_sort_buffer_size", (char*) &myisam_sort_buffer_size, SHOW_LONG}, + {"myisam_recover_options", (char*) &myisam_recover_options_str, SHOW_CHAR_PTR}, {"net_buffer_length", (char*) &net_buffer_length, SHOW_LONG}, {"net_read_timeout", (char*) &net_read_timeout, SHOW_LONG}, {"net_retry_count", (char*) &mysqld_net_retry_count, SHOW_LONG}, diff --git a/sql/sql_analyse.h b/sql/sql_analyse.h index 1d26b34dad9..2147f14e160 100644 --- a/sql/sql_analyse.h +++ b/sql/sql_analyse.h @@ -114,9 +114,9 @@ public: max_arg(""), sum(0), must_be_blob(0), was_zero_fill(0), was_maybe_zerofill(0), can_be_still_num(1) - { init_tree(&tree, 0, sizeof(String), a->binary ? + { init_tree(&tree, 0, 0, sizeof(String), a->binary ? (qsort_cmp2) stringcmp2 : (qsort_cmp2) sortcmp2, - 0, (void (*)(void*)) free_string); }; + 0, (tree_element_free) free_string, NULL); }; void add(); void get_opt_type(String*, ha_rows); @@ -154,8 +154,8 @@ class field_real: public field_info public: field_real(Item* a, analyse* b) :field_info(a,b), min_arg(0), max_arg(0), sum(0), sum_sqr(0), max_notzero_dec_len(0) - { init_tree(&tree, 0, sizeof(double), - (qsort_cmp2) compare_double2, 0, NULL); } + { init_tree(&tree, 0, 0, sizeof(double), + (qsort_cmp2) compare_double2, 0, NULL, NULL); } void add(); void get_opt_type(String*, ha_rows); @@ -200,8 +200,8 @@ class field_longlong: public field_info public: field_longlong(Item* a, analyse* b) :field_info(a,b), min_arg(0), max_arg(0), sum(0), sum_sqr(0) - { init_tree(&tree, 0, sizeof(longlong), - (qsort_cmp2) compare_longlong2, 0, NULL); } + { init_tree(&tree, 0, 0, sizeof(longlong), + (qsort_cmp2) compare_longlong2, 0, NULL, NULL); } void add(); void get_opt_type(String*, ha_rows); @@ -245,8 +245,8 @@ class field_ulonglong: public field_info public: field_ulonglong(Item* a, analyse * b) :field_info(a,b), min_arg(0), max_arg(0), sum(0),sum_sqr(0) - { init_tree(&tree, 0, sizeof(ulonglong), - (qsort_cmp2) compare_ulonglong2, 0, NULL); } + { init_tree(&tree, 0, 0, sizeof(ulonglong), + (qsort_cmp2) compare_ulonglong2, 0, NULL, NULL); } void add(); void get_opt_type(String*, ha_rows); String *get_min_arg(String *s) { s->set(min_arg); return s; } diff --git a/sql/uniques.cc b/sql/uniques.cc index 78fd8fe6e60..becb3d8a3a5 100644 --- a/sql/uniques.cc +++ b/sql/uniques.cc @@ -38,7 +38,7 @@ Unique::Unique(qsort_cmp2 comp_func, uint size, ulong max_in_memory_size_arg) :max_in_memory_size(max_in_memory_size_arg),elements(0) { my_b_clear(&file); - init_tree(&tree, max_in_memory_size / 16, size, comp_func, 0, 0); + init_tree(&tree, max_in_memory_size / 16, 0, size, comp_func, 0, NULL, NULL); /* If the following fail's the next add will also fail */ init_dynamic_array(&file_ptrs, sizeof(BUFFPEK), 16, 16); max_elements= max_in_memory_size / ALIGN_SIZE(sizeof(TREE_ELEMENT)+size); |