最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

ProposaltodeprecateCOM_REFRESHpacket_MySQL

来源:动视网 责编:小采 时间:2020-11-09 19:17:41
文档

ProposaltodeprecateCOM_REFRESHpacket_MySQL

ProposaltodeprecateCOM_REFRESHpacket_MySQL: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 b
推荐度:
导读ProposaltodeprecateCOM_REFRESHpacket_MySQL: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 b


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!

    文档

    ProposaltodeprecateCOM_REFRESHpacket_MySQL

    ProposaltodeprecateCOM_REFRESHpacket_MySQL: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 b
    推荐度:
    标签: com to mysql
    • 热门焦点

    最新推荐

    猜你喜欢

    热门推荐

    专题
    Top