代码之家  ›  专栏  ›  技术社区  ›  Bob Zheng

“concat”操作在替换中文后非法混合排序

  •  0
  • Bob Zheng  · 技术社区  · 7 年前

    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"}');
    

    运行成功。

    set extrainfo =concat( '{"from":"carpool","table":"Block","key_field":
    "b_index","key_value:"',b_index,'","infoid":"',info_id,'",
    "code":"0","message":"行程符合规范"}');
    

    (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'
    

    你能帮助我吗?

    1 回复  |  直到 7 年前
        1
  •  0
  •   Bob Zheng    7 年前

    我更改了代码:

    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":"行程符合规范"}');
    

    推荐文章