-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Incompatible with MySQL 8.0 about the CAST string to JSON #10390
Comments
Now, the master:
|
I have verified this against master. TiDB now correctly returns an error with the correct code. It is only the message that differs: select cast("2018-01-02 01:01:01.111111" as json);
..
mysql> select cast("2018-01-02 01:01:01.111111" as json);
ERROR 3140 (22032): Invalid JSON text: The document root must not be followed by other values.
mysql> SELECT tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v4.0.0-beta.2-771-gca41972fb
Edition: Community
Git Commit Hash: ca41972fbac068c8a5de107d9075f09ac68842ac
Git Branch: master
UTC Build Time: 2020-07-14 02:41:21
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.00 sec)
vs MySQL:
mysql [localhost:5731] {msandbox} (test) > select cast("2018-01-02 01:01:01.111111" as json);
ERROR 3141 (22032): Invalid JSON text in argument 1 to function cast_as_json: "The document root must not be followed by other values." at position 4.
|
@nullnotnil Then, can we close this issue? |
I agree. Message parity is less important here because it gets very specific about the json parser. We can re-open if it is discovered applications depend on it. |
i am saving json value which includes base64 text of 3mn characters, i am getting the below error while inserting in mysql.
this is how my table looks like the base64 text is an image. how can this error be resolved ? |
@HimanshuChugh2 can you provide an example |
Hey buddy @nullnotnil , thanks for your response, i have created a new issue, please take a look and help me, issue link: #18922 @nullnotnil |
Bug Report
Please answer these questions before submitting your issue. Thanks!
If possible, provide a recipe for reproducing the error.
The error should be produced.
Returns an unexpected result.
tidb-server -V
or runselect tidb_version();
on TiDB)?The text was updated successfully, but these errors were encountered: