1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

post-review fixes

HA_EXTRA_WRITE_CACHE now part of start_bulk_insert()
test cleanups


BitKeeper/deleted/.del-repair_part2-master.sh~f44a8c15d6c36585:
  Delete: mysql-test/t/repair_part2-master.sh
BitKeeper/deleted/.del-repair_part2.test~c20f60783b04d001:
  Delete: mysql-test/t/repair_part2.test
BitKeeper/deleted/.del-repair_part2.result~72ca166fb248b566:
  Delete: mysql-test/r/repair_part2.result
mysql-test/r/myisam.result:
  updated
mysql-test/t/lowercase_table2.test:
  typo fixed
mysql-test/r/repair.result:
  single repair.test from repair_part[12].test
mysql-test/t/lowercase_table3.test:
  typo fixed
mysql-test/t/lowercase_table_qcache.test:
  newline added
mysql-test/t/myisam.test:
  updated
mysql-test/t/repair.test:
  single repair.test from repair_part[12].test
sql/field.cc:
  reverted
sql/field.h:
  style fix
sql/ha_myisam.cc:
  add HA_EXTRA_WRITE_CACHE to start_bulk_insert
sql/sql_insert.cc:
  add HA_EXTRA_WRITE_CACHE to start_bulk_insert
sql/sql_load.cc:
  add HA_EXTRA_WRITE_CACHE to start_bulk_insert
sql/sql_table.cc:
  add HA_EXTRA_WRITE_CACHE to start_bulk_insert
This commit is contained in:
unknown
2004-04-07 16:04:28 +02:00
parent c627054340
commit 736853e501
16 changed files with 57 additions and 88 deletions

View File

@@ -264,17 +264,8 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
thd->proc_info="update";
if (duplic != DUP_ERROR)
table->file->extra(HA_EXTRA_IGNORE_DUP_KEY);
if ((lock_type != TL_WRITE_DELAYED && !(specialflag & SPECIAL_SAFE_MODE)) &&
values_list.elements >= MIN_ROWS_TO_USE_BULK_INSERT)
{
table->file->extra_opt(HA_EXTRA_WRITE_CACHE,
min(thd->variables.read_buff_size,
table->avg_row_length*values_list.elements));
if (lock_type != TL_WRITE_DELAYED)
table->file->start_bulk_insert(values_list.elements);
bulk_insert=1;
}
else
bulk_insert=0;
while ((values= its++))
{
@@ -352,24 +343,10 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
else
#endif
{
if (bulk_insert)
if (table->file->end_bulk_insert() && !error)
{
if (table->file->extra(HA_EXTRA_NO_CACHE))
{
if (!error)
{
table->file->print_error(my_errno,MYF(0));
error=1;
}
}
if (table->file->end_bulk_insert())
{
if (!error)
{
table->file->print_error(my_errno,MYF(0));
error=1;
}
}
table->file->print_error(my_errno,MYF(0));
error=1;
}
if (id && values_list.elements != 1)
thd->insert_id(id); // For update log
@@ -387,7 +364,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
transactional_table= table->file->has_transactions();
log_delayed= (transactional_table || table->tmp_table);
if ((info.copied || info.deleted || info.updated) &&
if ((info.copied || info.deleted || info.updated) &&
(error <= 0 || !transactional_table))
{
mysql_update_log.write(thd, thd->query, thd->query_length);
@@ -1439,8 +1416,6 @@ select_insert::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
table->next_number_field=table->found_next_number_field;
thd->count_cuted_fields= CHECK_FIELD_WARN; // calc cuted fields
thd->cuted_fields=0;
if (info.handle_duplicates != DUP_REPLACE)
table->file->extra(HA_EXTRA_WRITE_CACHE);
if (info.handle_duplicates == DUP_IGNORE ||
info.handle_duplicates == DUP_REPLACE)
table->file->extra(HA_EXTRA_IGNORE_DUP_KEY);
@@ -1497,7 +1472,6 @@ void select_insert::send_error(uint errcode,const char *err)
*/
DBUG_VOID_RETURN;
}
table->file->extra(HA_EXTRA_NO_CACHE);
table->file->end_bulk_insert();
/*
If at least one row has been inserted/modified and will stay in the table
@@ -1505,7 +1479,7 @@ void select_insert::send_error(uint errcode,const char *err)
error while inserting into a MyISAM table) we must write to the binlog (and
the error code will make the slave stop).
*/
if ((info.copied || info.deleted || info.updated) &&
if ((info.copied || info.deleted || info.updated) &&
!table->file->has_transactions())
{
if (last_insert_id)
@@ -1518,7 +1492,7 @@ void select_insert::send_error(uint errcode,const char *err)
mysql_bin_log.write(&qinfo);
}
if (!table->tmp_table)
thd->options|=OPTION_STATUS_NO_TRANS_UPDATE;
thd->options|=OPTION_STATUS_NO_TRANS_UPDATE;
}
if (info.copied || info.deleted || info.updated)
query_cache_invalidate3(thd, table, 1);
@@ -1532,8 +1506,7 @@ bool select_insert::send_eof()
int error,error2;
DBUG_ENTER("select_insert::send_eof");
if (!(error=table->file->extra(HA_EXTRA_NO_CACHE)))
error=table->file->end_bulk_insert();
error=table->file->end_bulk_insert();
table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
/*
@@ -1609,7 +1582,7 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
/* Don't set timestamp if used */
table->timestamp_default_now= table->timestamp_on_update_now= 0;
table->next_number_field=table->found_next_number_field;
restore_record(table,default_values); // Get empty record