Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error 3144: Cannot create a JSON value from a string with CHARACTER SET binary #86

Closed
milanatshopify opened this issue Jan 14, 2019 · 2 comments

Comments

@milanatshopify
Copy link
Contributor

milanatshopify commented Jan 14, 2019

Moving a shop failed with

Error 3144: Cannot create a JSON value from a string with CHARACTER SET binary
error.

@milanatshopify
Copy link
Contributor Author

Example value in the json type column that causes this: {"count": {"type": "other", "value": 1}}

shuhaowu added a commit to shuhaowu/ghostferry that referenced this issue Feb 16, 2019
JSON column was previously being recognized as a []byte array. This
causes the query generated to be something like `_binary'{"data": 1}'`.
However, JSON data are not binary, thus we get errors such as:

Error 3144: Cannot create a JSON value from a string with CHARACTER SET
binary error.

Fixing this requires us to pass the column types into the methods
actually escaping the values, as we cannot infer that something is a
JSON type from the Go type alone.

To do this the most generic way, I just pass down the table columns all
the way (in case we need something else from it in the future).

Fixes Shopify#86.
shuhaowu added a commit to shuhaowu/ghostferry that referenced this issue Feb 16, 2019
JSON column was previously being recognized as a []byte array. This
causes the query generated to be something like `_binary'{"data": 1}'`.
However, JSON data are not binary, thus we get errors such as:

Error 3144: Cannot create a JSON value from a string with CHARACTER SET
binary error.

Fixing this requires us to pass the column types into the methods
actually escaping the values, as we cannot infer that something is a
JSON type from the Go type alone.

To do this the most generic way, I just pass down the table columns all
the way (in case we need something else from it in the future).

Fixes Shopify#86.
@milanatshopify
Copy link
Contributor Author

#98

shuhaowu added a commit to shuhaowu/ghostferry that referenced this issue Feb 19, 2019
JSON column was previously being recognized as a []byte array. This
causes the query generated to be something like `_binary'{"data": 1}'`.
However, JSON data are not binary, thus we get errors such as:

Error 3144: Cannot create a JSON value from a string with CHARACTER SET
binary error.

Fixing this requires us to pass the column types into the methods
actually escaping the values, as we cannot infer that something is a
JSON type from the Go type alone.

To do this the most generic way, I just pass down the table columns all
the way (in case we need something else from it in the future).

Fixes Shopify#86.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant