summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-05-07 13:05:09 +0200
committerSergei Golubchik <sergii@pisem.net>2013-05-07 13:05:09 +0200
commitb381cf843c841151f96541b19bd753cd3bbae326 (patch)
treedfc377a1dfbd4d2044a0b799ff5ed6411c7e864f /sql/handler.cc
parentd4be9e7bc0cfd5ddd444ecc64daa4166597ca2eb (diff)
parente5055e22f1f311fa48457cfcc97b72e93a37329f (diff)
downloadmariadb-git-b381cf843c841151f96541b19bd753cd3bbae326.tar.gz
mysql-5.5.31 merge
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc20
1 files changed, 17 insertions, 3 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index 355226b0e25..85445ee44df 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -1,5 +1,5 @@
-/* Copyright (c) 2000, 2012, Oracle and/or its affiliates.
- Copyright (c) 2009-2011 Monty Program Ab
+/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
+ Copyright (c) 2009, 2013, Monty Program Ab.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -283,7 +283,8 @@ handler *get_ha_partition(partition_info *part_info)
}
else
{
- my_error(ER_OUTOFMEMORY, MYF(0), static_cast<int>(sizeof(ha_partition)));
+ my_error(ER_OUTOFMEMORY, MYF(ME_FATALERROR),
+ static_cast<int>(sizeof(ha_partition)));
}
DBUG_RETURN(((handler*) partition));
}
@@ -3438,6 +3439,9 @@ int handler::ha_check(THD *thd, HA_CHECK_OPT *check_opt)
}
if ((error= check(thd, check_opt)))
return error;
+ /* Skip updating frm version if not main handler. */
+ if (table->file != this)
+ return error;
return update_frm_version(table);
}
@@ -5161,6 +5165,8 @@ int handler::ha_write_row(uchar *buf)
Log_func *log_func= Write_rows_log_event::binlog_row_logging_function;
DBUG_ENTER("handler::ha_write_row");
DEBUG_SYNC_C("ha_write_row_start");
+ DBUG_EXECUTE_IF("inject_error_ha_write_row",
+ DBUG_RETURN(HA_ERR_INTERNAL_ERROR); );
MYSQL_INSERT_ROW_START(table_share->db.str, table_share->table_name.str);
mark_trx_read_write();
@@ -5189,6 +5195,7 @@ int handler::ha_update_row(const uchar *old_data, uchar *new_data)
(and the old record is in record[1]).
*/
DBUG_ASSERT(new_data == table->record[0]);
+ DBUG_ASSERT(old_data == table->record[1]);
MYSQL_UPDATE_ROW_START(table_share->db.str, table_share->table_name.str);
mark_trx_read_write();
@@ -5208,6 +5215,13 @@ int handler::ha_delete_row(const uchar *buf)
{
int error;
Log_func *log_func= Delete_rows_log_event::binlog_row_logging_function;
+ /*
+ Normally table->record[0] is used, but sometimes table->record[1] is used.
+ */
+ DBUG_ASSERT(buf == table->record[0] ||
+ buf == table->record[1]);
+ DBUG_EXECUTE_IF("inject_error_ha_delete_row",
+ return HA_ERR_INTERNAL_ERROR; );
MYSQL_DELETE_ROW_START(table_share->db.str, table_share->table_name.str);
mark_trx_read_write();