Skip to content

Latest commit

 

History

History
99 lines (88 loc) · 2.66 KB

4.3_Text_Protocol.md

File metadata and controls

99 lines (88 loc) · 2.66 KB

4.3 文本协议

4.3.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.
  • COM_SET_OPTION
    Enables or disables server option.
  • COM_CHANGE_USER
    Resets the connection and re-authenticates with the given credentials.
  • COM_RESET_CONNECTION
    Resets a connection without re-authentication.
    • 关闭后端连接(rollback & unlock)
    • 事务状态情况
    • 用户变量清空
    • 系统变量恢复成系统默认值
    • prepare清空
    • 上下文(字符集,隔离级别)恢复成为默认值
    • LAST_INSERT_ID 置零
  • COM_FIELD_LIST
    MySQL Doc said that it is deprecated from 5.7.11 . But some tools are still use it, like OGG or MariaDB client.

4.3.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.3.2 Not Supported

  • COM_DEBUG
    Forces the server to dump debug information to stdout
  • COM_STATISTICS
    Get internal server statistics.
  • COM_CREATE_DB
  • COM_DROP_DB

4.3.3 Internal

  • COM_SLEEP
    Used inside the server only.
  • COM_CONNECT an internal command in the server.
  • COM_TIME an internal command in the server.
  • COM_DAEMON an internal command in the server.
  • COM_DELAYED_INSERT an internal command in the server.

4.3.4 Deprecated

  • COM_PROCESS_INFO
    Deprecated from 5.7.11.
  • COM_PROCESS_KILL
    Deprecated from 5.7.11.
  • COM_SHUTDOWN
    Deprecated from 5.7.9.
  • COM_REFRESH
    Deprecated from 5.7.11.