Repository navigation
Description
Description
mo-dump reports a successful SQL export of valid DOUBLE NaN and ±Infinity values, but writes those values as unquoted identifiers. Restoring the script fails at the first INSERT, leaving the recreated table empty. FLOAT special values are already quoted by the same formatter; the DOUBLE branch is not.
Environment
- MatrixOne
main:75ff736835c3d00d40dc00a0a1d3b11129388e5b - mo_dump
main:324c33dbdc7075cd5d7beaafd1e15c76709dd442 - Isolated single LOG/TN/CN deployment; MySQL-protocol client.
Reproduce
CREATE DATABASE md_double_special_src;
CREATE TABLE md_double_special_src.t (id INT PRIMARY KEY, f FLOAT, d DOUBLE);
INSERT INTO md_double_special_src.t VALUES
(1, CAST('NaN' AS FLOAT), CAST('NaN' AS DOUBLE)),
(2, CAST('Infinity' AS FLOAT), CAST('Infinity' AS DOUBLE)),
(3, CAST('-Infinity' AS FLOAT), CAST('-Infinity' AS DOUBLE)),
(4, 1.25, 1.25), (5, NULL, NULL);Export with mo-dump -db md_double_special_src > dump.sql; retarget only the database name in a copy of the script before importing into an empty database. The generated data statement begins:
INSERT INTO `t` VALUES (1,'NaN',NaN),(2,'+Inf',+Inf),(3,'-Inf',-Inf),(4,1.25,1.25),(5,NULL,NULL);Result and controls
- Three independent fresh source databases: SQL export exited 0 with
MODUMP SUCCESS3/3; import exited 1 withERROR 20301 ... ambiguous column reference 'NaN'3/3. Each restored table had 0 rows. Each source retained all 5 rows; subsequentSELECT 1was usable. - The same three sources exported as CSV and restored with
LOAD DATA LOCAL INFILE3/3. Each target retainedNaN,+Infinity,-Infinity,1.25, andNULLin both columns, with 5 rows. - SQL export with
-where 'id>=4'(finite value and NULL only) restored correctly with 2 rows. The source acceptsCAST('NaN' AS DOUBLE)andCAST('+Inf' AS DOUBLE); this is not an invalid input fixture. - An independent FLOAT-only table with the same five values also completed SQL dump/restore successfully. Its restored rows were
NaN,+Infinity,-Infinity,1.25, andNULL, pinpointing the gap to the DOUBLE formatter branch.
Code analysis / regression
cmd/mo-dump/main.go:740-759 quotes nonnumeric FLOAT values, but includes double in the numeric passthrough branch. Quoting the DOUBLE special literals is needed for a restorable SQL dump. Historical merged matrixone#8084 implemented the special-value quote for FLOAT only; this DOUBLE gap remains in the pinned mo_dump main. Add a real SQL dump/restore regression for NaN, +Infinity, -Infinity, finite and NULL values for both floating types. This is distinct from #30521 (text-wire scientific notation).
Activity
fix: make SQL/CSV dump scripts restore-safe
fix: make SQL/CSV dump scripts restore-safe
fix: make SQL/CSV dump scripts restore-safe (#30596 #30598 #30587 #30…
slyunnn commentedon Oct 27, 2026
Regression and extended verification for #30596 (2026-10-27)
@aptend @iamlinjunhong — the merged tool fix and the later MatrixOne text-to-float change now conflict in the default restore mode; please coordinate the integration fix.
Verification Environment
main:2465dae7a4ada1b277113cca5afff6fe10149b96—refactor: consolidate unused code and bookkeeping cleanup (#31348); the rebuilt running binary reportedgit_version() = 2465dae7a4on all routes.mo-dumplatestmain:d9d6375512620f12ff371b8602cc1d10d6f6caa0—fix: make SQL/CSV dump scripts restore-safe (#30596 #30598 #30587 #30590 #30628 #30481) (#58). Related changes: mo_dump PR #58 and the subsequently merged MatrixOne PR #31191, commit861a2c4cb68961d8b6b01f18e0aa6ac52a3a505f.2 CN / 1 TN / 1 Log service / Proxy. Container endpoints Proxy6001, CN116001, CN216002were mapped to host6601,16601,16602; all three were connected and tested independently.mo-dumpMySQL driver; SQL and CSV restores used nativemysql 9.7.1over the MySQL text protocol. CSV restore enabledLOCAL INFILE.What Was Covered
FLOAT/DOUBLENaN,+Infinity, and-Infinityvalues were created using exactBIT_CAST(UNHEX(...))expressions; source rows were readable on all3routes. The old textualCAST('NaN' AS DOUBLE)fixture is no longer valid in the current default MySQL-compatible mode by design of PR Fix decimal rounding and MySQL text-to-float casts #31191.mo-dumpSQL export returned0withMODUMP SUCCESSand no longer emitted bare identifiers. Its data line includes(1,'NaN','NaN'),(2,'+Inf','+Inf'),(3,'-Inf','-Inf').1265(Data truncated for DOUBLE value: 'NaN') at theINSERTon Proxy, CN1, and CN2; each recreated target table contained0rows. Connections remained usable.1.25andNULLSQL-dump controls restored exactly on all3routes.5-row IEEE/finite/NULLfixture round-tripped throughmo-dump -csvandLOAD DATA LOCAL INFILEon all3routes.5rows through Proxy when the restore session explicitly usedMATRIXONE_NATIVE; this is a mode-specific control, not a fix for default-mode restore.Findings
PR #58 fixed the unquoted
DOUBLEtokens, but end-to-end SQL restoration is still broken on currentmain. PR #31191 intentionally treats textualNaN/Infas nonnumeric text in MySQL-compatible mode; strict assignments reject them. The tool's new quoted serialization therefore cannot recreate otherwise valid stored IEEE values under the default mode. A type-aware restore representation or equivalent cross-component contract is needed. This is the same user-visible restore failure already tracked by #30596, so no duplicate issue was opened.Large-data regression required: No. One stored IEEE row is sufficient to cross this parser/assignment boundary; more rows would not change the failure.
MOTR / BVT Coverage
The
mo_dumprepository's fullmake testpassed at the tested commit, but it did not catch this later MatrixOne compatibility change. A live cross-version SQL export/restore regression should be added with the fix. No passing MOTR case or PR was submitted for a still-failing contract.Final Conclusion
Partially fixed: bare
DOUBLEtokens are gone, but #30596's required SQL dump/restore roundtrip is not fixed on current MatrixOnemainin the default mode. Keep the issue open for integration repair and retest.Merge pull request #71 from matrixorigin/fix/astra-meow-30596