Skip to content

Wrong Result in Cast Blob to Json #58959

Open
@curry-oss

Description

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

DROP TABLE IF EXISTS t0;
CREATE TABLE t0(c0 BLOB);
INSERT INTO t0 VALUES ('1xx');

SELECT CAST(t0.c0 AS JSON) IS TRUE FROM t0;

2. What did you expect to see? (Required)

see the following case:

3. What did you see instead (Required)

// TiDB
mysql> SELECT CAST(t0.c0 AS JSON) IS TRUE FROM t0;
+-----------------------------+
| CAST(t0.c0 AS JSON) IS TRUE |
+-----------------------------+
|                           0 |
+-----------------------------+
1 row in set, 1 warning (0.04 sec)

// MySQL
MySQL [test]> SELECT CAST(t0.c0 AS JSON) IS TRUE FROM t0;
+-----------------------------+
| CAST(t0.c0 AS JSON) IS TRUE |
+-----------------------------+
|                           1 |
+-----------------------------+
1 row in set, 1 warning (0.01 sec)

4. What is your TiDB version? (Required)

TiDB v8.5.0

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions