Bug #24392 SHOW ENGINE <unknown> STATUS is a synonym for SHOW ENGINE ALL STATUS
Submitted: 17 Nov 2006 14:09 Modified: 9 Mar 2007 4:28
Reporter: Marko Mäkelä Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Parser Severity:S3 (Non-critical)
Version:5.1-BK OS:Linux (Linux)
Assigned to: Marc ALFF CPU Architecture:Any

[17 Nov 2006 14:09] Marko Mäkelä
Description:
The command SHOW MUTEX STATUS is deprecated in 5.1:
"The syntax 'SHOW MUTEX STATUS' is deprecated and will be removed in MySQL 5.2. Please use 'SHOW ENGINE INNODB MUTEX' instead"
The easier-to-remember choice, SHOW ENGINE MUTEX STATUS, will produce something completely different.

How to repeat:
SHOW ENGINE MUTEX STATUS\G
-- huh? where is the mutex information?

Suggested fix:
Make SHOW ENGINE MUTEX STATUS an alias for SHOW ENGINE INNODB MUTEX.
[21 Nov 2006 17:10] Valeriy Kravchuk
Thank you for a bug report. Verified just as described with latest 5.1-BK on Linux.
[18 Jan 2007 21:34] Konstantin Osipov
Marc, I found this indeed quite strange, and the problem seems to be indeed in the parser.

In 5.0 SHOW ENGINE MUTEX STATUS works correctly and produces "No such engine" error: 

mysql> show engine mutex status;
ERROR 1286 (42000): Unknown table engine 'mutex'

SHOW ENGINE INNODB MUTEX is not supported in 5.0.

In 5.1 SHOW ENGINE MUTEX STATUS produces some cryptic output if the server is started without InnoDB:
mysql> show warnings;
+-------+------+------------------------------+
| Level | Code | Message                      |
+-------+------+------------------------------+
| Error | 1286 | Unknown table engine 'mutex' | 
+-------+------+------------------------------+
1 row in set (0.00 sec)

Sic, a warning, not an error (I presume it has to be an error).

If the server is started _with_ innodb, show engine mutex status returns the output from InnoDB monitor!

The correct behaviour is to always return an error that the engine is unknown, like in 5.0.
[18 Jan 2007 21:37] Konstantin Osipov
MySQL manual:
http://dev.mysql.com/doc/refman/5.1/en/index.html
[20 Jan 2007 6:20] Marc ALFF
See related Bug#25719, Bug#25728
[23 Jan 2007 22:15] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/18665

ChangeSet@1.2408, 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.
[7 Mar 2007 22:02] Konstantin Osipov
Pushed into 5.1.17.
[9 Mar 2007 4:28] Jon Stephens
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release.

If necessary, you can access the source repository and build the latest available version, including the bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html

Documented bugfix in 5.1.17 changelog.