diff options
author | monty@hundin.mysql.fi <> | 2001-12-22 15:44:44 +0200 |
---|---|---|
committer | monty@hundin.mysql.fi <> | 2001-12-22 15:44:44 +0200 |
commit | 3eda53fb343fe3b2ac2b3868a779f17f22343a6f (patch) | |
tree | 786efd7b64be9ee4f055f52dc40616496719a65b /sql | |
parent | 9e9e765fbd209b59a8402a133b85b5a17d32621d (diff) | |
download | mariadb-git-3eda53fb343fe3b2ac2b3868a779f17f22343a6f.tar.gz |
Fix for error message when using HANDLER OPEN on InnoDB tables.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/mysql_priv.h | 2 | ||||
-rw-r--r-- | sql/sql_handler.cc | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 629f29a343e..739991f55b1 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -436,7 +436,7 @@ int mysqld_show(THD *thd, const char *wild, show_var_st *variables); /* sql_handler.cc */ int mysql_ha_open(THD *thd, TABLE_LIST *tables); -int mysql_ha_close(THD *thd, TABLE_LIST *tables); +int mysql_ha_close(THD *thd, TABLE_LIST *tables, bool dont_send_ok=0); int mysql_ha_read(THD *, TABLE_LIST *,enum enum_ha_read_modes,char *, List<Item> *,enum ha_rkey_function,Item *,ha_rows,ha_rows); diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc index 5d913d2b828..24108330dc9 100644 --- a/sql/sql_handler.cc +++ b/sql/sql_handler.cc @@ -58,6 +58,7 @@ int mysql_ha_open(THD *thd, TABLE_LIST *tables) if (!(tables->table->file->option_flag() & HA_CAN_SQL_HANDLER)) { my_printf_error(ER_ILLEGAL_HA,ER(ER_ILLEGAL_HA),MYF(0), tables->name); + mysql_ha_close(thd, tables,1); return -1; } @@ -65,7 +66,7 @@ int mysql_ha_open(THD *thd, TABLE_LIST *tables) return 0; } -int mysql_ha_close(THD *thd, TABLE_LIST *tables) +int mysql_ha_close(THD *thd, TABLE_LIST *tables, bool dont_send_ok) { TABLE **ptr=find_table_ptr_by_name(thd, tables->db, tables->name); @@ -75,8 +76,8 @@ int mysql_ha_close(THD *thd, TABLE_LIST *tables) close_thread_table(thd, ptr); VOID(pthread_mutex_unlock(&LOCK_open)); } - - send_ok(&thd->net); + if (!dont_send_ok) + send_ok(&thd->net); return 0; } |