{"record":{"id":"8027cfba3190b450","repo":"googleapis/mcp-toolbox","slug":"invalid-information-schema-query-path-q","errorCode":null,"errorMessage":"invalid INFORMATION_SCHEMA query path %q","messagePattern":"invalid INFORMATION_SCHEMA query path %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/tools/bigquery/bigquerycommon/table_name_parser.go","lineNumber":255,"sourceCode":"\n\t\t\t\t// Check for INFORMATION_SCHEMA\n\t\t\t\tinfoSchemaIdx := -1\n\t\t\t\tfor idx, part := range parts {\n\t\t\t\t\tif strings.EqualFold(part, \"INFORMATION_SCHEMA\") {\n\t\t\t\t\t\tinfoSchemaIdx = idx\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif infoSchemaIdx != -1 {\n\t\t\t\t\tviewName := parts[len(parts)-1]\n\t\t\t\t\tif !datasetLevelInformationSchemaViews[strings.ToLower(viewName)] {\n\t\t\t\t\t\treturn 0, fmt.Errorf(\"querying non-dataset-level INFORMATION_SCHEMA view %q is not allowed when dataset restrictions are in place\", viewName)\n\t\t\t\t\t}\n\t\t\t\t\tif infoSchemaIdx == 0 {\n\t\t\t\t\t\treturn 0, fmt.Errorf(\"querying INFORMATION_SCHEMA views without a dataset prefix is not allowed when dataset restrictions are in place\")\n\t\t\t\t\t}\n\t\t\t\t\tif infoSchemaIdx > 2 {\n\t\t\t\t\t\treturn 0, fmt.Errorf(\"invalid INFORMATION_SCHEMA query path %q\", strings.Join(parts, \".\"))\n\t\t\t\t\t}\n\t\t\t\t\tparts = parts[:infoSchemaIdx+1]\n\t\t\t\t}\n\n\t\t\t\tif len(parts) == 1 {\n\t\t\t\t\tkeyword := strings.ToLower(parts[0])\n\t\t\t\t\tswitch keyword {\n\t\t\t\t\tcase \"call\":\n\t\t\t\t\t\treturn 0, fmt.Errorf(\"CALL is not allowed when dataset restrictions are in place, as the called procedure's contents cannot be safely analyzed\")\n\t\t\t\t\tcase \"immediate\":\n\t\t\t\t\t\tif lastToken == \"execute\" {\n\t\t\t\t\t\t\treturn 0, fmt.Errorf(\"EXECUTE IMMEDIATE is not allowed when dataset restrictions are in place, as its contents cannot be safely analyzed\")\n\t\t\t\t\t\t}\n\t\t\t\t\tcase \"procedure\", \"function\":\n\t\t\t\t\t\tif lastToken == \"create\" || lastToken == \"create or replace\" {\n\t\t\t\t\t\t\treturn 0, fmt.Errorf(\"unanalyzable statements like '%s %s' are not allowed\", strings.ToUpper(lastToken), strings.ToUpper(keyword))\n\t\t\t\t\t\t}\n\t\t\t\t\tcase verbCreate, verbAlter, verbDrop, verbSelect, verbInsert, verbUpdate, verbDelete, verbMerge:","sourceCodeStart":237,"sourceCodeEnd":273,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/bigquery/bigquerycommon/table_name_parser.go#L237-L273","documentation":"The SQL scanner found INFORMATION_SCHEMA deeper than position 2 in the dotted identifier path — a shape like a.b.c.INFORMATION_SCHEMA.x that does not correspond to any valid BigQuery metadata view reference.","triggerScenarios":"Thrown at internal/tools/bigquery/bigquerycommon/table_name_parser.go:255 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Simplify the reference to project.dataset.INFORMATION_SCHEMA.view","Check for stray identifier segments in the query","Verify the intended metadata view path"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8cc6e09de2ad7b8bffc77751799585a1401a48eb","analyzedAt":"2026-09-05T01:10:36.887Z","contentChangedAt":"2026-09-05T01:10:36.887Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}