mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
10.0-base merge
(without InnoDB - all InnoDB changes were ignored)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/* Copyright (c) 2000, 2012, Oracle and/or its affiliates.
|
||||
Copyright (c) 2009, 2012, 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
|
||||
@@ -40,6 +40,7 @@
|
||||
#include "probes_mysql.h"
|
||||
#include <mysql/psi/mysql_table.h>
|
||||
#include "debug_sync.h" // DEBUG_SYNC
|
||||
#include "sql_audit.h"
|
||||
|
||||
#ifdef WITH_PARTITION_STORAGE_ENGINE
|
||||
#include "ha_partition.h"
|
||||
@@ -272,7 +273,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));
|
||||
}
|
||||
@@ -2199,7 +2201,7 @@ handle_condition(THD *,
|
||||
{
|
||||
*cond_hdl= NULL;
|
||||
/* Grab the error message */
|
||||
strmake(buff, msg, sizeof(buff)-1);
|
||||
strmake_buf(buff, msg);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -3712,6 +3714,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);
|
||||
}
|
||||
|
||||
@@ -3964,7 +3969,6 @@ int
|
||||
handler::ha_delete_table(const char *name)
|
||||
{
|
||||
mark_trx_read_write();
|
||||
|
||||
return delete_table(name);
|
||||
}
|
||||
|
||||
@@ -3997,8 +4001,11 @@ int
|
||||
handler::ha_create(const char *name, TABLE *form, HA_CREATE_INFO *info)
|
||||
{
|
||||
mark_trx_read_write();
|
||||
|
||||
return create(name, form, info);
|
||||
int error= create(name, form, info);
|
||||
if (!error &&
|
||||
!(info->options & (HA_LEX_CREATE_TMP_TABLE | HA_CREATE_TMP_ALTER)))
|
||||
mysql_audit_create_table(form);
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
@@ -5505,7 +5512,11 @@ int handler::ha_external_lock(THD *thd, int lock_type)
|
||||
{ error= external_lock(thd, lock_type); })
|
||||
|
||||
if (error == 0)
|
||||
{
|
||||
cached_table_flags= table_flags();
|
||||
if (table_share->tmp_table == NO_TMP_TABLE)
|
||||
mysql_audit_external_lock(thd, table_share, lock_type);
|
||||
}
|
||||
|
||||
if (MYSQL_HANDLER_RDLOCK_DONE_ENABLED() ||
|
||||
MYSQL_HANDLER_WRLOCK_DONE_ENABLED() ||
|
||||
@@ -5560,6 +5571,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();
|
||||
@@ -5590,6 +5603,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();
|
||||
@@ -5611,6 +5625,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();
|
||||
|
||||
Reference in New Issue
Block a user