summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-03-22 13:40:46 +0200
committerunknown <monty@hundin.mysql.fi>2002-03-22 13:40:46 +0200
commit30016518c3444e92ac1e43cfd71fc335d760bc19 (patch)
tree4b314a06a92e86f7ba44d4c2c46273c082202f39 /sql
parent07e154167cf69e90c2d22d04677163f8f5f13754 (diff)
parent51076279af41aab04d14375ed230f7324b976541 (diff)
downloadmariadb-git-30016518c3444e92ac1e43cfd71fc335d760bc19.tar.gz
Merge work:/home/bk/mysql into hundin.mysql.fi:/my/bk/mysql
Diffstat (limited to 'sql')
-rw-r--r--sql/lock.cc7
-rw-r--r--sql/log_event.h5
-rw-r--r--sql/sql_base.cc1
-rw-r--r--sql/sql_load.cc5
-rw-r--r--sql/sql_rename.cc10
5 files changed, 18 insertions, 10 deletions
diff --git a/sql/lock.cc b/sql/lock.cc
index aa06822e03f..a9054b99186 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -108,6 +108,13 @@ MYSQL_LOCK *mysql_lock_tables(THD *thd,TABLE **tables,uint count)
thd->locked=0;
break;
}
+ else if (!thd->open_tables)
+ {
+ // Only using temporary tables, no need to unlock
+ thd->some_tables_deleted=0;
+ thd->locked=0;
+ break;
+ }
/* some table was altered or deleted. reopen tables marked deleted */
mysql_unlock_tables(thd,sql_lock);
diff --git a/sql/log_event.h b/sql/log_event.h
index 94f7cce0e35..a31c698fae9 100644
--- a/sql/log_event.h
+++ b/sql/log_event.h
@@ -229,12 +229,13 @@ public:
THD* thd;
String field_lens_buf;
String fields_buf;
- Load_log_event(THD* thd, sql_exchange* ex, const char* table_name_arg,
+ Load_log_event(THD* thd, sql_exchange* ex,
+ const char *db_arg, const char* table_name_arg,
List<Item>& fields_arg, enum enum_duplicates handle_dup ):
Log_event(thd->start_time),data_buf(0),thread_id(thd->thread_id),
num_fields(0),fields(0),field_lens(0),field_block_len(0),
table_name(table_name_arg),
- db(thd->db),
+ db(db_arg),
fname(ex->file_name),
thd(thd)
{
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 656758623bc..985118ee218 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -464,6 +464,7 @@ void close_thread_tables(THD *thd, bool locked)
unused_tables=table->next=table->prev=table;
}
}
+ thd->some_tables_deleted=0;
thd->open_tables=0;
/* Free tables to hold down open files */
while (open_cache.records > table_cache_size && unused_tables)
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index dd8487ceecc..1dcc8c2130e 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -72,7 +72,6 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
*enclosed=ex->enclosed;
bool is_fifo=0;
bool using_transactions;
-
DBUG_ENTER("mysql_load");
if (escaped->length() > 1 || enclosed->length() > 1)
@@ -260,8 +259,8 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
if (!read_file_from_client && mysql_bin_log.is_open())
{
ex->skip_lines = save_skip_lines;
- Load_log_event qinfo(thd, ex, table->table_name, fields,
- handle_duplicates);
+ Load_log_event qinfo(thd, ex, table->table_cache_key, table->table_name,
+ fields, handle_duplicates);
mysql_bin_log.write(&qinfo);
}
if (using_transactions)
diff --git a/sql/sql_rename.cc b/sql/sql_rename.cc
index 0f6e2f9fbf3..a6614f3f3f6 100644
--- a/sql/sql_rename.cc
+++ b/sql/sql_rename.cc
@@ -129,7 +129,7 @@ rename_tables(THD *thd, TABLE_LIST *table_list, bool skip_error)
new_table=ren_table->next;
sprintf(name,"%s/%s/%s%s",mysql_data_home,
- new_table->db,new_table->name,
+ new_table->db,new_table->real_name,
reg_ext);
if (!access(name,F_OK))
{
@@ -137,7 +137,7 @@ rename_tables(THD *thd, TABLE_LIST *table_list, bool skip_error)
return ren_table; // This can't be skipped
}
sprintf(name,"%s/%s/%s%s",mysql_data_home,
- ren_table->db,ren_table->name,
+ ren_table->db,ren_table->real_name,
reg_ext);
if ((table_type=get_table_type(name)) == DB_TYPE_UNKNOWN)
{
@@ -146,11 +146,11 @@ rename_tables(THD *thd, TABLE_LIST *table_list, bool skip_error)
return ren_table;
}
else if (mysql_rename_table(table_type,
- ren_table->db, ren_table->name,
- new_table->db, new_table->name))
+ ren_table->db, ren_table->real_name,
+ new_table->db, new_table->real_name))
{
if (!skip_error)
- return ren_table;
+ DBUG_RETURN(ren_table);
}
}
DBUG_RETURN(0);