Repository navigation
Description
Is there an existing issue for the same bug?
- I have checked the existing issues.
ODBC umbrella issue: #26677
Branch Name
m-25908
Commit ID
The running server reports 8.0.30-MatrixOne-v25908.
Other Environment Information
- Hardware parameters: Apple Silicon ARM64, 10 logical CPUs
- OS type: macOS 15.5, Darwin 24.5.0
- Deployment: fresh local launch with etc/launch/launch.toml
- Client: MatrixOne ODBC derived from MySQL Connector/ODBC 9.7.0 through unixODBC 2.3.14 and MySQL client library 9.7.1
Actual Behavior
Floating-point values lose their fractional part when selected through an ODBC prepared statement.
Inserted values:
12.3
-15.7
3.5
ODBC result:
12
-16
4
The MatrixOne native MySQL command-line client query returns the original fractional values.
Native debugger evidence from the Connector/ODBC server-side prepared statement path:
field.type = MYSQL_TYPE_DOUBLE
field.decimals = 0
field.length = 53
field.name = num0
result bind type = MYSQL_TYPE_STRING
buffer length = 24
returned value = "12"
returned length = 2
Connector/ODBC intentionally asks mysqlclient to fetch prepared FLOAT and DOUBLE columns as character data for consistency with text results. Because MatrixOne reports decimals=0 in COM_STMT result metadata, conversion rounds the native value to zero decimal places before ODBC receives it.
This is a data correctness issue for ODBC and any prepared-statement client that requests string conversion based on MySQL metadata.
Expected Behavior
Prepared statement result metadata for FLOAT and DOUBLE must preserve the scale behavior required by the MySQL protocol and client libraries. Reading the values as SQL_C_DOUBLE or SQL_C_CHAR must return 12.3, -15.7, and 3.5 without rounding to integers.
Steps to Reproduce
Create data:
CREATE DATABASE IF NOT EXISTS test;
DROP TABLE IF EXISTS test.odbc_double_probe;
CREATE TABLE test.odbc_double_probe(v DOUBLE);
INSERT INTO test.odbc_double_probe VALUES (12.3),(-15.7),(3.5);Confirm the native text query:
SELECT v FROM test.odbc_double_probe ORDER BY v;Then prepare and execute the same SELECT through Connector/ODBC 9.7, bind the result as SQL_C_DOUBLE, and fetch all rows. The values are rounded to -16, 4, and 12.
The upstream Connector/ODBC test my_basics.t_bug107307 reproduces the same failure against MatrixOne.
Additional information
A defensive MatrixOne ODBC workaround can bind native MYSQL_TYPE_FLOAT and MYSQL_TYPE_DOUBLE buffers when the server identifies as MatrixOne, bypassing string conversion based on the incorrect decimals metadata. The server metadata still needs correction for other MySQL protocol clients.
Suggested regression coverage:
- COM_STMT_PREPARE and COM_STMT_EXECUTE metadata for FLOAT and DOUBLE columns.
- Native numeric and string result bindings.
- Positive, negative, fractional, zero, NULL, very small, and very large values.
- Text protocol and binary prepared protocol parity.
- ODBC SQL_C_DOUBLE and SQL_C_CHAR fetches.
Activity
fix(frontend): report unspecified floating-point decimals
fix(frontend): report unspecified floating-point decimals
slyunnn commentedon Aug 10, 2026
Extended verification for #26682 (2026-08-10)
Follow-up to the ODBC prepared-statement metadata report: verified FLOAT/DOUBLE
decimalsmetadata and prepared-queryvalue behavior after #26709.
Verification environment
mainfa0ea95aa77b59a2947159baab31e7215d040e93fix(plan): support subqueries in left and right join ON clauses (#26763)3639aac46 fix(frontend): report unspecified floating-point decimals (#26709)test/issue-26682-prepared-double-decimals49e6657f2ab678af9724dd2d784659e5e5c2f0f1What was covered
decimals = 0x1fFindings
DECIMAL_NOT_SPECIFIEDsentinel (0x1f) for FLOAT and DOUBLE without an explicitdisplay scale.
12.3,-15.7,3.5) remain unchanged through the SQL prepared-query paths.BVT / topology note
frontend binary-protocol unit tests.
Test-file changes
issue_26682_prepared_double_decimals.testto pin SQL-level FLOAT/DOUBLE prepared-query behavior..resultfile as the recorded expected output.Suggested resolution
Merge the MOTR regression PR and close #26682 as fixed by #26709.