{"record":{"id":"cb570be2364106b8","repo":"MyCATApache/Mycat-Server","slug":"er-syntax-error","errorCode":"ER_SYNTAX_ERROR","errorMessage":"Unsupported command","messagePattern":"Unsupported command","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/main/java/io/mycat/server/ServerQueryHandler.java","lineNumber":125,"sourceCode":"\t\tcase ServerParse.KILL:\n\t\t\tKillHandler.handle(sql, rs >>> 8, c);\n\t\t\tbreak;\n\t\t//不支持KILL_Query\n\t\tcase ServerParse.KILL_QUERY:\n\t\t\tLOGGER.warn(new StringBuilder().append(\"Unsupported command:\").append(sql).toString());\n\t\t\tc.writeErrMessage(ErrorCode.ER_UNKNOWN_COM_ERROR,\"Unsupported command\");\n\t\t\tbreak;\n\t\tcase ServerParse.USE:\n\t\t\tUseHandler.handle(sql, c, rs >>> 8);\n\t\t\tbreak;\n\t\tcase ServerParse.COMMIT:\n\t\t\tc.commit();\n\t\t\tbreak;\n\t\tcase ServerParse.ROLLBACK:\n\t\t\tc.rollback();\n\t\t\tbreak;\n\t\tcase ServerParse.HELP:\n\t\t\tLOGGER.warn(new StringBuilder().append(\"Unsupported command:\").append(sql).toString());\n\t\t\tc.writeErrMessage(ErrorCode.ER_SYNTAX_ERROR, \"Unsupported command\");\n\t\t\tbreak;\n\t\tcase ServerParse.MYSQL_CMD_COMMENT:\n\t\t\tc.write(c.writeToBuffer(OkPacket.OK, c.allocate()));\n\t\t\tbreak;\n\t\tcase ServerParse.MYSQL_COMMENT:\n\t\t\tc.write(c.writeToBuffer(OkPacket.OK, c.allocate()));\n\t\t\tbreak;\n        case ServerParse.LOAD_DATA_INFILE_SQL:\n\t\t\tif(RouteService.isHintSql(sql) > -1){ // 目前仅支持注解 datanode,原理为直接将导入sql发送到指定mysql节点\n\t\t\t\tc.execute(sql , ServerParse.LOAD_DATA_INFILE_SQL);\n\t\t\t}else{\n\t\t\t\tc.loadDataInfileStart(sql);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ServerParse.MIGRATE: {\n\t\t    try {\n                MigrateHandler.handle(sql, c);","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/MyCATApache/Mycat-Server/blob/65f8d8beb752f935752f2a0eec0ab017facab9ef/src/main/java/io/mycat/server/ServerQueryHandler.java#L107-L143","documentation":"The default branch of ServerQueryHandler.query's command switch: any command code that reached the server but has no case in the dispatcher (an unknown or not-yet-implemented MySQL command) falls through to here. The server logs 'Unsupported command:' with the SQL at WARN level and writes an ER_UNKNOWN_COM_ERROR error packet containing this message back to the client. It is a generic protocol-level rejection, not a SQL semantics error — the connection remains usable and subsequent valid commands are dispatched normally.","triggerScenarios":"Client sends 'HELP <topic>' or the mysql CLI protocol-level HELP request through MyCat.","commonSituations":"Interactive mysql client sessions (client sends HELP on '?' input); admin scripts probing server capabilities.","solutions":["Do not use HELP through MyCat; consult MySQL/MyCat documentation directly.","Connect to the backend MySQL for server-side HELP.","Avoid '?' shortcut in mysql CLI or run against a direct MySQL connection."],"exampleFix":"// before\nHELP SELECT;\n// after\n-- consult docs; run HELP against backend MySQL, not MyCat","handlingStrategy":"validation","validationCode":"// Avoid HELP statements through MyCat\nif (sql.trim().toUpperCase().startsWith(\"HELP\")) {\n    throw new UnsupportedOperationException(\"HELP is unsupported through MyCat\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    stmt.execute(sql);\n} catch (SQLException e) {\n    if (e.getErrorCode() == 1064 /* ER_SYNTAX_ERROR */ && e.getMessage().contains(\"Unsupported command\")) {\n        log.info(\"HELP not supported by MyCat; skipping\");\n    }\n}","preventionTips":["Do not use the mysql CLI '?' shortcut in MyCat sessions","Handle ER_SYNTAX_ERROR gracefully in admin tooling"],"tags":["help","unsupported-command","protocol"],"backgroundTag":"unsupported-operation","analyzedSha":"65f8d8beb752f935752f2a0eec0ab017facab9ef","analyzedAt":"2026-09-11T00:12:21.696Z","contentChangedAt":"2026-09-11T00:12:21.696Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}