替换中文后操作 'concat' 的归类非法混合
Illegal mix of collations for operation 'concat' after replace chinese
Before:
set extrainfo =concat('{"from":"carpool","table":"Block",
"key_field":"b_index","key_value:"',b_index,'","infoid":"',info_id,'",
"code":"0","message":"This trip is valid"}');
运行 success.
I replaced "This trip is valid" with "行程符合规范" :
set extrainfo =concat( '{"from":"carpool","table":"Block","key_field":
"b_index","key_value:"',b_index,'","infoid":"',info_id,'",
"code":"0","message":"行程符合规范"}');
show me:
(node:30849) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1):
`enter code here`Error: ER_CANT_AGGREGATE_NCOLLATIONS:
`enter code here`Illegal mix of collations for operation 'concat'
Can you help me?
我更改了代码:
set extrainfo =concat( '{"from":"carpool","table":"Block","key_field":
"b_index","key_value:"',convert(b_index,char),'","infoid":"',convert(info_id,char),'",
"code":"0","message":"行程符合规范"}');
将 b_index 替换为 convert(b_index,char)。效果不错。
Before:
set extrainfo =concat('{"from":"carpool","table":"Block",
"key_field":"b_index","key_value:"',b_index,'","infoid":"',info_id,'",
"code":"0","message":"This trip is valid"}');
运行 success. I replaced "This trip is valid" with "行程符合规范" :
set extrainfo =concat( '{"from":"carpool","table":"Block","key_field":
"b_index","key_value:"',b_index,'","infoid":"',info_id,'",
"code":"0","message":"行程符合规范"}');
show me:
(node:30849) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1):
`enter code here`Error: ER_CANT_AGGREGATE_NCOLLATIONS:
`enter code here`Illegal mix of collations for operation 'concat'
Can you help me?
我更改了代码:
set extrainfo =concat( '{"from":"carpool","table":"Block","key_field":
"b_index","key_value:"',convert(b_index,char),'","infoid":"',convert(info_id,char),'",
"code":"0","message":"行程符合规范"}');
将 b_index 替换为 convert(b_index,char)。效果不错。