summaryrefslogtreecommitdiff
path: root/sql/sql_load.cc
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2001-09-02 19:58:08 +0300
committerunknown <monty@hundin.mysql.fi>2001-09-02 19:58:08 +0300
commit3719b87396063fadf9a88a6acc6584f1321a7d6a (patch)
treec1066773b871f44ebb365c32dab0432f7da6da94 /sql/sql_load.cc
parentfa7b17e904a73da0e938eac8e8d1503838d78202 (diff)
parentddee00a6edc735b3bbef42b7d0d662091debd560 (diff)
downloadmariadb-git-3719b87396063fadf9a88a6acc6584f1321a7d6a.tar.gz
merge
configure.in: Auto merged sql/ha_innobase.cc: Auto merged sql/ha_myisam.cc: Auto merged sql/handler.cc: Auto merged sql/handler.h: Auto merged sql/lock.cc: Auto merged sql/mysql_priv.h: Auto merged sql/sql_db.cc: Auto merged sql/sql_delete.cc: Auto merged sql/sql_insert.cc: Auto merged sql/sql_load.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_yacc.yy: Auto merged
Diffstat (limited to 'sql/sql_load.cc')
-rw-r--r--sql/sql_load.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index d7f273bfaa4..c2793da78f3 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -86,6 +86,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
bool is_fifo=0;
LOAD_FILE_INFO lf_info;
char * db = table_list->db ? table_list->db : thd->db;
+ bool using_transactions;
DBUG_ENTER("mysql_load");
if (escaped->length() > 1 || enclosed->length() > 1)
@@ -170,7 +171,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
else
{
unpack_filename(name,ex->file_name);
-#ifndef __WIN__
+#if !defined(__WIN__) && !defined(OS2)
MY_STAT stat_info;
if (!my_stat(name,&stat_info,MYF(MY_WME)))
DBUG_RETURN(-1);
@@ -270,8 +271,11 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
free_blobs(table); /* if pack_blob was used */
table->copy_blobs=0;
thd->count_cuted_fields=0; /* Don`t calc cuted fields */
+ using_transactions = table->file->has_transactions();
if (error)
{
+ if (using_transactions)
+ ha_autocommit_or_rollback(thd,error);
if (!opt_old_rpl_compat && mysql_bin_log.is_open())
{
Delete_file_log_event d(thd);
@@ -286,7 +290,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
if(!thd->slave_thread)
mysql_update_log.write(thd,thd->query,thd->query_length);
- if (!table->file->has_transactions())
+ if (!using_transactions)
thd->options|=OPTION_STATUS_NO_TRANS_UPDATE;
if (mysql_bin_log.is_open())
{
@@ -303,7 +307,9 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
mysql_bin_log.write(&e);
}
}
- DBUG_RETURN(0);
+ if (using_transactions)
+ error=ha_autocommit_or_rollback(thd,error);
+ DBUG_RETURN(error);
}