You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: binary FLOAT prepared parameter in an integer comparison raises cast-to-int error #29464
Discovered while deeply reviewing #29462 / #29429. This is separate from serialized composite-key bug #29463: a plain integer column with no index also fails.
Confirmed on clean pre-PR commit a99db843c7b4630a86883addc9424433d93fc2d2 using a real JDBC server-side prepared statement:
createtablet(k int);
insert into t values (2), (3);
Use Connector/J with useServerPrepStmts=true, prepare select k from t where k > ? order by k, bind with PreparedStatement.setDouble(1, 2.5), and execute.
Actual: invalid argument cast to int, bad value 2.5.
Expected: one row, 3, without a conversion error. Equality with the same value should return no rows. Both k = ? and k + 0 = ? also raise this error on that commit.
Cause and fix under validation
The prepare-time integer CAST is provisional, but the execution admission detects text comparison specialization and overlooks FLOAT packets. The cached integer expression then consumes the decoded 2.5 transport text.
Working correction in #29462: collect numeric comparison parameter positions once per prepared-plan generation and route FLOAT bindings through the existing runtime specialization, preserving their numeric domain. No new runtime plan cache is added. Real binary/text protocol tests exercise equality, ranges and IN, primary/composite/secondary-key shapes, and later integer bindings on the same handle. Validation is in progress; this issue is not yet claimed fixed.
Activity
fix: restore prepared TPCC filter selectivity with per-binding proof (#…
Ariznawlll commentedon Oct 2, 2026
测试版本
maind50a2d475a406829f67127fef7b2ad4abc1c1d3dmo-service,独立数据目录;Go MySQL driver 的真实 COM_STMT 二进制协议原问题验证
按 issue 原始语义在上述 commit 重新执行并重复 3 次。真实 COM_STMT binary protocol 下 float64(2.5) 的范围查询返回 [3,4],等值为空,IN 返回 3;随后 int/NULL 重绑仍正常。
Happy Path 覆盖
覆盖 equality、range、IN 和连续三轮 statement reuse。
Unhappy Path 覆盖
覆盖 NULL、整数重绑和不命中值;参数类型切换后连接/statement 未被污染。
白盒验证
关联修复 #29462 已进入当前
main。同时将本 issue 的可公开观察契约固化为独立回归,避免只依赖实现细节或共享测试间接判断。回归测试
script/14_issue_regression/issue_29464_binary_float_compare.go714/714条语句通过。测试证据
d50a2d475a406829f67127fef7b2ad4abc1c1d3d14_issue_regression中观察到的旧 GOROOT/历史 golden/并发锁冲突属于既有无关失败,以上新增用例单独重跑均稳定通过。测试结论
测试通过。