summaryrefslogtreecommitdiff
path: root/sql/sql_insert.cc
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-11-07 04:02:37 +0200
committerunknown <monty@hundin.mysql.fi>2002-11-07 04:02:37 +0200
commit72413e7f81cb87327d8bb2094a43d66578cd1632 (patch)
treee27391c030124332f69b62384e7e47e39f8e1818 /sql/sql_insert.cc
parent23f4865b163293006bbedbc2b69bc55ba1081baa (diff)
downloadmariadb-git-72413e7f81cb87327d8bb2094a43d66578cd1632.tar.gz
Put temporary files in binlog cache when using BEGIN/COMMIT
Let MySQL 4.0 read 4.1 .frm files without 4.1 specific extensions New variables @@rand_seed1 and @@rand_seed2 (used by replication) DROP TEMPORARY TABLE mysql-test/r/rpl_log.result: Update of results after last replication change mysql-test/r/variables.result: Test of new variables @@rand_seed1 and @@rand_seed2 mysql-test/t/variables.test: Test of new variables @@rand_seed1 and @@rand_seed2 sql/field.cc: Let MySQL 4.0 read 4.1 .frm files without 4.1 specific extensions sql/field.h: Let MySQL 4.0 read 4.1 .frm files without 4.1 specific extensions sql/item_func.cc: Put temporary files in binlog cache when using BEGIN/COMMIT sql/log.cc: Put temporary files in binlog cache when using BEGIN/COMMIT More debug information sql/log_event.cc: Put temporary files in binlog cache when using BEGIN/COMMIT sql/log_event.h: Put temporary files in binlog cache when using BEGIN/COMMIT sql/set_var.cc: Add system variables @@rand_seed1 and @@rand_seed2 sql/set_var.h: Add system variables @@rand_seed1 and @@rand_seed2 sql/slave.cc: Put temporary files in binlog cache when using BEGIN/COMMIT sql/sql_acl.cc: Put temporary files in binlog cache when using BEGIN/COMMIT sql/sql_base.cc: Store DROP of temporary tables in binlog cache sql/sql_class.h: Put temporary files in binlog cache when using BEGIN/COMMIT sql/sql_db.cc: Put temporary files in binlog cache when using BEGIN/COMMIT sql/sql_delete.cc: Put temporary files in binlog cache when using BEGIN/COMMIT sql/sql_insert.cc: Put temporary files in binlog cache when using BEGIN/COMMIT sql/sql_lex.h: DROP TEMPORARY TABLE sql/sql_load.cc: Put temporary files in binlog cache when using BEGIN/COMMIT sql/sql_parse.cc: Put temporary files in binlog cache when using BEGIN/COMMIT sql/sql_rename.cc: Put temporary files in binlog cache when using BEGIN/COMMIT sql/sql_repl.cc: Put temporary files in binlog cache when using BEGIN/COMMIT sql/sql_repl.h: Put temporary files in binlog cache when using BEGIN/COMMIT sql/sql_table.cc: Put temporary files in binlog cache when using BEGIN/COMMIT sql/sql_update.cc: Put temporary files in binlog cache when using BEGIN/COMMIT sql/sql_yacc.yy: DROP TEMPORARY sql/table.cc: Let MySQL 4.0 read 4.1 .frm files without 4.1 specific extensions sql/unireg.cc: Let MySQL 4.0 read 4.1 .frm files without 4.1 specific extensions
Diffstat (limited to 'sql/sql_insert.cc')
-rw-r--r--sql/sql_insert.cc18
1 files changed, 10 insertions, 8 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index bd379bf688d..81178809f8f 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -104,7 +104,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, List<Item> &fields,
int error;
bool log_on= ((thd->options & OPTION_UPDATE_LOG) ||
!(thd->master_access & SUPER_ACL));
- bool using_transactions, bulk_insert=0;
+ bool transactional_table, log_delayed, bulk_insert=0;
uint value_count;
uint save_time_stamp;
ulong counter = 1;
@@ -297,21 +297,23 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, List<Item> &fields,
thd->insert_id(id); // For update log
else if (table->next_number_field)
id=table->next_number_field->val_int(); // Return auto_increment value
- using_transactions=table->file->has_transactions();
- if ((info.copied || info.deleted) && (error <= 0 || !using_transactions))
+
+ transactional_table= table->file->has_transactions();
+ log_delayed= (transactional_table || table->tmp_table);
+ if ((info.copied || info.deleted) && (error <= 0 || !transactional_table))
{
mysql_update_log.write(thd, thd->query, thd->query_length);
if (mysql_bin_log.is_open())
{
Query_log_event qinfo(thd, thd->query, thd->query_length,
- using_transactions);
- if (mysql_bin_log.write(&qinfo) && using_transactions)
+ log_delayed);
+ if (mysql_bin_log.write(&qinfo) && transactional_table)
error=1;
}
- if (!using_transactions)
+ if (!log_delayed)
thd->options|=OPTION_STATUS_NO_TRANS_UPDATE;
}
- if (using_transactions)
+ if (transactional_table)
error=ha_autocommit_or_rollback(thd,error);
if (info.copied || info.deleted)
{
@@ -1197,7 +1199,7 @@ bool delayed_insert::handle_inserts(void)
mysql_update_log.write(&thd,row->query, row->query_length);
if (using_bin_log)
{
- Query_log_event qinfo(&thd, row->query, row->query_length);
+ Query_log_event qinfo(&thd, row->query, row->query_length,0);
mysql_bin_log.write(&qinfo);
}
}