gpt4 book ai didi

mysql - 使用 MEDIUMTEXT 和页面的 mySQL 中的数据丢失

转载 作者:行者123 更新时间:2023-11-29 15:10:45 38 4
gpt4 key购买 nike

不知何故,GROUP_CONCAT 能够将一篇文章的六个“页面”(每个页面存储为文本)并将它们放入单个 MEDIUMTEXT 中,而不会丢失任何数据,但是有一些一页比正常情况长的文章(但显然仍然适合 TEXT 数据类型),会丢失大量数据。有谁知道怎么回事吗?

原始查询:

SET group_concat_max_len = 16000000;
UPDATE Threads t SET t.Content = (SELECT GROUP_CONCAT(a.Content ORDER
BY a.PageID SEPARATOR '<!-- pagebreak -->') FROM MSarticlepages a
WHERE a.ArticleID = t.MSthreadID GROUP BY a.ArticleID);

再次感谢您花时间指导我无知的自己!

最佳答案

MySQL 5.0 ( http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function_group-concat ) 引用手册指出:

Beginning with MySQL 5.0.19, the type returned by GROUP_CONCAT() is always VARCHAR unless group_concat_max_len is greater than 512, in which case, it returns a BLOB. (Previously, it returned a BLOB with group_concat_max_len greater than 512 only if the query included an ORDER BY clause.)

根据此数据,返回类型将为 BLOB,而不是 MEDIUMTEXT。总共的串联是否可能超过 2^16(65536 字节),这是 BLOB 的限制?

关于mysql - 使用 MEDIUMTEXT 和页面的 mySQL 中的数据丢失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/531242/

38 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com