FreeTDS 耗尽 DBD::Sybase 的内存
当我添加
client charset = UTF-8
到我的 freetds.conf 文件时,我的 DBD::Sybase 程序发出:
Out of memory!
并终止。当我对返回任何 ntext 字段的 SQL 查询语句调用execute() 时,会发生这种情况。我可以很好地返回数字数据、日期时间和 nvarchars,但只要输出字段之一是 ntext,我就会收到此错误。
所有这些查询在没有 UTF-8 设置的情况下都可以正常工作,但我确实需要处理一些在默认字符集下引发警告的字符。 (请参阅相关问题。)
错误消息的格式与其他 DBD::Sybase 不同错误消息似乎已格式化。不过,我确实收到一条消息,表明正在发出 rollback() 。 (我的错误 AutoCommit 标志得到了尊重。)我想我在某处读到 FreeTDS 使用 iconv 程序在字符集之间进行转换;这条消息有可能是从 iconv 发出的吗?
如果我在 tsql(FreeTDS 的命令行 SQL shell)中使用相同的 freetds.conf 设置执行相同的查询,则不会收到错误。
我正在连接到 SQL Server。
我需要做什么才能使这些查询成功返回?
When I add
client charset = UTF-8
to my freetds.conf file, my DBD::Sybase program emits:
Out of memory!
and terminates. This happens when I call execute() on an SQL query statement that returns any ntext fields. I can return numeric data, datetimes, and nvarchars just fine, but whenever one of the output fields is ntext, I get this error.
All these queries work perfectly fine without the UTF-8 setting, but I do need to handle some characters that throw warnings under the default character set. (See related question.)
The error message is not formatted the same way other DBD::Sybase error messages seem to be formatted. I do get a message that a rollback() is being issued, though. (My false AutoCommit flag is being honored.) I think I read somewhere that FreeTDS uses the iconv program to convert between character sets; is it possible that this message is being emitted from iconv?
If I execute the same query with the same freetds.conf settings in tsql (FreeTDS's command-line SQL shell), I don't get the error.
I'm connecting to SQL Server.
What do I need to do to get these queries to return successfully?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我在 .conf 文件中看到了这个 - 看看它是否有帮助:
I saw this in .conf file - see if it helps:
这些链接似乎也相关,并显示如何在不修改 freetds.conf 文件的情况下更改设置:
http://lists.ibiblio.org/pipermail/freetds/2002q1/006611.html
http://www.freetds.org/faq.html#textdata
常见问题解答是特别没有帮助,没有列出实际的错误消息。
These links seem relevant as well and show how the setting can be changed without modifying the freetds.conf file:
http://lists.ibiblio.org/pipermail/freetds/2002q1/006611.html
http://www.freetds.org/faq.html#textdata
The FAQ is particularly unhelpful, not listing the actual error message.