Repository navigation
fix: stabilize floating BIT_COUNT conversion across plans and upgrades - #32920
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? |
|
This pull request is merged. |
|
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: 33438a14ca0e6e8e0d125330007ee60bba7a7187
Assessment: request_changes
The new overloads reuse the existing unary executor for FLOAT and DOUBLE field rounding. The planner also applies rounding to an explicit cast when the same cast appears in GROUP BY, breaking the existing truncation behavior.
Model: gpt-6.2-sol / xhigh
Session: 01a1ee80-0d82-7030-a965-b51f496c3054 · slot 2 · generation 1
- P2
pkg/sql/plan/bit_count.go:74: Run SELECT BIT_COUNT(CAST(g AS DOUBLE)) FROM t GROUP BY CAST(g AS DOUBLE) with a FLOAT value of 3.9.
Impact: The grouped call yields 1 where the explicit cast requires 2. The same overload selection can change which groups pass a HAVING predicate.
Evidence: projection_binder.go:59 replaces the cast with a group-key reference. The projection binds before the aggregate node registers that reference, so the fallback at bit_count.go:74 selects the field overload. That overload rounds to 4 before counting, while the cast overload truncates to 3. Resolve same-block group keys through their bound producer before choosing the overload, and cover the grouped cast in the existing BIT_COUNT fixture.
Validation:
-
The frozen patch and discussion ledger matched. git diff --check and the private /tmp and loopback preflight passed.
-
A source trace and arithmetic check verified overload selection and the differing counts. The retained commands, logs, and exits are indexed in validation-reconciliation.json.
Limitations:
-
The local Go probe timed out during dependency downloads before tests started. The finding is based on source analysis.
-
The BVT evidence consists of the author's report. The frozen CI snapshot still showed relevant checks in progress.
|
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: 901e346349045d3ea8193fa630d515ffbf432470
Assessment: request_changes
The revision fixes the earlier GROUP BY and HAVING concern and reuses the existing unary executor. The binder still selects truncation for a floating column read from a derived table that MySQL materializes because its SELECT list contains a dependent subquery.
Model: gpt-6.2-sol / xhigh
Session: 01a1f0a0-5126-78f3-9ab8-ef4e87f2f119 · slot 0 · generation 3
- P2
pkg/sql/plan/bit_count.go:88: Read BIT_COUNT(x) from a derived table that projects CAST(d AS DOUBLE) AS x and also projects a dependent scalar subquery. The retained fixture uses a correlated MAX for the second projection.
Impact: For d = 3.9, the candidate selects the truncating overload and yields 2. MySQL 8.0.45 materializes the derived table and yields 1. A filter on that count can select the wrong rows.
Evidence: mysql-probe-final.log records the SQL results and the Materialize node. focused.log records the candidate selecting overload 9, and execution-probe.log confirms that overload returns 2. Preserve the dependent-subquery materialization boundary during binding and retain the ordinary merged CAST as a control. MySQL 8.0 derived-table optimization
Validation:
-
Private /tmp and loopback preflight, the native CGo build, and git diff --check passed with matching receipts.
-
Full normal tests passed for pkg/sql/plan and pkg/sql/plan/function. Focused probes verified overload selection for grouped SELECT and HAVING, plus prepared field rebinding.
-
The isolated MySQL 8.0.45 run confirmed the dependent-subquery mismatch and the expected results for ordinary merged, LIMIT-materialized, direct-field, and grouped-cast controls.
Limitations:
-
The local MatrixOne counterexample was verified through SQL binding and execution of the selected unary overload. The author supplied the full MatrixOne BVT and race results.
-
The frozen CI snapshot showed the build and unit checks still in progress.
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: a82a85d57cea887eb51bc026e083f93751112785
Assessment: request_changes
The append-only overloads preserve released BIT_COUNT IDs and reuse the existing executor and restore verifier. Release-qualified recovery still rejects compatible native-column schemas, and the newly expanded restore paths lack traceable current-head execution evidence. The discussion proposal to remove floating-point BIT_COUNT remains a product-scope dispute against the linked behavior and compatibility requirements.
Model: gpt-6.1-terra / max
Session: 01a237a3-bad5-7892-956a-029e09cf4554 · slot 2 · generation 21
-
P2
pkg/frontend/table_dump.go:2761: Restore a verified v4.2.8 physical v1 archive for a table containing an unrelated JSON or supported vector column alongside a generated BIT_COUNT(CAST(d AS DOUBLE)) column.
Impact: The qualified load rejects the schema before comparing its fingerprint. An ordinary v1 load cannot establish the historical floating binding, so this compatible archive has no supported recovery path.
Evidence: The new admission switch excludes JSON and arrays, while tableDumpV1CollationIndependent at line 2648 already accepts them as native columns when their expressions are collation-independent; existing released-schema tests cover those layouts at pkg/frontend/table_dump_test.go:2256. Extend the qualified schema proof to compatible JSON/vector columns while retaining fingerprint and object validation, and add a restore regression. -
P2
pkg/tests/sqlintegration/bit_count_v428_dump_test.go:301: The new v4.2.0 and v4.2.7 attestation, temporal layouts, and signed-operand reconstruction are assessed at this head.
Impact: The required public restore and subsequent-write behavior is not established by the supplied execution evidence for these newly changed paths.
Evidence: The frozen local_validation is empty, relevant CI was pending or skipped, and earlier reported runs predate the latest changes. The local Go attempt timed out downloading Go 1.27.1 before compilation (checks/1796232514937714528-3.json and go-test.log). Obtain a traceable passing result for the existing TestLoadReleasedBitCountNativeAndSignedArchives test at this head, including its LOAD, INSERT, and UPDATE assertions. -
P3
pkg/frontend/table_dump.go:3019: An operator follows the guide using the verified source label v4.2.8-hotfix-20261114 for an archive written by that hotfix.
Impact: The exact hotfix label is rejected, and the guide does not state whether the v4.2.8 GA label is the correct compatibility attestation for that archive.
Evidence: The guard accepts only GA labels. The v4.2.8 and v4.2.8-hotfix-20261114 tags have identical dump writer, schema renderer, binder, registry, and BIT_COUNT implementation blobs (checks/1796232825819728769-3.json and source-audit.log). Accept the verified hotfix label or explicitly document its GA compatibility mapping; also align the guide with the newly accepted v4.2.0–v4.2.7 labels.
Validation:
-
Isolation preflight passed; checks/1796232446368248502-3.json and preflight.log.
-
The assigned patch matched the frozen merge-base/head diff, and git diff --check passed; patch-audit.log and diff-check.log.
-
Verified 22 fixture manifests and 25 object sizes and SHA-256 digests; fixture-audit.log.
-
Verified the API descriptor is unchanged and the plan descriptor adds only Literal.float_conversion_source field 31; descriptor-audit.log.
-
Verified all 80 discussion keys are accounted for exactly once and reconciled eight command receipts with their logs; reconciliation.log and validation-reconciliation.json.
Limitations:
-
No Go or SQL tests executed locally: the required Go 1.27.1 toolchain download timed out before compilation. This is an environment limitation, not a product-test failure.
-
The PR reports earlier SQL, race, released-archive, and stopped-upgrade runs, but matching current-head logs were not supplied. A live MySQL comparison and stopped upgrade were not rerun.
|
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: 3cc7bc8861fcefbd6f31bd731af71bc35f0dfe8a
Assessment: request_changes
Release-qualified v1 restore still excludes compatible text-bearing tables and verified 4.2 hotfix labels. The append-only overloads reuse the existing executor and preserve released bindings. The previously reported JSON/vector, v4.2.8 hotfix, and named-test validation concerns are resolved. The suggestion to remove floating-point BIT_COUNT is a separate product-scope dispute against the linked behavior and compatibility requirements.
Model: gpt-6.1-terra / max
Session: 01a23642-a5da-74a3-9479-4bd000540084 · slot 0 · generation 54
-
P2
pkg/frontend/table_dump.go:2779: Restore an attested v4.2.8 v1 archive for a table containing a legacy bytewise VARCHAR column alongside a generated BIT_COUNT(CAST(d AS DOUBLE)) column.
Impact: The qualified load rejects the table before comparing its fingerprint. An unqualified load cannot establish the historical floating binding, leaving the backup without a safe restore path.
Evidence: The guard admits VARCHAR only for the hidden composite key. The existing released-v1 fingerprint owner at lines 2150 and 2263 already identifies a provable utf8mb4_bin text family. A diagnostic SQL probe confirmed that adding a bytewise VARCHAR reaches this rejection before fingerprint comparison; the unmodified released fixture restored as a control. Extend the verified path to the provable text family while retaining rejection for ambiguous collations, and cover a release-written mixed-schema archive. -
P3
pkg/frontend/table_dump.go:3026: An operator supplies the exact source label v4.2.1-hotfix-20261103 for a verified physical v1 archive.
Impact: The load rejects the release label immediately, although the guide requires the exact source label and ordinary loading cannot resolve sensitive floating BIT_COUNT bindings.
Evidence: The allowlist includes v4.2.1 and one v4.2.8 hotfix but omits the tagged v4.2.1 hotfixes. The frozen release tags have identical dump writer, schema renderer, DDL binder, BIT_COUNT registry and implementation, encoding, and serial-owner blobs for v4.2.1 and v4.2.1-hotfix-20261103. Accept verified equivalent hotfix labels or document a safe compatibility-label mapping.
Validation:
-
The isolated single-CN SQL integration run passed TestLoadReleasedBitCountNativeAndSignedArchives and TestLoadReleasedBitCountJSONAndVectorArchives on the assigned head; receipt checks/1796238866914580784-3.json and archive-integration.log record the command and results.
-
The diagnostic TestReviewV1TextAdmission overlay passed with the supplied isolated executor; receipt checks/1796239023067485325-3.json and text-admission-probe.log record the rejection and control.
-
Private /tmp and loopback preflight, git diff --check, the release-owner comparison, and checksums and sizes for 24 manifests and 28 objects passed. The native build used 198 inputs verified against the frozen source; reconciliation.log maps the checks to receipts.
-
The discussion assessment accounts for all 82 indexed keys.
Limitations:
-
The text admission probe deliberately added a column absent from its released fixture, so it proves rejection ordering rather than restoring a matching text-bearing archive. No physical fixture from the v4.2.1 hotfix was available.
-
The full distributed BVT, live MySQL comparison, and stopped-binary upgrade were not independently rerun; the PR reports those checks.
|
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: a6c5830e4d4ade67fc213c6432b4a0215e6b77af
Assessment: request_changes
The prior bytewise VARCHAR restore concern is resolved for payload-only tables, but a verifiable CHECK expression still prevents restoration. The changed SQL regression case also lacks traceable normal-comparison evidence. The append-only overloads and release-qualified restore path otherwise reuse the existing execution and recovery owners. The suggestion to remove floating-point BIT_COUNT remains a product-scope dispute against the linked behavior and compatibility requirements.
Model: gpt-6.1-terra / max
Session: 01a23642-a5da-74a3-9479-4bd000540084 · slot 0 · generation 54
-
P2
pkg/frontend/table_dump.go:2817: Load the retained v4.2.8 physical v1 archive for a table with a generated BIT_COUNT(CAST(d AS DOUBLE)) column and CHECK (payload <> 'forbidden'), using its release label, manifest checksum, and a matching utf8mb4_bin target.
Impact: The qualified load rejects the archive before fingerprint matching. An ordinary load also rejects the ambiguous historical BIT_COUNT binding, leaving no usable restore path if this archive is the remaining backup.
Evidence: The verifier has already established the revision-zero bytewise VARCHAR family, but its expression walk rejects every VARCHAR operand. The v4.2.8 not-equal implementation compares strings bytewise, and the current integration test explicitly expects this fixture to be rejected. A diagnostic-only blanket bypass of the guard restored six rows and passed the tested later writes and CHECK behavior; that bypass is not a safe general fix. Extend the existing proof to recognize independently verified bytewise comparisons while continuing to reject ambiguous collations and expressions. See pkg/tests/sqlintegration/bit_count_v428_dump_test.go:448, release-comparison-audit.log, and probe-text-check.log. -
P2
test/distributed/cases/function/func_bit_count.test:298: Validate the substantially changed BIT_COUNT SQL case, including selected-arm diagnostics, grouped text and vectors, and prepared expressions.
Impact: The required normal mo-tester comparison for the changed case remains unverified; this is a validation gap, not an observed SQL failure.
Evidence: The pinned testing contract requires comparison of the changed BVT case. The PR reports 339/339, but the supplied evidence has no matching command, source identity, terminal report, or teardown evidence; the frozen CI snapshot has no completed successful BVT result. The focused Go tests and six-query SQL probe cover only part of the case. Supply the retained same-head normal-comparison report or run func_bit_count.test once through mo-tester and retain its report and teardown evidence.
Validation:
-
Isolation preflight passed; receipt checks/1796245027038774636-3.json. Native prerequisites were built from the retained 198-input ledger.
-
Race-enabled focused planner, function, parser, and frontend tests passed; checks/1796245978183839309-3.json and focused-race.log.
-
Race-enabled released-archive SQL integration tests passed, including the expected checked-text rejection; checks/1796245686701154254-3.json, checks/1796246036619675685-3.json, bytewise-race.log, and released-archives-race.log.
-
A public SQL semantics probe passed on the candidate; checks/1796246178094311327-3.json. A separate diagnostic overlay demonstrated the checked-text counterfactual; checks/1796245841775595519-3.json.
-
The release comparison audit, fixture checksum audit, generated-parser reproduction, protobuf descriptor comparison, and git diff --check passed. Receipt-to-log mappings are recorded in reconciliation.log.
Limitations:
-
The full distributed BVT, live MySQL comparison, and stopped-binary upgrade were not independently rerun. The PR reports these checks, but matching current-head terminal logs were not supplied; mo-tester was not available on the review host.
-
Expression-binding behavior of v4.2.8-hotfix-20261126 and v4.2.8-hotfix-20261127 was not independently verified, so compatibility for those excluded labels was not inferred.
Keep release-qualified restore limited to proven bytewise CHECK bindings. Reuse the existing expression, fingerprint and archive checks; add real v4.2.8 archive and write-after-restore coverage.
|
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: 9203cdadf7d4e7c5f4b8ae9be16b21256d001d36
Assessment: request_changes
The prior bytewise CHECK fixture now restores and preserves its tested behavior on later writes. A related, independently verifiable text-null CHECK still prevents restore, and the prior normal BVT comparison evidence remains missing. The append-only overloads and release-qualified restore continue to reuse the existing execution and recovery owners. Removing floating-point BIT_COUNT remains a product-scope dispute against the linked behavior and compatibility requirements.
Model: gpt-6.1-terra / max
Session: 01a23642-a5da-74a3-9479-4bd000540084 · slot 0 · generation 54
-
P2
pkg/sql/plan/table_dump_bytewise_check.go:74: Restore a v4.2.8 physical v1 archive containing a generated BIT_COUNT(CAST(d AS DOUBLE)) column and a CHECK such aspayload <> 'forbidden' OR payload IS NULL, with the recorded release and checksum and a matching bytewise target.
Impact: Qualified LOAD rejects the schema, and ordinary LOAD rejects the historical BIT_COUNT binding. An operator whose remaining backup has this supported CHECK cannot restore it through either path.
Evidence: The new matcher handles boolean combinations and text comparisons but rejects IS NULL on a VARCHAR column; the released BIT_COUNT CHECK proof also restricts null tests to numeric columns. The v4.2.8 operators inspect the null bitmap independently of collation. A public SQL probe reproduced both rejections using synthetic matching manifests around an unchanged released object; the original archive and a numeric-null control restored. For SQL CHECK enforcement, the example accepts the same rows as the originalpayload <> 'forbidden'fixture. Extend the shared proof to recognize independently verified column nullness while retaining rejection of ambiguous expressions. See release-null-audit.log and probe-null-sql-v3.log. -
P2
test/distributed/cases/function/func_bit_count.test:298: Validate the changed BIT_COUNT SQL regression case, including selected-arm diagnostics, grouped text and vectors, and prepared expressions.
Impact: The required normal mo-tester comparison remains unverified. This is a validation gap, not an observed SQL failure.
Evidence: The pinned testing contract requires comparison of the changed BVT case. The PR reports 339/339, but the supplied evidence contains no matching command, source identity, terminal report, or teardown evidence; the frozen CI snapshot has no completed successful BVT result. Focused Go and archive SQL tests do not execute the complete case. Supply the retained matching report or run the changed case once in normal comparison mode and retain its report and teardown evidence.
Validation:
-
Isolation preflight passed, and the repository native prerequisites were built from 198 content-verified inputs; checks/1796249808082718136-3.json and native-inputs.log.
-
Race-enabled bytewise release-archive and numeric archive controls passed, including later writes; checks/1796250201861178191-3.json, checks/1796250412086431412-3.json, bytewise-race.log, and archive-controls-race.log.
-
Race-enabled focused planner, function, and parser tests passed; checks/1796251167235838192-3.json and focused-race.log.
-
Diagnostic planner, frontend, and public SQL probes confirmed the null-check admission boundary and its controls; checks/1796250564126028729-3.json, checks/1796250704760283101-3.json, checks/1796251048824914862-3.json, and probe-null-sql-v3.log.
-
The v4.2.8 null-operator source audit, 28 fixture-manifest and 35 object checksum checks, and git diff --check passed. Receipt-to-log mappings are retained in reconciliation.log.
Limitations:
-
The null-check public SQL reproduction uses synthetic manifests with an unchanged released object; that exact manifest was not produced by a released binary.
-
The full distributed BVT, live MySQL comparison, and stopped-binary upgrade were not independently rerun. The PR reports them, but matching current-head terminal logs were not supplied; mo-tester was not available in PATH.
Tree 14ca40e was tested using physical v1 archives written by official v4.2.8 and v4.2.9: five positive restore-and-restart cases and three rejected cases per release, plus eight stopped-upgrade tables each. The direct null-bit predicates keep the existing proof for expression identity and archive contents. Normal SQL comparison: mo-tester 309a0ca650e0c55e90292767fd61e4976818d66d, run.sh -m run -r 100 -n -g -o with func_bit_count.test and test/distributed/resources. Result: 339 passed, 0 failed/ignored/abnormal; test schema removed, server exited 0 and MySQL port closed. Fourteen Go SQL integration cases, type family and frontend expression checks passed.
|
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: 4a8df277d16f49ea8b334f00bd8525840f1ef076
Assessment: request_changes
The implementation reuses the vector executor and adds a bounded release-archive verification path, but that path rejects a compatible archive containing a simple integer CHECK predicate. The latest commit supplies source-tree-matched author evidence for the previously questioned SQL BVT run. A reviewer’s proposal to remove floating BIT_COUNT remains a product-scope disagreement with the linked compatibility requirements, not an independent approval gate.
Model: gpt-6.1-terra / max
Session: 01a23642-a5da-74a3-9479-4bd000540084 · slot 0 · generation 54
- P2
pkg/sql/plan/table_dump_binding.go:1023: Restore the committed v4.2.8 text_null_aliases physical archive with its correct release label and manifest checksum. Its CHECK combinespayload IS UNKNOWN AND id > 0with a floating BIT_COUNT comparison.
Impact: LOAD rejects the archive as having unverifiable persisted expression bindings and leaves the target empty. An operator who no longer has the original deployment cannot restore this otherwise compatible backup on the newer version.
Evidence: The comparison proof sendsidtoarithmeticBounds, which does not admit column references; the bytewise fallback also rejects>. The committed integration case explicitly expects refusal, while the corresponding null/BIT_COUNT case withoutid > 0is accepted. The released v4.2.8 and current signed-int32 comparison executors both implementa > b. Extend the released CHECK proof to verify this direct integer-column/literal comparison while retaining complete expression and binding checks, and cover restore and subsequent writes for the existing fixture.
Validation:
-
Private /tmp and loopback preflight passed; receipt checks/1796261299147419527-3.json.
-
Verified eight new fixture manifests and their object checksums, and compared generated protobuf descriptors; receipts checks/1796261594708751321-3.json and checks/1796261759001652859-3.json.
-
Traced the rejected fixture, its accepted control, the proof branches, and released versus current integer comparison code; receipt checks/1796262035905273575-3.json.
-
The final commit reports 339/339 normal mo-tester comparisons and physical release-archive cases against tree 14ca40e4d3982951c3745e27a8a4bb8109a51dea; that tree matches the frozen head. Receipt checks/1796261900318270186-4.json records the evidence match.
-
git diff --check passed, and all 88 discussion keys are covered by the saved assessment; receipts checks/1796261886097424990-3.json and checks/1796262097307512176-4.json.
Limitations:
-
The required Go 1.27.1 toolchain download timed out before local Go tests began; this is an environment limitation, not a product-test failure. Receipt checks/1796261471269434802-3.json and go-toolchain.log record the timeout.
-
The BVT and release-archive execution results are author-reported; their full execution logs were not available in this job.
…stores Replay the reviewed contents of matrixorigin#32920 up through 4a8df27. Preserve the persisted definitions, public SQL regressions and physical release fixtures.
Prove the direct column, signed or unsigned integer literal, comparison overload and lossless integer domain against the source SQL and rebound CHECK. Share the Boolean traversal with the existing released-expression verifier. The committed v4.2.8 text_null_aliases fixture now restores. Its regression asserts correct later inserts, refusal of a failing update and row preservation. The new v4.2.9 physical fixtures cover signed and unsigned comparisons and an out-of-range SMALLINT literal.
…story The first parent carries the two PR commits replayed on 66002aa. The second parent preserves the previous PR head 4a8df27 for a fast-forward update. Tested source tree 5f5831d, local build commit 3ba7e02c1145fa4eedee897a4fa6de8d8b0dcb87, Linux/amd64 with Go 1.27.1. Official v4.2.9 and v4.2.8 writers produced the physical v1 archives. Public TCP LOAD restored the reported compound CHECK with id > 0. Each writer had 7 successful restores and 6 expected refusals. Later writes, restart and re-dump/load passed. In separate cold-upgrade runs the v4.2.9 and v4.2.8 stopped databases each passed checks on 8 tables. The focused pkg/tests/sqlintegration invocation passed 15 archive tests including TestLoadReleasedBitCountIntegerComparisons. The separate pkg/sql/plan test build was killed before its assertions ran on the first attempt. Normal mo-tester 309a0ca650e0c55e90292767fd61e4976818d66d ran bash ./run.sh -m run -r 100 -n -g -o -p "$MATRIXONE/test/distributed/cases/function/func_bit_count.test" -s "$MATRIXONE/test/distributed/resources". Its comparison reported 339 passed and zero failed, ignored or abnormal. Runner and server exited 0, the temporary database was removed and the TCP port closed. The expected result stayed unchanged. Test blob dd318a6, expected-result blob be4059a; binary SHA-256 7a3d585b7e2de72ca9111a3ca74ee51e3b3ef351a6cd4237a5bc542369a330f3.
|
mo-bot review · Commit: linked issue or PR description changed before publication |
|
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: fc367cae09b696e04783fa2d1b9eb7dee347471c
Assessment: request_changes
The append-only overloads reuse the existing executor and preserve released floating BIT_COUNT bindings. The release verifier addresses the previous integer CHECK example, but still rejects a verifiable v4.2.9 backup. The proposal to remove floating BIT_COUNT support remains a product-scope dispute against the linked behavior and compatibility requirements.
Model: gpt-6.1-terra / max
Session: 01a23642-a5da-74a3-9479-4bd000540084 · slot 0 · generation 54
- P2
pkg/sql/plan/table_dump_v1_check.go:221: Restore the retained v4.2.9 out_of_range physical archive with its recorded release and manifest checksum. Its CHECK combiness < 32768, wheresis SMALLINT, with a floating BIT_COUNT predicate.
Impact: The qualified LOAD rejects the supported archive and leaves the target empty, preventing recovery on the newer server even though the historical CHECK binding can be verified.
Evidence: The proof requires 32768 to fit the original SMALLINT column. The v4.2.9 binder and current binder instead widen this comparison to INT64, where every SMALLINT value and the literal are represented exactly; both comparisons preserve NULL. TestLoadReleasedBitCountIntegerComparisons explicitly expects this archive to be rejected. Extend the proof to accept this lossless, release-verified comparison domain while retaining the complete expression and scope checks, and change the existing fixture test to verify restore and subsequent writes.
Validation:
-
Isolation preflight and git diff --check passed.
-
Verified READY markers, sizes and SHA-256 digests for 38 fixture manifests and 45 objects.
-
A source audit compared the v4.2.9 and current integer comparison rules and checked all 65,536 SMALLINT values. This was a static audit, not a SQL execution.
-
The final commit reports 339/339 normal mo-tester comparisons and 15 focused archive tests. The reported source tree and BVT input blobs match the frozen head; the execution logs were not supplied.
-
The review plan, assessment of all 91 discussion keys, and receipt-to-log reconciliation are saved in the diagnostic directory.
Limitations:
-
No local Go or SQL tests ran. The installed Go version is 1.26.6, while the checkout requires 1.27.1; automatic toolchain download timed out before compilation.
-
The frozen CI snapshot showed the shared build and unit job in progress and the upgrade checks skipped.
A SMALLINT column and the literal 32768 compare in BIGINT in the official v4.2.9 and v4.2.8 artifacts. Validate the full column range and the literal's exact value in each executable comparison domain. Reuse the published v4.2 coercion policy during historical CHECK binding and the scalar binder's canonical signed literals, including the BIGINT minimum. Archive recovery retains the original operator and NULL semantics. The old binder's out-of-range signed narrowing and negative-to-unsigned narrowing remain unverifiable. The ordinary binder and existing function IDs remain in place. Local validation on source tree 08bb85b, built from e0a35433c84380262f61c939f4855816954e60fe with Go 1.27.1 on Linux/amd64. Binary SHA-256 813fe3e5c8d7c8b1e9b33ee22874710a48b313cede4ac3251101d61139448c09. For each official v4.2.9 and v4.2.8 writer, public MySQL TCP LOAD restored three physical archives and refused two unsupported comparison domains. The run also rejected wrong manifest hashes, same-length object corruption before first install, and altered target schemas. Later writes, restart and ordinary LOAD of the typed re-dump passed. A separate stopped database copy per release reopened, preserved five tables and accepted the same writes across a restart. The official narrowing controls returned 1690. Normal mo-tester 309a0ca650e0c55e90292767fd61e4976818d66d ran bash ./run.sh -m run -r 100 -n -g -o -p "$MATRIXONE/test/distributed/cases/function/func_bit_count.test" -s "$MATRIXONE/test/distributed/resources". It reported 339 passed, with zero failed, ignored or abnormal. The runner and server exited normally, the temporary schema was removed, TCP closed and the committed expectation remained unchanged. Test blob dd318a6 and result blob be4059a.
|
mo-bot review · Commit: "interrupted" |
The direct recovery test exercises the planner diagnostic. It separately proves that current comparisons preserve the full value range and that released SMALLINT/SMALLINT UNSIGNED comparisons reject signed overflow or unsigned underflow. Both subtests then verify that recovery refuses the named CHECK. This tree (8ea2fcf) changes only pkg/sql/plan/table_dump_binding_compare_test.go. Local source a3a1207be0b5c369d28dc8a79011f0369cfed9b3 passed all seven selected planner tests with Go 1.27.1 on Linux/amd64, including signed_overflow and unsigned_underflow. The constrained local run used go test -mod=readonly -p 1 -gcflags=github.com/matrixorigin/matrixone/pkg/sql/plan=-l -vet=off -count=1 for the planner package. Planner stdout SHA-256: e98f39fd9ff8d7b99ef2b99263699b60d4a7ae348bd0d84a8f78c6c4ce977b43. The production tree and committed SQL inputs are byte-identical to parent 12dbb4a outside this Go test file. The parent's production binary passed 15 archive integration tests, actual v4.2.9 and v4.2.8 physical restore/upgrade/restart, and 339/339 standard mo-tester comparisons. Integration stdout SHA-256: 73a2c24d582711226283da692d865876cdabf47ada7be140d76d22a3e2cc70f0. Normal BVT stdout SHA-256: 0aea7f0c13ab4d4378a4bd5bc3b9349594440765f3c96d1dd0263850491a5b06.
gouhongshen
left a comment
There was a problem hiding this comment.
Codex automated review
I revalidated the PR at the new head da27835, inspected the full increment from fc367ca (two PR commits after a base sync), and re-checked the complete diff against origin/main, whose merge base moved forward to 26eef2f; the three newer main commits (IVFFlat probe budgeting, stats estimation, a Sirius startup test) touch no files this PR owns. The increment resolves the single previously open finding from the review history: the release verifier now verifies released CHECK literals in the recorded comparison domain (releasedV1IntegerLiteralMatches uses arg.Typ instead of the declared column type), conservatively excludes MEDIUMINT columns whose historical rendering cannot be proven, generalizes the v4.2 binding context from a random-bytes-specific flag to WithV42TableDumpBinding/V42TableDumpBinding (rename complete across base_binder, function.go, integer_arguments, make.go with no stale references), and applies that v4.2 binding mode when rebinding released BIT_COUNT CHECKs so both native integer domains participate in the proof. The change is pinned from both directions: a new unit test refuses lossy narrowings that raise error 1690 in the published binders (-32769 < SMALLINT, -1 < SMALLINT UNSIGNED) with RecoverTableDumpV1BindingsForVerifiedRelease failing, while the integration test now restores the real v4.2.9 out_of_range archive (SMALLINT s < 32768 compared in BIGINT), accepts subsequent writes at both SMALLINT endpoints plus NULL, and rejects a CHECK-violating update; new wide_peers and mixed_uint64 fixture archives pin lossless widened comparisons (including NULL-safe equality and BIGINT UNSIGNED bounds) and the refusal of a mixed signed/unsigned 64-bit comparison; the upgrade guide now states that released and current comparisons must preserve the column's full range, the literal's exact value, and NULL behavior. With this fix every issue raised across the 41 prior reviews, the four reviewer comments from iamlinjunhong, and the earlier inline threads is addressed; the interrupted mo-bot run for 12dbb4a published no assessment, so no unaddressed findings remain from other reviewers. I found no new defects in the increment: operator precedence, the single updated caller, gofmt cleanliness, and the protobuf/parser/generated-file consistency from my prior pass all check out. Verification limitation, reconfirmed on this head with a refreshed go list snapshot (1657 packages, zero dependency metadata errors): the native thirdparties install (jemalloc, CRoaring, usearch headers and libraries under thirdparties/install) is absent, and building those prerequisites is out of review scope, so pkg/sql/plan, pkg/sql/plan/function, and pkg/frontend plus their test binaries cannot compile or run in this checkout; the pure-Go fallback also fails on the pre-existing mpool SimpleCAllocator gap, so I could not independently execute the 339/339 BVT, the race UTs, or the archive restore tests, which remain author-reported and are mirrored by the repository tests I reviewed statically.
|
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: da2783554170fb55f70af76b640d8385364fc650
Assessment: approve
No actionable defects remain. The change preserves the released floating-point overloads for stored expressions and extends the existing dump and expression owners with bounded, fail-closed recovery. The prior SMALLINT CHECK restore issue is resolved. The proposal to remove floating-point BIT_COUNT remains a product-scope disagreement with the linked behavior and compatibility requirements.
Model: gpt-6.1-terra / max
Session: 01a23a4f-ba37-79e1-ad8d-cd6bacb29eeb · slot 2 · generation 23
Validation:
-
Private /tmp and loopback preflight passed; retained native inputs were verified against the assigned source before testing.
-
Focused planner, executor, frontend and SQL integration tests passed; see focused-tests.log and receipt checks/1796277720657335920-3.json.
-
All 15 released-archive SQL integration tests passed across the focused and additional archive runs, including restore, later writes, rejection cases, indexes, bytewise checks and the SMALLINT boundary. See released-archive-tests.log, released-archive-remaining.log and their receipts.
-
Parser, serialization, prepared-binding and lossy-integer comparison tests passed; see parser-serial-prepared-tests.log and receipt checks/1796278326526238549-3.json.
-
git diff --check passed. The changed API descriptor decompresses to the same contents as the merge-base descriptor; see api-descriptor.log and receipt checks/1796278609076446035-4.json.
Limitations:
-
The full distributed BVT, live MySQL comparison and stopped-binary upgrade were not independently rerun. The author reported 339/339 normal BVT comparisons on an earlier source tree whose BIT_COUNT case and relevant implementation remain semantically unchanged; the original execution logs were not supplied.
-
The frozen CI snapshot contained pending or skipped checks, which were not counted as passes.
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #32506
Fixes #32924
Related: #33036
What this PR does / why we need it:
BIT_COUNTnow distinguishes a FLOAT/DOUBLE field from an explicit floating CAST and ordinary floating arithmetic. For example, a storedd = 3.9produces 1 whileCAST(d AS DOUBLE)produces 2. The conversion is retained through filters, CTAS, grouping, prepared statements and supported scalar subqueries. DirectIF/CASEuses the selected arm's conversion without evaluating masked arms. DOUBLE field overflow diagnostics are emitted for the selected rows.Safe grouped string predicates retain the selected arm using the existing representative row, and repeated predicates share a nullable boolean input. Exact group expressions remain legal under
ONLY_FULL_GROUP_BYeven when their source columns cannot be replayed. Unsafe or volatile selectors, and strict selectors whose inputs are not group-determined, use the grouped value's conversion and can differ from the ungrouped expression. A same-domain floating unary plus in a transparent nested scalar retains the selected arm's conversion.Derived-table selectors consistently use their common field value even when the optimizer removes the projection; unrelated sibling subqueries do not change the result. Explicit materialization boundaries expose a field, while
OFFSET 0is normalized as a no-op. MySQL may choose different results for implicit derived-table materialization. Explicit floating CASTs retain MatrixOne's existing saturation behavior outside the integer range; MySQL can report an error instead.The planner follows the actual source and its explicit boundaries; it does not predict optimizer materialization or maintain a separate constant-predicate evaluator. The v4.2.8 persisted FLOAT/DOUBLE overloads 8 and 9 keep their original behavior for generated columns. New bindings use append-only overloads. An administrator can restore a physical v1 archive from v4.2.8 or v4.2.9 with a verified release and the original manifest checksum. The common v1 checker matches the complete expression against its SQL origin, verifies its column scope, and restores all recovered expressions in a single catalog definition. For floating BIT_COUNT it accepts a mode-independent column or direct cast, plus addition or multiplication whose intermediates are exact integers in DOUBLE. Ordinary v1 loads reject ambiguous floating bindings. Integer-only tables retain the ordinary dump and load path. The legacy binding check is selected from the actual BIT_COUNT operand type so that an integer BIT_COUNT inside a floating CAST does not make a v1 archive spuriously ambiguous. For existing historical catalog definitions, a complete exact v4.2.8 expression binding can still be verified and preserved in a bound v3 dump.
A v3 re-dump of a pre-upgrade numeric-only table may still require a target with the same historical default-charset fingerprint: a newly created target with the same visible DDL can fail the existing schema-hash check before expression verification. Returning to v4.2.8 requires restoring the complete pre-upgrade backup, discarding later changes. See the 4.2 upgrade guide for the exact scope and stopped-upgrade requirements.
Validation
-race, with stored and virtual generated columns, NULL and negative inputs, checksum rejection, later INSERT/UPDATE, and a fresh v1 dump/reload. The two existing real v4.2.8 floating and composite-key archives also restored under-race.-race:pkg/sql/planandpkg/frontendon the final change;pkg/pb/plan,pkg/sql/plan/function,pkg/sql/parsers/tree, andpkg/sql/parsers/dialect/mysqlon the preceding revision, whose corresponding code is unchanged.go vetonpkg/sql/plan,pkg/frontendandpkg/tests/sqlintegration. CI-configuredmake static-check-changedpassed across the full graph selected for the changed testdata: 0 issues.Verification of the unified restore path
The SQL grammar and protobuf bindings are generated files and account for most of the raw line churn.