PDA

View Full Version : Attachment Mysql Errors


mmllc
11-26-2007, 07:51 PM
Hello,

I think this problem is unique, I haven't found this exact error here or in Google. So I can upload attachments to my board, they show up in the Attachment Manager, but when I go to view the post, I get a mysql error:

Database error in vBulletin 3.6.8:

Invalid SQL:

SELECT dateline, thumbnail_dateline, filename, filesize, visible, attachmentid, counter, extratype,
postid, IF(thumbnail_filesize > 0, 1, 0) AS hasthumbnail, thumbnail_filesize,
attachmenttype.thumbnail AS build_thumbnail, attachmenttype.newwindow
FROM attachment
LEFT JOIN attachmenttype AS attachmenttype USING (extension)
WHERE postid IN (-1,12)
ORDER BY attachmentid;

MySQL Error : Unknown column 'extratype' in 'field list'
Error Number : 1054


I've searched the DB high and low for the EXTRATYPE and FIELD LIST, because it says an unknown column, but nothing. Keep in mind this is a fresh install of Vbul here and I've made very few changes to templates and I don't think any product I installed could affect this in such a manner because I've used them before without problems, but I guess anything is possible. Any ideas?

TigerWare
11-26-2007, 08:34 PM
FWIW I ran the same query on my own unmodified test 3.6.8 and I got the same error. Have you installed any hacks that have done anything to the attachments table?

Could this be caused by a bad hack UNinstall?

Lynne
11-26-2007, 10:06 PM
I've got 3.6.8 on my test site and I have no field called extratype in the attachment table. I then did a search in all my files in my test site and found no reference to the field 'extratype'. I would look at any hacks you may have installed.

mmllc
11-27-2007, 07:50 AM
Thanks for the replies. The only hacks I installed were hacks I used a few weeks ago without incident. It's odd too that I don't have EXTRATYPES anywhere in my sql or templates.

I actually installed Vbul clean, no addons, no hacks, and the problem still persists. It must be something with my host I'm guessing.

TigerWare
11-27-2007, 07:56 AM
I actually installed Vbul clean, no addons, no hacks, and the problem still persists. It must be something with my host I'm guessing.

Your host would not be interfereing with your MySQL tables. When you reinstalled, did you also start with a fresh MySQL DB? If not, I wonder whether the vBulletin install just removes data if the tables already exist, under that circumstance the extra field would not have been removed. For sure, something was/is installed that has added a field to the table. Have you checked through all of the product XML's for any hack previously installed? The culprit should be in one of them, probably part of the install script.

mmllc
11-27-2007, 08:44 AM
I fixed it, I think*

I simply added a an extra row in ATTACHMENTS in the sql and instantly, the error went away, thumbnails are being viewed, shalala, lalalala. Isn't it odd that both a clean install of Vbulletin with a fresh database would have the same problem? The problem being that a single yet necessary row was not created in the database during install?

Doesn't everyone else have this EXTRATYPE in their ATTACHMENTS table?

Marco van Herwaarden
11-27-2007, 09:02 AM
First of all, vBulletin uses a table named "attachment", not "attachmentS".
Second the column "extratype" is not a default vBulletin column. By adding it you only have worked around the symptoms but you did not solve the problem. Even though you claim that you have no modifications, this really can only be caused by a modification that is still installed.

Lynne
11-27-2007, 02:01 PM
As Marco said, there is no field named "extratype" in the attachment table by default. You have a query somewhere that is looking for it though. If you already looked through all your files, then you need to look through your products. You didn't post the complete error in your first post because it would have said what page is making that query. You can look in your error_logs and probably find out what line the query is getting called on and if it's a hook location, then you just need to look through your products for anything that uses that hook.