From 733f865f54e297bf512f10ec0631342303164b25 Mon Sep 17 00:00:00 2001 From: "monty@hundin.mysql.fi" <> Date: Wed, 22 Aug 2001 01:45:07 +0300 Subject: Fixes for OS2. Fix bug in isamlog Add argument types to function declarations. --- sql/sql_load.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/sql_load.cc') diff --git a/sql/sql_load.cc b/sql/sql_load.cc index ce8e34b9265..274b1814674 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -156,7 +156,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); -- cgit v1.2.1 From 788bc3f43bb20915e5ae733f868f98cbce85fdcc Mon Sep 17 00:00:00 2001 From: "monty@hundin.mysql.fi" <> Date: Tue, 28 Aug 2001 06:43:55 +0300 Subject: Fixed that LOAD DATA INFILE works with transactions. Fix for lower case filenames --- sql/sql_load.cc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'sql/sql_load.cc') diff --git a/sql/sql_load.cc b/sql/sql_load.cc index 274b1814674..9d3b899d31b 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -71,6 +71,8 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, String *field_term=ex->field_term,*escaped=ex->escaped, *enclosed=ex->enclosed; bool is_fifo=0; + bool using_transactions; + DBUG_ENTER("mysql_load"); if (escaped->length() > 1 || enclosed->length() > 1) @@ -239,8 +241,13 @@ 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) - DBUG_RETURN(-1); // Error on read + { + if (using_transactions) + ha_autocommit_or_rollback(thd,error); + DBUG_RETURN(-1); // Error on read + } sprintf(name,ER(ER_LOAD_INFO),info.records,info.deleted, info.records-info.copied,thd->cuted_fields); send_ok(&thd->net,info.copied+info.deleted,0L,name); @@ -248,7 +255,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 (!read_file_from_client && mysql_bin_log.is_open()) { @@ -257,7 +264,9 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, handle_duplicates); mysql_bin_log.write(&qinfo); } - DBUG_RETURN(0); + if (using_transactions) + error=ha_autocommit_or_rollback(thd,error); + DBUG_RETURN(error); } -- cgit v1.2.1