MediumText 和 ASP/MySQL 的数据损坏

发布于 2024-07-23 01:04:33 字数 406 浏览 4 评论 0原文

我有一个用 ASP 编写的网站,带有 mySQL 数据库。 ASP 使用 ODBC 5.1 驱动程序连接到数据库。 数据库内部有一个 varchar(8000) 列(长度一开始很小,但应用程序自概念以来已经发展了很多)。 不管怎样,最近很明显 varchar 列应该更改为 MEDIUMTEXT 列。 我做了改变,一切看起来都很好。 但是,每当我执行 UPDATE 语句时,该特定行的该列中的数据就会损坏。 由于网站的性质,我无法提供数据或示例查询,但查询没有使用任何功能或任何东西; 只是直接更新。

varchar 一切正常,但当我将该字段设置为 MEDIUMTEXT 时,一切都会崩溃。 我所说的腐​​败如下:

ٔ带��������������������������������

有什么想法吗?

I have a website written in ASP with a mySQL database. ASP uses the ODBC 5.1 driver to connect to the database. Inside the database there is a varchar(8000) column (the length started small, but the application has evolved A LOT since its conception). Anyway, it recently became evident that the varchar column should be changed into a MEDIUMTEXT column. I made the change and everything appeared alright. However, whenever I do an UPDATE statement, the data in that column for that specific row gets corrupted. Do to the nature of the website, I am unable to provide data or example queries, but the queries are not using any functions or anything; just a straight UPDATE.

Everything works fine with the varchar, but blows up when I make the field a MEDIUMTEXT. The corruption I'm talking about is as follows:

ٔڹ���������������ߘ����ߘ��������

Any ideas?

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

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

发布评论

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

评论(2

网名女生简单气质 2024-07-30 01:04:33

你检查过编码(ASP+HTML+DB)吗? 使用UTF8?

不使用 UTF8 并且该文本不是英文,对吗?

Have you checked encodings (ASP+HTML+DB)? Using UTF8?

Not using UTF8 and that text is not English , right?

放肆 2024-07-30 01:04:33

您可能有特定于版本的错误。 我搜索了“mysql alter table Mediumtext Corruption”,发现了一些与代码页和非 latin1 字符集有关的错误。

最好的方法是对该表进行调查,将其与备份进行比较。 如果这是一个 MyISAM 表,您可能需要使用 启用“CHECKSUM”选项。 检查表告诉您什么? 如果 ALTER TABLE 不适合您,您可以考虑将中文本字段分区到它自己的表中,或者使用 INSERT...SELECT 的变体复制表内容:

CREATE TABLE b LIKE a;
ALTER TABLE b MODIFIY b.something MEDIUMTEXT;
INSERT INTO b SELECT * FROM a LIMIT x,1000;
-- now check those 1000 rows --

通过一次插入几行,然后检查通过它们,您也许能够弄清楚哪种输入转换得不好。

检查 dmesg 和 syslog 输出,看看是否有内存或磁盘问题。 我见过由于 ECC 错误、坏的 raid 控制器、坏扇区和错误的网络传输而发生表损坏。 您可以在类似的机器上尝试 ALTER TABLE 并查看它是否正常。

You might have a version specific bug. I searched for "mysql alter table mediumtext corruption" and there were some bugs specifically having to do with code pages and non-latin1 character sets.

Your best best is conduct a survey of the table, comparing it against a backup. If this is a MyISAM table, you might want to recreate the table with CHECKSUM option enabled. What does a CHECK TABLE tell you? If an ALTER TABLE isn't working for you, you could consider partitioning the mediumtext field into it's own table, or duplicating the table contents using a variation of an INSERT...SELECT:

CREATE TABLE b LIKE a;
ALTER TABLE b MODIFIY b.something MEDIUMTEXT;
INSERT INTO b SELECT * FROM a LIMIT x,1000;
-- now check those 1000 rows --

By inserting a few rows at a time and then checking them, it you might be able to tease out what kind of input isn't converting well.

Check dmesg and syslog output to see if you've got ram or disk issues. I have seen table corruptions occur due to ECC errors, bad raid controllers, bad sectors and faulty network transmission. You might attempt the ALTER TABLE on a comparable machine and see if it checks out.

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