Database error in vBulletin 4.1.11

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mick West
    New Member
    • Dec 2010
    • 12

    [CMS] Database error in vBulletin 4.1.11

    [Edit: FIXED, see post #7 below]

    I've upgraded from 4.10 to 4.11, and I get an error when showing or attempting to edit any of my CMS posts.

    Database error in vBulletin 4.1.11:


    Invalid SQL:
    SELECT post.postid, post.visible, post.dateline FROM vbmb_post AS post
    INNER JOIN vbmb_cms_nodeinfo AS info ON info.associatedthreadid = post.threadid
    AND post.dateline > info.creationdate WHERE info.nodeid=129 AND post.parentid != 0 AND post.visible = 1
    ORDER BY post.dateline ASC;
    /**get_comments- vbcms**/;


    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 ';
    /**get_comments- vbcms**/' at line 4
    Error Number : 1064
    Request Date : Wednesday, February 29th 2012 @ 09:55:21 PM
    Error Date : Wednesday, February 29th 2012 @ 09:55:21 PM
    Script : http://metabunk.org/content/129/edit
    Referrer : http://metabunk.org/admincp/cms_cont...in.php?do=list
    IP Address :
    Username : Mick
    Classname : vB_Database
    MySQL Version : 5.0.51a-3ubuntu5.8
    However, if I cut and paste the above query (in bold) into phpMyAdmin, it returns a table with the post comments as expected.

    CMS posts with comments disabled are fine.
    Forum posts are fine.

    So my site is partially broken, but just the CMS. I don't want to roll back as the forums have been active, and the CMS does not get a lot of traffic, so any suggestions would be appreciated.
    Server Type Linux Users to Moderate 0 [View]
    Web Server Apache v2.2.8 Threads to Moderate 0 [View]
    PHP 5.2.4-2ubuntu5.17 Posts to Moderate 0 [View]
    PHP Max Post Size 8.00 MB Attachments to Moderate 0 [View]
    PHP Maximum Upload Size 16.00 MB Events to Moderate 0 [View]
    PHP Memory Limit 64.00 MB
    MySQL Version 5.0.51a-3ubuntu5.8
    MySQL Packet Size 16.00 MB
    Last edited by Mick West; Thu 1 Mar '12, 5:11am.
  • Mick West
    New Member
    • Dec 2010
    • 12

    #2
    I have temporarily "fixed" it with the following SQL query executed in phpmyadmin

    UPDATE `vbmb_cms_node` SET comments_enabled=0

    (vbmb is the site-specific table prefix)

    This disabled comments on all CMS posts. So it's NOT REALLY A FIX, but got me up and running with no CMS comments.

    Re-enabling comments on any CMS post, or publishing a post with comments enabled results in the same error.

    I suspect MySQL version? But upgrading looks like a pain.
    Last edited by Mick West; Wed 29 Feb '12, 7:40pm. Reason: not really a fix

    Comment

    • dbigras
      New Member
      • Oct 2008
      • 12

      #3
      I have the exact same problem..

      Please help..

      Comment

      • Mick West
        New Member
        • Dec 2010
        • 12

        #4
        What MySQL version do you have?

        Comment

        • Fready
          Senior Member
          • Nov 2010
          • 137
          • 4.0.x

          #5
          Have you sent in a Support ticket?

          Comment

          • Mick West
            New Member
            • Dec 2010
            • 12

            #6
            I just did now. Never done it before so I was not sure where to go.

            Comment

            • Mick West
              New Member
              • Dec 2010
              • 12

              #7
              FIXED! It's the semicolons in the new queries in the file vb/db/mysql/querydefs.php

              none of the other queries had semicolons, so some new programmer added these, and it worked on most MySQL systems

              Remove the five semicolons at the end of the queries in lines 196,201,204,206 and 208

              e.g., change

              post.dateline ASC;'),

              to

              post.dateline ASC'),

              Comment

              • Ramsesx
                Senior Member
                • Aug 2005
                • 3254
                • 3.8.x

                #8
                Thank you Mick.
                .......

                Comment

                • ZeroHour
                  Senior Member
                  • Sep 2007
                  • 167

                  #9
                  This sounds like everyone should be bugged but I cant recreate this on my end?
                  Can you give me some steps as I want to double check I dont need to apply the fix.

                  Comment

                  • Mick West
                    New Member
                    • Dec 2010
                    • 12

                    #10
                    The bug clearly will not show up for everyone,as it got through testing. All it takes to replicate it (after the upgrade to 4.1.11) is to view a CMS post/page (not a forum post) that has comments. If you have the problem (which is probably down to server/MySQL versions), then this will give an error 100% of the time and you can do the minor edits to fix it. If you don't have the problem, then it will work normally.

                    Comment

                    • ZeroHour
                      Senior Member
                      • Sep 2007
                      • 167

                      #11
                      Originally posted by Mick West
                      The bug clearly will not show up for everyone,as it got through testing. All it takes to replicate it (after the upgrade to 4.1.11) is to view a CMS post/page (not a forum post) that has comments. If you have the problem (which is probably down to server/MySQL versions), then this will give an error 100% of the time and you can do the minor edits to fix it. If you don't have the problem, then it will work normally.
                      Thanks for the reply, this kind of problem makes me think of my previous suggestion: https://www.vbulletin.com/forum/show...=1#post2243424 to have a hotfixes area with drop in files.
                      I use MariaDB, what do you use?

                      Comment

                      • Mick West
                        New Member
                        • Dec 2010
                        • 12

                        #12
                        Originally posted by ZeroHour
                        I use MariaDB, what do you use?
                        MySQL server 5.0.51a-3ubuntu5.8

                        Comment

                        • ZeroHour
                          Senior Member
                          • Sep 2007
                          • 167

                          #13
                          Originally posted by Mick West
                          MySQL server 5.0.51a-3ubuntu5.8
                          Eep thats quite a old version although vbulletin says its supported. Its probably not a problem on new versions or MySQL have tweaked the rules.
                          I dont know if running Suhosin-Patch makes a difference either.

                          Comment

                          • Ramsesx
                            Senior Member
                            • Aug 2005
                            • 3254
                            • 3.8.x

                            #14
                            Originally posted by Mick West
                            to replicate it (after the upgrade to 4.1.11) is to view a CMS post/page (not a forum post) that has comments.
                            In my case there weren't comments.
                            .......

                            Comment

                            • Mick West
                              New Member
                              • Dec 2010
                              • 12

                              #15
                              Originally posted by Ramsesx
                              In my case there weren't comments.
                              I mean with comments enabled. It will run the query even if there are no comments.

                              Comment

                              Related Topics

                              Collapse

                              Working...