tag太多,导致发帖报错

昨天在为一个用户排查发帖报错时遇到如下错误:

Discuz! Database Error The database has encountered a problem. Need Help? Error messages:
[Type] 查询语句错误     [1062] Duplicate entry '65535' for key 1
[Query] INSERT INTO common_tag (tagname, status) VALUES ('通话时间', '0')
Program messages:
[Line: 0060]forum.php(require)
[Line: 0362]source/module/forum/forum_post.php(require_once)
[Line: 0621]source/include/post/post_editpost.php(modthreadtag)
 [Line: 0841]source/function/function_forum.php(DB::query)

去看了一下,原来是tags过多,自动增长的id超出了mysql默认的最大值,这里只要找到pre_common_tag表中,tagid的类型由smallint改为mediumint类型,长度/值改为8.增大一下默认的tag个数。

当然一般的网站可能不会有这么多的站,像手机站这种tag比较多的站点注意一下这个问题!

Comments

No comments yet. Why don’t you start the discussion?

发表回复