diff options
author | unknown <serg@serg.mysql.com> | 2002-12-07 22:40:20 +0100 |
---|---|---|
committer | unknown <serg@serg.mysql.com> | 2002-12-07 22:40:20 +0100 |
commit | 6271ea35b83501781cf3ee51a62fd95870b3fb96 (patch) | |
tree | cac4edcace5032716391947982c07af2dba77b24 /sql/ha_myisam.cc | |
parent | 23865c0eea7d3d670f4b84a76cbe3511fe241b7f (diff) | |
download | mariadb-git-6271ea35b83501781cf3ee51a62fd95870b3fb96.tar.gz |
bulk insert code optimized
mysql-test/r/distinct.result:
updated
mysql-test/r/fulltext.result:
updated
mysql-test/r/select.result:
updated
mysql-test/r/show_check.result:
updated
mysql-test/t/insert.test:
updated
Diffstat (limited to 'sql/ha_myisam.cc')
-rw-r--r-- | sql/ha_myisam.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index 0c472ea6a45..0560afdf068 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -685,11 +685,14 @@ void ha_myisam::deactivate_non_unique_index(ha_rows rows) /* Only disable old index if the table was empty */ if (file->state->records == 0) mi_disable_non_unique_index(file,rows); - ha_myisam::extra_opt(HA_EXTRA_BULK_INSERT_BEGIN, - current_thd->variables.bulk_insert_buff_size); + else + { + mi_init_bulk_insert(file, + current_thd->variables.bulk_insert_buff_size, rows); table->bulk_insert= 1; } } + } enable_activate_all_index=1; } else @@ -704,7 +707,7 @@ bool ha_myisam::activate_all_index(THD *thd) MYISAM_SHARE* share = file->s; DBUG_ENTER("activate_all_index"); - mi_extra(file, HA_EXTRA_BULK_INSERT_END, 0); + mi_end_bulk_insert(file); table->bulk_insert= 0; if (enable_activate_all_index && share->state.key_map != set_bits(ulonglong, share->base.keys)) @@ -945,13 +948,11 @@ int ha_myisam::extra(enum ha_extra_function operation) } -/* To be used with WRITE_CACHE, EXTRA_CACHE and BULK_INSERT_BEGIN */ +/* To be used with WRITE_CACHE and EXTRA_CACHE */ int ha_myisam::extra_opt(enum ha_extra_function operation, ulong cache_size) { - if ((specialflag & SPECIAL_SAFE_MODE) & - (operation == HA_EXTRA_WRITE_CACHE || - operation == HA_EXTRA_BULK_INSERT_BEGIN)) + if ((specialflag & SPECIAL_SAFE_MODE) & operation == HA_EXTRA_WRITE_CACHE) return 0; return mi_extra(file, operation, (void*) &cache_size); } @@ -1213,8 +1214,7 @@ longlong ha_myisam::get_auto_increment() } if (table->bulk_insert) - mi_extra(file, HA_EXTRA_BULK_INSERT_FLUSH, - (void*) &table->next_number_index); + mi_flush_bulk_insert(file, table->next_number_index); longlong nr; int error; |