WL#5078: Create SQL command classes for show statements
Status: In-Progress
Create classes derived from Sql_cmd that represent all supported show statements. This is a subtask of WL#5047. Testing: Testing of this task needs to be detailed.
1. Classes used to represent show statements These classes will be created as derived from Sql_cmd_select. Some of the classes are actually executed as SELECT statements, whereas others have specialized implementations. The common parts of the SHOW commands are as follows: - They all return data to the client in a tabular form. - Data returned are described with metadata, such as number of columns and details of columns (name, datatype, nullability, etc). The classes are defined in sql_cmd_show.h and implemented in sql_cmd_show.cc. 1.1 Class Sql_cmd_show_warnings Command: SHOW WARNINGS Member: m_limits - Offset and number of rows returned - to be added later. 1.2 Class Sql_cmd_show_errors Command: SHOW ERRORS Member: m_limits - Offset and number of rows returned - to be added later. 1.3 Class Sql_cmd_show_profiles Command: SHOW PROFILES 1.4 Class Sql_cmd_show_slave_hosts Command: SHOW SLAVE HOSTS 1.5 Class Sql_cmd_show_slave_status Command: SHOW SLAVE STATUS 1.6 Class Sql_cmd_show_master_status Command: SHOW MASTER STATUS 1.7 Class Sql_cmd_show_binlog_events Command: SHOW BINLOG EVENTS Member: m_logfile - Name of logfile Member: m_position - Start position within logfile Member: m_limits - offset and number of rows returned - to be added later. 1.8 Class Sql_cmd_show_relaylog_events Command: SHOW RELAYLOG EVENTS Member: m_logfile - Name of logfile Member: m_position - Start position within logfile Member: m_limits - offset and number of rows returned - to be added later. 1.9 Class Sql_cmd_show_engine_status Command: SHOW ENGINE STATUS Member: m_engine - name of engine - to be added later. 1.10 Class Sql_cmd_show_engine_mutex Command: SHOW ENGINE MUTEX Member: m_engine - name of engine - to be added later. 1.11 Class Sql_cmd_show_engine_logs Command: SHOW ENGINE LOGS (deprecated) Member: m_engine - name of engine - to be added later. 1.12 Class Sql_cmd_show_binlogs Command: SHOW BINARY LOGS (synonym SHOW MASTER LOGS) 1.13 Class Sql_cmd_show_processes Command: SHOW PROCESSLIST Member: m_verbose - true if verbose output wanted 1.14 Class Sql_cmd_show_authors Command: SHOW AUTHORS 1.15 Class Sql_cmd_show_contributors Command: SHOW CONTRIBUTORS 1.16 Class Sql_cmd_show_privileges Command: SHOW PRIVILEGES 1.17 Class Sql_cmd_show_create_schema Command: SHOW CREATE DATABASE Member: m_name - name of schema (database) Member: m_options - Options for command 1.18 Class Sql_cmd_show_create_event Command: SHOW CREATE EVENT Member: m_name - Name of event, including schema name 1.19 Class Sql_cmd_show_create_function Command: SHOW CREATE FUNCTION Member: m_name - Name of function, including schema name 1.20 Class Sql_cmd_show_create_procedure Command: SHOW CREATE PROCEDURE Member: m_name - Name of procedure, including schema name 1.21 Class Sql_cmd_show_create trigger Command: SHOW CREATE TRIGGER Member: m_name - Name of trigger, including schema name 1.22 Class Sql_cmd_show_create_table Command: SHOW CREATE TABLE Member: TBD 1.23 Class Sql_cmd_show_create_view Command: SHOW CREATE VIEW Member: TBD 1.24 Class Sql_cmd_show_function_code Command: SHOW FUNCTION CODE Member: m_name - Name of function, including schema name 1.25 Class Sql_cmd_show_procedure_code Command: SHOW PROCEDURE CODE Member: m_name - Name of procedure, including schema name 1.26 Class Sql_cmd_show_grants Command: SHOW GRANTS Member: m_user - Name of user 1.27 Remaining SHOW commands The following commands are implemented as SELECT statements, and will be converted later. SHOW EVENTS SHOW PROCEDURE STATUS SHOW FUNCTION STATUS SHOW STATUS SHOW DATABASES SHOW TABLES SHOW TRIGGERS SHOW TABLE STATUS SHOW OPEN TABLES SHOW PLUGINS SHOW COLUMNS SHOW INDEX (synonyms SHOW INDEXES, SHOW KEYS) SHOW VARIABLES SHOW CHARACTER SET SHOW COLLATION SHOW ENGINES SHOW PROFILE 2. Support classes These are additional classes used by show classes. No classes are defined so far. 3. Documentation anomalies found - SHOW SCHEDULER STATUS was mentioned in documentation, but not implemented. - SHOW ENGINE ALL STATUS not documented (BUG#46833) - SHOW ENGINE ALL MUTEX not documented. (BUG#46833) 4. Bugs found - SHOW ENGINE resolves the engine name to a plugin reference and stores it in the LEX object. For a prepared statement, this means (probably) that a reference to the engine is kept as long as the prepared statement exists, effectivly preventing the engine from being uninstalled. Otherwise, the pointer may point to unallocated storage, causing a core dump if executed after the engine is uninstalled. (Needs verification).
Copyright (c) 2000, 2024, Oracle Corporation and/or its affiliates. All rights reserved.