使用proxy,sql带中文导致执行失败

方便更快捷的说明问题,可以按需填写(可删除)

使用环境:

shardingsphere-proxy 5.3.1版本

场景、问题:

通过navicat查询SQL:
SELECT
sp.id AS id,
sp.id AS personId,
sp.NAME,
sp.phone,
sp.office,
sp.dept_id AS deptId,
sp.addtime,
sp.tenant,
sp.belong_project AS belongProject,
sp.sex,
sp.sex_str AS sexStr,
sp.email,
sd.NAME AS deptName,
sp.DISABLE,
sp.community,
sp.street,
su.role_orientation
FROM
sharding_db.straw_sys_person sp
LEFT JOIN sharding_db.straw_sys_user su ON sp.id = su.person_id
LEFT JOIN sharding_db.straw_sys_dept sd ON sp.dept_id = sd.id
WHERE
1 = 1
AND sp.city_code = ‘450100’
AND sp.street like ‘%蓝标%’
ORDER BY
sp.create_time DESC
LIMIT 1
执行失败。
报错信息:
30000 - Unknown exception: while converting 1 = 1 AND sp.city_code = ‘450100’ AND sp.street LIKE u&’%\84dd\6807%’

已进行操作:

设置server.yaml的属性
sql-federation-type: ADVANCED
config-sharding.yaml的属性
jdbc:mysql://IP:3306/test?serverTimezone=UTC&useSSL=false&characterEncoding=utf-8

现状:

把中文进行了转码,导致SQL异常
经过测试,把sql-federation-type 设置为NONE,就执行成功了

京ICP备2021015875号