1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Bug #29692 Single row inserts can incorrectly report a huge number of row insertions

This bug was caused by unitialized value that was the result of a bad 5.0 merge.


sql/sql_class.h:
  Readded comments lost in a bad merge.
sql/sql_insert.cc:
  Fixed code to completely initialize (zero) the "COPY_INFO info" var in the same manner as the delayed write code.
  
  Readded a change that was lost in a bad merge.
tests/mysql_client_test.c:
  Test case added for bug#29692.
This commit is contained in:
unknown
2007-07-16 14:53:05 -04:00
parent f3fd6168ff
commit fcc51efc4d
3 changed files with 54 additions and 8 deletions

View File

@@ -661,7 +661,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
/*
Fill in the given fields and dump it to the table file
*/
info.records= info.deleted= info.copied= info.updated= 0;
bzero((char*) &info,sizeof(info));
info.ignore= ignore;
info.handle_duplicates=duplic;
info.update_fields= &update_fields;
@@ -1421,6 +1421,10 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
goto before_trg_err;
table->file->restore_auto_increment(prev_insert_id);
if (table->next_number_field)
table->file->adjust_next_insert_id_after_explicit_value(
table->next_number_field->val_int());
info->touched++;
if ((table->file->ha_table_flags() & HA_PARTIAL_COLUMN_READ) ||
compare_record(table))
{
@@ -1448,9 +1452,6 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
handled separately by THD::arg_of_last_insert_id_function.
*/
insert_id_for_cur_row= table->file->insert_id_for_cur_row= 0;
if (table->next_number_field)
table->file->adjust_next_insert_id_after_explicit_value(
table->next_number_field->val_int());
trg_error= (table->triggers &&
table->triggers->process_triggers(thd, TRG_EVENT_UPDATE,
TRG_ACTION_AFTER, TRUE));