mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
merge
This commit is contained in:
@@ -205,7 +205,7 @@ cleanup:
|
||||
|
||||
#define MEM_STRIP_BUF_SIZE current_thd->variables.sortbuff_size
|
||||
|
||||
int refposcmp2(void* arg, const void *a,const void *b)
|
||||
extern "C" static int refposcmp2(void* arg, const void *a,const void *b)
|
||||
{
|
||||
return memcmp(a,b, *(int*) arg);
|
||||
}
|
||||
@@ -396,7 +396,7 @@ void multi_delete::send_error(uint errcode,const char *err)
|
||||
|
||||
int multi_delete::do_deletes(bool from_send_error)
|
||||
{
|
||||
int error = 0, counter = 0;
|
||||
int local_error= 0, counter= 0;
|
||||
|
||||
if (from_send_error)
|
||||
{
|
||||
@@ -417,26 +417,26 @@ int multi_delete::do_deletes(bool from_send_error)
|
||||
TABLE *table = table_being_deleted->table;
|
||||
if (tempfiles[counter]->get(table))
|
||||
{
|
||||
error=1;
|
||||
local_error=1;
|
||||
break;
|
||||
}
|
||||
|
||||
READ_RECORD info;
|
||||
init_read_record(&info,thd,table,NULL,0,0);
|
||||
while (!(error=info.read_record(&info)) && !thd->killed)
|
||||
while (!(local_error=info.read_record(&info)) && !thd->killed)
|
||||
{
|
||||
if ((error=table->file->delete_row(table->record[0])))
|
||||
if ((local_error=table->file->delete_row(table->record[0])))
|
||||
{
|
||||
table->file->print_error(error,MYF(0));
|
||||
table->file->print_error(local_error,MYF(0));
|
||||
break;
|
||||
}
|
||||
deleted++;
|
||||
}
|
||||
end_read_record(&info);
|
||||
if (error == -1) // End of file
|
||||
error = 0;
|
||||
if (local_error == -1) // End of file
|
||||
local_error = 0;
|
||||
}
|
||||
return error;
|
||||
return local_error;
|
||||
}
|
||||
|
||||
|
||||
@@ -452,7 +452,7 @@ bool multi_delete::send_eof()
|
||||
thd->proc_info="deleting from reference tables";
|
||||
|
||||
/* Does deletes for the last n - 1 tables, returns 0 if ok */
|
||||
int error = do_deletes(0); // returns 0 if success
|
||||
int local_error= do_deletes(0); // returns 0 if success
|
||||
|
||||
/* reset used flags */
|
||||
thd->proc_info="end";
|
||||
@@ -471,14 +471,14 @@ bool multi_delete::send_eof()
|
||||
Query_log_event qinfo(thd, thd->query, thd->query_length,
|
||||
log_delayed);
|
||||
if (mysql_bin_log.write(&qinfo) && !normal_tables)
|
||||
error=1; // Log write failed: roll back the SQL statement
|
||||
local_error=1; // Log write failed: roll back the SQL statement
|
||||
}
|
||||
/* Commit or rollback the current SQL statement */
|
||||
VOID(ha_autocommit_or_rollback(thd,error > 0));
|
||||
VOID(ha_autocommit_or_rollback(thd,local_error > 0));
|
||||
|
||||
query_cache_invalidate3(thd, delete_tables, 1);
|
||||
}
|
||||
if (error)
|
||||
if (local_error)
|
||||
::send_error(&thd->net);
|
||||
else
|
||||
::send_ok(&thd->net,deleted);
|
||||
|
||||
Reference in New Issue
Block a user