From fca8f01abcc7ba150773cda3aeb5322a95a210d5 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 10 Nov 2005 08:24:21 -0800 Subject: [PATCH] Added handlerton flag to make storage engines invisable via flag. mysql-test/r/ps_1general.result: Remove binlog from visable engine list. sql/handler.h: Added documentation to HTON's sql/log.cc: binlog now has hidden flag show that it does now show up in show storage engine list. sql/sql_show.cc: Flag removes engines from view in show storage engines --- mysql-test/r/ps_1general.result | 1 - sql/handler.h | 5 +++-- sql/log.cc | 2 +- sql/sql_show.cc | 23 +++++++++++++---------- 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result index d41d1b74ca7..aba3da02c4c 100644 --- a/mysql-test/r/ps_1general.result +++ b/mysql-test/r/ps_1general.result @@ -332,7 +332,6 @@ CSV YES/NO CSV storage engine ndbcluster YES/NO Clustered, fault-tolerant, memory-based tables FEDERATED YES/NO Federated MySQL storage engine MRG_MYISAM YES/NO Collection of identical MyISAM tables -binlog YES/NO This is a meta storage engine to represent the binlog in a transaction ISAM YES/NO Obsolete storage engine drop table if exists t5; prepare stmt1 from ' drop table if exists t5 ' ; diff --git a/sql/handler.h b/sql/handler.h index e317f95b990..be188f7cacd 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -401,8 +401,9 @@ struct show_table_alias_st { /* Possible flags of a handlerton */ #define HTON_NO_FLAGS 0 #define HTON_CLOSE_CURSORS_AT_COMMIT (1 << 0) -#define HTON_ALTER_NOT_SUPPORTED (1 << 1) -#define HTON_CAN_RECREATE (1 << 2) +#define HTON_ALTER_NOT_SUPPORTED (1 << 1) //Engine does not support alter +#define HTON_CAN_RECREATE (1 << 2) //Delete all is used fro truncate +#define HTON_HIDDEN (1 << 3) //Engine does not appear in lists typedef struct st_thd_trans { diff --git a/sql/log.cc b/sql/log.cc index 7ea2dba2144..4b3d6698051 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -67,7 +67,7 @@ handlerton binlog_hton = { NULL, /* create_cursor_read_view */ NULL, /* set_cursor_read_view */ NULL, /* close_cursor_read_view */ - HTON_NO_FLAGS + HTON_HIDDEN }; /* diff --git a/sql/sql_show.cc b/sql/sql_show.cc index b4b24e0b6be..ef5db767809 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -70,17 +70,20 @@ bool mysqld_show_storage_engines(THD *thd) handlerton **types; for (types= sys_table_types; *types; types++) { - protocol->prepare_for_resend(); - protocol->store((*types)->name, system_charset_info); - const char *option_name= show_comp_option_name[(int) (*types)->state]; + if (!((*types)->flags & HTON_HIDDEN)) + { + protocol->prepare_for_resend(); + protocol->store((*types)->name, system_charset_info); + const char *option_name= show_comp_option_name[(int) (*types)->state]; - if ((*types)->state == SHOW_OPTION_YES && - !my_strcasecmp(system_charset_info, default_type_name, (*types)->name)) - option_name= "DEFAULT"; - protocol->store(option_name, system_charset_info); - protocol->store((*types)->comment, system_charset_info); - if (protocol->write()) - DBUG_RETURN(TRUE); + if ((*types)->state == SHOW_OPTION_YES && + !my_strcasecmp(system_charset_info, default_type_name, (*types)->name)) + option_name= "DEFAULT"; + protocol->store(option_name, system_charset_info); + protocol->store((*types)->comment, system_charset_info); + if (protocol->write()) + DBUG_RETURN(TRUE); + } } send_eof(thd); DBUG_RETURN(FALSE);