Repository navigation
fix(sysview): NULL charset/collation for binary-family columns and NULL UPDATE/CHECK time for fresh tables in information_schema - #31461
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? |
… and NULL UPDATE/CHECK time for fresh tables in information_schema
…tations with the NULL contract (matrixorigin#31160) information_schema.COLUMNS renders NULL charset/collation for the binary family after matrixorigin#31160. Align the suite with that verdict and with the subscription refresh convergence semantics: - sqlintegration: scan charset/collation as NULL-safe values and expect NULL collation after converting columns to binary. - upgrade view_description: before the V109/V118 refresh a subscriber still persisted on the historical V58/V100 COLUMNS text may project 'binary' for the binary family; assert per-column equality with the publisher for non-binary columns, constrain the raw column to the historical-or-refreshed projection with charset/collation consistency, and require the native refresh to converge to NULL. - BVT goldens: update only the binary-family charset/collation rows (binary -> null) in charset_collation_defaults_conversion, binary_string_function_semantics, binary_string_result_domain and func_string_soundex; verified against the real engine in both metadata-strict and -g -n modes on the 31160/31163 branch.
9487169 to
739b885
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: 739b885ba0ace79cbf4a739dbc102ae182bbbef6
Assessment: approve
Reviewed the complete delta, linked issues, discussion, historical compatibility and tenant-maintenance lifecycle. No actionable findings remain.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1
Validation:
-
Passed focused tests and complete sysview, bootstrap and bootstrap/versions package tests.
-
Passed TestDatabaseCharsetInheritanceContract and TestViewDescriptionSubscription through the SQL frontend.
-
A diagnostic overlay verified fresh metadata and actual background repair of pre-fix definitions in a final-version tenant, preserving text metadata and post-DML timestamp behavior.
-
Bootstrap passed under the race detector; the new CAS test passed 100 repetitions.
-
Verified native provenance, golden changes, clean source and discussion-ledger completeness. Commands, source fingerprints, exit receipts and retained logs are reconciled in attempt-1/validation-audit.json.
Limitations:
-
Author validation artifacts were unavailable and were not counted as verified execution.
-
No mo-tester, multi-CN scale or cross-binary restart run was performed. The repair probe used historical definitions seeded into a single-binary cluster.
🚫 Left the queue23 min in the queue, with no time running CI. So far
Reason Pull request #31461 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.
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. Merge conditions: 2 of 3 metThis pull request
The batch, tested in place
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:
Fixes #31160
Fixes #31163
What this PR does / why we need it:
#31160 —
information_schema.COLUMNSreturnedbinary/binaryin CHARACTER_SET_NAME/COLLATION_NAME for BINARY/VARBINARY/BLOB(-family) columns; per MySQL semantics these must beNULL/NULL(text family keeps utf8mb4). #31163 — freshly created tables showed non-NULLinformation_schema.TABLES.UPDATE_TIME/CHECK_TIME; these must beNULL(CREATE_TIMEstays non-NULL; views keepNULLas before).Implementation:
pkg/util/sysview/predefined.go— update the predefinedinformation_schema.COLUMNS/TABLESview SQL (binary-family → NULL charset/collation; UPDATE_TIME/CHECK_TIME → NULL).AdaptLegacyViewDefinitions,pkg/bootstrap/versions/information_schema_tables.go) shared by the planner snapshot path and bootstrap maintenance. Existing tenants keep their persisted view definitions, so updating only the predefined SQL (used at init) never repairs them.MaybeUpgradeTenantgates on version change, so no entry re-ran the CheckFunc, andInitSystemViewsis sys-only. Addedpkg/bootstrap/service_information_schema_columns_tables_maintenance.go: a post-upgrade maintenance pass that pages accounts (one txn per page), compares each tenant's persisted information_schema view definition by exact equality against the versioned-entry contract, and repairs only on mismatch. Error semantics (fail-fast, NOT per-account isolation): any account's CheckFunc/repair error aborts the pass — the page's singleExecTxnis rolled back, the account cursor is not advanced, and the error propagates to the caller (service_upgrade_tenantreturns it, surfacing as an upgrade error; the same page is re-scanned on the next trigger/restart). The protocol-gate abort is the exception and is swallowed as a normal rolling-upgrade retry (returns nil). The only per-account skip is the AccountGone path (account deleted mid-page: its remaining entries are skipped while the rest of the page still commits). Idempotent across restarts (persisted definition converges ⇒ 0 repairs, verified).test/distributed/cases/information_schema/binary_charset_meta.sqlandtables_time_defaults.sql; resynceddml/show/show.resultandtest/distributed/cases/zz_accesscontrol/account_restricted.resultSHOW CREATE VIEW expected metadata to the new persisted view definitions (visibility/ACL semantics unchanged).CI repair round (second commit,
739b885ba0):binary/binarycontract. Fixed here — product code unchanged:pkg/tests/sqlintegration/database_defaults_test.go— scan charset/collation NULL-safe (NullString) and expect NULL after converting columns to binary.pkg/tests/upgrade/view_description_test.go— subscription charset assertions made precise: before the per-tenant V109/V118 MODIFY_VIEW refresh, a subscriber still persisted on the historical V58/V100 i_s.COLUMNS text may legally project'binary'for the binary family (historical projections are byte-stable by design inAdaptLegacyInformationSchemaColumnsDDL); the test asserts exact per-column equality with the publisher for all non-binary columns, constrains the raw (varbinary) column to the legal pre-refresh states ('binary'or the refreshed NULL) with charset/collation consistency, and asserts the native refresh converges the subscription to NULL (rewriting any historical'binary'projection).charset_collation/charset_collation_defaults_conversion.result,dtype/binary_string_function_semantics.result,dtype/binary_string_result_domain.result,function/func_string_soundex.result.Validation (evidence:
/tmp/astra-meow-31160-31163-r20261027t051703/): the r4 local four-case mo-tester runs below (both the local-g -nruns and the strict META runs) used the private service running the binary built at the feature commit1849c7d804(build shad9f908f50740;make-build-head.out). Separately: PR HEAD is739b885ba0on top of upstreamd4ffbae43d; this second commit changes only 2 Go test files and 4.resultfiles — no product source. Other evidence items below carry their own binary identities as stated per item (the upgrade A/B binaries are from the 1231f06-era older tip; the earliest issue-specific BVT was recorded against the then-current fixed binary):'binary'literals,upg-p1-binarylit.count=1; non-NULL times) → cross-version restart on fixed binary: maintenance repairs triggered exactly once (upg-p2-repairs.count=2), persisted def clean (upg-p2-binarylit.count=0), binary family now NULL/NULL, text utf8mb4 preserved, table times NULL, view stays NULL, new-tenant control NULL → second restart idempotent (upg-p3-repairs.count=0). Raw phase files:upg-p1-*,upg-p2-*,upg-p3-*,run-upg.sh. Honesty note: the raw combined run (upgrade-run6.log) exited non-zero due to a harness oracle bug (awk/grep direction on NULL counts), not an engine failure; the corrected verdict on the raw per-phase files is reported as such, not as an original rc=0 run.TestDatabaseCharsetInheritanceContractrc=0 (ut-charsetcontract.out);TestViewDescriptionSubscriptionrc=0, pass=1 fail=0 (ut-viewsub2.out). Static:STATIC_CHECK_PACKAGES='./pkg/tests/upgrade ./pkg/tests/sqlintegration'→0 issues.rc=0 (static-cifix2.out), plus the 4-package static set rc=0 (static-post-rebase.out);-racebootstrap named set 6/6 pass, 0 data race (race-post-rebase.out).r4/report-*):dml/show/show.testtotal 189 / success 189 / failed 0 (mt2-show.out);zz_accesscontrol/account_restricted.sql126 / 125 / 0 failed / 1 ignored (pre-existing ignore flag, not counted as passed;mt2-acct.out).run.sh -g -n(the actual CI runner invocation could not be extracted from the job logs; this is a local compare-new-results run, not a verified CI-mode-equivalent one): charset 121/121, binary_string_function_semantics 157/157, binary_string_result_domain 25/25, func_string_soundex 75/75 — all rc=0 (r4/ng-*.out).show full columnsstatements (rows 26/45/121); the only delta is the result-set Field type-annotation headerField[1,0,0]vsField[12,-1,0]— row byte payloads are identical (evidence:r4/report-meta-charset/error.txt) and these exact statements passed in CI with the unchanged bytes, so the header annotations were deliberately NOT resynced (local mo-tester jar annotation drift). META is recorded here as rc=1 with this counter-evidence, not claimed as a pass.binary_charset_meta10/10 rc=0,tables_time_defaults9/9 rc=0.Limitations: A/B upgrade binaries built on the older base (semantic-equivalence evidence as described); META charset rc=1 with the Field-annotation explanation above (not a green result); account_restricted keeps its 1 pre-existing ignored statement; no whole-directory or whole-repo stress rerun.