C MySQL 客户端库行为

发布于 2024-07-08 15:05:45 字数 307 浏览 8 评论 0原文

我有一个客户端应用程序,它使用 SuSE SLES 9 上的库存库连接到 MySQL 数据库 4 服务器。但是,有时在处理来自服务器的特定重置集时,迭代抛出结果不允许我处理所有结果在数据库中。

有时会发生此问题,主要是当服务器已经正常运行几天时。 我怀疑重新启动可以解决问题。

无论如何,随着时间的推移不释放MySQL结果集是否会导致内存泄漏,并以这种奇怪的行为表现出来,必须始终释放所有结果集? 然而,同一个表和同一个程序在另一台计算机上的行为应该是一样的。

由于应用程序或 mysql 客户端库中的实现问题是否会导致结果集损坏?

I have a client application that connects to the MySQL database 4 server using stock libraries on SuSE SLES 9. However, at times when processing a particular reset set from the server, iterating throw the results does not allow me to process all the results that is in the database.

This issue happens sometimes, mostly when servers have had several days of uptime. I would suspect that a reboot solves the problem.

Is there anyway that not releasing the MySQL result set over time gives rise to this memory leak and displays itself in this strange behavior must all result sets always be freed? However same table and same program behaves as should on another computer.

Could corruption of the result set occur because of implementation issues in either the application or the mysql client library?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

时光礼记 2024-07-15 15:05:45

一切皆有可能,但我倾向于默认处理应用程序级别的问题。 如果您使用 C/C++ 进行编码,任何听起来可能与内存相关的问题都是堆损坏错误的主要候选者,并且可能会导致结果集问题。 另外,我很好奇您将这个结果集打开多长时间 - 是否有可能在查询运行时间和检索结果之间插入了您“丢失”的行结果集中的值?

最后,当您关闭数据库连接时,会自动在服务器上释放结果集,因此除非您将单个连接保持打开状态数天,否则这不太可能成为问题,除非 MySQL 中存在错误。

Anything is possible, however I'd be inclined to go with app-level issues by default. Any problem that smells like it could be memory related is a prime candidate for a heap corruption bug if you're coding in C/C++, and that could cause result set problems. Also, I'm curious about how long you're holding this result set open for -- is it possible that the rows that you're "missing" might have been inserted between the time the query ran and when you're retrieving the value from the result set?

Finally, releasing a result set on the server happens automatically when you close the database connection, so unless you're holding a single connection open for days, that is unlikely to be the problem, absent a bug in MySQL.

云淡月浅 2024-07-15 15:05:45

您可能会考虑升级到 MySQL 5。
拥有最新版本通常很好。

You may think about upgrading to MySQL 5.
It's usually good to have the latest version.

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