This repository was archived by the owner on Apr 21, 2026. It is now read-only.
Fix silent ID corruption caused by ColdFusion float precision limits#298
Merged
zainforbjs merged 2 commits intomainfrom Feb 17, 2026
Merged
Fix silent ID corruption caused by ColdFusion float precision limits#298zainforbjs merged 2 commits intomainfrom
zainforbjs merged 2 commits intomainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
ColdFusion represents all numbers as IEEE-754 double-precision floats, safely handling integers only up to
2^53-1 (9,007,199,254,740,991).CockroachDB IDs exceed this limit. Any numeric coercion at the ColdFusion layer silently rounded ID values before they reached the database.
Observed behaviour:
No exception was thrown. WHERE clauses silently matched nothing.
UPDATE statements affected no rows. Lookups returned empty results.
Root Cause
ID fields were being coerced to ColdFusion numeric type through val(), int() binding in Wheels, and direct numeric
comparisons. All of these routes through CF's double, losing precision on any ID exceeding the safe integer range.
Error Example
Problem: Using
val()converts the ID to a double number, which cannot safely represent very large integers. The DB ID does not match the coerced numeric value → query returns nothing.Fix
All ID field bindings changed string, keeping values as strings from CockroachDB through to the JDBC driver.
ColdFusion never interprets the value as a number.
val()usage on identifier fieldsTesting
Notes
This is not a Wheels or CockroachDB bug. Any language using double as its default numeric type has this limit. Treating identifiers as strings at the application layer is the correct long-term pattern.
Fixed the above issue for the blog functionality. Others are in progress.