Bug #25719 SHOW ENGINE .. STATUS gives incorrect error text for disabled engines
Submitted: 19 Jan 2007 13:55 Modified: 29 Jan 2007 8:14
Reporter: Mark Leith Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Errors Severity:S3 (Non-critical)
Version:5.0.32 / 5.1.14 OS:
Assigned to: Marc ALFF CPU Architecture:Any
Tags: errors, show, STATUS

[19 Jan 2007 13:55] Mark Leith
Description:
SHOW ENGINE <enginename> STATUS gives and incorrect value for the engine when used against a disabled engine - using "STATUS" for the engine name. 

i.e:

mysql> show engines;
+------------+---------+----------------------------------------------------------------+
| Engine     | Support | Comment                                                        |
+------------+---------+----------------------------------------------------------------+
| MyISAM     | DEFAULT | Default engine as of MySQL 3.23 with great performance         | 
| MEMORY     | YES     | Hash based, stored in memory, useful for temporary tables      | 
| InnoDB     | YES     | Supports transactions, row-level locking, and foreign keys     | 
| BerkeleyDB | NO      | Supports transactions and page-level locking                   | 
| BLACKHOLE  | YES     | /dev/null storage engine (anything you write to it disappears) | 
| EXAMPLE    | YES     | Example storage engine                                         | 
| ARCHIVE    | YES     | Archive storage engine                                         | 
| CSV        | NO      | CSV storage engine                                             | 
| ndbcluster | NO      | Clustered, fault-tolerant, memory-based tables                 | 
| FEDERATED  | YES     | Federated MySQL storage engine                                 | 
| MRG_MYISAM | YES     | Collection of identical MyISAM tables                          | 
| ISAM       | NO      | Obsolete storage engine                                        | 
+------------+---------+----------------------------------------------------------------+
12 rows in set (0.00 sec)

mysql> show engine berkeleydb status;
ERROR 1235 (42000): This version of MySQL doesn't yet support 'STATUS'
mysql> show engine CSV status;
ERROR 1235 (42000): This version of MySQL doesn't yet support 'STATUS'

The message is correct for "unknown" engines:

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

I also think we should drop the "yet" in the first error message - i.e berkleydb was dropped, so it is not that it is "not yet supported"

How to repeat:
SHOW ENGINE berkeleydb STATUS;
SHOW ENGINE foobar STATUS;

Suggested fix:
Report the engine name passed (not the incorrect token in the string)
[19 Jan 2007 14:33] Mark Leith
Ah I note now that we hard code the "STATUS", and use the more generic error message for this:

        STATUS_SYM
          {
            switch (Lex->create_info.db_type) {
            case DB_TYPE_NDBCLUSTER:
              Lex->sql_command = SQLCOM_SHOW_NDBCLUSTER_STATUS;
              break;
            case DB_TYPE_INNODB:
              Lex->sql_command = SQLCOM_SHOW_INNODB_STATUS;
              break;
            default:
              my_error(ER_NOT_SUPPORTED_YET, MYF(0), "STATUS");
              YYABORT;
            }
          }

So the "yet" is valid in the error message. I think we should instead use a different error message in this case.
[20 Jan 2007 6:00] Marc ALFF
Thanks for the report.

For 5.0 :

select version();
version()
5.0.36-debug-log

show engine foobar status;
ERROR 42000: Unknown table engine 'foobar'
--> expected result

show engine csv status;
ERROR 42000: This version of MySQL doesn't yet support 'STATUS'
--> expected result, the engine CSV does not support SHOW STATUS

show engine berkeleydb status;
ERROR 42000: This version of MySQL doesn't yet support 'STATUS'
--> expected result, the engine BDB does not support SHOW STATUS

About the "Yet" part of the message : won't fix in 5.0,
since this would require a new message.

For 5.1 :

select version();
version()
5.1.15-beta-debug-log

set sql_mode='';

show engine foobar status;
Type    Name    Status
Warnings:
Error   1286    Unknown table engine 'foobar'
--> duplicate of Bug#24392.
The code behave as SHOW ENGINE ALL STATUS, which is a bug.

show engine csv status;
Type    Name    Status
--> expected result, SHOW STATUS is not implemented by the CSV engine.
Note that the parser does not block the call, and the storage engine is used,
as per the plug-able engine architecture.

set sql_mode = 'NO_ENGINE_SUBSTITUTION';
show engine foobar status;
ERROR 42000: Unknown table engine 'foobar'
--> expected result.

Closing as not a bug.