diff options
author | unknown <kostja@dipika.(none)> | 2008-02-19 14:53:22 +0300 |
---|---|---|
committer | unknown <kostja@dipika.(none)> | 2008-02-19 14:53:22 +0300 |
commit | ead02981eae47130fe5d205a11336b3c00225be1 (patch) | |
tree | 04e23b57dfe474c6eec621c1ff38cbb47a67058c /sql/sql_partition.cc | |
parent | da1a6127d61bf8ef7c4fd0c48afb2572260f9fb8 (diff) | |
parent | 526798dbb55c79b62e795a1cf40062030e2342bd (diff) | |
download | mariadb-git-ead02981eae47130fe5d205a11336b3c00225be1.tar.gz |
Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into dipika.(none):/opt/local/work/mysql-5.1-2pc-opt-merge-push
mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
Auto merged
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
Auto merged
sql/ha_ndbcluster_binlog.cc:
Auto merged
sql/log.cc:
Auto merged
sql/log_event.cc:
Auto merged
sql/sp.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_table.cc:
Auto merged
mysql-test/suite/rpl_ndb/t/disabled.def:
Manual merge.
Diffstat (limited to 'sql/sql_partition.cc')
-rw-r--r-- | sql/sql_partition.cc | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index eabf4526f7b..cf0aeee938b 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -3968,31 +3968,35 @@ static int fast_end_partition(THD *thd, ulonglong copied, bool written_bin_log) { int error; + char tmp_name[80]; DBUG_ENTER("fast_end_partition"); thd->proc_info="end"; + if (!is_empty) query_cache_invalidate3(thd, table_list, 0); - error= ha_commit_stmt(thd); - if (ha_commit(thd)) + + error= ha_autocommit_or_rollback(thd, 0); + if (end_active_trans(thd)) error= 1; - if (!error || is_empty) - { - char tmp_name[80]; - if ((!is_empty) && (!written_bin_log) && - (!thd->lex->no_write_to_binlog)) - write_bin_log(thd, FALSE, thd->query, thd->query_length); - close_thread_tables(thd); - my_snprintf(tmp_name, sizeof(tmp_name), ER(ER_INSERT_INFO), - (ulong) (copied + deleted), - (ulong) deleted, - (ulong) 0); - send_ok(thd, (ha_rows) (copied+deleted),0L,tmp_name); - DBUG_RETURN(FALSE); + + if (error) + { + /* If error during commit, no need to rollback, it's done. */ + table->file->print_error(error, MYF(0)); + DBUG_RETURN(TRUE); } - table->file->print_error(error, MYF(0)); - close_thread_tables(thd); - DBUG_RETURN(TRUE); + + if ((!is_empty) && (!written_bin_log) && + (!thd->lex->no_write_to_binlog)) + write_bin_log(thd, FALSE, thd->query, thd->query_length); + + my_snprintf(tmp_name, sizeof(tmp_name), ER(ER_INSERT_INFO), + (ulong) (copied + deleted), + (ulong) deleted, + (ulong) 0); + send_ok(thd, (ha_rows) (copied+deleted),0L, tmp_name); + DBUG_RETURN(FALSE); } |