summaryrefslogtreecommitdiff
path: root/sql/sql_load.cc
diff options
context:
space:
mode:
authorguilhem@gbichot3.local <>2006-09-05 16:52:05 +0200
committerguilhem@gbichot3.local <>2006-09-05 16:52:05 +0200
commite4d3595b18eda1d2327050eb95262c92eed5d8bf (patch)
treee3d37dfc52626891f544df507b4fd8fa18d444f0 /sql/sql_load.cc
parent4d0430c8fde8c5c20afee073775210c7f13f7a44 (diff)
downloadmariadb-git-e4d3595b18eda1d2327050eb95262c92eed5d8bf.tar.gz
Fix for BUG#11151 "LOAD DATA INFILE commits transaction in 5.0".
In 5.0 we made LOAD DATA INFILE autocommit in all engines, while only NDB wanted that. Users and trainers complained that it affected InnoDB and was a change compared to 4.1 where only NDB autocommitted. To revert to the behaviour of 4.1, we move the autocommit logic out of mysql_load() into ha_ndbcluster::external_lock(). The result is that LOAD DATA INFILE commits all uncommitted changes of NDB if this is an NDB table, its own changes if this is an NDB table, but does not affect other engines. Note: even though there is no "commit the full transaction at end" anymore, LOAD DATA INFILE stays disabled in routines (re-entrency problems per a comment of Pem). Note: ha_ndbcluster::has_transactions() does not give reliable results because it says "yes" even if transactions are disabled in this engine...
Diffstat (limited to 'sql/sql_load.cc')
-rw-r--r--sql/sql_load.cc5
1 files changed, 0 insertions, 5 deletions
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index b1ba2e96651..d5faf6ee7e9 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -147,10 +147,6 @@ bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
MYF(0));
DBUG_RETURN(TRUE);
}
- /*
- This needs to be done before external_lock
- */
- ha_enable_transaction(thd, FALSE);
if (open_and_lock_tables(thd, table_list))
DBUG_RETURN(TRUE);
if (setup_tables_and_check_access(thd, &thd->lex->select_lex.context,
@@ -394,7 +390,6 @@ bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
table->file->extra(HA_EXTRA_WRITE_CANNOT_REPLACE);
table->next_number_field=0;
}
- ha_enable_transaction(thd, TRUE);
if (file >= 0)
my_close(file,MYF(0));
free_blobs(table); /* if pack_blob was used */