Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 11-26-2007, 07:51 PM
mmllc's Avatar
mmllc mmllc is offline
 
Join Date: Nov 2007
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 11-26-2007, 08:34 PM
TigerWare TigerWare is offline
 
Join Date: Feb 2007
Location: England, UK
Posts: 282
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #3  
Old 11-26-2007, 10:06 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 11-27-2007, 07:50 AM
mmllc's Avatar
mmllc mmllc is offline
 
Join Date: Nov 2007
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 11-27-2007, 07:56 AM
TigerWare TigerWare is offline
 
Join Date: Feb 2007
Location: England, UK
Posts: 282
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mmllc View Post
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.
Reply With Quote
  #6  
Old 11-27-2007, 08:44 AM
mmllc's Avatar
mmllc mmllc is offline
 
Join Date: Nov 2007
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #7  
Old 11-27-2007, 09:02 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 11-27-2007, 02:01 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:58 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.03804 seconds
  • Memory Usage 2,236KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete