List:Commits« Previous MessageNext Message »
From:marc.alff Date:January 23 2007 11:14pm
Subject:bk commit into 5.1 tree (malff:1.2408) BUG#24392
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of marcsql. When marcsql 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-01-23 15:14:08-07:00, malff@weblab.(none) +7 -0
  Bug#24392 (SHOW ENGINE MUTEX STATUS is a synonym for SHOW INNODB STATUS)
  
  Before this fix, the command SHOW ENGINE <name> STATUS would:
  - print a warning if the engine name is unknown,
  - proceed and implement the same behavior as SHOW ENGINE ALL STATUS,
  and list the status of all the storage engines registered.
  
  In particular, this behavior caused confusion about the command :
  SHOW ENGINE MUTEX STATUS, which as a side effect would print the status
  of the innodb engine when that engine is registered.
  
  Also, before this fix, every time an unknown engine name was substituted by
  the default engine (which happen unless SQL_MODE NO_ENGINE_SUBSTITUTION is
  set), a malformed warning was raised.
  For example, the command ALTER TABLE T1 ENGINE = X would print :
  Warnings:
  Error 1286 Unknown table engine 'X'
  
  With this fix:
  SHOW ENGINE <name> STATUS|LOGS|MUTEX
  always fails with an error when the engine <name> is unknown.
  
  For other commands, warnings about unknown engines are raised as:
  Warnings:
  Warning 1286 Unknown table engine 'X'
  
  In other words, engine substitution never affect the SHOW ENGINE command,
  since this would lead to very confusing results.

  mysql-test/r/ndb_dd_basic.result@stripped, 2007-01-23 15:11:34-07:00, malff@weblab.(none) +1
-1
    Warnings for unknown engines.

  mysql-test/r/partition_innodb.result@stripped, 2007-01-23 15:11:34-07:00, malff@weblab.(none)
+2 -2
    Warnings for unknown engines.

  mysql-test/r/ps_1general.result@stripped, 2007-01-23 15:11:34-07:00, malff@weblab.(none) +3
-1
    Fixed SHOW ENGINE <name> STATUS|LOGS|MUTEX

  mysql-test/r/show_check.result@stripped, 2007-01-23 15:11:34-07:00, malff@weblab.(none) +14
-0
    Fixed SHOW ENGINE <name> STATUS|LOGS|MUTEX

  mysql-test/t/ps_1general.test@stripped, 2007-01-23 15:11:35-07:00, malff@weblab.(none) +3 -7
    Fixed SHOW ENGINE <name> STATUS|LOGS|MUTEX

  mysql-test/t/show_check.test@stripped, 2007-01-23 15:11:35-07:00, malff@weblab.(none) +18 -0
    Fixed SHOW ENGINE <name> STATUS|LOGS|MUTEX

  sql/sql_yacc.yy@stripped, 2007-01-23 15:11:35-07:00, malff@weblab.(none) +22 -12
    Fixed SHOW ENGINE <name> STATUS|LOGS|MUTEX

# 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:	malff
# Host:	weblab.(none)
# Root:	/home/marcsql/TREE/mysql-5.1-24392

--- 1.534/sql/sql_yacc.yy	2007-01-23 15:14:15 -07:00
+++ 1.535/sql/sql_yacc.yy	2007-01-23 15:14:15 -07:00
@@ -1021,7 +1021,7 @@ bool my_yyoverflow(short **a, YYSTYPE **
 
 %type <interval_time_st> interval_time_st
 
-%type <db_type> storage_engines
+%type <db_type> storage_engines known_storage_engines
 
 %type <row_type> row_types
 
@@ -4228,19 +4228,31 @@ default_collation:
             Lex->create_info.used_fields|= HA_CREATE_USED_DEFAULT_CHARSET;
         };
 
+known_storage_engines:
+        ident_or_text
+        {
+          $$ = ha_resolve_by_name(YYTHD, &$1);
+          if ($$ == NULL)
+          {
+            my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), $1.str);
+            YYABORT;
+          }
+        }
+        ;
+
 storage_engines:
 	ident_or_text
 	{
 	  $$ = ha_resolve_by_name(YYTHD, &$1);
 	  if ($$ == NULL)
-          if (YYTHD->variables.sql_mode & MODE_NO_ENGINE_SUBSTITUTION)
-	  {
-	    my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), $1.str);
-	    YYABORT;
-	  }
-          else
           {
-            push_warning_printf(YYTHD, MYSQL_ERROR::WARN_LEVEL_ERROR,
+            if (YYTHD->variables.sql_mode & MODE_NO_ENGINE_SUBSTITUTION)
+	    {
+	      my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), $1.str);
+	      YYABORT;
+	    }
+
+            push_warning_printf(YYTHD, MYSQL_ERROR::WARN_LEVEL_WARN,
                                 ER_UNKNOWN_STORAGE_ENGINE,
                                 ER(ER_UNKNOWN_STORAGE_ENGINE), $1.str);
           }
@@ -8433,12 +8445,10 @@ show_param:
             if (prepare_schema_table(YYTHD, lex, 0, SCH_PLUGINS))
               YYABORT;
 	  }
-	| ENGINE_SYM storage_engines 
+	| ENGINE_SYM known_storage_engines show_engine_param
 	  { Lex->create_info.db_type= $2; }
-	  show_engine_param
-	| ENGINE_SYM ALL 
+	| ENGINE_SYM ALL show_engine_param
 	  { Lex->create_info.db_type= NULL; }
-	  show_engine_param
 	| opt_full COLUMNS from_or_in table_ident opt_db wild_and_where
 	  {
  	    LEX *lex= Lex;

--- 1.63/mysql-test/r/ps_1general.result	2007-01-23 15:14:15 -07:00
+++ 1.64/mysql-test/r/ps_1general.result	2007-01-23 15:14:15 -07:00
@@ -304,7 +304,9 @@ execute stmt4;
 Variable_name	Value
 sql_mode	
 prepare stmt4 from ' show engine bdb logs ';
-execute stmt4;
+ERROR 42000: Unknown table engine 'bdb'
+prepare stmt4 from ' show engine foo logs ';
+ERROR 42000: Unknown table engine 'foo'
 prepare stmt4 from ' show grants for user ';
 prepare stmt4 from ' show create table t2 ';
 prepare stmt4 from ' show master status ';

--- 1.37/mysql-test/t/ps_1general.test	2007-01-23 15:14:15 -07:00
+++ 1.38/mysql-test/t/ps_1general.test	2007-01-23 15:14:15 -07:00
@@ -321,14 +321,10 @@ prepare stmt4 from ' show status like ''
 execute stmt4;
 prepare stmt4 from ' show variables like ''sql_mode'' ';
 execute stmt4;
-# The output depends on the bdb being enabled and on the history
-# history (actions of the bdb engine).
-# That is the reason why, we switch the output here off.
-#   (The real output will be tested in ps_6bdb.test)
---disable_result_log
+--error ER_UNKNOWN_STORAGE_ENGINE
 prepare stmt4 from ' show engine bdb logs ';
-execute stmt4;
---enable_result_log
+--error ER_UNKNOWN_STORAGE_ENGINE
+prepare stmt4 from ' show engine foo logs ';
 prepare stmt4 from ' show grants for user ';
 prepare stmt4 from ' show create table t2 ';
 prepare stmt4 from ' show master status ';

--- 1.13/mysql-test/r/ndb_dd_basic.result	2007-01-23 15:14:15 -07:00
+++ 1.14/mysql-test/r/ndb_dd_basic.result	2007-01-23 15:14:15 -07:00
@@ -11,7 +11,7 @@ ADD UNDOFILE 'undofile02.dat'
 INITIAL_SIZE = 4M 
 ENGINE=XYZ;
 Warnings:
-Error	1286	Unknown table engine 'XYZ'
+Warning	1286	Unknown table engine 'XYZ'
 Error	1466	Table storage engine 'MyISAM' does not support the create option 'TABLESPACE
or LOGFILE GROUP'
 CREATE TABLESPACE ts1
 ADD DATAFILE 'datafile.dat'

--- 1.109/mysql-test/r/show_check.result	2007-01-23 15:14:15 -07:00
+++ 1.110/mysql-test/r/show_check.result	2007-01-23 15:14:15 -07:00
@@ -730,4 +730,18 @@ show keys from `mysqlttest\1`.`a\b`;
 Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment
 drop table `mysqlttest\1`.`a\b`;
 drop database `mysqlttest\1`;
+show engine foobar status;
+ERROR 42000: Unknown table engine 'foobar'
+show engine foobar logs;
+ERROR 42000: Unknown table engine 'foobar'
+show engine foobar mutex;
+ERROR 42000: Unknown table engine 'foobar'
+show engine mutex status;
+ERROR 42000: Unknown table engine 'mutex'
+show engine csv status;
+Type	Name	Status
+show engine csv logs;
+Type	Name	Status
+show engine csv mutex;
+Type	Name	Status
 End of 5.1 tests

--- 1.72/mysql-test/t/show_check.test	2007-01-23 15:14:15 -07:00
+++ 1.73/mysql-test/t/show_check.test	2007-01-23 15:14:15 -07:00
@@ -563,4 +563,22 @@ show keys from `mysqlttest\1`.`a\b`;
 drop table `mysqlttest\1`.`a\b`;
 drop database `mysqlttest\1`;
 
+#
+# Bug#24392: SHOW ENGINE MUTEX STATUS is a synonym for SHOW INNODB STATUS
+#
+
+--error ER_UNKNOWN_STORAGE_ENGINE
+show engine foobar status;
+--error ER_UNKNOWN_STORAGE_ENGINE
+show engine foobar logs;
+--error ER_UNKNOWN_STORAGE_ENGINE
+show engine foobar mutex;
+
+--error ER_UNKNOWN_STORAGE_ENGINE
+show engine mutex status;
+
+show engine csv status;
+show engine csv logs;
+show engine csv mutex;
+
 --echo End of 5.1 tests

--- 1.2/mysql-test/r/partition_innodb.result	2007-01-23 15:14:15 -07:00
+++ 1.3/mysql-test/r/partition_innodb.result	2007-01-23 15:14:15 -07:00
@@ -54,7 +54,7 @@ create table t1 (a int)
 engine = x
 partition by key (a);
 Warnings:
-Error	1286	Unknown table engine 'x'
+Warning	1286	Unknown table engine 'x'
 show create table t1;
 Table	Create Table
 t1	CREATE TABLE `t1` (
@@ -67,7 +67,7 @@ partition by list (a)
 (partition p0 values in (0));
 alter table t1 engine = x;
 Warnings:
-Error	1286	Unknown table engine 'x'
+Warning	1286	Unknown table engine 'x'
 show create table t1;
 Table	Create Table
 t1	CREATE TABLE `t1` (
Thread
bk commit into 5.1 tree (malff:1.2408) BUG#24392marc.alff23 Jan