Repository navigation
Description
Description
The SQL dump of a valid near-maximum finite FLOAT value is marked successful but cannot be restored: the emitted numeric literal is rejected as out of range. The same raw-numeric serialization also loses the sign of stored negative zero. CSV/LOAD DATA LOCAL INFILE roundtrips both values on this commit.
Environment
- MatrixOne
main:75ff736835c3d00d40dc00a0a1d3b11129388e5b - mo_dump
main:324c33dbdc7075cd5d7beaafd1e15c76709dd442 - Isolated single LOG/TN/CN deployment; MySQL-protocol client.
Reproduce
CREATE DATABASE md_float_boundary_src;
CREATE TABLE md_float_boundary_src.t (id INT PRIMARY KEY, f FLOAT, d DOUBLE);
INSERT INTO md_float_boundary_src.t VALUES
(1, CAST('-0.0' AS FLOAT), CAST('-0.0' AS DOUBLE)),
(2, CAST('1e-45' AS FLOAT), CAST('5e-324' AS DOUBLE)),
(3, CAST('3.4028234e38' AS FLOAT), CAST('1.7976931348623157e308' AS DOUBLE)),
(4, CAST('-1e-45' AS FLOAT), CAST('-5e-324' AS DOUBLE));Export with mo-dump -db md_float_boundary_src > dump.sql; retarget only the database name in a copy before importing into an empty database. The dump's data line includes (1,-0,-0) and (3,3.4028235e+38,1.7976931348623157e+308).
Actual / expected
- Three independent fresh source databases: full SQL export exits 0 with
MODUMP SUCCESS3/3; restore failsERROR 1690 (22003): data out of range: data type float32, value '3.4028235e+38'at theINSERT3/3, leaving each recreated table empty. Sources remain four rows and the connection is usable. - The source accepts
CAST('3.4028234e38' AS FLOAT)and retains the max finite float32 value.CAST('3.4028235e+38' AS FLOAT)also succeeds, but parsing the emitted unquoted numeric literal3.4028235e+38as FLOAT fails. A restorable dump must preserve the source value or fail export explicitly. - Filtering the same three dumps to
id=1(negative zero only) makes SQL restore succeed 3/3, but bothFLOATandDOUBLEchange from source display-0to restored display03/3. The full CSV exports restore-0for both columns in all three targets. This is a silent roundtrip representation loss, not the out-of-range error.
Controls and code
- The same three sources exported to CSV and restored 3/3; each target has four rows, with zero null-safe numeric mismatches for FLOAT/DOUBLE. CSV displays the negative zero sign and max finite FLOAT like the sources.
- SQL dump filtered to rows 1, 2 and 4 (no max FLOAT) imports; all three numeric row values compare equal, although row 1 loses the sign of zero as noted above.
cmd/mo-dump/main.go:739-759emits finite FLOAT/DOUBLE wire-text values as bare numeric SQL literals. The source wire text for the max FLOAT is rounded to3.4028235e+38, which is not a safe numeric literal for reinsertion on this server;-0is parsed as unsigned-signless integer zero. A type-aware, roundtrip-safe representation is needed.
Regression / related
Add real SQL and CSV dump/restore cases for max finite FLOAT, min positive/negative subnormals, signed zero, max finite DOUBLE, and NULL. This is distinct from #30596, where unquoted DOUBLE NaN/Inf causes a different parser error, and from #30521, which concerns general text-wire notation.
Activity
slyunnn commentedon Oct 27, 2026
Regression and extended verification for #30598 (2026-10-27)
Verification Environment
main:2465dae7a4ada1b277113cca5afff6fe10149b96—refactor: consolidate unused code and bookkeeping cleanup (#31348); rebuilt binarygit_version()was2465dae7a4on all routes.mo-dumplatestmain:d9d6375512620f12ff371b8602cc1d10d6f6caa0—fix: make SQL/CSV dump scripts restore-safe (#30596 #30598 #30587 #30590 #30628 #30481) (#58). Associated fix: mo_dump PR #58.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; restore used nativemysql 9.7.1over the MySQL text protocol.What Was Covered
FLOATandDOUBLE, positive and negative minimum subnormals, maximum finiteFLOAT, and maximum finiteDOUBLE.0on Proxy, CN1, and CN2; the earlier max-FLOATout-of-range error did not recur.3routes, including-0in both types.HEX(SERIAL(f))/HEX(SERIAL(d))matched exactly for all4rows on all3routes, providing a bit-sensitive representation check beyond numeric equality.Findings
The tested SQL serializer now emits restorable values without losing signed zero or overflowing maximum finite
FLOAT. Large-data regression required: No; this is a numeric encoding boundary, covered by the minimum4-row type/value matrix.MOTR / BVT Coverage
The owning
mo_dumprepository's fullmake testpassed at the tested commit, and live export/native-client restore passed through all3routes. No duplicate SQL-only MOTR case was added because the dump text and CLI restore status are part of the contract.Final Conclusion
Fixed for #30598 on the tested revisions. No issue-specific PR was created.