vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Attachment Mysql Errors (https://vborg.vbsupport.ru/showthread.php?t=163669)

mmllc 11-26-2007 07:51 PM

Attachment Mysql Errors
 
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:

PHP Code:

Database error in vBulletin 3.6.8:

Invalid SQL:

            
SELECT datelinethumbnail_datelinefilenamefilesizevisibleattachmentidcounterextratype,
                
postid, IF(thumbnail_filesize 010) AS hasthumbnailthumbnail_filesize,
                
attachmenttype.thumbnail AS build_thumbnailattachmenttype.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

Quote:

Originally Posted by mmllc (Post 1390154)
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.


All times are GMT. The time now is 02:16 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02208 seconds
  • Memory Usage 1,734KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete