{"record":{"id":"e6db282a91bb6565","repo":"temporalio/temporal","slug":"error-opening-file-s-w","errorCode":null,"errorMessage":"error opening file %s: %w","messagePattern":"error opening file (.+?): %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/persistence/query_util.go","lineNumber":46,"sourceCode":"\tsqlLoopKeyword         = \"loop\"\n\tsqlBeginKeyword        = \"begin\"\n\tsqlEndKeyword          = \"end\"\n\tsqlLineComment         = \"--\"\n\tsqlSingleQuote         = '\\''\n\tsqlDoubleQuote         = '\"'\n)\n\n// LoadAndSplitQuery loads and split cql / sql query into one statement per string.\n// Comments are removed from the query.\nfunc LoadAndSplitQuery(\n\tfilePaths []string,\n) ([]string, error) {\n\tvar files []io.Reader\n\n\tfor _, filePath := range filePaths {\n\t\tf, err := os.Open(filePath)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error opening file %s: %w\", filePath, err)\n\t\t}\n\t\tfiles = append(files, f)\n\t}\n\n\treturn LoadAndSplitQueryFromReaders(files)\n}\n\n// LoadAndSplitQueryFromReaders loads and split cql / sql query into one statement per string.\n// Comments are removed from the query.\nfunc LoadAndSplitQueryFromReaders(\n\treaders []io.Reader,\n) ([]string, error) {\n\tresult := make([]string, 0, querySliceDefaultSize)\n\tfor _, r := range readers {\n\t\tcontent, err := io.ReadAll(r)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error reading contents: %w\", err)\n\t\t}","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/temporalio/temporal/blob/bde624efd13fbd3843654058db6d9c716166318b/common/persistence/query_util.go#L28-L64","documentation":"Error \"error opening file %s: %w\" thrown in temporalio/temporal.","triggerScenarios":"Thrown at common/persistence/query_util.go:46 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"}