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

Unexpect error when cast BIT to JSON #13492

Closed
Deardrops opened this issue Nov 15, 2019 · 2 comments
Closed

Unexpect error when cast BIT to JSON #13492

Deardrops opened this issue Nov 15, 2019 · 2 comments
Labels
challenge-program help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. sig/execution SIG execution

Comments

@Deardrops
Copy link
Contributor

Deardrops commented Nov 15, 2019

Description

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
    If possible, provide a recipe for reproducing the error.
select cast(B'1' as JSON);
  1. What did you expect to see?
mysql> select cast(B'1' as JSON);
+----------------------+
| cast(B'1' as JSON)   |
+----------------------+
| "base64:type15:AQ==" |
+----------------------+
1 row in set (0.00 sec)

mysql> select json_type(cast(B'1' as JSON));
+-------------------------------+
| json_type(cast(B'1' as JSON)) |
+-------------------------------+
| BLOB                          |
+-------------------------------+
1 row in set (0.00 sec)
  1. What did you see instead?
mysql> select cast(B'1' as JSON);
ERROR 3140 (22032): Invalid JSON text: The document root must not be followed by other values.
  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
Release Version: None
Git Commit Hash: None
Git Branch: None
UTC Build Time: None
GoVersion: None
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false

SIG slack channel

#sig-exec

Score

300

Mentor

@Deardrops Deardrops added the type/bug The issue is confirmed as a bug. label Nov 15, 2019
@ghost
Copy link

ghost commented Jul 16, 2020

Confirming that I can still reproduce in master:

select cast(B'1' as JSON);
select json_type(cast(B'1' as JSON));

..

mysql> select cast(B'1' as JSON);
ERROR 3140 (22032): Invalid JSON text: The document root must not be followed by other values.
mysql> select json_type(cast(B'1' 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-782-gb72e47e6d
Edition: Community
Git Commit Hash: b72e47e6db8863c08e47714391cf937b0f1c3269
Git Branch: master
UTC Build Time: 2020-07-15 01:26:06
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)

@jebter jebter added the sig/execution SIG execution label Nov 16, 2020
@lzmhhh123 lzmhhh123 added challenge-program help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Dec 4, 2020
@XuHuaiyu
Copy link
Contributor

A duplicate issue with #9988.

Not a bug according to this comment

@XuHuaiyu XuHuaiyu removed severity/moderate type/bug The issue is confirmed as a bug. labels Dec 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
challenge-program help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. sig/execution SIG execution
Projects
None yet
Development

No branches or pull requests

6 participants