Skip to content

fix(frontend): restore main build after #31795/#31798 merge (writeDisposition) - #31813

Closed
MatrixAdventurer wants to merge 1 commit into
matrixorigin:mainfrom
MatrixAdventurer:fix/main-build-delete-write-disposition
Closed

MatrixAdventurer wants to merge 1 commit into
matrixorigin:mainfrom
MatrixAdventurer:fix/main-build-delete-write-disposition

Conversation

@MatrixAdventurer

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • BUG (build break on main)

Which issue(s) this PR fixes:

No issue filed; main does not compile at f6feb84.

Summary

go build ./pkg/frontend fails on main f6feb84:

pkg/frontend/txn_read_only.go:230:13: cannot use true (untyped bool constant) as writeDisposition value in return statement

#31795 (resolve DELETE targets in their source scope) added a return true // Missing or derived source: fail closed. branch in classifyStatementWrite. #31798 (consolidate UPDATE target ownership), merged next, changed that function to return writeDisposition. Each PR compiled alone; the merge result does not.

Fix (1 line): return writePersistent, the fail-closed value the neighbouring branches already use. Behaviour is the same as #31795 intended: a DELETE target that does not resolve to a FROM source still needs write access.

Verification

  • Before: mo-service build and go vet ./pkg/frontend fail with the error above.
  • After: mo-service builds; go test ./pkg/frontend -run 'ReadOnly|ClassifyStatement|StatementWrite' -count=1 passes (includes TestDeleteReadOnlyClassification* with delete tt from (select 1 as a) as tt, delete tt from otherdb.tt).

Merge Danger

None. One line in one production file.

本操作由 LW 授权的 Grok Bot 智能体执行。

…sition merges

matrixorigin#31795 added a 'return true' fail-closed branch in classifyStatementWrite
while matrixorigin#31798 changed the function to return writeDisposition, so main at
f6feb84 does not compile. Return writePersistent, the fail-closed value.
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@mergify mergify Bot added the kind/bug Something isn't working label Oct 30, 2026
XuPeng-SH added a commit that referenced this pull request Oct 30, 2026
## What type of PR is this?

- [ ] API-change
- [x] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [ ] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

Refs #29249

## What this PR does / why we need it:

The combination of #31795 and #31798 left a boolean return in a function
that now returns `writeDisposition`, breaking the main build. Return
`writePersistent` for an unresolved or derived DELETE source, preserving
the existing fail-closed behavior.

The same one-line correction is proposed in #31813; that PR's main CI is
currently blocked by its preflight description check.

Validation on darwin/arm64, Go 1.27.1, `GOEXPERIMENT=simd`:

- Full `pkg/frontend` unit suite passed (`-count=1`).
- Affected read-only classification tests passed with `-race -count=1`,
including the existing derived-source case.
- Configured incremental SCA for `./pkg/frontend` passed with 0 issues.

GitHub CI is pending.
@XuPeng-SH

Copy link
Copy Markdown
Contributor

fixed

@XuPeng-SH XuPeng-SH closed this Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants