summaryrefslogtreecommitdiff
path: root/sql/sql_insert.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_insert.cc')
-rw-r--r--sql/sql_insert.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 25ca7d76e03..b1ae918a791 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -222,7 +222,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, List<Item> &fields,
break;
}
}
- if (lock_type == TL_WRITE_DELAYED)
+ if (lock_type == TL_WRITE_DELAYED && ! table->file->has_transactions())
{
error=write_delayed(thd,table,duplic,query, thd->query_length, log_on);
query=0;
@@ -262,6 +262,8 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, List<Item> &fields,
Query_log_event qinfo(thd, thd->query);
mysql_bin_log.write(&qinfo);
}
+ if (!table->file->has_transactions())
+ thd->options|=OPTION_STATUS_NO_TRANS_UPDATE;
}
error=ha_autocommit_or_rollback(thd,error);
if (thd->lock)
@@ -282,7 +284,8 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, List<Item> &fields,
if (values_list.elements == 1 && (!(thd->options & OPTION_WARNINGS) ||
!thd->cuted_fields))
send_ok(&thd->net,info.copied+info.deleted,id);
- else {
+ else
+ {
char buff[160];
if (duplic == DUP_IGNORE)
sprintf(buff,ER(ER_INSERT_INFO),info.records,info.records-info.copied,