Below is the list of changes that have just been committed into a local
5.1 repository of antony. When antony does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.2246 06/07/11 12:55:01 acurtis@stripped +4 -0
Removing redundant code:
mysqld_show_storage_engines()
sql/sql_yacc.yy
1.485 06/07/11 12:54:55 acurtis@stripped +2 -0
prepare information schema for use in "SHOW TABLE TYPES"
sql/sql_show.cc
1.355 06/07/11 12:54:55 acurtis@stripped +7 -56
no need for mysqld_show_storage_engines()
remove redundant code
sql/sql_parse.cc
1.567 06/07/11 12:54:55 acurtis@stripped +1 -3
no need for mysqld_show_storage_engines()
sql/mysql_priv.h
1.418 06/07/11 12:54:55 acurtis@stripped +0 -1
no need for mysqld_show_storage_engines()
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: acurtis
# Host: ltantony.xiphis.org
# Root: /home/antony/work2/cleanup-5.1
--- 1.417/sql/mysql_priv.h 2006-07-04 00:50:37 -07:00
+++ 1.418/sql/mysql_priv.h 2006-07-11 12:54:55 -07:00
@@ -1002,7 +1002,6 @@ int mysqld_show_status(THD *thd);
int mysqld_show_variables(THD *thd,const char *wild);
int mysql_find_files(THD *thd,List<char> *files, const char *db,
const char *path, const char *wild, bool dir);
-bool mysqld_show_storage_engines(THD *thd);
bool mysqld_show_authors(THD *thd);
bool mysqld_show_contributors(THD *thd);
bool mysqld_show_privileges(THD *thd);
--- 1.566/sql/sql_parse.cc 2006-07-04 01:02:05 -07:00
+++ 1.567/sql/sql_parse.cc 2006-07-11 12:54:55 -07:00
@@ -2536,6 +2536,7 @@ mysql_execute_command(THD *thd)
/* fall through */
case SQLCOM_SHOW_STATUS_PROC:
case SQLCOM_SHOW_STATUS_FUNC:
+ case SQLCOM_SHOW_STORAGE_ENGINES:
res= execute_sqlcom_select(thd, all_tables);
break;
case SQLCOM_SHOW_STATUS:
@@ -3583,9 +3584,6 @@ end_with_restore_list:
NullS :
thd->security_ctx->priv_user),
lex->verbose);
- break;
- case SQLCOM_SHOW_STORAGE_ENGINES:
- res= mysqld_show_storage_engines(thd);
break;
case SQLCOM_SHOW_AUTHORS:
res= mysqld_show_authors(thd);
--- 1.354/sql/sql_show.cc 2006-06-26 07:44:38 -07:00
+++ 1.355/sql/sql_show.cc 2006-07-11 12:54:55 -07:00
@@ -71,61 +71,6 @@ static TYPELIB grant_types = { sizeof(gr
static void store_key_options(THD *thd, String *packet, TABLE *table,
KEY *key_info);
-/***************************************************************************
-** List all table types supported
-***************************************************************************/
-
-static my_bool show_handlerton(THD *thd, st_plugin_int *plugin,
- void *arg)
-{
- handlerton *default_type= (handlerton *) arg;
- Protocol *protocol= thd->protocol;
- handlerton *hton= (handlerton *)plugin->data;
-
- if (!(hton->flags & HTON_HIDDEN))
- {
- protocol->prepare_for_resend();
- protocol->store(plugin->name.str, plugin->name.length,
- system_charset_info);
- const char *option_name= show_comp_option_name[(int) hton->state];
-
- if (hton->state == SHOW_OPTION_YES && default_type == hton)
- option_name= "DEFAULT";
- protocol->store(option_name, system_charset_info);
- protocol->store(plugin->plugin->descr, system_charset_info);
- protocol->store(hton->commit ? "YES" : "NO", system_charset_info);
- protocol->store(hton->prepare ? "YES" : "NO", system_charset_info);
- protocol->store(hton->savepoint_set ? "YES" : "NO", system_charset_info);
-
- return protocol->write() ? 1 : 0;
- }
- return 0;
-}
-
-bool mysqld_show_storage_engines(THD *thd)
-{
- List<Item> field_list;
- Protocol *protocol= thd->protocol;
- DBUG_ENTER("mysqld_show_storage_engines");
-
- field_list.push_back(new Item_empty_string("Engine",10));
- field_list.push_back(new Item_empty_string("Support",10));
- field_list.push_back(new Item_empty_string("Comment",80));
- field_list.push_back(new Item_empty_string("Transactions",3));
- field_list.push_back(new Item_empty_string("XA",3));
- field_list.push_back(new Item_empty_string("Savepoints",3));
-
- if (protocol->send_fields(&field_list,
- Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
- DBUG_RETURN(TRUE);
-
- if (plugin_foreach(thd, show_handlerton,
- MYSQL_STORAGE_ENGINE_PLUGIN, thd->variables.table_type))
- DBUG_RETURN(TRUE);
-
- send_eof(thd);
- DBUG_RETURN(FALSE);
-}
static int make_version_string(char *buf, int buf_length, uint version)
{
@@ -3148,6 +3093,7 @@ static my_bool iter_schema_engines(THD *
void *ptable)
{
TABLE *table= (TABLE *) ptable;
+ handlerton *default_type= thd->variables.table_type;
handlerton *hton= (handlerton *)plugin->data;
const char *wild= thd->lex->wild ? thd->lex->wild->ptr() : NullS;
CHARSET_INFO *scs= system_charset_info;
@@ -3158,6 +3104,7 @@ static my_bool iter_schema_engines(THD *
if (!(wild && wild[0] &&
wild_case_compare(scs, plugin->name.str,wild)))
{
+ LEX_STRING defstate= {(char*) STRING_WITH_LEN("DEFAULT")};
LEX_STRING state[2]= {{(char*) STRING_WITH_LEN("ENABLED")},
{(char*) STRING_WITH_LEN("DISABLED")}};
LEX_STRING yesno[2]= {{(char*) STRING_WITH_LEN("NO")},
@@ -3166,7 +3113,11 @@ static my_bool iter_schema_engines(THD *
restore_record(table, s->default_values);
table->field[0]->store(plugin->name.str, plugin->name.length, scs);
- tmp= &state[test(hton->state)];
+ if (thd->lex->sql_command == SQLCOM_SHOW_STORAGE_ENGINES &&
+ hton->state == SHOW_OPTION_YES && default_type == hton)
+ tmp= &defstate;
+ else
+ tmp= &state[test(hton->state)];
table->field[1]->store(tmp->str, tmp->length, scs);
table->field[2]->store(plugin->plugin->descr,
strlen(plugin->plugin->descr), scs);
--- 1.484/sql/sql_yacc.yy 2006-06-26 07:44:38 -07:00
+++ 1.485/sql/sql_yacc.yy 2006-07-11 12:54:55 -07:00
@@ -8190,6 +8190,8 @@ show_param:
LEX *lex=Lex;
lex->sql_command= SQLCOM_SHOW_STORAGE_ENGINES;
WARN_DEPRECATED(yythd, "5.2", "SHOW TABLE TYPES", "'SHOW [STORAGE] ENGINES'");
+ if (prepare_schema_table(YYTHD, lex, 0, SCH_ENGINES))
+ YYABORT;
}
| opt_storage ENGINES_SYM
{
| Thread |
|---|
| • bk commit into 5.1 tree (acurtis:1.2246) | antony | 11 Jul |