mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Creation of mysql-trunk = {summit + "Innodb plugin replacing the builtin"}:
bzr branch mysql-5.1-performance-version mysql-trunk # Summit cd mysql-trunk bzr merge mysql-5.1-innodb_plugin # which is 5.1 + Innodb plugin bzr rm innobase # remove the builtin Next step: build, test fixes.
This commit is contained in:
@@ -301,9 +301,7 @@ static int check_update_fields(THD *thd, TABLE_LIST *insert_table_list,
|
||||
List<Item> &update_fields, table_map *map)
|
||||
{
|
||||
TABLE *table= insert_table_list->table;
|
||||
my_bool timestamp_mark;
|
||||
|
||||
LINT_INIT(timestamp_mark);
|
||||
my_bool timestamp_mark= 0;
|
||||
|
||||
if (table->timestamp_field)
|
||||
{
|
||||
@@ -393,7 +391,7 @@ void upgrade_lock_type(THD *thd, thr_lock_type *lock_type,
|
||||
bool is_multi_insert)
|
||||
{
|
||||
if (duplic == DUP_UPDATE ||
|
||||
duplic == DUP_REPLACE && *lock_type == TL_WRITE_CONCURRENT_INSERT)
|
||||
(duplic == DUP_REPLACE && *lock_type == TL_WRITE_CONCURRENT_INSERT))
|
||||
{
|
||||
*lock_type= TL_WRITE_DEFAULT;
|
||||
return;
|
||||
@@ -858,11 +856,13 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
|
||||
*/
|
||||
query_cache_invalidate3(thd, table_list, 1);
|
||||
}
|
||||
if (changed && error <= 0 || thd->transaction.stmt.modified_non_trans_table
|
||||
|| was_insert_delayed)
|
||||
if ((changed && error <= 0) ||
|
||||
thd->transaction.stmt.modified_non_trans_table ||
|
||||
was_insert_delayed)
|
||||
{
|
||||
if (mysql_bin_log.is_open())
|
||||
{
|
||||
int errcode= 0;
|
||||
if (error <= 0)
|
||||
{
|
||||
/*
|
||||
@@ -877,6 +877,9 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
|
||||
/* todo: consider removing */
|
||||
thd->clear_error();
|
||||
}
|
||||
else
|
||||
errcode= query_error_code(thd, thd->killed == THD::NOT_KILLED);
|
||||
|
||||
/* bug#22725:
|
||||
|
||||
A query which per-row-loop can not be interrupted with
|
||||
@@ -893,8 +896,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
|
||||
if (thd->binlog_query(THD::ROW_QUERY_TYPE,
|
||||
thd->query, thd->query_length,
|
||||
transactional_table, FALSE,
|
||||
(error>0) ? thd->killed : THD::NOT_KILLED) &&
|
||||
transactional_table)
|
||||
errcode))
|
||||
{
|
||||
error=1;
|
||||
}
|
||||
@@ -1113,6 +1115,33 @@ static bool mysql_prepare_insert_check_table(THD *thd, TABLE_LIST *table_list,
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Get extra info for tables we insert into
|
||||
|
||||
@param table table(TABLE object) we insert into,
|
||||
might be NULL in case of view
|
||||
@param table(TABLE_LIST object) or view we insert into
|
||||
*/
|
||||
|
||||
static void prepare_for_positional_update(TABLE *table, TABLE_LIST *tables)
|
||||
{
|
||||
if (table)
|
||||
{
|
||||
if(table->reginfo.lock_type != TL_WRITE_DELAYED)
|
||||
table->prepare_for_position();
|
||||
return;
|
||||
}
|
||||
|
||||
DBUG_ASSERT(tables->view);
|
||||
List_iterator<TABLE_LIST> it(*tables->view_tables);
|
||||
TABLE_LIST *tbl;
|
||||
while ((tbl= it++))
|
||||
prepare_for_positional_update(tbl->table, tbl);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Prepare items in INSERT statement
|
||||
|
||||
@@ -1262,9 +1291,8 @@ bool mysql_prepare_insert(THD *thd, TABLE_LIST *table_list,
|
||||
Only call prepare_for_posistion() if we are not performing a DELAYED
|
||||
operation. It will instead be executed by delayed insert thread.
|
||||
*/
|
||||
if ((duplic == DUP_UPDATE || duplic == DUP_REPLACE) &&
|
||||
(table->reginfo.lock_type != TL_WRITE_DELAYED))
|
||||
table->prepare_for_position();
|
||||
if (duplic == DUP_UPDATE || duplic == DUP_REPLACE)
|
||||
prepare_for_positional_update(table, table_list);
|
||||
DBUG_RETURN(FALSE);
|
||||
}
|
||||
|
||||
@@ -2667,6 +2695,12 @@ bool Delayed_insert::handle_inserts(void)
|
||||
thd.variables.time_zone = row->time_zone;
|
||||
}
|
||||
|
||||
/* if the delayed insert was killed, the killed status is
|
||||
ignored while binlogging */
|
||||
int errcode= 0;
|
||||
if (thd.killed == THD::NOT_KILLED)
|
||||
errcode= query_error_code(&thd, TRUE);
|
||||
|
||||
/*
|
||||
If the query has several rows to insert, only the first row will come
|
||||
here. In row-based binlogging, this means that the first row will be
|
||||
@@ -2677,7 +2711,7 @@ bool Delayed_insert::handle_inserts(void)
|
||||
*/
|
||||
thd.binlog_query(THD::ROW_QUERY_TYPE,
|
||||
row->query.str, row->query.length,
|
||||
FALSE, FALSE);
|
||||
FALSE, FALSE, errcode);
|
||||
|
||||
thd.time_zone_used = backup_time_zone_used;
|
||||
thd.variables.time_zone = backup_time_zone;
|
||||
@@ -3090,7 +3124,10 @@ bool select_insert::send_data(List<Item> &values)
|
||||
store_values(values);
|
||||
thd->count_cuted_fields= CHECK_FIELD_IGNORE;
|
||||
if (thd->is_error())
|
||||
{
|
||||
table->auto_increment_field_not_null= FALSE;
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
if (table_list) // Not CREATE ... SELECT
|
||||
{
|
||||
switch (table_list->view_check_option(thd, info.ignore)) {
|
||||
@@ -3104,6 +3141,9 @@ bool select_insert::send_data(List<Item> &values)
|
||||
// Release latches in case bulk insert takes a long time
|
||||
ha_release_temporary_latches(thd);
|
||||
|
||||
// Release latches in case bulk insert takes a long time
|
||||
ha_release_temporary_latches(thd);
|
||||
|
||||
error= write_record(thd, table, &info);
|
||||
table->auto_increment_field_not_null= FALSE;
|
||||
|
||||
@@ -3176,7 +3216,8 @@ bool select_insert::send_eof()
|
||||
table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
|
||||
table->file->extra(HA_EXTRA_WRITE_CANNOT_REPLACE);
|
||||
|
||||
if (changed= (info.copied || info.deleted || info.updated))
|
||||
changed= (info.copied || info.deleted || info.updated);
|
||||
if (changed)
|
||||
{
|
||||
/*
|
||||
We must invalidate the table in the query cache before binlog writing
|
||||
@@ -3197,11 +3238,14 @@ bool select_insert::send_eof()
|
||||
*/
|
||||
if (mysql_bin_log.is_open())
|
||||
{
|
||||
int errcode= 0;
|
||||
if (!error)
|
||||
thd->clear_error();
|
||||
else
|
||||
errcode= query_error_code(thd, killed_status == THD::NOT_KILLED);
|
||||
thd->binlog_query(THD::ROW_QUERY_TYPE,
|
||||
thd->query, thd->query_length,
|
||||
trans_table, FALSE, killed_status);
|
||||
trans_table, FALSE, errcode);
|
||||
}
|
||||
table->file->ha_release_auto_increment();
|
||||
|
||||
@@ -3268,8 +3312,11 @@ void select_insert::abort() {
|
||||
if (thd->transaction.stmt.modified_non_trans_table)
|
||||
{
|
||||
if (mysql_bin_log.is_open())
|
||||
{
|
||||
int errcode= query_error_code(thd, thd->killed == THD::NOT_KILLED);
|
||||
thd->binlog_query(THD::ROW_QUERY_TYPE, thd->query, thd->query_length,
|
||||
transactional_table, FALSE);
|
||||
transactional_table, FALSE, errcode);
|
||||
}
|
||||
if (!thd->current_stmt_binlog_row_based && !can_rollback_data())
|
||||
thd->transaction.all.modified_non_trans_table= TRUE;
|
||||
if (changed)
|
||||
@@ -3661,10 +3708,14 @@ select_create::binlog_show_create_table(TABLE **tables, uint count)
|
||||
DBUG_ASSERT(result == 0); /* store_create_info() always return 0 */
|
||||
|
||||
if (mysql_bin_log.is_open())
|
||||
{
|
||||
int errcode= query_error_code(thd, thd->killed == THD::NOT_KILLED);
|
||||
thd->binlog_query(THD::STMT_QUERY_TYPE,
|
||||
query.ptr(), query.length(),
|
||||
/* is_trans */ TRUE,
|
||||
/* suppress_use */ FALSE);
|
||||
/* suppress_use */ FALSE,
|
||||
errcode);
|
||||
}
|
||||
}
|
||||
|
||||
void select_create::store_values(List<Item> &values)
|
||||
|
Reference in New Issue
Block a user