{"record":{"id":"b75cd464145237a6","repo":"apache/skywalking","slug":"unsupported-bool-operation-b75cd4","errorCode":null,"errorMessage":"Unsupported bool operation.","messagePattern":"Unsupported bool operation\\.","errorType":"exception","errorClass":"IllegalExpressionException","httpStatus":null,"severity":"error","filePath":"oap-server/mqe-rt/src/main/java/org/apache/skywalking/mqe/rt/operation/BoolOp.java","lineNumber":69,"sourceCode":"        }\n        if (!checkBool(rightValue)) {\n            throw new IllegalExpressionException(\"Bool Operation: The result of the right expression is not 1 or 0.\");\n        }\n        switch (opType) {\n            case MQEParser.AND:\n                if (leftValue == 1 && rightValue == 1) {\n                    return 1;\n                } else {\n                    return 0;\n                }\n            case MQEParser.OR:\n                if (leftValue == 1 || rightValue == 1) {\n                    return 1;\n                } else {\n                    return 0;\n                }\n            default:\n                throw new IllegalExpressionException(\"Unsupported bool operation.\");\n        }\n    }\n\n    private static boolean checkExpression(ExpressionResult result) {\n        return result.isBoolResult();\n    }\n\n    private static boolean checkBool(double v) {\n        int i = (int) v;\n        return i == 0 || i == 1;\n    }\n}\n","sourceCodeStart":51,"sourceCodeEnd":82,"githubUrl":"https://github.com/apache/skywalking/blob/102af09b4a56064e22050dded10e2c52e490d040/oap-server/mqe-rt/src/main/java/org/apache/skywalking/mqe/rt/operation/BoolOp.java#L51-L82","documentation":"IllegalExpressionException at the bottom of BoolOp.boolOp's switch: the opType token reaching the scalar boolean AND/OR evaluator is neither MQEParser.AND nor MQEParser.OR. Grammar-level, && and || are the only boolean connectors, so a different token here means dispatch drift (a new connector token added to the grammar without a matching case here).","triggerScenarios":"Internal-only: a grammar/runtime version skew where the parser emits a boolean-connective token unknown to this switch, e.g. a fork adding 'xor' or an upgraded UI/parser against an older mqe-rt jar.","commonSituations":"Mixed-version OAP deployments; custom grammar extensions. Standard user queries with && and || never land on the default branch.","solutions":["Ensure parser (mqe-grammar) and runtime (mqe-rt) jars come from the same OAP build","If extending the grammar with a new boolean connector, add its case to this switch (AND/OR pattern)","Report upstream if reproduced with a stock expression on a clean install"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"catch (IllegalExpressionException e) { /* grammar/runtime skew — rebuild with matching mqe-grammar and mqe-rt */ }","preventionTips":["Never mix parser and runtime jars from different OAP versions","Add switch cases when adding new boolean connectors in forks"],"tags":["mqe","boolean","internal","unsupported-operation","version-mismatch"],"backgroundTag":null,"analyzedSha":"102af09b4a56064e22050dded10e2c52e490d040","analyzedAt":"2026-08-14T10:47:52.647Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}