时间:2021-07-01 10:21:17 帮助过:17人阅读
# ./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 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!