Announcement

Collapse
No announcement yet.

Database error Unknown column 'bypass' in 'where clause'

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

  • Database error Unknown column 'bypass' in 'where clause'

    I keep getting this db error on my test server

    Database error in vBulletin 3.0.0 Beta 3:

    Invalid SQL:
    ### Query for stale sessions that don't bypass the lastactivity ###
    SELECT userid,lastactivity
    FROM session
    WHERE lastactivity < 1056766244
    AND bypass = 0

    mysql error: Unknown column 'bypass' in 'where clause'

    mysql error number: 1054

    Date: Friday 27th of June 2003 09:40:44 PM
    Script: http://localhost/v3b4/cron.php?&rand=199106
    Referer: http://localhost/v3b4/index.php?
    Username: tamarian
    IP Address: x.x.x.x
    vB Drupal Community Plumbing | vB Survey | vBusy | vB Spell | vBouncer

  • #2
    you have beta 4 files on a beta 3 database.
    Scott MacVicar

    My Blog | Twitter

    Comment


    • #3
      I think that means run upgrade.php fyi.

      Comment


      • #4
        Originally posted by Scott MacVicar
        you have beta 4 files on a beta 3 database.
        Yes, I think I ran the wrong upgrade file. upgrade2 seem to fix that
        vB Drupal Community Plumbing | vB Survey | vBusy | vB Spell | vBouncer

        Comment


        • #5
          Always run upgrade.php, It'll automatically send you to the correct upgradeX.php file.

          Comment


          • #6
            Damn, I just got this error right after I thought I'd fixed a session table corruption problem. I dropped the table and re-imported the blank structure. Any idea what's going on?

            Edit: I should point out that I'm using beta 4. My upgrade path went from 2.3.0 to 3.0 beta 3 to 3.0 beta 4. I didn't start getting these errors until I imported the blank session table. When I upgraded I deleted all the beta 3.0 files first, uploaded the new ones and then used the upgrade script in the usual way.
            Last edited by Stryker; Tue 8 Jul '03, 3:07pm.

            Comment


            • #7
              So is anyone else having problems with this? I'm still getting about 100 error emails a day all like this one...

              Database error in vBulletin 3.0.0 Beta 4:

              Invalid SQL:
              ### Query for stale sessions that don't bypass the lastactivity ###
              SELECT userid,lastactivity
              FROM session
              WHERE lastactivity < 1057746663
              AND bypass = 0

              mysql error: Unknown column 'bypass' in 'where clause'

              mysql error number: 1054

              The table type of the session entry was set to ISAM and has been all along and I've never had this problem until now. I read in another thread that it should be set as HEAP. I changed that last night and it hasn't made any difference.

              Comment


              • #8
                Login to your Admin CP and under Import & Maintenance select Repair / Optimize Tables. Check All and click Continue, see if that corrects it.

                Comment


                • #9
                  The answer is right up above. You either didn't run the upgrade script or you dropped your session table and used the incorrect schema to add it back.

                  Comment


                  • #10
                    I've already tried to use the repair script. Everything came back 'OK' but the session table was nowhere to be seen.

                    I did run the upgrade script. Everything was fine until these Inktomi bots crashed the session table. I imported the structure for the session table by copying the relevant text from mysql-scema.php. This was as follows...

                    CREATE TABLE " . TABLE_PREFIX . "session (
                    sessionhash char(32) NOT NULL DEFAULT '',
                    userid int unsigned NOT NULL DEFAULT '0',
                    host char(15) NOT NULL DEFAULT '',
                    idhash char(32) NOT NULL DEFAULT '',
                    lastactivity int unsigned NOT NULL DEFAULT '0',
                    location char(255) NOT NULL DEFAULT '',
                    useragent char(100) NOT NULL DEFAULT '',
                    styleid smallint unsigned NOT NULL DEFAULT '0',
                    loggedin smallint unsigned NOT NULL DEFAULT '0',
                    inforum smallint unsigned NOT NULL DEFAULT '0',
                    inthread int unsigned NOT NULL DEFAULT '0',
                    incalendar smallint unsigned NOT NULL DEFAULT '0',
                    badlocation smallint unsigned NOT NULL DEFAULT '0',
                    bypass TINYINT NOT NULL DEFAULT '0',
                    PRIMARY KEY (sessionhash)
                    )
                    ";

                    ...except I replaced the top line with CREATE TABLE `session` (

                    Comment


                    • #11
                      Try this:

                      CREATE TABLE session (
                      sessionhash varchar(32) NOT NULL default '',
                      userid int(10) unsigned NOT NULL default '0',
                      host varchar(15) NOT NULL default '',
                      useragent varchar(100) NOT NULL default '',
                      lastactivity int(10) unsigned NOT NULL default '0',
                      location varchar(255) NOT NULL default '',
                      styleid smallint(5) unsigned NOT NULL default '0',
                      althash varchar(32) NOT NULL default '',
                      badlocation tinyint(3) unsigned NOT NULL default '0',
                      inforum smallint(5) unsigned NOT NULL default '0',
                      inthread int(10) unsigned NOT NULL default '0',
                      incalendar int(10) unsigned NOT NULL default '0',
                      loggedin smallint(5) unsigned NOT NULL default '0',
                      idhash varchar(32) NOT NULL default '',
                      bypass smallint(6) NOT NULL default '0',
                      PRIMARY KEY (sessionhash)
                      ) TYPE=MyISAM;

                      Comment


                      • #12
                        OK, thanks. I dropped my version and imported yours. I'll just have to wait and see if the error emails stop coming now. Where did you get these queries from btw?

                        Comment


                        • #13
                          I just dumped my current forums database table, 'session'.

                          Comment


                          • #14
                            That did the trick, thanks very much. The bombardment of error emails finally stopped, but today those Inktomi bots crashed the table again and I had to repeat the steps above to fix it. It wasn't possible to just use the 'delete from' command to empty the data so I had to drop it and reimport.

                            Well at least I know how to fix it now, that's progress anyway. Hopefully these bots will be finished soon so it won't be a problem in future. Do you know if this has been classified as a vB 3.0 bug or does it also happen with vB 2.3.0? It's odd that the queries in the installation file didn't work seeing as they're the ones that would be used when you upgrade or install for the first time.

                            Comment


                            • #15
                              Now I'm getting hundreds of error emails like this...

                              Database error in vBulletin 3.0.0 Beta 4: Invalid SQL: SELECT * FROM session WHERE userid = 0 AND host = '64.68.82.25' AND idhash = 'b4060478aad084bc81f95bed62b2972d' LIMIT 1 mysql error: Can't open file: 'session.MYI'. (errno: 145) mysql error number: 1016
                              Could one of the vB devs tell me, is this a beta issue or a MySQL problem?

                              Comment

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