Repository navigation
Conversation
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: 117bfe8c250a2cf79eec227ef1599ba7b1448820
Assessment: request_changes
Reviewed the complete five-file delta and affected callers. The mode-aware comment escaping is sound, but it changes persisted DUMP schema fingerprints without preserving compatibility.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1586-7a01-9000-d45e20995cf8 · slot 1 · generation 1
- P1
pkg/sql/plan/build_show_util.go:1680: Create a DUMP TABLE archive before this change for a table with backslashes in a column or table comment, then upgrade and LOAD it into an identically defined empty table.
Impact: Existing archives are rejected with "target table schema does not match table dump" despite unchanged metadata. Preserve legacy fingerprint compatibility alongside the escaping fix, and add a pre-fix archive/current-version LOAD regression.
Evidence: pkg/frontend/table_dump.go:357–367 hashes ConstructCreateTableSQL output; DUMP persists that hash at line 1290, and LOAD requires exact equality at lines 1722–1723 without a fallback. Hashing uses a nil compiler context, so the new helper doubles backslashes. The source-extracted probe confirms changed fingerprints for both column and table comments, while quote-only, plain and empty controls remain unchanged.
Validation:
-
Isolation preflight passed: checks/1792911898139249946-2.json matches preflight.log.
-
The source-extracted formatter/scanner probe passed 40 round-trip cases across four SQL-mode configurations and five fingerprint controls. Receipt checks/1792912003112957379-2.json matches comment_probe.log, exit 0 and the assigned executor.
-
Commands, source/artifact fingerprints, logs and clean checkout status were independently reconciled. Evidence and review notes are retained under /home/xupeng/.local/state/mo-bot/jobs/ab16a8df77e65f1e0e6859ba/attempt-1.
-
Frozen exact-head evidence records successful UT, SCA, coverage and proxy/pessimistic BVT checks; local_validation is empty.
Limitations:
-
The probe executes extracted formatter/scanner code with fixture scaffolding, not production DUMP/LOAD. The rejection follows from the reviewed production call chain; no cross-version server restore was executed.
-
Native package tests were not rerun, and raw CI logs were not supplied.
-
Rendering adds SQL-mode parsing and linear comment escaping work, bounded by existing comment limits. Ordinary SELECT/DML is unaffected; no performance benchmark was run.
…igin#31068) Column and table comments are stored with quotes already doubled but backslashes raw, so SHOW CREATE TABLE printed C:\dir\new as 'C:\dir\new' and replaying it changed the comment. Escape backslashes unless NO_BACKSLASH_ESCAPES is set.
|
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: 089fd2e28f46204ddef9ec8393f0a2fd9bca1bab
Assessment: approve
Reviewed the complete 15-file delta and affected callers. The previous DUMP compatibility finding is resolved: one shared planner implementation now distinguishes replayable SQL from historical schema-hash input, preserving strict LOAD validation. Comment escaping respects SQL mode and existing quote encoding without mutating metadata. The design is proportionate, and no actionable defects remain.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1
Validation:
-
The independent static audit passed: checks/1792951857477887056-4.json matches review-audit-final.log, exit 0, the assigned head and a clean source checkout. It verified legacy reconstruction-body equivalence to the base, four Go source fingerprints, module/config identities, fixture integrity and retained evidence consistency.
-
Verified all four legacy archive files against recorded producer hashes and manifest object sizes: 3,884 bytes total. Reviewed the embedded cross-version SQL transcripts covering old-to-new and new-to-old LOAD, row/comment/index preservation, and five schema-mismatch rejections leaving targets empty.
-
Reconciled source history with retained normal/race package records and focused regression selection. Reviewed normal BVT reports for the changed case, comment group and same-instance repeat: 32/32, 106/106 and 32/32, with teardown checks. These are reused author records, not newly executed tests.
-
The frozen exact-head CI snapshot records successful shared build, UT, SCA, coverage, proxy BVT and multi-CN BVT. Skipped upgrade checks were not counted as passes.
-
Detailed review and receipt mapping are retained under /home/xupeng/.local/state/mo-bot/jobs/ed2391dd0d914246a3aa6c83/attempt-1/review-record.json. The initial audit-script key error is preserved separately and is not a product failure.
Limitations:
-
No native tests or server processes were run locally. Original author binaries and full raw Go/lint/service logs are unavailable; verification used committed transcripts, terminal records, source identities, immutable fixtures and the frozen CI snapshot. Raw CI logs were not supplied.
-
No performance benchmark was run. Additional work is limited to SQL-mode parsing and linear comment escaping during reconstruction; ordinary SELECT/DML paths are unchanged, and schema hashing bypasses escaping.
Merge Queue Status
This pull request spent 1 hour 27 minutes 15 seconds in the queue, with no time running CI. ReasonPull request #31069 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.
HintYou 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. Waiting for any of
All conditions
Tick the box to put this pull request back in the merge queue (same as
|
…ions Main already carries the production repair for matrixorigin#31068: the merged PR matrixorigin#31069 renders stored column/table comments with backslashes doubled for replay (verbatim under NO_BACKSLASH_ESCAPES) through ConstructCreateTableSQL, keeps the historical raw spelling for persisted DUMP fingerprints via ConstructCreateTableSQLForSchemaHash, and pins the display and legacy-archive regressions with its own UT and BVT. Rebase this branch onto that fix: the duplicate production changes and the signature churn of the private constructCreateTableSQL parameter are dropped in favor of the merged implementation, while the regression coverage this branch developed stays, adapted to the merged API: - pkg/sql/plan/show_create_comment_backslash_replay_test.go: catalog-stored comment bytes pinned across default and NO_BACKSLASH_ESCAPES modes including plain, empty, trailing-backslash and quote-adjacent columns; rendered fragment asserts plus their negation, replay idempotence, non-mutation of the input TableDef, and single-literal transport re-parsing. - pkg/frontend/table_dump_comment_fingerprint_test.go: the frozen pre-fix schema and logical-index fingerprints for backslash comments, old-manifest acceptance after the escaping fix, and corrupted-comment/altered-type mismatch controls on tableDumpRelationSchemaMatches. - comment_backslash_roundtrip BVT: replay SHOW output with both-column hex asserts, the NO_BACKSLASH_ESCAPES and plain-comment controls, merged with the upstream legacy dump-fixture and metadata-only DUMP/LOAD blocks. Related to matrixorigin#31068
…ions (#31143) ## What type of PR is this? - [ ] API-change - [ ] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [x] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Related to #31068 ## What this PR does / why we need it: The production repair for #31068 has already merged into `main` as #31069: stored column/table comments keep their already-doubled quotes and get their backslashes doubled for replay while backslash escapes are active (verbatim under `NO_BACKSLASH_ESCAPES`), and the persisted `DUMP` schema fingerprints keep hashing the historical raw comment spelling through `ConstructCreateTableSQLForSchemaHash`. While that merged upstream, this branch had independently developed the same regression theme. This PR rebases onto the merged fix, drops the duplicate production implementation in favor of the merged one, and keeps the complementary regression coverage this branch produced, adapted to the merged API: - `pkg/sql/plan/show_create_comment_backslash_replay_test.go` (new): pins the exact catalog-stored comment bytes through render+replay in both SQL modes for plain, empty, trailing-backslash and quote-adjacent columns, asserts the rendered fragments plus their negation, requires replay idempotence (re-rendering is byte-stable), non-mutation of the rendered `TableDef`, and that the displayed DDL survives single-literal transport encoding. - `pkg/frontend/table_dump_comment_fingerprint_test.go` (new): freezes the pre-fix schema and logical-index fingerprints for a backslash-comment fixture, accepts an old manifest (legacy fingerprint) for an unchanged table after the escaping fix, and rejects genuine mismatches: the corrupted comment bytes the pre-fix bug produced and an altered column type. - `test/distributed/cases/comment/comment_backslash_roundtrip.sql` + `.result`: replay `SHOW CREATE TABLE` output with `information_schema` hex checks on both columns plus the table comment in both SQL modes, the plain-comment control and the `NO_BACKSLASH_ESCAPES` controls, merged with the upstream immutable legacy dump-fixture LOAD and metadata-only DUMP/LOAD fingerprint-mismatch blocks. The case owns and drops its database and stages, so it is re-runnable, and it saves the incoming `sql_mode` into a user variable around its `NO_BACKSLASH_ESCAPES` control block and restores it afterwards (the pattern `information_schema.sql` and `table_func_json_table.sql` already use), so the shared mo-tester session is left in its incoming state for every later script of the same BVT generation. All production behavior now comes unchanged from `main`; this PR is test-only. ## Validation All verification ran on the rebased tree `07876cfdab` = `origin/main@b160a38` (which already contains merged #31069) plus this commit; the produced binary contains CommitID `07876cfdab` (sha256 `968e0617...`). CGo test runs use the repository `mo-cgo-test` wrapper. - `go test -list` selection proof: `TestShowCreateTableCommentBackslashStoredByteRoundTrip`, `TestShowCreateTableCommentIsNotMutated`, `TestShowCreateTableCommentTransport` (new in `pkg/sql/plan`), the merged upstream `TestShowCreateTableCommentBackslashRoundTrip`, and `TestDumpSchemaHashKeepsLegacyBackslashCommentSpelling`, `TestOldDumpManifestMatchesUnchangedTableAfterCommentEscapingFix` (new in `pkg/frontend`) plus the upstream `TestTableSchemaHashStoredCommentCompatibility`, `TestTableSchemaHashStillRejectsCommentAndSchemaDifferences` all listed (non-empty selection). - `go test -run 'TestShowCreateTableComment' ./pkg/sql/plan` - ok 2.527s, exit 0 (replay round trip in both sql modes, fragment/negation asserts, idempotent re-render, non-mutation, transport re-encode). - `go test -run 'TestDumpSchemaHashKeepsLegacyBackslashCommentSpelling|TestOldDumpManifestMatchesUnchangedTableAfterCommentEscapingFix|TestTableSchemaHashStoredCommentCompatibility|TestTableSchemaHashStillRejectsCommentAndSchemaDifferences' ./pkg/frontend` - ok 7.847s, exit 0. The pre-fix fixture fingerprint stays `d0f7fd53926c805dd05af3d5dcd2f4f148d8861d539db9a7490aa77e07b061bd` under the merged `ConstructCreateTableSQLForSchemaHash` path (schema and logical-index hashes), an old manifest still matches an unchanged table, and corrupted-comment/altered-type mismatches are still rejected. - Owning packages in normal mode: `go test ./pkg/sql/plan` - ok 256.339s exit 0; `go test ./pkg/frontend` - ok 54.640s exit 0. - BVT on an isolated single-node instance (fresh runtime, separate port plan): `genrs` regenerated `comment_backslash_roundtrip.result` byte-identical to the committed file (zero-diff, every row reviewed against the union of the two upstream expectations); normal comparison run 42/42 exit 0; same-instance repeat run 42/42 exit 0; full `test/distributed/cases/comment` group 116/116 exit 0 (`annotion` 18, `comment` 56, `comment_backslash_roundtrip` 42, mo-tester `error.txt` empty). The legacy `$resources` dump fixture loads with rows intact, `FORCE INDEX` is honored, `LOAD` rejects the changed-schema target with `target table schema does not match table dump` and the mismatched table stays empty. Post-run teardown verified: `comment_bs_rt` database, both stages, `/tmp` metadata files all absent; the instance was stopped with SIGTERM and confirmed exited with its listeners released. - Static: `gofmt -l` on all changed Go files - clean; `go vet` and `go vet -vettool=molint` on `./pkg/frontend ./pkg/sql/plan` with the repository CGo environment - exit 0; `golangci-lint run -c .golangci.yml --new-from-rev origin/main` on the two packages - 0 issues (see golangci-rebased log). ## Follow-up (2026-10-26): fix the compose-proxy BVT failure this branch introduced CI run [40232128784](https://github.com/matrixorigin/matrixone/actions/runs/40232128784) ('multi cn e2e bvt test docker compose(PROXY)') failed exactly 2 of 49746 statements, both in `test/distributed/cases/cte/local_outer_reference.sql` (rows 379/382) with `correlated columns in aggregate function is not yet implemented`; every other script in the generation stayed green, including `comment_backslash_roundtrip.sql` itself (42/42). Root cause: the case's `NO_BACKSLASH_ESCAPES` control block ended with `set sql_mode = ''`, mo-tester reuses one session for every script of a generation (CI log shows `con[id=0]` throughout), so the CTE case and everything later lost `ONLY_FULL_GROUP_BY`. `pkg/sql/plan/having_binder.go` only rebinds correlated columns in aggregate/HAVING predicates under `mysqlFullGroupByCompat`, which requires `ONLY_FULL_GROUP_BY` in `sql_mode`; without it the binder returns the NYI error. Commit `57f93b5873` therefore saves the incoming `sql_mode` before the block and restores it afterwards. The same run's `UT Coverage` failure (`TestCrossTargetUpgradeRecovery/manual-4.0.13`, pkg/embed upgrade-recovery budget flake) is the known family flake tracked in #31044 and is unrelated to this test-only diff. New verification for `57f93b5873` ran on a fresh isolated instance of the same produced binary (`07876cfdab`; `57f93b5873` changes only the two comment BVT files, so production behavior is identical): - Direct session probe on the same binary: the controlled statement returns the expected rows (1|1, 2|NULL, 3|0) under the platform default `sql_mode` (`ONLY_FULL_GROUP_BY,...`), fails with the exact NYI error under `sql_mode=''`, and passes again after the save/restore pattern. - Ordered pair through mo-tester (CI compare semantics: `$resources` mapping + `nometa`), exactly as the CI group orders them: pre-fix reproduction = `comment_backslash_roundtrip.sql` 42/42 and `cte/local_outer_reference.sql` 266/268 with only rows 379/382 failing (mo-tester exit 1); post-fix = comment 43/43, cte 268/268, 311/311 and exit 0. - `genrs` on the fixed case regenerates `comment_backslash_roundtrip.result` byte-identical to the committed file (zero-diff). - Full `test/distributed/cases/comment` group with metadata comparison on: 117/117 exit 0 (`annotion` 18, `comment` 56, `comment_backslash_roundtrip` 43). ## Residual risk - The case writes DUMP metadata to `/tmp/mo-comment-backslash-roundtrip-31068/` and removes it again in the same script (`remove files from stage ...`), the same path and cleanup the merged upstream case already carries. - No CI, workflow, or configuration files are touched; the diff is limited to the two new UT files and the reworked comment BVT case. --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: XuPeng-SH <[email protected]>
Resolve table_dump.go conflict with matrixorigin#31069: a single ConstructCreateTableSQLForSchemaHash now keeps both legacy comment bytes and legacy string-default bytes for DUMP fingerprints.
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #31068
What this PR does / why we need it:
SHOW CREATE TABLE must preserve backslashes when its column/table comments are replayed. Stored comments already double single quotes but keep backslashes raw; escape those backslashes in default SQL mode while retaining literal backslashes under NO_BACKSLASH_ESCAPES.
Preserve DUMP/LOAD compatibility at the same time. DUMP persists a SHA256 of reconstructed schema text, so changing comment display bytes originally made old archives fail LOAD despite identical metadata. A dedicated hash-only planner entry retains the historical column/table COMMENT representation; ordinary SHOW/replay and manifest DDL keep the corrected escaping. Index/default quoting, archive versions, existing normalization/fallbacks and strict LOAD comparisons are unchanged. Changed comments, types and defaults remain mismatches.
Rebased onto frozen main
12eeeb0205b5e87faef48660ddbcd8cb5e18baea. Production repair is4c797463ad; subsequent Go changes only release test-owned ASTs.Regression and compatibility evidence
0357a0ede5ef359080f54e141cda3556a1dd789ae980566e6a2aa89146af87cd. Old archive files remain byte-for-byte unchanged.pkg/sql/planandpkg/frontendnormal/race validation passes, including changed regressions. Three unrelated existing skips are explicitly excluded from pass counts. The first planner race attempt hit a 30s deadline in an unchanged view-schema test; the baseline focused check and final complete planner race pass. That first attempt is not counted as a package pass or claimed to prove a pre-existing defect.Reproduction and retained evidence include source/binary/native identities, exact commands, old/new archive manifests, SQL receipts, BVT reports/cleanup and test selections. Initial harness/index-flush/startup preflights are explicitly excluded. New-head GitHub CI has not been evaluated and is not included in local pass claims.