1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Merge latest 5.1 into performance version

This commit is contained in:
Mikael Ronstrom
2008-12-15 09:47:39 +01:00
513 changed files with 193036 additions and 238182 deletions

View File

@@ -830,7 +830,6 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
info.copied=values_list.elements;
end_delayed_insert(thd);
}
query_cache_invalidate3(thd, table_list, 1);
}
else
#endif
@@ -1545,6 +1544,17 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
}
}
}
/*
If more than one iteration of the above while loop is done, from the second
one the row being inserted will have an explicit value in the autoinc field,
which was set at the first call of handler::update_auto_increment(). This
value is saved to avoid thd->insert_id_for_cur_row becoming 0. Use this saved
autoinc value.
*/
if (table->file->insert_id_for_cur_row == 0)
table->file->insert_id_for_cur_row= insert_id_for_cur_row;
thd->record_first_successful_insert_id_in_cur_stmt(table->file->insert_id_for_cur_row);
/*
Restore column maps if they where replaced during an duplicate key
@@ -2532,8 +2542,13 @@ bool Delayed_insert::handle_inserts(void)
thd_proc_info(&thd, "upgrading lock");
if (thr_upgrade_write_delay_lock(*thd.lock->locks))
{
/* This can only happen if thread is killed by shutdown */
sql_print_error(ER(ER_DELAYED_CANT_CHANGE_LOCK),table->s->table_name.str);
/*
This can happen if thread is killed either by a shutdown
or if another thread is removing the current table definition
from the table cache.
*/
my_error(ER_DELAYED_CANT_CHANGE_LOCK,MYF(ME_FATALERROR),
table->s->table_name.str);
goto err;
}
@@ -2688,9 +2703,10 @@ bool Delayed_insert::handle_inserts(void)
query_cache_invalidate3(&thd, table, 1);
if (thr_reschedule_write_lock(*thd.lock->locks))
{
/* This should never happen */
sql_print_error(ER(ER_DELAYED_CANT_CHANGE_LOCK),
table->s->table_name.str);
/* This is not known to happen. */
my_error(ER_DELAYED_CANT_CHANGE_LOCK,MYF(ME_FATALERROR),
table->s->table_name.str);
goto err;
}
if (!using_bin_log)
table->file->extra(HA_EXTRA_WRITE_CACHE);
@@ -2737,6 +2753,11 @@ bool Delayed_insert::handle_inserts(void)
/* Remove all not used rows */
while ((row=rows.get()))
{
if (table->s->blob_fields)
{
memcpy(table->record[0],row->record,table->s->reclength);
free_delayed_insert_blobs(table);
}
delete row;
thread_safe_increment(delayed_insert_errors,&LOCK_delayed_status);
stacked_inserts--;
@@ -3621,7 +3642,8 @@ select_create::binlog_show_create_table(TABLE **tables, uint count)
tmp_table_list.table = *tables;
query.length(0); // Have to zero it since constructor doesn't
result= store_create_info(thd, &tmp_table_list, &query, create_info);
result= store_create_info(thd, &tmp_table_list, &query, create_info,
/* show_database */ TRUE);
DBUG_ASSERT(result == 0); /* store_create_info() always return 0 */
if (mysql_bin_log.is_open())