FreeTDS 耗尽 DBD::Sybase 的内存

发布于 2024-08-31 12:37:23 字数 722 浏览 6 评论 0原文

当我添加

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

雨落星ぅ辰 2024-09-07 12:37:23

我在 .conf 文件中看到了这个 - 看看它是否有帮助:

# Command and connection timeouts
; timeout = 10
; connect timeout = 10
# If you get out of memory errors, it may mean that your client
# is trying to allocate a huge buffer for a TEXT field.
# (Microsoft servers sometimes pretend TEXT columns are
# 4 GB wide!) If you have this problem, try setting
# 'text size' to a more reasonable limit
text size = 64512 

I saw this in .conf file - see if it helps:

# Command and connection timeouts
; timeout = 10
; connect timeout = 10
# If you get out of memory errors, it may mean that your client
# is trying to allocate a huge buffer for a TEXT field.
# (Microsoft servers sometimes pretend TEXT columns are
# 4 GB wide!) If you have this problem, try setting
# 'text size' to a more reasonable limit
text size = 64512 
旧时浪漫 2024-09-07 12:37:23

这些链接似乎也相关,并显示如何在不修改 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文