Announcement

Collapse
No announcement yet.

Invalid SQL

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [Forum] Invalid SQL

    I'm getting the following error every few minutes - any ideas?

    Code:
    Database error in vBulletin 4.0.0:
    
    Invalid SQL:
    
    		SELECT thread.*,thread.title AS threadtitle, post.dateline AS postdateline, post.pagetext AS preview, attachment.thumbnail_filesize AS thumbsize, MIN(attachment.attachmentid) AS attachmentid 
    		FROM vbulletinthread AS thread
    		LEFT JOIN vbulletinpost AS post
    			ON (post.postid = thread.firstpostid)
    		LEFT JOIN vbulletinattachment AS attachment
    			ON (attachment.postid = thread.firstpostid AND attachment.extension IN('jpg', 'gif', 'png', 'jpeg', 'bmp')) 
    		WHERE thread.forumid IN (52)
    		 AND thread.visible = 1   
    		GROUP BY thread.threadid
    		ORDER BY thread.dateline DESC
    		
    		LIMIT 20, 10;
    
    MySQL Error   : Unknown column 'attachment.thumbnail_filesize' in 'field list'
    Error Number  : 1054
    Request Date  : Tuesday, December 22nd 2009 @ 09:03:41 PM
    Error Date    : Tuesday, December 22nd 2009 @ 09:03:41 PM
    Script        : http://www.thefollowon.com/community/articles.php?&order=desc&page=3
    Referrer      : 
    IP Address    : 65.55.207.121
    Username      : Unregistered
    Classname     : vB_Database_MySQLi

  • #2
    looks like upgrade wasn't done correctly. Try to run the upgrade script once again.
    while(true){
    if(
    $someone->needsHelp() && $i->canHelp()) $post->help();
    if(
    $i->findBug()) $post->bug();
    }

    Comment


    • #3
      Thanks Dody. I've run the upgrade again. Waiting to see what happens ...

      Comment


      • #4
        Nope - it didn't make any difference. I've run the upgrade script again and also optimised and repaired the tables. Still no joy.

        Anyone else have any ideas what's causing this?

        Comment


        • #5
          The error is caused because you have unknown column, which means the upgrade script didn't add it. If I was you, I would restart the upgrade process from upgrade_400a1.php and run it through until gold.
          while(true){
          if(
          $someone->needsHelp() && $i->canHelp()) $post->help();
          if(
          $i->findBug()) $post->bug();
          }

          Comment


          • #6
            I've changed a few things and deleted an incompatible style and I haven't had an error for over an hour now. Fingers crossed ...

            Comment


            • #7
              Still getting this error, so I have done as Dody suggested and run the upgrade process from the very beginning. If the error keeps happening, I will have to put in s support ticket - unless you guys suggest something else to try.

              Comment


              • #8
                Error continued, so in desperation, I have tried moving all the attachments from the database to the file system. Let's see if that cures the problem.

                EDIT: No joy. This is getting frustrating now.
                Last edited by Alan Rowley; Thu 24 Dec '09, 3:08am.

                Comment


                • #9
                  Could this be due a plugin you have installed? try to disable them all if so.
                  while(true){
                  if(
                  $someone->needsHelp() && $i->canHelp()) $post->help();
                  if(
                  $i->findBug()) $post->bug();
                  }

                  Comment


                  • #10
                    Hi Dody, thanks for trying to sort this out for me. The error isn't stopping the site from performing, but it's just frustrating that I can't figure out what's causing it.

                    The forum had several plugins installed when I was running 3.8.4. I disabled all these when I upgraded to 4.0.0, but they are still present.

                    The only plugins currently enabled are: vBulletin, vBulletin CMS and vBulletin Blogs.

                    Comment


                    • #11
                      Looking colser at my avB 4.0 attachment table, there is no "thumbnail_filesize" column by default. The only thing could cause this is a plugin.

                      try to adddefine('DISABLE_HOOKS', true); to your config.php and see how it goes.
                      while(true){
                      if(
                      $someone->needsHelp() && $i->canHelp()) $post->help();
                      if(
                      $i->findBug()) $post->bug();
                      }

                      Comment


                      • #12
                        OK. I have uninstalled all of my old 3.8 mods and now have only vBulletin, vBulletin CMS and vBulletin Blogs. If one of the old mods was causing the problem, uninstalling ought to get rid of the error message.

                        Fingers still crossed.

                        Comment


                        • #13
                          Still getting an error, but it's changed to ...

                          Code:
                          Database error in vBulletin 4.0.0:
                          
                          Invalid SQL:
                          
                          		SELECT COUNT(*) AS threads, SUM(IF(thread.lastpost > 1261739141 AND open <> 10, 1, 0)) AS newthread
                          		FROM vbulletinthread AS thread
                          		WHERE forumid IN( 0, )
                          		 AND thread.visible = 1;
                          
                          MySQL Error   : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')
                          		 AND thread.visible = 1' at line 3
                          Error Number  : 1064
                          Request Date  : Friday, December 25th 2009 @ 11:05:41 AM
                          Error Date    : Friday, December 25th 2009 @ 11:05:41 AM
                          Script        : http://www.thefollowon.com/community/articles.php?&order=desc&page=7
                          Referrer      : 
                          IP Address    : 67.195.111.165
                          Username      : Unregistered
                          Classname     : vB_Database_MySQLi
                          MySQL Version :
                          Anyone any suggestions?

                          Comment


                          • #14
                            Hey all, I'm also having the problem after an upgrade to 4.0

                            All my forums work fine except one which is really weird.

                            Anyone else have any ideas

                            My Error:

                            Database error in vBulletin 4.0.0:

                            Invalid SQL:

                            SELECT
                            IF(votenum >= 1, votenum, 0) AS votenum,
                            IF(votenum >= 1 AND votenum > 0, votetotal / votenum, 0) AS voteavg,
                            post.pagetext AS preview,
                            thread.threadid, thread.title AS threadtitle, thread.forumid, pollid, open, postusername, postuserid, thread.iconid AS threadiconid,
                            thread.dateline, notes, thread.visible, sticky, votetotal, thread.attach, thread.lastpost, thread.lastposter, thread.lastposterid, thread.lastpostid, thread.replycount, IF(thread.views<=thread.replycount, thread.replycount+1, thread.views) AS views,
                            thread.prefixid, thread.taglist, hiddencount, deletedcount,
                            user.usergroupid, user.homepage, user.options AS useroptions, IF(userlist.friend = 'yes', 1, 0) AS isfriend
                            , NOT ISNULL(subscribethread.subscribethreadid) AS issubscribed
                            , deletionlog.userid AS del_userid, deletionlog.username AS del_username, deletionlog.reason AS del_reason

                            , threadredirect.expires
                            , attachment.thumbnail_filesize AS thumbsize , MIN(attachment.attachmentid) AS attachmentid
                            FROM VB_thread AS thread
                            LEFT JOIN VB_user AS user ON (user.userid = thread.lastposterid)
                            LEFT JOIN VB_userlist AS userlist ON (userlist.relationid = user.userid AND userlist.type = 'buddy' AND userlist.userid = 1)
                            LEFT JOIN VB_deletionlog AS deletionlog ON(thread.threadid = deletionlog.primaryid AND deletionlog.type = 'thread')
                            LEFT JOIN VB_subscribethread AS subscribethread ON(subscribethread.threadid = thread.threadid AND subscribethread.userid = 1 AND canview = 1)

                            LEFT JOIN VB_post AS post ON(post.postid = thread.firstpostid)

                            LEFT JOIN VB_threadredirect AS threadredirect ON(thread.open = 10 AND thread.threadid = threadredirect.threadid)
                            LEFT JOIN VB_attachment as attachment ON(attachment.postid = thread.firstpostid)
                            WHERE thread.threadid IN (0,67153,67152,82602,82649,82561,64683,60769,82566,34220,82459,82518,82359,82063,82110,824 32,82556,41712,82567,82565,82564,46036,73864,50236,30261) GROUP BY thread.threadid
                            ORDER BY sticky DESC, lastpost DESC;

                            MySQL Error : Unknown column 'attachment.thumbnail_filesize' in 'field list'
                            Error Number : 1054
                            Request Date : Saturday, December 26th 2009 @ 01:55:28 AM
                            Error Date : Saturday, December 26th 2009 @ 01:55:29 AM
                            Script : http://www.newsgab.com/forumdisplay.php?f=36
                            Referrer : http://www.newsgab.com/your-entertainment/
                            IP Address : 203.206.91.236
                            Username : Chief
                            Classname : vB_Database
                            MySQL Version : 5.0.85-community
                            Getting Down under | Download2me | Newsgab | Careercraft | Newmomsforum | Freeware Downloads

                            Comment


                            • #15
                              Originally posted by Newmomsforum View Post
                              Hey all, I'm also having the problem after an upgrade to 4.0

                              All my forums work fine except one which is really weird.
                              You need to disable your plugins
                              while(true){
                              if(
                              $someone->needsHelp() && $i->canHelp()) $post->help();
                              if(
                              $i->findBug()) $post->bug();
                              }

                              Comment

                              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                              Working...
                              X