summaryrefslogtreecommitdiff
path: root/sql/sql_delete.cc
diff options
context:
space:
mode:
authormonty@narttu.mysql.fi <>2002-08-30 12:40:40 +0300
committermonty@narttu.mysql.fi <>2002-08-30 12:40:40 +0300
commit7134ffec210edde21860a2b2c2654be481de49b4 (patch)
tree1bb81fd601075133af9ee99bd7ac94baf5ffc46c /sql/sql_delete.cc
parent921f7c9c551d9e1bdd5083ebe71d204ab6246ba1 (diff)
parentdd5382187e68ff5337e1fe7ba5f86f0d9cdd31d5 (diff)
downloadmariadb-git-7134ffec210edde21860a2b2c2654be481de49b4.tar.gz
Merge with 4.0.3
Some simple optimzations, more comments and indentation changes. Add ` around database in 'use database' in binary log. Moved max_error_count and max_warning_count to variables struct. Removed SHOW_WARNS_COUNT and SHOW_ERRORS_COUNT calls. Changed string functions to use character set of first string argument as default return characterset (Each string function can change the above assumption if needed)
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r--sql/sql_delete.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index eaa8c6c2a67..fc98cfb90c5 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -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";
@@ -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);