Skip to content

fix(sql): translate temporary DDL database lookup sentinel - #31019

Merged
XuPeng-SH merged 10 commits into
matrixorigin:mainfrom
iamlinjunhong:codex/loom/develop/ee1c040951aeca4a8130ee02e26a260e39f3ee657052d0ca3912ef6ec3836aaf
Oct 25, 2026
Merged

XuPeng-SH merged 10 commits into
matrixorigin:mainfrom
iamlinjunhong:codex/loom/develop/ee1c040951aeca4a8130ee02e26a260e39f3ee657052d0ca3912ef6ec3836aaf

Conversation

@iamlinjunhong

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:

#30506

What this PR does / why we need it:

  • Prevents CREATE TEMPORARY TABLE in a database created by the same uncommitted transaction from exposing the internal ExpectedEOB sentinel.
  • Translates only the independent schema transaction's OkExpectedEOB lookup result into the existing typed 20105 error: not supported: temporary table in an uncommitted database generation.
  • Preserves parent-transaction lookup behavior, other database errors, database-generation checks, and Engine.Database sentinel semantics.
  • Adds focused compile coverage for the error and no-side-effect path, plus a public SQL case covering the rejected uncommitted generation, committed temporary-table success, and unknown-database control.

Validation:

  • make build
  • GOWORK=off go test -mod=readonly -run '^TestSessionTemporaryDDLMapsSchemaDatabaseEOB$' -count=1 ./pkg/sql/compile
  • GOWORK=off go test -mod=readonly -count=1 -timeout 10m ./pkg/sql/compile
  • GOWORK=off go vet -mod=readonly ./pkg/sql/compile
  • Real MySQL-protocol runs against a clean test-owned mo-service instance, repeated twice with 20105, committed success, and 1049 controls.

@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 →

@XuPeng-SH

XuPeng-SH commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

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

Commit: c14f4cf4853939a9b4ef8ccbbd911e0ad1672633

"interrupted"

@XuPeng-SH

XuPeng-SH commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

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

Commit: 25eddc8a12fdc5127089bd46942c50db61975bfe

Review belongs to an older commit; it is not a review of the current head.

@XuPeng-SH

XuPeng-SH commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

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

Commit: 0f2543da52231e10fbbbd3419b1b5aaca002413c

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: 0f2543da52231e10fbbbd3419b1b5aaca002413c

Assessment: approve

Reviewed the complete five-file delta and affected callers. Error translation belongs at the temporary-DDL boundary, preserves engine sentinel semantics and rollback ownership, and adds no work to successful SQL paths. No actionable findings remain.

Model: gpt-6-astra / xhigh

Session: 01a13dcf-1586-7a01-9000-d45e20995cf8 · slot 1 · generation 1

Validation:

  • Reconciled retained compile-package and vet receipts against byte-identical Go inputs: 1,554 root tests passed, including the new regression.

  • Isolation preflight passed. Verified 192 native inputs and compatible libraries through the repository provenance owner.

  • Exact BVT passed twice on the same ready instance: 16/16 statements each, with zero residual test databases.

  • MySQL-protocol checks passed twice for error 20105, committed temporary-table operations, and missing-database error 1049.

  • Source remained unchanged. Commands, fingerprints, exits, logs and artifacts were reconciled in /home/xupeng/.local/state/mo-bot/jobs/48042b60e2cab8915dc6dccd/attempt-1/validation-audit.json.

Limitations:

  • The linked issue body was absent from frozen evidence; its contract was assessed through the PR description and source.

  • Fresh runtime validation used one CPU CN. No concurrency or routing behavior changed; no performance benchmark was warranted.

@mergify mergify Bot added the queued label Oct 24, 2026
@mergify

mergify Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-10-24 21:16 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • ❌ Checks failed · in-place
  • 🚫 Left the queue — 2026-10-24 23:49 UTC · at 96d4746de867f52b474918a1cbb4a3d8e6dea220

This pull request spent 2 hours 32 minutes 33 seconds in the queue, with no time running CI.

Reason

The merge conditions cannot be satisfied due to failing checks

  • CI Required

Failing checks:

Hint

You may have to fix your CI before adding the pull request to the queue again.
If you update this pull request, to fix the CI, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Waiting for any of
  • check-neutral = CI Required
  • check-skipped = CI Required
  • check-success = CI Required
All conditions

Requeued — the merge queue status continues in this comment ↓.

@mergify

ghost commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-10-25 01:00 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • 🟠 Checks running · in-place
  • 🚫 Left the queue — 2026-10-25 04:57 UTC · at a8ce62f3433f04747de7c25050752fdfe6f96b2d

This pull request spent 3 hours 57 minutes 36 seconds in the queue, with no time running CI.

Reason

Pull request #31019 has been dequeued

Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.

The author needs to enable "Allow edits from maintainers" on this pull request.

Hint

You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it.
If you do update this pull request, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Waiting for any of
  • check-neutral = CI Required
  • check-skipped = CI Required
  • check-success = CI Required
All conditions

Tick the box to put this pull request back in the merge queue (same as @mergifyio queue).

  • Requeue this pull request

@mergify mergify Bot removed the dequeued label Oct 25, 2026

This branch had an error being deployed

1 failed deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dequeued kind/bug Something isn't working kind/test-ci size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants