Skip to content

Error 3144 (HY000): Cannot create a JSON value from a string with CHARACTER SET 'binary'. #54044

@hackersean

Description

@hackersean

Bug Report

the bug is same as MySQL, link

1. Minimal reproduce step (Required)

when use gorm in golang.

storage.DB().Model(filter).Where(filter).Where("JSON_CONTAINS(labels,JSON_OBJECT(?,?))", "flag", true).Find(&list).Error

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

The query result is displayed normally

3. What did you see instead (Required)

Error 3144 (HY000): Cannot create a JSON value from a string with CHARACTER SET 'binary'.

If concatenated into an SQL statement, it runs properly.

4. What is your TiDB version? (Required)

Release Version: v6.5.0
Edition: Community
Git Commit Hash: 706c3fa
Git Branch: heads/refs/tags/v6.5.0
UTC Build Time: 2022-12-27 03:50:44
GoVersion: go1.19.3
Race Enabled: false
TiKV Min Version: 6.2.0-alpha
Check Table Before Drop: false
Store: tikv

Metadata

Metadata

Assignees

Labels

affects-6.5This bug affects the 6.5.x(LTS) versions.affects-7.1This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.affects-8.1This bug affects the 8.1.x(LTS) versions.affects-8.5This bug affects the 8.5.x(LTS) versions.severity/moderatesig/sql-infraSIG: SQL Infratype/bugThe issue is confirmed as a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions