List:Commits« Previous MessageNext Message »
From:gluh Date:April 16 2007 11:15am
Subject:bk commit into 5.1 tree (gluh:1.2570) BUG#27629
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of gluh. When gluh 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@stripped, 2007-04-16 16:15:33+05:00, gluh@stripped +2 -0
  Bug#27629 Possible security flaw in INFORMATION_SCHEMA and SHOW statements
  changed:'show engines' works via I_S.engines table now

  sql/sql_parse.cc@stripped, 2007-04-16 16:15:31+05:00, gluh@stripped +1 -3
    changed:'show engines' works via I_S.engines table now

  sql/sql_show.cc@stripped, 2007-04-16 16:15:31+05:00, gluh@stripped +5 -56
    changed:'show engines' works via I_S.engines table now

# 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:	gluh
# Host:	eagle.(none)
# Root:	/home/gluh/MySQL/Bugs/5.1.27684

--- 1.652/sql/sql_parse.cc	2007-04-07 14:59:49 +05:00
+++ 1.653/sql/sql_parse.cc	2007-04-16 16:15:31 +05:00
@@ -1824,6 +1824,7 @@ mysql_execute_command(THD *thd)
   case SQLCOM_SHOW_VARIABLES:
   case SQLCOM_SHOW_CHARSETS:
   case SQLCOM_SHOW_COLLATIONS:
+  case SQLCOM_SHOW_STORAGE_ENGINES:
   case SQLCOM_SELECT:
     thd->status_var.last_query_cost= 0.0;
     if (all_tables)
@@ -2870,9 +2871,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.404/sql/sql_show.cc	2007-04-07 14:55:24 +05:00
+++ 1.405/sql/sql_show.cc	2007-04-16 16:15:31 +05:00
@@ -79,58 +79,6 @@ append_algorithm(TABLE_LIST *table, Stri
 ** 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)
 {
   return my_snprintf(buf, buf_length, "%d.%d", version>>8,version&0xff);
@@ -3286,16 +3234,17 @@ static my_bool iter_schema_engines(THD *
     if (!(wild && wild[0] &&
           wild_case_compare(scs, plugin->name.str,wild)))
     {
-      LEX_STRING state[2]= {{ C_STRING_WITH_LEN("ENABLED") },
-                            { C_STRING_WITH_LEN("DISABLED") }};
       LEX_STRING yesno[2]= {{ C_STRING_WITH_LEN("NO") },
                             { C_STRING_WITH_LEN("YES") }};
       LEX_STRING *tmp;
+      const char *option_name= show_comp_option_name[(int) hton->state];
       restore_record(table, s->default_values);
 
       table->field[0]->store(plugin->name.str, plugin->name.length, scs);
-      tmp= &state[test(hton->state)];
-      table->field[1]->store(tmp->str, tmp->length, scs);
+      if (hton->state == SHOW_OPTION_YES &&
+          hton == thd->variables.table_type)
+        option_name= "DEFAULT";
+      table->field[1]->store(option_name, strlen(option_name), scs);
       table->field[2]->store(plugin->plugin->descr,
                              strlen(plugin->plugin->descr), scs);
       tmp= &yesno[test(hton->commit)];
Thread
bk commit into 5.1 tree (gluh:1.2570) BUG#27629gluh16 Apr