Skip to content

Clarification on Data Type Conversion in Text Protocol for v1.8.0 #1627

Closed Answered by methane
mimaken3 asked this question in Q&A
Discussion options

You must be logged in to vote

I managed to run your code and I can reproduce it.
https://gist.github.com/methane/8f7bf5c84705246ab7c8da3eb5889820

I confirm that MySQL returns DOUBLE (float64) for both queries.

$ mysql -h 127.0.0.1 -u root test --column-type-info

mysql> select sum(JSON_EXTRACT(name, '$.hoge1.fuga1')) as piyo from users;
Field   1:  `piyo`
Catalog:    `def`
Database:   ``
Table:      ``
Org_table:  ``
Type:       DOUBLE
Collation:  binary (63)
Length:     23
Max_length: 6
Decimals:   31
Flags:      BINARY NUM


+--------+
| piyo   |
+--------+
| 100000 |
+--------+
1 row in set (0.00 sec)

mysql> select sum(JSON_EXTRACT(name, '$.hoge2.fuga2')) as piyo from users;
Field   1:  `piyo`
Catalog:    `def`
Da…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@methane
Comment options

Comment options

You must be logged in to vote
1 reply
@mimaken3
Comment options

Answer selected by mimaken3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants