Skip to content

Commit

Permalink
expression: fix casting REAL type to STRING type (#16975)
Browse files Browse the repository at this point in the history
close #16974

expression: fix casting REAL type to STRING type
- unify the behavior of converting real types to strings in tidb#53129 and tikv.
- use ryu lib in tikv to implement casting real type to str type.
- `if abs(num) >= 1e15 or (num is not zero and abs(num) < 1e-15)` then use decimal exponent format

Signed-off-by: TONG, Zhigao <tongzhigao@pingcap.com>
  • Loading branch information
solotzg committed May 11, 2024
1 parent 69f13af commit 7fb3666
Show file tree
Hide file tree
Showing 3 changed files with 449 additions and 32 deletions.
5 changes: 3 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions components/tidb_query_expr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ num-traits = "0.2"
openssl = { workspace = true }
protobuf = "2"
regex = "1.1"
ryu = "1.0"
safemem = { version = "0.3", default-features = false }
serde = "1.0"
serde_json = "1.0"
Expand Down

0 comments on commit 7fb3666

Please sign in to comment.