JSON data type always parsed as binary
See original GitHub issueI have a table with JSON column.
Column options: encoding UTF-8, collationutf8mb4_general_ci. Table options: CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci.
Query this column always returns json object with broken character set. For example:
Real data stored in mysql: {“value”: “Problem: Arbeitsaufträge - привет”} Query result: {“value”: “Problem: ArbeitsauftraÌge - пÑивеє}
I’ve made a little research and it turns out that mysql returns characterSet: 63 (binary) for that column, but node-mysql handles it well, while node-mysql2 - not.
Field definition in result set:
{ catalog: 'def',
schema: '...',
name: 'metadata',
orgName: 'metadata',
table: 'products',
orgTable: 'products',
characterSet: 63,
columnLength: 4294967295,
columnType: 245,
flags: 144,
decimals: 0
}
Issue Analytics
- State:
- Created 7 years ago
- Comments:15 (14 by maintainers)
Top Results From Across the Web
Binary Data in JSON String. Something better than Base64
18 Answers 18 · 1. "In some cases, BSON will use more space than JSON due to the length prefixes and explicit array...
Read more >Value Types - Universal Binary JSON Specification
The Universal Binary JSON Specification defines a total of 13 value types (to JSON's 5 ... Boolean Types; Numeric Types; Char Type; String...
Read more >obsius/typed-binary-json - GitHub
A Typed Binary JSON serializer and parser for JS. ... The header contains information necessary to parse the binary data. It is raw...
Read more >Binary Values - JSON for Modern C++
Binary values are never created by the JSON parser, and are only part of a serialized JSON text if they have been created...
Read more >java - Recursive parser from Binary to JSON output
The program's task is to parse a binary file and prints it as human readable text.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@sidorares thank you for explanation, I’ll do it soon
Fixed in #410 , will be released soon:)