1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

bzr merge -rtag:mariadb-10.0.15 maria/10.0

This commit is contained in:
Nirbhay Choubey
2014-12-05 12:33:02 -05:00
2330 changed files with 593281 additions and 12514 deletions

View File

@ -56,7 +56,7 @@
*/
#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
#include <my_global.h> /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_priv.h"
#include "unireg.h" // REQUIRED: for other includes
#include "sql_insert.h"
@ -868,6 +868,8 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
table_list->prepare_check_option(thd))
error= 1;
table->reset_default_fields();
while ((values= its++))
{
if (fields.elements || !value_count)
@ -1665,6 +1667,13 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
DBUG_ASSERT(table->insert_values != NULL);
store_record(table,insert_values);
restore_record(table,record[1]);
/*
in INSERT ... ON DUPLICATE KEY UPDATE the set of modified fields can
change per row. Thus, we have to do reset_default_fields() per row.
Twice (before insert and before update).
*/
table->reset_default_fields();
DBUG_ASSERT(info->update_fields->elements ==
info->update_values->elements);
if (fill_record_n_invoke_before_triggers(thd, table, *info->update_fields,
@ -1692,6 +1701,7 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
if (res)
goto err;
}
table->reset_default_fields();
/* CHECK OPTION for VIEW ... ON DUPLICATE KEY UPDATE ... */
if (info->view &&
@ -3483,6 +3493,7 @@ select_insert::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
table->file->ha_start_bulk_insert((ha_rows) 0);
}
restore_record(table,s->default_values); // Get empty record
table->reset_default_fields();
table->next_number_field=table->found_next_number_field;
#ifdef HAVE_REPLICATION