简体   繁体   English

CF10将mysql字符串连接为二进制数据

[英]CF10 concatenated mysql string as binary data

I'm working on moving a site from CF8 to CF10 and just came across something I wasn't expecting. 我正在努力将一个站点从CF8转移到CF10,只是遇到了一些我没想到的东西。 My MySQL query has a simple concatenate to combine a company ID with company name as such: 我的MySQL查询有一个简单的连接,可以将公司ID与公司名称结合起来:

SELECT CONCAT(co_coid, ' - ',co_company) AS IDCONAME

On CF8, this returns a string I can just as my display value on a cfselect. 在CF8上,这会返回一个字符串,我可以在cfselect上作为我的显示值。

998 - Company A
999 - Company B

etc. 等等

However, on CF10 when I dump the query it's showing as binary data and I have to use toString() on the output. 但是,在CF10上,当我转储查询时,它显示为二进制数据,我必须在输出上使用toString()。

I knew there were some gotchas that required using toString() when returning encrypted data that weren't there before, but I'm not sure why it's doing this on a simple string concatenation. 我知道有些问题需要在返回之前没有的加密数据时使用toString(),但我不确定为什么它在简单的字符串连接上执行此操作。

[update] Can this be changed through a connect string or other server wide setting? [更新]可以通过连接字符串或其他服务器范围设置更改吗? I know I can use toString() on output, or CAST() in the query, but something server wide would be ideal. 我知道我可以在输出中使用toString(),或者在查询中使用CAST(),但服务器范围内的东西是理想的。 The MySQL server is the same server, so there's no version change there. MySQL服务器是同一台服务器,因此没有版本更改。

将数字转换为字符串,

SELECT CONCAT(CAST(co_coid AS CHAR(15)), ' - ',co_company) AS IDCONAME

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM