mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge weblab.(none):/home/marcsql/TREE/mysql-5.1-base
into weblab.(none):/home/marcsql/TREE/mysql-5.1-rt-merge mysql-test/r/trigger.result: Auto merged mysql-test/t/trigger.test: Auto merged sql/field.cc: Auto merged sql/field.h: Auto merged sql/handler.cc: Auto merged sql/item.h: Auto merged sql/log.cc: Auto merged sql/mysql_priv.h: Auto merged sql/sql_class.h: Auto merged sql/sql_insert.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_partition.cc: Auto merged sql/sql_prepare.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_yacc.yy: Auto merged
This commit is contained in:
@@ -932,20 +932,24 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
|
||||
if (values_list.elements == 1 && (!(thd->options & OPTION_WARNINGS) ||
|
||||
!thd->cuted_fields))
|
||||
{
|
||||
thd->row_count_func= info.copied+info.deleted+info.updated;
|
||||
thd->row_count_func= info.copied + info.deleted +
|
||||
((thd->client_capabilities & CLIENT_FOUND_ROWS) ?
|
||||
info.touched : info.updated);
|
||||
send_ok(thd, (ulong) thd->row_count_func, id);
|
||||
}
|
||||
else
|
||||
{
|
||||
char buff[160];
|
||||
ha_rows updated=((thd->client_capabilities & CLIENT_FOUND_ROWS) ?
|
||||
info.touched : info.updated);
|
||||
if (ignore)
|
||||
sprintf(buff, ER(ER_INSERT_INFO), (ulong) info.records,
|
||||
(lock_type == TL_WRITE_DELAYED) ? (ulong) 0 :
|
||||
(ulong) (info.records - info.copied), (ulong) thd->cuted_fields);
|
||||
else
|
||||
sprintf(buff, ER(ER_INSERT_INFO), (ulong) info.records,
|
||||
(ulong) (info.deleted+info.updated), (ulong) thd->cuted_fields);
|
||||
thd->row_count_func= info.copied+info.deleted+info.updated;
|
||||
(ulong) (info.deleted + updated), (ulong) thd->cuted_fields);
|
||||
thd->row_count_func= info.copied + info.deleted + updated;
|
||||
::send_ok(thd, (ulong) thd->row_count_func, id, buff);
|
||||
}
|
||||
thd->abort_on_warning= 0;
|
||||
@@ -1415,19 +1419,20 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
|
||||
goto before_trg_err;
|
||||
|
||||
table->file->restore_auto_increment(prev_insert_id);
|
||||
if ((error=table->file->ha_update_row(table->record[1],
|
||||
table->record[0])))
|
||||
{
|
||||
if (info->ignore &&
|
||||
!table->file->is_fatal_error(error, HA_CHECK_DUP_KEY))
|
||||
{
|
||||
goto ok_or_after_trg_err;
|
||||
}
|
||||
goto err;
|
||||
}
|
||||
if ((table->file->ha_table_flags() & HA_PARTIAL_COLUMN_READ) ||
|
||||
compare_record(table))
|
||||
compare_record(table))
|
||||
{
|
||||
if ((error=table->file->ha_update_row(table->record[1],
|
||||
table->record[0])))
|
||||
{
|
||||
if (info->ignore &&
|
||||
!table->file->is_fatal_error(error, HA_CHECK_DUP_KEY))
|
||||
{
|
||||
goto ok_or_after_trg_err;
|
||||
}
|
||||
goto err;
|
||||
}
|
||||
|
||||
info->updated++;
|
||||
/*
|
||||
If ON DUP KEY UPDATE updates a row instead of inserting one, it's
|
||||
@@ -1446,6 +1451,11 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
|
||||
info->copied++;
|
||||
}
|
||||
|
||||
if (table->next_number_field)
|
||||
table->file->adjust_next_insert_id_after_explicit_value(
|
||||
table->next_number_field->val_int());
|
||||
info->touched++;
|
||||
|
||||
goto ok_or_after_trg_err;
|
||||
}
|
||||
else /* DUP_REPLACE */
|
||||
@@ -3136,7 +3146,9 @@ bool select_insert::send_eof()
|
||||
else
|
||||
sprintf(buff, ER(ER_INSERT_INFO), (ulong) info.records,
|
||||
(ulong) (info.deleted+info.updated), (ulong) thd->cuted_fields);
|
||||
thd->row_count_func= info.copied+info.deleted+info.updated;
|
||||
thd->row_count_func= info.copied + info.deleted +
|
||||
((thd->client_capabilities & CLIENT_FOUND_ROWS) ?
|
||||
info.touched : info.updated);
|
||||
|
||||
id= (thd->first_successful_insert_id_in_cur_stmt > 0) ?
|
||||
thd->first_successful_insert_id_in_cur_stmt :
|
||||
|
Reference in New Issue
Block a user