diff options
author | monty@hundin.mysql.fi <> | 2001-09-02 19:58:08 +0300 |
---|---|---|
committer | monty@hundin.mysql.fi <> | 2001-09-02 19:58:08 +0300 |
commit | 381093b3228524f151c8e5e61120e827c0441aea (patch) | |
tree | c1066773b871f44ebb365c32dab0432f7da6da94 /sql/sql_load.cc | |
parent | 35118a00c1f52495b17783f546425084c28b0235 (diff) | |
parent | 447c18954e904e5770d64ae3b0817a16b9060b74 (diff) | |
download | mariadb-git-381093b3228524f151c8e5e61120e827c0441aea.tar.gz |
merge
Diffstat (limited to 'sql/sql_load.cc')
-rw-r--r-- | sql/sql_load.cc | 12 |
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); } |