question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

JSON data type always parsed as binary

See original GitHub issue

I 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: Arbeitsaufträ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:closed
  • Created 7 years ago
  • Comments:15 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
pankicommented, Sep 23, 2016

@sidorares thank you for explanation, I’ll do it soon

0reactions
sushantdhimancommented, Sep 24, 2016

Fixed in #410 , will be released soon:)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found