CE-1007: offline validate fails thrash grants binds - #146
Conversation
Hard-fail bare $N, hybrid $N<path>, and dotted ?<a.b> on grants queries; dry-run ?<name> expansion against a synthetic parent resource. Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
| var ( | ||
| hybridPlaceholderRegex = regexp.MustCompile(`\$\d+<`) | ||
| dottedPlaceholderRegex = regexp.MustCompile(`\?<[^>\n]*\.[^>\n]*>`) | ||
| bareDollarParamRegex = regexp.MustCompile(`\$[0-9]+`) |
There was a problem hiding this comment.
🟡 Suggestion: bareDollarParamRegex (\$[0-9]+) scans the entire grants query string, so it also matches $N sequences inside string literals or Postgres dollar-quoted bodies (e.g. regexp_replace(col, '(x)', '$1') or a $1$-tagged block). A grants query using those forms would be rejected even though it contains no real bind placeholder. Low confidence since such patterns are uncommon in grants queries, but worth considering if false rejections surface.
Connector PR Review: CE-1007: offline validate fails thrash grants bindsBlocking Issues: 0 | Suggestions: 1 | Threads Resolved: 0 Review Summary Security Issues Correctness Issues Suggestions
Prompt for AI agents |
Summary
$N, hybrid$N<path>, dotted?<a.b>?<name>expansion dry-run with synthetic parent (no DB)Context
Customer-bar slice for CE-1007 / c1#21984. No dialect change; placeholder grammar unchanged.
Test plan
go test ./pkg/bsql/ -run OfflineValidate