Repository navigation
fix(sysview): publish declared COLUMNS metadata, numeric SUB_PART and full generated expressions - #31489
Conversation
a068278 to
08a08b4
Compare
e74be9d to
f844b90
Compare
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: efb72346825daf719455aa6c5e4230841bd06cc8
Assessment: approve
No actionable findings remain. The metadata corrections preserve historical readers, and the catalog migration covers existing and late-upgraded tenants. The earlier protocol-gate concern is resolved in this head.
Model: gpt-6-astra / xhigh
Session: 01a1869d-999c-7481-b340-ae4a63e8cee4 · slot 1 · generation 2
Validation:
-
Reviewed all 38 changed files, relevant owners and consumers, three linked issues, and all 16 discussion items.
-
Bounded static checks passed: frozen head, unchanged source, patch correspondence, gofmt, diff whitespace and golden-file scope.
-
Reused supplied exact-head successful build, UT, SCA, coverage and proxy/pessimistic BVT conclusions.
-
Saved review-plan.md, discussion-assessment.json, review-notes.md and validation-manifest.json; check receipts were reconciled with retained logs.
Limitations:
-
No local Go, SQL or race tests were rerun. Raw CI logs and author-local receipts were unavailable, so individual test execution and race mode were not independently certified.
-
Upgrade compatibility CI jobs were skipped and are not counted as passes.
-
Preexisting ambiguity in comma-containing ENUM label encoding remains outside this change.
gouhongshen
left a comment
There was a problem hiding this comment.
Codex automated review
Follow-up review of head efb7234 against the previously reviewed head 9f454cb. The delta is the rebase onto current main plus the renumbered delivery vehicle; the range contains no merge commit, so no conflict-resolution delta exists. The previously blocking topic, the per-feature MORPCVersion-135 gates with their mixed-version machinery, is fixed at the rework head and is still fully gone here: pkg/defines is unchanged versus main, MORPCLatestVersion stays 134, and no serving-floor, metadata-maintenance, or admission-survey code remains anywhere in the tree. aunjgr's inline finding and the two mo-bot CHANGES_REQUESTED reviews on that topic are answered by that rework, and I verified their substance in code, so there is nothing left to report from them. The new surface this round reworks the vehicle onto the consolidated ladder: a v4_0_8 tenant hop as the direct successor of the frozen 4.0.7 stage with two shared-builder MODIFY_VIEW legs (COLUMNS at the historical 109 gate, the prefix-aware STATISTICS identity at 41), the four upstream upgrade-admission guards keyed on final == '4.0.7' re-keyed onto a >= 4.0.7 comparison plus the registered 4.0.7 handle identity, and the login and manual on-demand walks continuing via upgradeTenantToFinalVersionOnDemand to the cluster final before success is cached, keeping mid-walk failures resumable from the committed create_version. I checked the fix from first principles: the label-aware overloads derive metadata only for T_enum/T_uint64 columns carrying declared labels, with empty-domain, NULL-label, BIGINT UNSIGNED, geometry-SRID and JSON-array branches all handled; the STATISTICS and SHOW INDEX projections are legal under their GROUP BY after the algo_params addition; the historical V110 and NULL-selector COLUMNS identities are recognized byte-stably at all three snapshot-reader seams; and the four changed distributed-BVT expectation rows match the new identities, with no stale prefix-index expectations elsewhere in the suite. Verification at this head through the repository CGo wrapper, all with real exit statuses: full ./pkg/bootstrap/... including the new v4_0_8 package, ./pkg/util/sysview, ./pkg/sql/plan/function, the pkg/frontend publication oracles, pkg/sql/plan TestHistoricalViewColumnsSQL, the embedded-cluster oracles TestIssue30936* (4/4 pass: declared ENUM/SET metadata on both CNs, numeric and NULL SUB_PART through STATISTICS and SHOW INDEX, unbounded GENERATION_EXPRESSION, encoding boundary), the previously CI-failing TestCreateAccountCatalogInitialization, and pkg/embed TestCallerOwnedTenantUpgradeRollsBackAndRetries, all pass. Limitations: I did not run the distributed multi-CN BVT, race mode, or the hosted CI matrix; hosted-CI failures the author attributes to upstream code (e.g. the data race inside issue_31401_test.go) were not reproduced and I attribute them to upstream as the author does. One non-blocking P2 on test hygiene remains, described in the findings; there are no blocking findings, so this verdict is COMMENT.
P2 - pkg/embed tenant-walk oracle pins the literal 4.0.8 instead of deriving it from the registered final (pkg/embed/catalog_view_identity_test.go:271)
TestCallerOwnedTenantUpgradeRollsBackAndRetries pins the literal "4.0.8" at lines 271 and 280 to assert that the caller-owned walk continues past the paged 4.0.7 stage to the registered final. This exact version-literal pin class already broke this PR's CI twice: run 40792282505 failed UT Coverage on the pkg/embed pin ("4.0.7" at the previous head), and run 40932194894 failed UT Coverage on the sqlintegration literal, which commit efb7234 then fixed by deriving the expectation from the bootstrap registry itself (GetBootstrapService().GetFinalVersion()). The embed oracle holds the same service handle in scope at line 239 (svc.GetBootstrapService()), so both assertions could compare against the registered final and keep their meaning: the observed walk outcome equals the registry's final version. As written, every future registered upgrade hop retires this literal again and re-breaks the package in CI until it is edited by hand, repeating the failure mode this round spent a commit repairing. The walk behavior itself is correct and verified passing at this head; this is purely test-hygiene and does not block the change.
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: efb72346825daf719455aa6c5e4230841bd06cc8
Assessment: approve
No actionable findings remain. Metadata corrections, historical readers and tenant-upgrade continuation are coherent. The earlier protocol-gate concern is resolved; the new test-version literal suggestion is nonblocking.
Model: gpt-6-astra / xhigh
Session: 01a1869d-999c-7481-b340-ae4a63e8cee4 · slot 1 · generation 2
Validation:
-
Reviewed all 38 changed files, relevant owners and consumers, three linked issues and all 19 discussion items.
-
Bounded static checks passed: frozen head, unchanged source, patch correspondence, formatting, whitespace, complete golden transformations and discussion coverage.
-
Reused supplied exact-head successful build, UT, SCA, coverage and proxy/pessimistic BVT conclusions.
-
Saved review records and reconciled check receipts with retained logs in validation-manifest.json.
Limitations:
-
No local Go, SQL or race tests were rerun. Raw CI logs and author-local receipts were unavailable; individual test execution and race mode were not independently certified.
-
Upgrade compatibility CI jobs were skipped and are not counted as passes.
-
Preexisting ambiguity in comma-containing ENUM label encoding remains outside this change.
aunjgr
left a comment
There was a problem hiding this comment.
The per-feature mixed-version gate I previously flagged is removed. The current design approval and upgrade vehicle are not accurately represented in the delivery record, so this review stops at the design-artifact gate rather than approving the implementation.
… full generated expressions (matrixorigin#30936, matrixorigin#30935, matrixorigin#30937) Declared catalog metadata published through information_schema.COLUMNS: - ENUM/SET columns report CHARACTER_MAXIMUM_LENGTH and CHARACTER_OCTET_LENGTH from the declared labels, and NUMERIC_PRECISION/NUMERIC_SCALE as NULL instead of the physical OID projections (issue matrixorigin#30936). - COLUMN_TYPE composes upstream matrixorigin#31739's attributed-DECIMAL decoration (varchar(65535) pin, att_is_unsigned) over the label-aware current. - GENERATION_EXPRESSION keeps the full stored expression instead of the varchar(500) double cast (issue matrixorigin#30937). - information_schema.STATISTICS and SHOW INDEX report SUB_PART as a numeric prefix length with SQL NULL for non-prefix indexes instead of the string 'NULL' (issue matrixorigin#30935). Delivery: upstream matrixorigin#31739 consumed the planned successor slot as "4.0.18", so the refresh vehicle is renumbered to v4_0_19 ("4.0.19"), registered behind v4_0_18. Its tenant hop publishes both identities for existing accounts - a ready 4.0.7 cluster queues the single direct [4.0.7 -> 4.0.19] route, a main-era 4.0.18 stamp queues [4.0.18 -> 4.0.19], older sources chain their per-handle rows and the on-demand walks step every successor handle; fresh accounts initialize on the published identities. History: every recorded COLUMNS generation keeps binding. Snapshots recorded under the base-era binary-null template and under upstream's published 4.0.18 identity are frozen and recognized byte-stably at the historical adapter, the derived-metadata and migration-gate seams, so a snapshot read after the refresh keeps its recorded projections and timestamp; unknown or user-edited definitions still fail with 'unsupported historical information_schema.COLUMNS definition'. MO_INDEX_SUB_PART is renumbered to 623 (FUNCTION_END_NUMBER 624) after upstream allocated 620..622 for the unsigned-Decimal admission checks; the id is internal plan wiring only. Test evidence: pkg/tests/issues TestIssue30936 replay the three issue reproductions; sysview identity and seam oracles pin the byte-stable frozen templates; bootstrap route/continuation/recovery suites cover the direct and chained censuses, and upstream's crossing-admission fixtures (service_upgrade_crossing_test.go) are re-derived to this composed route matrix - final row 4.0.19/2, three-leg chained routes, the single direct 4.0.7 -> 4.0.19 row, and the frozen-4.0.7 resume admission counting its second legacy-CDC gate read; the plan-side historical reader oracle covers the 4.0.18-era snapshots and the migration-gate pre-refresh leg; BVT rows rendering the published identity are regenerated from the merged constructor.
Documentation-only change requested by PR matrixorigin#31489's implementation review; no code or test change. The status block now records the design-first approval chain and the delivered vehicle: the delivered design content is the independently approved revision 14 (sha256 22aaf464a18a8be7e7d4889e605850c0792bca6df7bd234e97569445b0c84c66), implemented at PR matrixorigin#31489 head 61da7f8, following PASS-approved revision 9 (sha256 57043aac71c74a7cb63f0a8ac047a4ac898bf974791644569e5c57f4bd2838d9, 2026-10-28) and revision 12 (sha256 47ebfe15a45940221c3d2d5ad6955e11a5c89a1a909fa9d4e382e1ac9db0a599, 2026-10-29); the revision history records every reviewed revision's exact content hash and PASS/REQUEST_CHANGES disposition, and the approval artifacts are the design-review records in this PR's chain. The approved D13/D14 amendments are folded into the standing sections (refresh vehicle renumbered to 4.0.19 behind upstream's 4.0.18 handle, frozen InformationSchemaColumns4018DDL() recognition at the reader seams, census-derived population oracles, recovery/recheck shapes), and the transient per-round implementation and rebase narratives move out of this tracked document into the PR's review threads and retained review evidence. Every decision, invariant, oracle and validation entry keeps its approved wording; the approved revision-14 wording governs wherever this consolidation could be read as a change. Revision 15 content sha256: 551fb06436f784e8b75fa9c7d37702ea47379ed5902256b8188d1dfcacb22f6c
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 38901ce0e77c413966d8e775b639b05d42e227b6
Assessment: approve
Reviewed the complete delta and relevant consumers. Metadata corrections, historical view recognition, and 4.0.19 upgrade paths are coherent. Prior protocol-gate and design-record concerns are resolved; no actionable findings remain.
Model: gpt-6-astra / xhigh
Session: 01a1869d-999c-7481-b340-ae4a63e8cee4 · slot 1 · generation 2
Validation:
-
Reused supplied exact-head successful build, UT, SCA, coverage, and multi-CN BVT results.
-
Static audit passed: clean source, frozen constructor preservation, golden changes, function IDs, and complete discussion coverage. Receipt: checks/1793366386295029479-2.json; log: static-audit.log.
-
Saved review-plan.md, review-notes.md, discussion-assessment.json covering all 25 entries, and validation-manifest.json.
Limitations:
-
No local Go or race tests run. CI raw logs were unavailable; upgrade-compatibility jobs were skipped.
-
The preexisting ENUM embedded-comma encoding ambiguity remains an accepted scoped limitation.
aunjgr
left a comment
There was a problem hiding this comment.
The delivery record now correctly identifies the 4.0.19 vehicle and the revised design content. The earlier mixed-version gate concern remains resolved. The approval trace still asserts an independent PASS for revision 14 by date and hash without identifying/linking the actual design-first decision. Please make that existing decision accessible, tied to content hash 22aaf464a18a8be7e7d4889e605850c0792bca6df7bd234e97569445b0c84c66 and its reviewer. A link to retained external evidence is sufficient; do not commit raw logs or repeat a review already performed. This is the remaining design-gate finding, not a claim of a new runtime defect or a full implementation approval.
|
mo-bot review · Commit: "interrupted" |
… delivered revision Revision 16 (documentation-only): the status block's approval trace and the revision history now identify the actual design-first decision for the delivered revision 14 and its reviewer, tied to the approved content hash 22aaf464a18a8be7e7d4889e605850c0792bca6df7bd234e97569445b0c84c66, and link the retained external evidence: the public byte link of the approved content (the commit whose document hashes to that value), the durable verbatim decision record gist, and the controller-retained review transcript and checkpoint submission. No design decision, invariant, oracle or validation entry changed. Answers the design-gate review of 2026-10-30T13:43:27Z.
|
Handled at head The existing design-first decision is now identified and linked. It is the controller-run independent pre-PR design review of 2026-10-30: a read-only, ephemeral Codex review session under the Retained external evidence:
Design revision 16 (sha256 |
|
Unresolved unrelated CI blocker record (auto-maintained by the issue-fix-loop handler for issue group #30936):
|
|
mo-bot review · Commit: Review discussion changed before publication; a fresh contextual review is queued. |
gouhongshen
left a comment
There was a problem hiding this comment.
Codex automated review
Follow-up review of head a62c338 against the previously reviewed head 38901ce. The delta is documentation-only: design doc revision 16 in docs/design/20261026-declared-catalog-metadata-publication-and-repair.md, with zero Go or test file changes, so the implementation (committed at 61da7f8) is byte-identical to what prior rounds reviewed. Disposition of my prior blockers: (1) the per-feature MORPCVersion-135 mixed-version gate machinery from the first round was removed at 9f454cb and remains absent (MORPCLatestVersion stays 134, pkg/defines untouched); (2) the delivery-record inaccuracy about the design approval and upgrade vehicle was corrected at 38901ce and still reads correctly; (3) my remaining design-gate blocker from 2026-10-30T13:43:27Z — the approval trace asserted an independent PASS for design revision 14 by date and hash without identifying or linking the actual design-first decision — is fixed at this head. Revision 16 now names the reviewer (the issue-fix-loop controller's independent local reviewer, a read-only ephemeral Codex session under the fix-issue-loop-local-reviewer contract, model gpt-6.1-sol, controller run 3dedc8b010734de9ba6a4c92c3fdf56e, thread 01a18bcc-5369-7d91-ae66-c072a48a5b1e, PASS at 2026-10-30T07:59:46Z) and links durable external evidence at gist f1120ed42e7a71f75afa79d1ff8b5bc2. I independently verified every checkable claim: the gist is public and contains the verbatim approved:true PASS JSON tied to design revision 14 at sha256 22aaf464a18a8be7e7d4889e605850c0792bca6df7bd234e97569445b0c84c66 plus reviewer identity and provenance; the document committed at implementation head 61da7f8 byte-hashes to exactly that approved value; the current revision-16 document hashes to 2df7a7dfef372bf41feb160c3c3252ac9f1d6b3522106c94fe1e3f5d038d9f8d as the author states; and the PR description carries the same links. No raw transcript was committed and no completed review was repeated, matching the blocker's constraints. Other reviewers: mo-bot approved the identical code at 38901ce with no actionable findings; the earlier Codex review's non-blocking P2 test-literal suggestion was raised by that reviewer and is not re-emitted here. No blocking or non-blocking findings remain. Limitation: I did not re-run Go tests because the delta since the last validated head is markdown-only and would exercise byte-identical code; focused-suite passes at the implementation head are recorded in the 2026-10-29 review comment.
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: a62c3387bfc0b3d1c53c8db0503d9c8447c0d18c
Assessment: approve
Complete review closed with no actionable findings. Metadata corrections, historical readers and migration paths remain coherent. The new discussion confirms the resolved design-decision concern.
Model: gpt-6-astra / xhigh
Session: 01a1869d-999c-7481-b340-ae4a63e8cee4 · slot 1 · generation 2
Validation:
-
Revalidated frozen source and complete patch identity, qualifying reuse of the full implementation analysis.
-
Verified the accessible design PASS and both document hashes; classified all 33 discussion entries.
-
Reused supplied exact-head successful build, UT, SCA, coverage and multi-CN BVT conclusions.
-
Static audit passed; receipt checks/1793379707320834829-2.json matches static-audit.log. Review records and validation-manifest.json are saved.
Limitations:
-
No local Go, SQL or race tests rerun. Raw CI logs were unavailable, so individual test execution and race mode were not independently certified.
-
Upgrade-compatibility CI jobs were skipped.
-
Preexisting ambiguity in comma-containing ENUM labels remains outside the accepted scope.
🚫 Left the queue1 min in the queue, with no time running CI. So far
Reason The pull request can't be updated
Hint You should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again. Tick the box to put this pull request back in the merge queue (same as
Times in UTC · dashboard · how the merge queue works |
What type of PR is this?
Which issue(s) this PR fixes:
Related to #30936.
Related to #30935.
Related to #30937.
What this PR does / why we need it:
Fixes the declared-catalog metadata defects of #30936/#30935/#30937 and delivers the corrected
identities through the repository's supported model: unconditional publication plus one
idempotent stored-view refresh hop. No feature-specific protocol gate and no mixed-version
fallback exists in this PR: after the first implementation review every such mechanism was
removed (
MORPCLatestVersionstays 134, no read substitution, no admission survey, no per-tenantfloor), while the stored-view migration the reviewers called "necessary" is retained.
Design record (design-first review chain)
The change is triggered (persisted-view migration, upgrade recovery, cross-subsystem changes), so
the repository's design gate applies:
docs/design/20261026-declared-catalog-metadata-publication-and-repair.mdis the reviewed artifact, implementation of each round proceeded only after that round's
independent design review returned PASS, and the document's status block and revision history
record every reviewed revision's exact content hash, disposition and implementing head:
57043aac71c74a7cb63f0a8ac047a4ac898bf974791644569e5c57f4bd2838d9),PASS 2026-10-28 - the shutdown-only rework that removed the protocol-135 gate family;
implemented at rework head
9f454cb5d0.47ebfe15a45940221c3d2d5ad6955e11a5c89a1a909fa9d4e382e1ac9db0a599),PASS 2026-10-29 - the post-consolidation vehicle plus preserved upgrade admission and
on-demand continuation; implemented at head
efb7234682.22aaf464a18a8be7e7d4889e605850c0792bca6df7bd234e97569445b0c84c66),PASS 2026-10-30 - the rebase onto upstream fix(sql): enforce DECIMAL UNSIGNED and ZEROFILL attributes end to end #31739's ladder: vehicle renumbered to
v4_0_19,the merged COLUMNS identity, the frozen 4.0.18-snapshot recognition, the direct-route census.
This is the delivered design content; it was implemented at head
61da7f8ef0.document (revision 16) and here. The returning review was the controller-run independent
pre-PR design review: a read-only, ephemeral Codex review session under the
fix-issue-loop-local-reviewercontract, provider-separated from the implementing Grok CLIsession (reviewer model
gpt-6.1-sol, reasoning effortxhigh;implementing handler
magpie/tass/glm-5.3; controller run3dedc8b010734de9ba6a4c92c3fdf56e, review session thread01a18bcc-5369-7d91-ae66-c072a48a5b1e, run window 2026-10-30T07:53:04Z-07:59:46Z,exit 0). It returned
approved: true(PASS - design only, no findings) at2026-10-30T07:59:46Z for exactly that content hash. Retained external evidence:
the approved bytes are public at
https://github.com/matrixorigin/matrixone/blob/61da7f8ef005f2ee14a3ea44e738e6baee24876d/docs/design/20261026-declared-catalog-metadata-publication-and-repair.md
(that committed document hashes to the approved sha256); the verbatim decision record plus
its provenance is durably published at
https://gist.github.com/gouhongshen/f1120ed42e7a71f75afa79d1ff8b5bc2; and the controller
retains the full review transcript and the exact checkpoint submission the reviewer was
sent (
state/logs/issue-30936/1793346784-b0837235.jsonl,state/artifacts/issue-30936/pr-event-result-1793345798133.json), next to every earlierround's decision record under
state/artifacts/issue-30936/(revision 9 PASSpre-pr-review-1793174134562.json, revision 10 REQUEST_CHANGESpre-pr-review-1793224739314.json, revision 11 REQUEST_CHANGESpre-pr-review-1793225484685.json, revision 12 PASSpre-pr-review-1793226200902.json,revision 13 REQUEST_CHANGES
pre-pr-review-1793323124836.json).551fb06436f784e8b75fa9c7d37702ea47379ed5902256b8188d1dfcacb22f6c) - the documentation-onlyconsolidation at the implementation review's request (head
38901ce0e7): the design-approval chain andthe actual
v4_0_19vehicle are stated in the document's status block, the revision-13/14amendments are folded into the standing sections, and the transient review/run correspondence
was moved out of the tracked file (it remains recorded in the review threads and retained
review evidence). No decision, invariant, oracle or validation entry changed from the approved
revision 14; the approved revision-14 wording governs wherever the consolidation could be read
as a change.
2df7a7dfef372bf41feb160c3c3252ac9f1d6b3522106c94fe1e3f5d038d9f8d) - thedocumentation-only evidence-link pass at the design-gate review's request (this push): the
tracked design's status block and revision history now identify the actual design-first
decision of record for the delivered revision and its reviewer, and link the retained
external evidence (public byte link of the approved content, durable verbatim
decision-record gist, controller-retained transcript and checkpoint submission). No
decision, invariant, oracle or validation entry changed from the approved revision 14.
Delivered vehicle
The stored-view refresh hop is
pkg/bootstrap/versions/v4_0_19- version "4.0.19", minimumupgrade version "4.0.7", required protocol 118 (a pre-existing grandfathered gate), offset 2 -
registered on main's consolidated ladder behind upstream's
v4_0_18handle (upstream #31739consumed the planned successor slot as "4.0.18", so the vehicle was renumbered after it). Its
tenant hop publishes both identities for existing accounts: a ready 4.0.7 cluster queues the
single direct [4.0.7 -> 4.0.19] upgrade executed by this handler alone, a main-era 4.0.18 stamp
queues the direct [4.0.18 -> 4.0.19] upgrade, older sources chain their per-handle rows through
the frozen 4.0.7 stage and the 4.0.18 handle, and the login/manual on-demand walks step every
successor handle (upstream's re-entrant planning loops with this PR's manual-walk completion
check); fresh accounts initialize at 4.0.19 with the published identities and run no leg.
Root causes
information_schema.COLUMNS([Bug]: ENUM/SET character length is missing and SET is misreported as numeric in information_schema.COLUMNS #30936) derived every declared-metadata field from thephysical column type alone:
internal_char_length(mc.atttyp)andinternal_numeric_precision(mc.atttyp). ENUM is stored as an internal uint16 and SET as auint64 bitmap, so both published SQL NULL for
CHARACTER_MAXIMUM_LENGTH/CHARACTER_OCTET_LENGTH, while SET exposed its backing-storeNUMERIC_PRECISION=20/NUMERIC_SCALE=0. The declared labels persisted inmo_columns.attr_enumwere neverconsulted.
information_schema.STATISTICSandSHOW INDEX([Bug]: prefix-index length is missing from STATISTICS.SUB_PART and SHOW INDEX metadata #30935) published NULL literals and thestring
'NULL'forSUB_PART/Sub_part, although prefix lengths are retained inmo_catalog.mo_indexes.algo_params.GENERATION_EXPRESSION([Bug]: information_schema truncates valid generated-column expressions at 500 characters #30937) went throughvarchar(500)casts, silently truncatingdeclared generated-column expressions longer than 500 characters.
Exact changes (shutdown-only delivery)
pkg/sql/plan/function: additive two-argument overloads(
varchar,varchar -> int64) oninternal_char_length/internal_char_size/internal_numeric_precision/internal_numeric_scalethat derive character metadata from thedeclared ENUM/SET labels and suppress SET's bitmap numeric identity, plus the new
mo_index_sub_partfunction. The historical one-argument overloads remain bound fordefinitions persisted by older binaries; the new ones carry no protocol requirement.
pkg/util/sysview: the currentCOLUMNSidentity composes those label-aware overloads and theunbounded
GENERATION_EXPRESSIONprojection on the#31160binary-family NULL selector,under upstream fix(sql): enforce DECIMAL UNSIGNED and ZEROFILL attributes end to end #31739's attributed-DECIMAL
COLUMN_TYPEdecoration applied verbatim (COLUMN_TYPEpinned to
varchar(65535),att_is_unsigneddecked ancient rows - D13-2/D14-1); the currentSTATISTICSidentity publishes retained prefix lengths as a numericSUB_PART(actual SQLNULL for whole-column parts). Bootstrap init, CREATE ACCOUNT and subscription publication
install these identities unconditionally: after main's fix(bootstrap): remove view scan and enforce complete tenant initialization #31662, CREATE ACCOUNT installs the
complete current definition set or aborts, so this PR adds no rung, survey or authoring floor.
AdaptLegacyInformationSchemaColumnsDDL, the derived view-metadata seamViewMetadataColumnsDDLand the migration gateIsInformationSchemaColumnsMigrationDDLrecognize every recent published generation byte-stably - the historical templates, the
base-era NULL-selector MEDIUMINT identity, and the exact upstream 4.0.18 published identity
frozen independently of the mutable current constructor (
InformationSchemaColumns4018DDL,D14-1) - next to the corrected current. Unknown or user-edited definitions stay refused with
the unchanged error,
IsCurrentInformationSchemaColumnsDDLstays exclusive, and snapshots keeptheir recorded projections and timestamp; the readers stay read-only.
pkg/bootstrap/versions: thev4_0_19tenant hop carries the two shared-builder legs: theshared COLUMNS entry keeps its exact base shape (
UpgSql = sysview.InformationSchemaColumnsDDL,protocol gate 109, exact-identity CheckFunc, DROP+CREATE), so refreshing an account installs the
merged identity; the shared STATISTICS entry publishes the prefix-aware identity under the
pre-existing STATISTICS gate (41). One idempotent rewrite per pre-existing account; completed
legs never churn; a failed leg leaves the account marker untouched and retries.
pkg/bootstrapupgrade admission and continuation: upstream's re-keyed admission guards (the>= 4.0.7line, the registered frozen-handle identity and thecrossingPendingroutepredicates) are adopted verbatim; this PR keeps the recovery-path guards (the frozen 4.0.7
target's legacy-CDC admission and the offset-only resume rejection) that a final above 4.0.7
otherwise bypasses, and adds the manual walk's in-transaction completion check (an account left
below the cluster final returns
cannot upgrade tenant version %s to current cn version %sinstead of caching success) - upstream's loops alone lack it.
pkg/sql/plan:SHOW INDEXpublishesSub_partthroughmo_index_sub_part(numericprotocol type, actual SQL NULL without a retained prefix).
MO_INDEX_SUB_PARTis id 623 (FUNCTION_END_NUMBER624) after upstream fix(sql): enforce DECIMAL UNSIGNED and ZEROFILL attributes end to end #31739 allocated620..622 for the unsigned-Decimal admission checks; the id is internal plan wiring only and
every view DDL references the name.
MORPCVersion135constant and plan feature flag, the persisted-expression/remote-execution protocol mappings
for it, the admission/authoring-floor branches in tenant publication, the
FrozenViewServingBelowMetadataFloorread substitution and its serving-floor adapter, themetadata maintenance pass and its restore-compatibility/admission-interval tests. The
pre-existing 118/126 admission handoffs, the VIEWS authoring fence, the 130-134 upstream
planes and the columns/tables maintenance keep their base behavior untouched.
Issue-to-test proof
Defect oracles (unchanged red/green pair on base
7e0c9d94vs the fixed tree; recorded probelogs and full-suite receipts in the review evidence):
pkg/tests/issues/issue_30936_test.go,issue_30936b_test.go,pkg/sql/plan/function/func_internal_columns_metadata_test.go): fort(id INT PRIMARY KEY, e ENUM('a','bb'), s SET('a','bb'))the base returned SQL NULLcharacter lengths and SET numeric 20/0; the fixed tree reports
e2/8 ands4/16 with SQLNULL numeric metadata, on both CNs, for reordered and multibyte label sets (
1/3,2/4),with the INT control at 10/0; empty-domain and colliding-declaration boundary batteries pin
the
attr_enumencoding boundary.func_internal_index_sub_part_test.goplus the issue SQL):SUB_PART/Sub_partreport the declared prefix length (numeric
LONGLONGat the client) and actual SQL NULLfor whole-column positions on both surfaces.
GENERATION_EXPRESSION,SHOW CREATE TABLEand the evaluated values, VIRTUAL and STORED.Delivery and history oracles (all green at the delivered head):
pkg/frontend,pkg/util/sysview) :TestCreateTablesInformationSchemaPublishesDeclaredMetadataUnconditionallyproves freshcreation executes the corrected declared-label COLUMNS identity and the prefix-aware
STATISTICS identity and never authors a predecessor identity, beside upstream's own
TestCreateTenantInformationSchemaRequiresCurrentProtocolpeer-answer rejection matrix.pkg/bootstrap): rewrite/no-op/retry chains for the v4_0_19 hop - base-eraNULL-selector and V110 tenants converge to exactly the published identities, a current
tenant is a no-op, a mid-hop DDL failure leaves the marker untouched and repairs on retry,
and a 4.0.13 account converges through the whole historical chain
(
TestColumnsUpgradeReachesExistingTenants; the maintenance keeps a single current identityacross shared/maintenance/hop).
registration, final 4.0.19): the ready 4.0.6, created-4.0.7, off-frozen-offset and
interrupted offset-only routes keep upstream's terminal rejections (
TestLegacyCDCAdmissionBeforeUpgradeMutation,TestV407RejectsDifferentOffsetBeforeCreatingRoute,TestV407RejectsInterruptedOffsetOnlyRouteBeforeMutation) including the recovery path, withthe crossed-route non-rejection the pending-scan permits; the continuation oracles drive the
real
v4_0_7handler plus the successor registration (late-login convergence from 4.0.6 tothe final, already-4.0.7 manual upgrade, failure/retry without premature caching,
second-login idempotence and the no-successor-SQL-before-4.0.7-completion ordering).
InformationSchemaColumns4018DDLidentity are recognized byte-stably at all three readerseams, an unknown definition stays refused at every seam, and with the live view at the
corrected identity a snapshot recorded at the base-era or the 4.0.18 current definition binds
and returns its recorded text with its projections and timestamp preserved, while the
pre-refresh leg pins a live 4.0.18 definition still gating legacy adaptation (no silent
pass-through).
[4.0.7 -> 4.0.19] row, the direct [4.0.18 -> 4.0.19] row, three-leg chained census for
below-4.0.7 sources, the frozen-4.0.7 resume admission), and
pkg/tests/sqlintegration/TestCreateAccountCatalogInitializationandpkg/embed/catalog_view_identity_test.goderive their expected version from the registeredfinal (
GetFinalVersion), so renumbered vehicles no longer retire a version literal one byone.
Verification at the delivered head (repository CGo wrapper, real exit statuses in the round logs)
All green at the reworked head
61da7f8ef0: the full./pkg/bootstrap/...ladder(route/continuation/recovery/census, including the renamed vehicle's own
versions/v4_0_19suite and upstream's
versions/v4_0_18suite), the full./pkg/util/sysview,TestHistoricalViewColumnsSQLinpkg/sql/plan, the full./pkg/sql/plan/function,TestIssue30936*in./pkg/tests/issuesreplaying the three issue reproductions,TestCreateAccountCatalogInitialization|TestCollationsMetadataUpgradein./pkg/tests/sqlintegration, thepkg/embedcatalog identity pair + caller-owned continuationoracle, and the
pkg/frontendpublication oracle pair. The first full bootstrap pass at thishead also exposed that upstream's crossing-admission fixtures still modeled the upstream-only
route matrix; they were re-derived to this delivery's composed census (per design D13-7/D14-3,
no production change) and the focused rerun and full ladder rerun are green - the first-pass
failure is retained verbatim in the round logs as the fixture-round evidence. Earlier rounds'
receipts remain valid for the unchanged parts per the repository's evidence-reuse rules; the
distributed multi-CN BVT and hosted CI matrix remain CI work at the pushed head.
Residual risks
mergeStateStatus: BEHIND), with no file-level overlapagainst this PR's 37 files; freshness is left to the merge queue rather than a rebase.
to end (metadata,
SHOW CREATE TABLEand accepted values). This is the pre-existingattr_enumcomma-join catalog encoding (unchanged base behavior); the boundary isdocumented in the design note (sections 2.3/4.3/8), pinned by
TestInternalDeclaredLabelEncodingBoundaryOracleandTestIssue30936DeclaredLabelEncodingBoundary, and scheduled as a separate gatedcatalog-format follow-up.
completes, that account keeps serving its pre-correction (readable) values - the same
convergence timing every version-held correction has.