Skip to content

fix(plan): allow INSERT IGNORE into writable external tables - #32750

Merged
mergify[bot] merged 1 commit into
matrixorigin:mainfrom
aptend:fix/astra-meow-32512
Nov 14, 2026
Merged

mergify[bot] merged 1 commit into
matrixorigin:mainfrom
aptend:fix/astra-meow-32512

Conversation

@aptend

@aptend aptend commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

Fixes #32512

What this PR does / why we need it:

Allow INSERT IGNORE into writable, non-Iceberg external tables to use the existing legacy external-insert path when the modern binder returns its exact external-table sentinel. This restores VALUES, SELECT and prepared forms without changing assignment, warning or external-file writer semantics. Read-only tables, Iceberg DML, ODKU, RETURNING and non-Iceberg OVERWRITE keep their existing rejection paths.

The planner regression covers six admitted forms, eight rejection controls and unchanged ordinary external INSERT. No FileService, authorization, error-mapping or native code changes are included.

Validation on the final source based on upstream bc9b822cd1f5d742b550f8366516fd836936ba70:

  • Regression RED exit 1 before the admission fix and GREEN exit 0 after it. The CGO-enabled owning pkg/sql/plan run through mo-cgo-test recorded 24,593 named passes and two skips; skipped cases are excluded from pass claims. The focused admission regression selected 16 named records including its root.
  • Repository-pinned local SCA: STATIC_CHECK_PACKAGES='./...' make static-check-selected — original exit 0, zero issues. The canonical changed/test/reverse-dependency graph crossed the incremental workflow's half-tree threshold (336/510), so explicit full fallback was used. No linter configuration changes or suppressions.
  • Current CGO-enabled ELF and worktree-native library identities/provenance were verified. One foreground real-SQL run completed with both helper and outer exit 0: 98 statements, 14 exact typed negative controls, complete 20-row result and CSV multiset comparison (18 CSV files), three dependent-default/NULL rows, and four native prepared statement-ID pairs reused across success and error recovery. SQL PREPARE, NULL/1048 warnings, strict 3819 rejection and empty-source behavior were checked.
  • Real writer failure produced exact 1105/HY000 with the owned ENOTDIR path, preserved the blocker bytes and allowed same-connection recovery. A non-admin custom role received exact 20101 file-policy denials for both ordinary and IGNORE external writes while internal DML remained usable. Eight DDL cleanup attempts, ten handles and four owned paths completed; both child processes were reaped with exit 0 and all 240 frozen owned socket inodes disappeared across TCP/TCP6/UDP/UDP6.

The final SQL result supersedes earlier failed private-fixture runs; their original nonzero evidence remains retained. Unchanged owning-package/native/SCA evidence was reused by source and dependency identity. Hosted CI for the new PR is pending.

@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 commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Queue requested — the merge queue status continues in this comment ↓.

@XuPeng-SH

XuPeng-SH commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: 0ccfff3489bdab57cee5fbca1b5bf97035679ea6

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mo-bot review · mo-bot-local · review

Commit: 0ccfff3489bdab57cee5fbca1b5bf97035679ea6

Assessment: approve

The exact-sentinel fallback restores writable external INSERT IGNORE admission while retaining existing rejection and writer semantics. It reuses the established planner and cleanup owners without adding another execution path. No actionable findings remain.

Model: gpt-6.1-sol / max

Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0

Validation:

  • Reviewed the complete two-file delta, sentinel producers, legacy planner, prepared-input handling, external writer/error/authorization/cleanup consumers, and all supplied discussion and linked-issue context.

  • Local preflight, source/guard/patch audit, gofmt and receipt reconciliation passed. discussion-assessment.json covers all three keys; validation-manifest.json indexes retained commands, receipts and logs.

  • Frozen current-head CI passed shared build, UT, SCA, coverage and active multi-CN BVT. Fourteen skipped and two neutral checks are excluded from passes.

  • Reused attributed author reports of focused RED/GREEN and owning-package tests, plus final-source real SQL, native prepared reuse, CSV/result comparisons, writer failures, file-policy denials and cleanup.

Limitations:

  • The local focused test stopped before compilation because matching libmo.so prerequisites were absent; it is not counted as a product failure or pass.

  • Raw CI and author-local execution logs were unavailable. No fresh local product-test or real-SQL pass is claimed.

@mergify mergify Bot added the queued label Nov 14, 2026
@mergify
mergify Bot merged commit 8868e6c into matrixorigin:main Nov 14, 2026
@mergify

mergify Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

✅ Merged into main as 8868e6c at 16:25 UTC

Less than a minute in the queue, with no time running CI.

So far

  • ✅ Entered the queue Sat 14 Nov, 16:25 · rule main · triggered by rule Automatic queue on approval for main
  • ✅ Checks skipped · PR is already up-to-date
  • ✅ Merged 16:25 · 8868e6c · squash
3 merge conditions met
  • #review-threads-unresolved = 0 · required by GitHub branch protection
  • github-review-approved · required by GitHub branch protection
  • any of · required by GitHub branch protection:
    • check-success = CI Required
    • check-neutral = CI Required
    • check-skipped = CI Required

Times in UTC · dashboard · how the merge queue works

This branch was previously deployed

1 inactive deployment
ci — 0ccfff34 Deployed Nov 14, 2026 by aptend
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 size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: writable external tables reject valid INSERT IGNORE VALUES and SELECT with 20313

3 participants