We've built a new 4.1.11 forum and used impexx to import everything from our old 3.8 forum. Everything looks fine, but when I try to comment on a cms article as a normal registered user I get a popup saying "<p>Database Error</p>". I took a look in firebug and the actual error is as follows:
It looks to me like the database is confused about the unspecified postid column in that statement. The schema for posts is as follows. I'm not that familiar with vb's tables, but I find it strange that postid is not autoincrement, not null, and yet the default is null. Did our schema get borked somehow?
Any help is greatly appreciated!
Code:
<?xml version="1.0" encoding="windows-1252"?> <errors> <error><![CDATA[<p>Database Error</p>]]></error> <error_html><![CDATA[<p>Database error in vBulletin 4.1.11</p> <p>Invalid SQL:INSERT INTO post (showsignature, allowsmilie, htmlstate, username, userid, title, pagetext, iconid, visible, parentid, threadid, dateline, ipaddress, attach) VALUES (0, 1, 'on_nl2br', 'TestUser', 3109, '', 'testing testing', 0, 1, 12448, 2445, 1333040476, 'X.X.X.X', 0);<p> <p><strong>MySQL Error</strong> : Duplicate entry '0' for key 'PRIMARY'<br /> <strong>Error Number</strong> : 1062<br /> <strong>Request Date</strong> : Thursday, March 29th 2012 @ 01:01:16 PM<br /> <strong>Error Date</strong> : Thursday, March 29th 2012 @ 01:01:16 PM<br /> <strong>Script</strong> : http://XXX/newreply.php?do=postreply<br /> <strong>Referrer</strong> : http://XXX/content.php/119-Welcome-to-the-New-and-Improved-XXX!<br /> <strong>Classname</strong> : vB_Database<br /><strong>MySQL Version</strong> : <br /> </p>]]></error_html> </errors>
Code:
mysql> desc post; +----------------+-----------------------------+------+-----+----------+-------+ | Field | Type | Null | Key | Default | Extra | +----------------+-----------------------------+------+-----+----------+-------+ | postid | int(10) unsigned | NO | PRI | NULL | | | threadid | int(10) unsigned | NO | MUL | 0 | | | parentid | int(10) unsigned | NO | | 0 | | | username | varchar(100) | NO | | | | | userid | int(10) unsigned | NO | MUL | 0 | | | title | varchar(250) | NO | | | | | dateline | int(10) unsigned | NO | MUL | 0 | | | pagetext | mediumtext | YES | | NULL | | | allowsmilie | smallint(6) | NO | | 0 | | | showsignature | smallint(6) | NO | | 0 | | | ipaddress | char(15) | NO | MUL | | | | iconid | smallint(5) unsigned | NO | | 0 | | | visible | smallint(6) | NO | | 0 | | | attach | smallint(5) unsigned | NO | | 0 | | | infraction | smallint(5) unsigned | NO | | 0 | | | reportthreadid | int(10) unsigned | NO | | 0 | | | htmlstate | enum('off','on','on_nl2br') | NO | | on_nl2br | | | importthreadid | bigint(20) | NO | | 0 | | | importpostid | bigint(20) | NO | MUL | 0 | | +----------------+-----------------------------+------+-----+----------+-------+ 19 rows in set (0.00 sec)
Comment