summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2002-12-13 16:28:15 +0200
committerunknown <monty@mashka.mysql.fi>2002-12-13 16:28:15 +0200
commitd2bae465344fcc81bb6fca940ed2025da7b52798 (patch)
treeb9e2ac4e6f700f09f7a80dd67b0d3feb8798d1f1
parent6a2ce08600d55898d3a4487f8d502aa3d9d988c9 (diff)
downloadmariadb-git-d2bae465344fcc81bb6fca940ed2025da7b52798.tar.gz
Fixed possible replication problem in LOAD DATA INFILE with innodb tables.
-rw-r--r--sql/sql_load.cc15
1 files changed, 9 insertions, 6 deletions
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index cfb12b8a5bf..6375ba46fd7 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -269,11 +269,6 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
table->time_stamp=save_time_stamp;
table->next_number_field=0;
- if (thd->lock)
- {
- mysql_unlock_tables(thd, thd->lock);
- thd->lock=0;
- }
}
if (file >= 0) my_close(file,MYF(0));
free_blobs(table); /* if pack_blob was used */
@@ -292,7 +287,8 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
mysql_bin_log.write(&d);
}
}
- DBUG_RETURN(-1); // Error on read
+ error= -1; // Error on read
+ goto err;
}
sprintf(name,ER(ER_LOAD_INFO),info.records,info.deleted,
info.records-info.copied,thd->cuted_fields);
@@ -326,6 +322,13 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
}
if (transactional_table)
error=ha_autocommit_or_rollback(thd,error);
+
+err:
+ if (thd->lock)
+ {
+ mysql_unlock_tables(thd, thd->lock);
+ thd->lock=0;
+ }
DBUG_RETURN(error);
}