From 042448aa3364a65ed41ceeff10edbd170ee85a2c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 27 Jan 2005 22:38:56 +0100 Subject: query_id and my_xid -> ulonglong fix for binlog+autocommit+tclog comments, style fixes libmysqld/libmysqld.rc: Change mode to -rw-rw-r-- libmysqld/resource.h: Change mode to -rw-rw-r-- configure.in: check for getpagesize include/my_global.h: typo ? include/my_pthread.h: bug in thread_safe_decrement_and_test() mysql-test/r/bdb.result: results updated mysql-test/r/innodb.result: results updated mysql-test/r/mix_innodb_myisam_binlog.result: results updated mysql-test/r/rpl_relayrotate.result: results updated sql/ha_berkeley.cc: style fixes sql/ha_innodb.cc: fixes to follow innodb coding style sql/handler.cc: more comments. XA COMMIT ONE PHASE fix. sql/handler.h: my_xid -> ulonglong. comments sql/item_func.cc: DO RELEASE_LOCK("...") is no cache_stmt sql/log.cc: comments, better error messages sql/log_event.cc: even in autocommit mode we may need to cache_stmt xid is ulonglong sql/log_event.h: more comments. sql/mysql_priv.h: query_id is ulonglong sql/mysqld.cc: default value for --log-tc changed sql/share/errmsg.txt: better error messages sql/sql_class.h: cleanup, comments sql/sql_delete.cc: deleting from temporary tables is not always transactional sql/sql_insert.cc: insert into temporary table is not always transactional sql/sql_load.cc: load data into temp table is not always transactional sql/sql_parse.cc: comments. bad merge fixed. xa_state_names[] sql/sql_table.cc: create/drop temp table is not always transactional sql/sql_update.cc: update temp table is not always transactional --- sql/sql_delete.cc | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'sql/sql_delete.cc') diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index f4c5b0f8b59..a9d76052982 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -36,8 +36,8 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, TABLE *table; SQL_SELECT *select=0; READ_RECORD info; - bool using_limit=limit != HA_POS_ERROR; - bool transactional_table, log_delayed, safe_update, const_cond; + bool using_limit=limit != HA_POS_ERROR; + bool transactional_table, safe_update, const_cond; ha_rows deleted; SELECT_LEX *select_lex= &thd->lex->select_lex; DBUG_ENTER("mysql_delete"); @@ -233,7 +233,6 @@ cleanup: delete select; transactional_table= table->file->has_transactions(); - log_delayed= (transactional_table || table->tmp_table); /* We write to the binary log even if we deleted no row, because maybe the user is using this command to ensure that a table is clean on master *and @@ -249,11 +248,11 @@ cleanup: if (error <= 0) thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, - log_delayed, FALSE); + transactional_table, FALSE); if (mysql_bin_log.write(&qinfo) && transactional_table) error=1; } - if (!log_delayed) + if (!transactional_table) thd->options|=OPTION_STATUS_NO_TRANS_UPDATE; } if (transactional_table) @@ -398,7 +397,7 @@ multi_delete::multi_delete(THD *thd_arg, TABLE_LIST *dt, uint num_of_tables_arg) : delete_tables(dt), thd(thd_arg), deleted(0), found(0), num_of_tables(num_of_tables_arg), error(0), - do_delete(0), transactional_tables(0), log_delayed(0), normal_tables(0) + do_delete(0), transactional_tables(0), normal_tables(0) { tempfiles = (Unique **) sql_calloc(sizeof(Unique *) * (num_of_tables-1)); } @@ -445,9 +444,7 @@ multi_delete::initialize_tables(JOIN *join) tbl->no_cache= 1; tbl->used_keys.clear_all(); if (tbl->file->has_transactions()) - log_delayed= transactional_tables= 1; - else if (tbl->tmp_table != NO_TMP_TABLE) - log_delayed= 1; + transactional_tables= 1; else normal_tables= 1; } @@ -670,14 +667,14 @@ bool multi_delete::send_eof() if (error <= 0) thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, - log_delayed, FALSE); + transactional_tables, FALSE); if (mysql_bin_log.write(&qinfo) && !normal_tables) local_error=1; // Log write failed: roll back the SQL statement } - if (!log_delayed) + if (!transactional_tables) thd->options|=OPTION_STATUS_NO_TRANS_UPDATE; } - /* Commit or rollback the current SQL statement */ + /* Commit or rollback the current SQL statement */ if (transactional_tables) if (ha_autocommit_or_rollback(thd,local_error > 0)) local_error=1; @@ -768,7 +765,7 @@ bool mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok) *fn_ext(path)=0; // Remove the .frm extension error= ha_create_table(path,&create_info,1); - query_cache_invalidate3(thd, table_list, 0); + query_cache_invalidate3(thd, table_list, 0); end: if (!dont_send_ok) @@ -779,7 +776,7 @@ end: { thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, - thd->tmp_table, FALSE); + 0, FALSE); mysql_bin_log.write(&qinfo); } send_ok(thd); // This should return record count -- cgit v1.2.1 From de1dcee97e34f43b810a9329479e7e68b120eb55 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 16 Feb 2005 17:34:02 +0100 Subject: after merge fixes --- sql/sql_delete.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/sql_delete.cc') diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 0033e419351..1737a277466 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -732,7 +732,7 @@ bool mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok) 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; + goto end; } (void) sprintf(path,"%s/%s/%s%s",mysql_data_home,table_list->db, -- cgit v1.2.1