Proposal to deprecate COM_REFRESH packet_MySQL

WBOY
发布: 2016-06-01 13:14:11
原创
922 人浏览过

In the MySQL team we are proposing to deprecate theCOM_REFRESHpacket in favor of specific queries to executeFLUSHcommands. To provide a bit of context:

  • The MySQL server protocol allows for clients to speak API commands via both a query and binary protocol interface. The set of the API commands can be seen in theMySQL Client/Server Protocolinternals documentation, or very simply as they appear in a single switch statement:
    # ./sql/sql_parse.cc:1009 (simplified view)switch (command) {case COM_REGISTER_SLAVE:{/* do stuff */break;}case COM_QUERY:{/* parse query, do stuff */break;}case COM_REFRESH:{ /* equivalent to running a FLUSH command */break;}case COM_SHUTDOWN:{kill_mysql();break;}}
    登录后复制
  • The historical advantage of having a binary protocol meant that less bytes needed to be transfered across the network as well as less processing on the server, since parsing of statements is not required.
  • The disadvantage of the binary protocol is that it is less extensible. In the case ofCOM_REFRESHit was designed to accept only a 1 byte payload to indicate which flush command to run. A quick look at theMySQL manualshows that there are now more than eight (1 byte payload = 8 possible flags) flush commands available. This leads to API inconsistency as some commands are available via the binary interface and others are not.

Our proposed solution to this problem is to deprecate the binary interface for refresh commands and promote usage of the query interface (FLUSH LOGS,FLUSH TABLES,FLUSH HOSTSetc) instead. While we have no immediate plans to remove theCOM_REFRESHbinary interface (and thus break older clients) we are seeking feedback on the direction of this change. Please leave a comment, orget in touch!

来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板