Skip to content

Latest commit

 

History

History
84 lines (71 loc) · 2.1 KB

4.2_Text_Protocol.md

File metadata and controls

84 lines (71 loc) · 2.1 KB

4.2 文本协议

4.2.1 Supported

  • COM_INIT_DB
    Specifies the default schema for the connection.
  • COM_PING
    Sends a packet containing one byte to check that the connection is active.
  • COM_QUERY
    Sends the server an SQL statement to be executed immediately.Support Multi-Statement.
  • COM_QUIT
    Client tells the server that the connection should be terminated.

4.2.1.1 Multi-Statement

  • Supported
    • DML:select/insert/update/replace/delete
    • DDL
    • OTHER
      • BEGIN;
      • COMMIT;
      • LOCK TABLE
      • UNLOCK TABLES
      • START
      • KILL
      • USE
      • ROLLBACK
      • MYSQL_CMD_COMMENT
      • MYSQL_COMMENT
      • SELECT VERSION_COMMENT ( SELECT @@VERSION_COMMENT)
      • SELECT DATABASE( select database() )
      • SELECT USER(select user())
      • SELECT VERSION (select version())
      • SELECT SESSION_INCREMENT(select @@session.auto_increment_increment)
      • SELECT SESSION_ISOLATION(select @@session.tx_isolation)
      • SELECT LAST_INSERT_ID(select last_insert_id(#) as id)
      • SELECT IDENTITY(select @@identity)
      • SELECT SESSION_TX_READ_ONLY(select @@session.tx_read_only)
  • Not Supported
    • EXPLAIN
    • EXPLAIN2
    • DESCRIBE
    • SET
    • SHOW DATABASES/TABLES/TABLE_STATUS/COLUMNS/INDEX/CREATE_TABLE/VARIABLES/CREATE_VIEW/CHARSET
    • HELP
    • LOAD_DATA_INFILE_SQL
    • CREATE_VIEW
    • REPLACE_VIEW
    • ALTER_VIEW
    • DROP_VIEW

4.2.2 Not Supported

  • COM_CHANGE_USER
    Resets the connection and re-authenticates with the given credentials.
  • COM_DEBUG
    Forces the server to dump debug information to stdout
  • COM_RESET_CONNECTION
    Resets a connection without re-authentication.
  • COM_SET_OPTION
    Enables or disables server option.
  • COM_STATISTICS
    Get internal server statistics.
  • COM_CREATE_DB
  • COM_DROP_DB

4.2.3 Internal

  • COM_SLEEP
    Used inside the server only.

4.2.4 Deprecated

  • COM_PROCESSLIST
    Deprecated from 5.7.11.
  • COM_PROCESS_KILL
    Deprecated from 5.7.11.
  • COM_FIELD_LIST
    Deprecated from 5.7.11.
  • COM_SHUTDOWN
    Deprecated from 5.7.9.