summaryrefslogtreecommitdiff
path: root/sql/sql_handler.cc
diff options
context:
space:
mode:
authorIgnacio Galarza <iggy@mysql.com>2009-03-19 09:44:58 -0400
committerIgnacio Galarza <iggy@mysql.com>2009-03-19 09:44:58 -0400
commit675c3ce2bbe7f033930822dd0ef9126ebb25d44b (patch)
tree0d1697348f5ffacdf22ddce0537910d41d6482f0 /sql/sql_handler.cc
parent54fbbf9591e21cda9f7b26c2d795d88f51827f07 (diff)
parent0d18d930aed47ed97ef3309f9510cfd7a366202e (diff)
downloadmariadb-git-675c3ce2bbe7f033930822dd0ef9126ebb25d44b.tar.gz
auto-merge
Diffstat (limited to 'sql/sql_handler.cc')
-rw-r--r--sql/sql_handler.cc15
1 files changed, 7 insertions, 8 deletions
diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc
index 67f9992499b..c376f1b3d1d 100644
--- a/sql/sql_handler.cc
+++ b/sql/sql_handler.cc
@@ -151,6 +151,9 @@ static void mysql_ha_close_table(THD *thd, TABLE_LIST *tables)
}
VOID(pthread_mutex_unlock(&LOCK_open));
}
+
+ /* Mark table as closed, ready for re-open if necessary. */
+ tables->table= NULL;
}
/*
@@ -168,8 +171,7 @@ static void mysql_ha_close_table(THD *thd, TABLE_LIST *tables)
'reopen' is set when a handler table is to be re-opened. In this case,
'tables' is the pointer to the hashed TABLE_LIST object which has been
saved on the original open.
- 'reopen' is also used to suppress the sending of an 'ok' message or
- error messages.
+ 'reopen' is also used to suppress the sending of an 'ok' message.
RETURN
FALSE OK
@@ -205,8 +207,7 @@ bool mysql_ha_open(THD *thd, TABLE_LIST *tables, bool reopen)
(uint) strlen(tables->alias) + 1))
{
DBUG_PRINT("info",("duplicate '%s'", tables->alias));
- if (! reopen)
- my_error(ER_NONUNIQ_TABLE, MYF(0), tables->alias);
+ my_error(ER_NONUNIQ_TABLE, MYF(0), tables->alias);
goto err;
}
}
@@ -251,8 +252,7 @@ bool mysql_ha_open(THD *thd, TABLE_LIST *tables, bool reopen)
/* There can be only one table in '*tables'. */
if (! (tables->table->file->table_flags() & HA_CAN_SQL_HANDLER))
{
- if (! reopen)
- my_error(ER_ILLEGAL_HA, MYF(0), tables->alias);
+ my_error(ER_ILLEGAL_HA, MYF(0), tables->alias);
goto err;
}
@@ -464,8 +464,7 @@ retry:
if (need_reopen)
{
- mysql_ha_close_table(thd, tables);
- hash_tables->table= NULL;
+ mysql_ha_close_table(thd, hash_tables);
/*
The lock might have been aborted, we need to manually reset
thd->some_tables_deleted because handler's tables are closed