Repository navigation
[4.2-dev] fix(plan): preserve replayable defaults and DUMP fingerprints - #32449
mergify[bot] merged 14 commits into
Conversation
Adapt main matrixorigin#31067 (4769417) while preserving the existing 4.2 DUMP schema fingerprint policy. Refs matrixorigin#31066.
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
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: 30295d25dfc032e6b4966648b907a5fe321d3075
Assessment: request_changes
The shared renderer and separate historical-default hash policy are a proportionate design and preserve the 4.2 archive fingerprint. However, two NO_BACKSLASH_ESCAPES consumer paths regress: the public SHOW CREATE result consumes backslashes through its outer SELECT, and CREATE LIKE reparses ordinary-mode enum spellings with a different mode. Both require correction despite successful frozen-head CI.
Model: gpt-6.1-sol / max
Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0
-
P2
pkg/sql/plan/build_show_util.go:219: Run SHOW CREATE TABLE in a NO_BACKSLASH_ESCAPES session for a column whose default contains backslashes, then replay the actual returned text.
Impact: The new renderer emits literal backslashes, but buildShowCreateTable embeds that text in a double-quoted SELECT and returnByRewriteSQL/getRewriteSQLStmt still parse that SELECT in ordinary mode. That extra parse consumes the backslashes (for example two literal backslashes become one; a single backslash before t becomes a tab), so the displayed and replayed default changes. Preserve the rendered DDL through the outer result construction and add a public SHOW CREATE/replay regression; the current tests call ConstructCreateTableSQL directly and miss this step.
Evidence: build_show.go:145-168,1114-1121,1167-1175; pkg/sql/parsers/sqlparse.go:30-35; tree/constant.go:190-224. display-probe.log executes the production NumVal formatter, outer SELECT assembly and scanner, with a baseline legacy-rendering control and a plain-string control: baseline replay preserves the original, candidate replay loses a backslash. Extraction inputs are in probes/display-probe-inputs.json; successful check receipt checks/1794288052177486003-5.json. This is a component reproduction plus caller source trace, not a server test. -
P2
pkg/sql/plan/build_show_util.go:93: Create a table with an enum member containing newline, carriage return or NUL, then execute CREATE TABLE copy LIKE source under NO_BACKSLASH_ESCAPES.
Impact: Changing the parser mode for the entire reconstructed CREATE changes fields that have not been rendered for that mode. FormatColType still calls EscapeFormat, which emits newline/CR/NUL as backslash-n/backslash-r/backslash-0; the new parser treats those as literal characters. CREATE LIKE then rebuilds the table from that AST and silently changes its enum domain. Make these fields mode-correct, or preserve a canonical AST independently of display-mode rendering, and cover this cloning path.
Evidence: build_show_util.go:179-183,1115-1157,1495-1514; build_ddl.go:986-1004 consumes the returned AST; build_util.go:277-284 stores enum members without SQL escaping. mode-probe.log uses exact EscapeFormat and scanner source functions: ordinary-mode baseline preserves all three characters, NBE candidate changes all three, and the plain member control is unchanged. Input fingerprints: probes/mode-probe-inputs.json; receipt checks/1794287930970230385-3.json. Source comparison in review-audit.log confirms these formatter functions and baseline rewrite parser are otherwise unchanged.
Validation:
-
Complete seven-file delta, affected canonical-default owner, SHOW CREATE/CREATE LIKE/ALTER COPY consumers and persisted DUMP/LOAD hash boundary reviewed against the frozen base. All two discussion keys assessed in discussion-assessment.json; linked issue #31066 and all three linked comments read.
-
Frozen evidence.json eligibility_snapshot at the assessed head records UT Test on Ubuntu/x86, UT Coverage, two multi-CN BVT configurations and CI Required SUCCESS. run_ut.sh includes pkg/sql/plan and pkg/frontend; skipped upgrade/Python jobs were not counted as passes.
-
Local isolation preflight passed: preflight.log and checks/1794287765108757442-4.json. Repository CGo test wrapper stopped before compilation for missing libmo.so: focused-tests.log and checks/1794287819218718247-3.json (exit 1, environment setup failure).
-
Two extracted production-component probes, executed with the supplied test-exec, confirmed the mode regressions against baseline and unaffected controls: mode-probe.log and display-probe.log, receipts checks/1794287930970230385-3.json and checks/1794288052177486003-5.json. Their PASS means the expected mismatch was reproduced, not that product behavior passes.
-
Final source, extraction fingerprints, discussion coverage and command/source/exit receipts audited successfully: review-audit.log and checks/1794288113160661686-5.json. Frozen HEAD remains clean.
Limitations:
-
No local full planner/frontend package execution: the read-only checkout lacks native prerequisites. Component probes do not execute a planner or server; broader validation is reused from the frozen CI snapshot.
-
The PR body describes targeted mo-dump acceptance as still in progress; its completion is not established by the supplied evidence. Linked main-branch results are contextual and were not treated as execution evidence for this backport.
|
mo-bot review · Commit: Review linked issue or PR description changed before publication; a fresh contextual review is queued. |
|
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: f2a891e2797de1be0441c4b2a82e7209843b7310
Assessment: request_changes
One NO_BACKSLASH_ESCAPES external CSV COMMENT replay regression remains. The shared renderer and separate historical 4.2 hash policy are proportionate, and the previously published findings are resolved.
Model: gpt-6.1-sol / max
Session: 01a1a004-9884-72c0-ad39-f096c4209c4a · slot 1 · generation 0
- P2
pkg/sql/plan/build_show.go:151: Under NO_BACKSLASH_ESCAPES, SHOW CREATE a CSV external table whose three-byte COMMENT marker consists of #, a backslash and t, then replay the returned DDL.
Impact: The marker gains a second backslash. The recreated table stops skipping the original comment lines, changing query results or causing CSV conversion errors. Preserve the corrected outer SELECT transport, pass the target mode through external-option formatting, reuse formatDDLString and add a public SHOW/replay regression.
Evidence: build_show_util.go:798,1431,1458 still formats option values with ordinary-mode formatStrLit. The changed outer SELECT preserves both backslashes; mysql_sql.y:10036 retains them under NO_BACKSLASH_ESCAPES. build_ddl.go:5571 permits this marker, and external/types.go:483 passes it to csv_parser.go:679 for literal prefix matching. Reused exact-head/base mode-probe.log confirms baseline success, candidate mismatch and passing plain controls; review-audit.stdout.log verifies source/input/receipt identity.
Validation:
-
Reviewed the complete twelve-file delta, affected owners/consumers and supported DUMP/LOAD hash boundary. discussion-assessment.json covers all eight discussion keys; linked #31066 and all three comments were assessed.
-
Reused retained execution at this exact head/base after verifying identical patches, scanner/token inputs and extracted production formatter/transport fragments. reused-evidence/mode-probe.log and receipts/1794541933934814156-3.json record completed exit 1: baseline COMMENT replay passes, candidate fails, plain controls pass. Retained isolation preflight exited 0.
-
Current-head evidence.json records successful shared build, Ubuntu UT/coverage, arm64 SCA and PROXY/PESSIMISTIC multi-CN BVT. Fourteen successful checks were distinguished from thirteen skipped and two neutral checks.
-
Current source/evidence/discussion audit and Go/SQL diff whitespace checks passed: review-audit.stdout.log, empty review-audit.stderr.log and checks/1794543768353025300-2.json, exit 0. Frozen source remains clean.
Limitations:
-
The reused counterexample executes extracted production formatters/scanners, with current planner/grammar/CSV source tracing; it is not a full planner or server run. Its separate synthetic PROPERTIES failure is excluded because production catalog reachability was not established.
-
No fresh Go package, embedded-server, BVT or 10G mo-dump run was performed. Broad validation reuses the supplied current-head CI; older-head author tests and pending acceptance are not counted as candidate passes.
|
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: abbc33deb8486da83296bd5915db77ec82a2c47b
Assessment: request_changes
The shared renderer and separate historical 4.2 hash policy are proportionate, and the previously published findings are resolved. NO_BACKSLASH_ESCAPES replay still corrupts Kafka WITH option literals.
Model: gpt-6.1-sol / max
Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0
- P2
pkg/sql/plan/build_show_util.go:780: Create a Kafka CSV external table with a one-character backslash separator, then SHOW CREATE and replay its output under NO_BACKSLASH_ESCAPES.
Impact: The separator becomes two backslashes. Recreating the table fails ParseTableOptions' single-character separator validation, breaking SHOW-based schema replay.
Evidence: formatKafkaTableOptionsForShowCreate still uses ordinary-mode formatStrInSingleQuotes at line 1370, while the changed parser and outer SELECT preserve that doubled spelling. build_ddl.go:1233 accepts and persists the original option; pkg/sql/kafka/config.go:148 rejects the replayed two-rune value. mode-probe.stdout.log and probe-inputs.json execute current/base production formatter, transport and scanner fragments: baseline NBE replay preserves one rune, candidate has two, and plain controls pass. Render engine WITH literals for the target mode using existing formatDDLString and add a public SHOW/replay regression.
Validation:
-
Reviewed the complete twelve-file delta, affected SHOW/CREATE LIKE/ALTER COPY and DUMP/LOAD contracts, all ten discussion entries and linked issue context.
-
Isolation preflight passed. The Go component counterexample ran with the supplied test-exec; its PASS confirms the expected candidate mismatch, baseline NBE success and plain controls. Receipt: checks/1794548803960224985-3.json; mode-probe.stdout.log and probe-inputs.json.
-
Frozen CI snapshot reports 14 successful, 13 skipped and 2 neutral checks, including Ubuntu UT/coverage, arm64 SCA and enabled multi-CN BVT.
-
Source, patch, discussion coverage and receipt audit retained in review-audit.json and review-audit.stdout.log.
Limitations:
-
The local counterexample uses extracted production components and source-traced planner/config consumers; it is not a full planner or networked SQL execution.
-
No local native owning-package, BVT or 10G mo-dump run was performed. Older-head author and main-branch results were kept separate from candidate validation.
|
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: 4329992206c0f67a44ff23bcc340fe1a0c5e1c39
Assessment: approve
The mode-aware renderer resolves the prior SHOW/replay defects, while the separate legacy policy preserves existing 4.2 DUMP fingerprints. Shared parser and literal-formatting owners keep the solution proportionate. No actionable findings remain.
Model: gpt-6.1-sol / max
Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0
Validation:
-
Reviewed the complete 15-file delta, affected consumers, all 12 discussion entries and linked issue31066 with its three comments. All four prior reviews are resolved in discussion-assessment.json.
-
Isolation preflight passed. Six extracted-production formatter/scanner Go tests passed using the assigned test-exec on Go1.26.6/linux-amd64, with frozen-base and unaffected controls: component-tests-final.jsonl; checks/1794559779168723273-2.json.
-
Changed-Go formatting, Go/SQL whitespace and final source/receipt audit passed. review-audit.log, checks/1794560093845360030-2.json and validation-summary.json reconcile commands, fingerprints, exits, logs and earlier reviewer harness diagnostics. Source remains unchanged.
-
Reused successful exact-head CI reports for shared build, Ubuntu UT/coverage, arm64 SCA and enabled PROXY/PESSIMISTIC multi-CN BVT.
Limitations:
-
Local native planner validation stopped before compilation because libmo.so is unavailable. Component checks do not execute the full planner or server; broader native validation relies on supplied CI statuses, whose raw test/case logs were unavailable.
-
No local embedded-SQL, standalone BVT or 10G mo-dump acceptance run was performed. The PR describes targeted mo-dump acceptance as pending; older-head author tests and main-branch results were not counted as candidate passes.
✅ Merged into
|
What type of PR is this?
Which issue(s) this PR fixes
Backport of #31067 for #31066 on
4.2-dev.Why
128 nightly run 42641191428, MO
ba2a0caee86dd0f660776560a2a68943abb11df2, passed the actual TPCH 10G dump/import row and schema checks, but failed the independent post-restore default-value oracle: apostrophes and backticks were doubled after replaying SHOW CREATE TABLE.Branch-specific backport
Originally based on
4.2-dev@bf15b1c7a82e1801fb0a34f234b77d92d6766606, subsequently synchronized by Mergify to9dd4d33e2bf3353ac66f62105f9093c8032e6ed2; adapted from main commit4769417cdce5531c9771644eca49f1e71d8f654crather than importing unrelated main-only charset/DDL infrastructure.Validation
git diff --checkfor Go/SQL passed. The copied upstream BVT.resultdeliberately preserves trailing spaces for its empty-string output column.30295d25dfc032e6b4966648b907a5fe321d3075, the following focused tests passed with-count=3on macOS arm64 / Go 1.26.5:TestShowCreateTableStringDefaultRoundTripTestDefaultWithoutBackslashEscapesRejectsInvalidScalarTestAlterCopyDefaultUsesInternalParserModeTestTableDumpDefaultHashesPreserve42TestTableSchemaHashIgnoresIdentity,TestTableSchemaHashExpandsCreateLike,TestTableSchemaHashFallback-ldflags=-wonly to omit local test-binary debug symbols. No product build flags, assertions or timeouts were weakened. Native dependencies came from the existing local MatrixOne build. The BVT file has been backported but not independently executed yet.30295d25dfc032e6b4966648b907a5fe321d3075fromAriznawlll/matrixone, regression workflowmain@d00e9351280da05a4d7f88e059a60e6c77a9e8f0,Run_Mode=modump-only. It covers default-value SQL dump/restore plus TPCH 10G nation/customer/orders export, ordinary-tenant import, full row/schema checksums and owner-scoped cleanup. Status: in progress, not yet accepted.Remote verification results will be linked when available. Remote acceptance is pending; this is not a claim that the PR or mo-dump run is fully green.