mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
merged
BitKeeper/etc/logging_ok: auto-union configure.in: Auto merged libmysqld/Makefile.am: Auto merged myisam/Makefile.am: Auto merged myisam/mi_check.c: Auto merged myisam/myisampack.c: Auto merged mysql-test/r/fulltext.result: Auto merged mysys/Makefile.am: Auto merged sql/Makefile.am: Auto merged sql/sql_delete.cc: Auto merged sql/sql_update.cc: Auto merged strings/Makefile.am: Auto merged
This commit is contained in:
@@ -43,7 +43,7 @@ int mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, ORDER *order,
|
||||
table_list->db=thd->db;
|
||||
if ((thd->options & OPTION_SAFE_UPDATES) && !conds)
|
||||
{
|
||||
send_error(&thd->net,ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE);
|
||||
send_error(thd,ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE);
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ int mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, ORDER *order,
|
||||
!limit)
|
||||
{
|
||||
delete select;
|
||||
send_ok(&thd->net,0L);
|
||||
send_ok(thd,0L);
|
||||
DBUG_RETURN(0); // Nothing to delete
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ int mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, ORDER *order,
|
||||
if ((thd->options & OPTION_SAFE_UPDATES) && limit == HA_POS_ERROR)
|
||||
{
|
||||
delete select;
|
||||
send_error(&thd->net,ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE);
|
||||
send_error(thd,ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE);
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
}
|
||||
@@ -188,10 +188,10 @@ cleanup:
|
||||
}
|
||||
delete select;
|
||||
if (error >= 0) // Fatal error
|
||||
send_error(&thd->net,thd->killed ? ER_SERVER_SHUTDOWN: 0);
|
||||
send_error(thd,thd->killed ? ER_SERVER_SHUTDOWN: 0);
|
||||
else
|
||||
{
|
||||
send_ok(&thd->net,deleted);
|
||||
send_ok(thd,deleted);
|
||||
DBUG_PRINT("info",("%d records deleted",deleted));
|
||||
}
|
||||
DBUG_RETURN(0);
|
||||
@@ -222,9 +222,10 @@ multi_delete::multi_delete(THD *thd_arg, TABLE_LIST *dt,
|
||||
|
||||
|
||||
int
|
||||
multi_delete::prepare(List<Item> &values)
|
||||
multi_delete::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
|
||||
{
|
||||
DBUG_ENTER("multi_delete::prepare");
|
||||
unit= u;
|
||||
do_delete = true;
|
||||
thd->proc_info="deleting from main table";
|
||||
|
||||
@@ -353,7 +354,7 @@ void multi_delete::send_error(uint errcode,const char *err)
|
||||
DBUG_ENTER("multi_delete::send_error");
|
||||
|
||||
/* First send error what ever it is ... */
|
||||
::send_error(&thd->net,errcode,err);
|
||||
::send_error(thd,errcode,err);
|
||||
|
||||
/* If nothing deleted return */
|
||||
if (!deleted)
|
||||
@@ -455,7 +456,7 @@ bool multi_delete::send_eof()
|
||||
thd->proc_info="end";
|
||||
if (error)
|
||||
{
|
||||
::send_error(&thd->net);
|
||||
::send_error(thd);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -482,7 +483,7 @@ bool multi_delete::send_eof()
|
||||
{
|
||||
query_cache_invalidate3(thd, delete_tables, 1);
|
||||
}
|
||||
::send_ok(&thd->net,deleted);
|
||||
::send_ok(thd,deleted);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -520,8 +521,9 @@ int mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
|
||||
table->file->info(HA_STATUS_AUTO | HA_STATUS_NO_LOCK);
|
||||
bzero((char*) &create_info,sizeof(create_info));
|
||||
create_info.auto_increment_value= table->file->auto_increment_value;
|
||||
db_type table_type=table->db_type;
|
||||
create_info.table_charset=default_charset_info;
|
||||
|
||||
db_type table_type=table->db_type;
|
||||
strmov(path,table->path);
|
||||
*table_ptr= table->next; // Unlink table from list
|
||||
close_temporary(table,0);
|
||||
@@ -532,8 +534,8 @@ int mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
|
||||
table_list->real_name, 1))))
|
||||
(void) rm_temporary_table(table_type, path);
|
||||
/*
|
||||
Sasha: if we return here we will not have binloged the truncation and
|
||||
we will not send_ok() to the client.
|
||||
If we return here we will not have logged the truncation to the bin log
|
||||
and we will not send_ok() to the client.
|
||||
*/
|
||||
goto end;
|
||||
}
|
||||
@@ -562,6 +564,8 @@ int mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
|
||||
}
|
||||
|
||||
bzero((char*) &create_info,sizeof(create_info));
|
||||
create_info.table_charset=default_charset_info;
|
||||
|
||||
*fn_ext(path)=0; // Remove the .frm extension
|
||||
error= ha_create_table(path,&create_info,1) ? -1 : 0;
|
||||
query_cache_invalidate3(thd, table_list, 0);
|
||||
@@ -576,7 +580,7 @@ end:
|
||||
Query_log_event qinfo(thd, thd->query, thd->query_length);
|
||||
mysql_bin_log.write(&qinfo);
|
||||
}
|
||||
send_ok(&thd->net); // This should return record count
|
||||
send_ok(thd); // This should return record count
|
||||
}
|
||||
VOID(pthread_mutex_lock(&LOCK_open));
|
||||
unlock_table_name(thd, table_list);
|
||||
|
Reference in New Issue
Block a user