我刚从我的应用程序更新了JDBC驱动程序
mysql-connector-java-3.1.12-bin.jar
至
mysql-connector-java-5.1.34-bin.jar.
使用v3.x驱动程序,这种查询有效:
select concat("<a href>", count(sakila.payment.payment_id), "</a>")
from sakila.payment;
但现在使用新的v5.x驱动程序,查询仅适用于cast().
select cast(concat("<a href>", count(sakila.payment.payment_id), "</a>")
as char(30)) from sakila.payment;
我可以更改MysqL数据库中的任何属性吗?
我不想改变这样的数百个查询.
解决方法:
我怀疑你必须咬紧牙关并更新你的代码.有一个错误报告here似乎符合您的情况,该错误报告的状态是“无法修复”.开发商的回应([2007年4月4日17:43] Reggie Burnett)是:
This is something that we can’t really fix. Let me explain.
MysqL has several issues when it comes to reporting whether a result if binary or not. This was very bad on MysqL versions prior to 5.0 but it’s still a problem even today. The sql you reported is returned by MysqL as binary when it obvIoUsly is not. The connector can’t kNow for sure. With 5.0.5 and 5.0.6, we tried to make a “best guess” but that code caused more problems than it solved, so with 5.0.7 we have rolled it out. Your sql will return string properly with 5.0.7, but that doesn’t mean it’s fixed. In fact, it returns string because we are ignoring the binary flag so that means you Could generate valid sql that should return binary and 5.0.7 will return string.
Until the server is fixed, the connector just can’t always do the right thing. I hope this has cleared it up somewhat.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。