No announcement yet.

MySQL version Issue while Upgrading from 3.6.7 PL1 to 3.8.7 PL2

  • Filter
  • Time
  • Show
Clear All
new posts

  • MySQL version Issue while Upgrading from 3.6.7 PL1 to 3.8.7 PL2

    Hi there,

    I believe this is a bug in vBulletin 3.8.7 PL2 upgrade script, but still need to confirm with vB Team/Expert

    My System Info:

    $ php -v
    PHP 5.2.17 (cli) (built: Jan 7 2011 10:39:29)

    mysql> select version();
    | version() |
    | 5.5.15 |

    Upgrading from vBulletin 3.6.7 PL1 to 3.8.7 PL2.

    I run into the database error on http://www.[mydomain].com/install/upgrade_380a2.php?step=3

    Error Detail:
    Database error in vBulletin 3.7.1:
    Invalid SQL:
                    ALTER TABLE groupmessage
                    TYPE = MYISAM;
    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 'TYPE = MYISAM' at line 2
    Error Number  : 1064
    Request Date  : Friday, September 16th 2011 @ 12:01:29 PM
    Error Date    : Friday, September 16th 2011 @ 12:01:30 PM
    Script        : http://www.[mydomain].com/install/upgrade_380a2.php?step=3
    Referrer      : http://www.[mydomain].com/install/upgrade_380a2.php?step=2
    IP Address    :
    Username      : 
    Classname     : vB_Database_MySQLi
    MySQL Version : 5.5.15
    I know that in MySQL 5.5 syntax "TYPE = MYISAM" is no longer valid, you have to use "ENGINE = MYISAM". Unfortunately, in this upgrade script, it is somehow using the old command instead.

    Although I see:
    PHP Code:
    $enginetype = (version_compare(MYSQL_VERSION'4.0.18''<')) ? 'TYPE' 'ENGINE'
    in many places of vB upgrade scripts, this script indeed failed.

    I was so enthusiastic to know why this is failing, and couldn't wait for vB Support. I dug through the upgrade code.

    Database Error thrown from:
    File: /upload/install/upgrade_380a2.php
    Line: 503
    Code: $upgrade->execute();
    This function definition is in upgradecore.php and inside that function setup_db_alter_class is called
    File: /upload/install/upgradecore.php
    Line: 1139
    Code: $this->setup_db_alter_class($data['table']);
    Inside of setup_db_alter_class function, vB_Database_Alter_MySQL class is created
    File: /upload/install/upgradecore.php
    Line: 1309
    Code: $this->alter_cache["$table"] =& new vB_Database_Alter_MySQL($this->db);
    Finally, I reached to where the real problem exists: "TYPE = {MySQL Table Type}"
    File: /upload/includes/class_dbalter.php
    Line: 428
    Code: $this->sql = "
                                    ALTER TABLE " . TABLE_PREFIX . $this->db->escape_string($this->table_name) . "
                                    TYPE = " . $this->db->escape_string(strtoupper($type));

    So the main cause of Database Error is in
    File: /upload/includes/class_dbalter.php 
    Line: 428
    It shouldn't be hard coded as "TYPE = "; MYSQL_VERSION should be checked here first to determine whether to use "TYPE" or "ENGINE".

    I hope someone can confirm this for me. Thanks.

  • #2
    Whatever version you have there, it isnt vB 4.1.5

    That alter statement is at line 464, and uses ENGINE.

    Even right back as far as vb 4.1.0, that alter statement is around line 464, so you must be using a very old set of files. You need the latest versions.
    Baby, I was born this way


    • #3
      Paul, he's upgrading to 3.8.7, not 4.x

      Please don't PM or VM me for support - I only help out in the threads.
      vBulletin Manual & vBulletin 4.0 Code Documentation (API)
      Want help modifying your vbulletin forum? Head on over to
      If I post CSS and you don't know where it goes, throw it into the additional.css template.

      W3Schools &lt;- awesome site for html/css help


      • #4

        I confused this with another thread on the same subject.

        Yes, its a bug in 3.8.7. It was only fixed in 4.1.5 onwards, not in the 3.x series.
        Baby, I was born this way


        • #5
          Thanks for confirming that, Paul and Lynne. You guys are rock!!!

          I patched the "/upload/includes/class_dbalter.php" file by myself while I was in upgrade process. After that, I reverted back to original file which comes with vB 3.8.7 PL2.

          Should I keep the patched version or vB 3.8.7 PL2 original version on my production sites?

          Great Thanks.


          • #6
            That functionality is only used in installs & upgrades.
            Baby, I was born this way


            • #7
              Thanks for the info. Appreciate that.


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