mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.1
into ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.1-marvel client/mysqlcheck.c: Auto merged client/mysqldump.c: Auto merged include/my_time.h: Auto merged mysql-test/r/date_formats.result: Auto merged mysql-test/r/grant.result: Auto merged mysql-test/r/sp.result: Auto merged mysql-test/r/type_date.result: Auto merged mysql-test/r/type_datetime.result: Auto merged mysql-test/t/grant.test: Auto merged mysql-test/t/sp.test: Auto merged mysys/my_malloc.c: Auto merged mysys/my_static.c: Auto merged mysys/safemalloc.c: Auto merged sql/event_queue.cc: Auto merged sql/field.cc: Auto merged sql/field.h: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/handler.cc: Auto merged sql/item.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_func.h: Auto merged sql/log.cc: Auto merged sql/log_event.cc: Auto merged sql/mysql_priv.h: Auto merged sql/set_var.cc: Auto merged sql/slave.cc: Auto merged sql/sp.cc: Auto merged sql/sp_head.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_db.cc: Auto merged sql/sql_delete.cc: Auto merged sql/sql_insert.cc: Auto merged sql/sql_repl.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_show.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_update.cc: Auto merged sql/table.cc: Auto merged sql-common/client.c: Auto merged sql-common/my_time.c: Auto merged sql/time.cc: Auto merged storage/archive/ha_archive.cc: Auto merged storage/innobase/handler/ha_innodb.cc: Auto merged storage/ndb/src/mgmclient/CommandInterpreter.cpp: Auto merged tests/mysql_client_test.c: Auto merged client/client_priv.h: Manual merge with main 5.1 source. sql/event_data_objects.cc: Manual merge with main 5.1 source. sql/event_db_repository.cc: Manual merge with main 5.1 source. sql/mysqld.cc: Manual merge with main 5.1 source. sql/sql_load.cc: Manual merge with main 5.1 source. sql/sql_parse.cc: Manual merge with main 5.1 source.
This commit is contained in:
@@ -449,7 +449,7 @@ int mysql_update(THD *thd,
|
||||
thd->proc_info="Updating";
|
||||
|
||||
transactional_table= table->file->has_transactions();
|
||||
thd->no_trans_update= 0;
|
||||
thd->no_trans_update.stmt= FALSE;
|
||||
thd->abort_on_warning= test(!ignore &&
|
||||
(thd->variables.sql_mode &
|
||||
(MODE_STRICT_TRANS_TABLES |
|
||||
@@ -489,7 +489,7 @@ int mysql_update(THD *thd,
|
||||
if (fill_record_n_invoke_before_triggers(thd, fields, values, 0,
|
||||
table->triggers,
|
||||
TRG_EVENT_UPDATE))
|
||||
break; /* purecov: inspected */
|
||||
break; /* purecov: inspected */
|
||||
|
||||
found++;
|
||||
|
||||
@@ -550,7 +550,7 @@ int mysql_update(THD *thd,
|
||||
if (!error)
|
||||
{
|
||||
updated++;
|
||||
thd->no_trans_update= !transactional_table;
|
||||
thd->no_trans_update.stmt= !transactional_table;
|
||||
|
||||
if (table->triggers &&
|
||||
table->triggers->process_triggers(thd, TRG_EVENT_UPDATE,
|
||||
@@ -676,11 +676,11 @@ int mysql_update(THD *thd,
|
||||
transactional_table, FALSE) &&
|
||||
transactional_table)
|
||||
{
|
||||
error=1; // Rollback update
|
||||
error=1; // Rollback update
|
||||
}
|
||||
}
|
||||
if (!transactional_table)
|
||||
thd->options|=OPTION_STATUS_NO_TRANS_UPDATE;
|
||||
thd->no_trans_update.all= TRUE;
|
||||
}
|
||||
free_underlaid_joins(thd, select_lex);
|
||||
if (transactional_table)
|
||||
@@ -1045,7 +1045,7 @@ bool mysql_multi_update(THD *thd,
|
||||
handle_duplicates, ignore)))
|
||||
DBUG_RETURN(TRUE);
|
||||
|
||||
thd->no_trans_update= 0;
|
||||
thd->no_trans_update.stmt= FALSE;
|
||||
thd->abort_on_warning= test(thd->variables.sql_mode &
|
||||
(MODE_STRICT_TRANS_TABLES |
|
||||
MODE_STRICT_ALL_TABLES));
|
||||
@@ -1370,7 +1370,7 @@ multi_update::~multi_update()
|
||||
delete [] copy_field;
|
||||
thd->count_cuted_fields= CHECK_FIELD_IGNORE; // Restore this setting
|
||||
if (!trans_safe)
|
||||
thd->options|=OPTION_STATUS_NO_TRANS_UPDATE;
|
||||
thd->no_trans_update.all= TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -1431,40 +1431,40 @@ bool multi_update::send_data(List<Item> ¬_used_values)
|
||||
else if (error == VIEW_CHECK_ERROR)
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
if (!updated++)
|
||||
{
|
||||
/*
|
||||
Inform the main table that we are going to update the table even
|
||||
while we may be scanning it. This will flush the read cache
|
||||
if it's used.
|
||||
*/
|
||||
main_table->file->extra(HA_EXTRA_PREPARE_FOR_UPDATE);
|
||||
}
|
||||
if ((error=table->file->ha_update_row(table->record[1],
|
||||
table->record[0])))
|
||||
{
|
||||
updated--;
|
||||
if (!updated++)
|
||||
{
|
||||
/*
|
||||
Inform the main table that we are going to update the table even
|
||||
while we may be scanning it. This will flush the read cache
|
||||
if it's used.
|
||||
*/
|
||||
main_table->file->extra(HA_EXTRA_PREPARE_FOR_UPDATE);
|
||||
}
|
||||
if ((error=table->file->ha_update_row(table->record[1],
|
||||
table->record[0])))
|
||||
{
|
||||
updated--;
|
||||
if (!ignore ||
|
||||
table->file->is_fatal_error(error, HA_CHECK_DUP_KEY))
|
||||
{
|
||||
{
|
||||
/*
|
||||
If (ignore && error == is ignorable) we don't have to
|
||||
do anything; otherwise...
|
||||
*/
|
||||
if (table->file->is_fatal_error(error, HA_CHECK_DUP_KEY))
|
||||
thd->fatal_error(); /* Other handler errors are fatal */
|
||||
table->file->print_error(error,MYF(0));
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
}
|
||||
table->file->print_error(error,MYF(0));
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!table->file->has_transactions())
|
||||
thd->no_trans_update= 1;
|
||||
thd->no_trans_update.stmt= TRUE;
|
||||
if (table->triggers &&
|
||||
table->triggers->process_triggers(thd, TRG_EVENT_UPDATE,
|
||||
TRG_ACTION_AFTER, TRUE))
|
||||
DBUG_RETURN(1);
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1700,7 +1700,7 @@ bool multi_update::send_eof()
|
||||
}
|
||||
}
|
||||
if (!transactional_tables)
|
||||
thd->options|=OPTION_STATUS_NO_TRANS_UPDATE;
|
||||
thd->no_trans_update.all= TRUE;
|
||||
}
|
||||
|
||||
if (transactional_tables)
|
||||
|
Reference in New Issue
Block a user