{"record":{"id":"114e696d8cfa1c6c","repo":"temporalio/temporal","slug":"error-reading-contents-unmatched-c","errorCode":null,"errorMessage":"error reading contents: unmatched `%c`","messagePattern":"error reading contents: unmatched `%c`","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/persistence/query_util.go","lineNumber":185,"sourceCode":"\t\t\t\t\t\t\tj++\n\t\t\t\t\t\t}\n\t\t\t\t\t\ti = j\n\t\t\t\t\t}\n\n\t\t\t\tdefault:\n\t\t\t\t\t// no-op: generic character\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif len(st) > 0 {\n\t\t\t\tswitch st[len(st)-1] {\n\t\t\t\tcase sqlLeftParenthesis:\n\t\t\t\t\treturn nil, fmt.Errorf(\"error reading contents: unmatched left parenthesis\")\n\t\t\t\tcase sqlBeginKeyword[0]:\n\t\t\t\t\treturn nil, fmt.Errorf(\"error reading contents: unmatched `BEGIN` keyword\")\n\t\t\t\tdefault:\n\t\t\t\t\t// should never enter here\n\t\t\t\t\treturn nil, fmt.Errorf(\"error reading contents: unmatched `%c`\", st[len(st)-1])\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t_, _ = stmtBuilder.Write(content[i:j])\n\t\t\tstmt := strings.TrimSpace(stmtBuilder.String())\n\t\t\tif stmt == \"\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tresult = append(result, stmt)\n\t\t}\n\t}\n\treturn result, nil\n}\n\n// hasWordAt is a simple test to check if it matches the whole word:\n// it checks if the adjacent characters are not alphanumeric if they exist.\nfunc hasWordAt(s, word string, pos int) bool {\n\tif pos+len(word) > len(s) || s[pos:pos+len(word)] != word {","sourceCodeStart":167,"sourceCodeEnd":203,"githubUrl":"https://github.com/temporalio/temporal/blob/bde624efd13fbd3843654058db6d9c716166318b/common/persistence/query_util.go#L167-L203","documentation":"Error \"error reading contents: unmatched `%c`\" thrown in temporalio/temporal.","triggerScenarios":"Thrown at common/persistence/query_util.go:185 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bde624efd13fbd3843654058db6d9c716166318b","analyzedAt":"2026-09-01T07:18:39.080Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}