tidb icon indicating copy to clipboard operation
tidb copied to clipboard

`json_objectagg()` is not compatible with MySQL on `varbinary` type

Open tangenta opened this issue 3 years ago • 1 comments

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

drop table if exists tbl_0;
create table tbl_0 (col_2 int, col_3 varbinary(163));
insert into tbl_0 values (1,'o');
select json_objectagg( col_2, col_3 ) from tbl_0;

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

MySQL returns a strange string:

+--------------------------------+
| json_objectagg( col_2, col_3 ) |
+--------------------------------+
| {"1": "base64:type15:bw=="}    |
+--------------------------------+

3. What did you see instead (Required)

TiDB returns o for varbinary:

+--------------------------------+
| json_objectagg( col_2, col_3 ) |
+--------------------------------+
| {"1": "o"}                     |
+--------------------------------+

4. What is your TiDB version? (Required)

commit 0158f71cda6ccbbd382c6e8759904234baca259c (HEAD, upstream/master)
Author: tangenta <[email protected]>
Date:   Tue Jun 1 18:59:37 2021 +0800

    ddl: support type conversion between non-varchar and varchar (#24959)

tangenta avatar Jun 02 '21 06:06 tangenta

/assign @wzru

wzru avatar Jul 14 '21 03:07 wzru