Recent Topics

v4.1.5 : MySQL error on install/upgrade

Started by on Jul 24, 2012 – Contents updated: Jul 24, 2012

Jul 24, 2012 17:51    

UPDATE: v4.1.5b fixes this error

When running the install script for an upgrade, I get this error:
Additional information about this error:
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 '), (4, "last_invalidation_timestamp", ), (5, "last_invalidation_timestamp", ),' at line 1(Errno=1064)
Your query: Invalidate blogs's page caches
REPLACE INTO evo_coll_settings ( cset_coll_ID, cset_name, cset_value )

VALUES (1, "last_invalidation_timestamp", ), (4, "last_invalidation_timestamp", ), (5, "last_invalidation_timestamp", ), (6, "last_invalidation_timestamp", ), (8, "last_invalidation_timestamp", )

Looks like there is an empty field in each value entry.

Jul 24, 2012 21:45

Looking in the code, in function invalidate_pagecaches() in file inc/_core/_misc.func.php, it seems that $servertimenow is not set in the upgrade case.
In 4.1.4, the function used a local variable that was set to the output of time(), as a diff shows.

Jul 25, 2012 03:07

This diff fixes the problem:

Code

--- b2evolution-4.1.4.orig/blogs/install/_functions_evoupgrade.php  2012-04-03 11:17:56.000000000 -0700
+++ b2evolution-4.1.5/blogs/install/_functions_evoupgrade.php  2012-07-24 12:58:37.463559112 -0700
@@ -242,6 +242,9 @@
  global $locales, $default_locale;
  global $DB;
  global $admin_url;
+  global $servertimenow;
+
+  $servertimenow = time();
  // used for defaults, when upgrading to 1.6
  global $use_fileupload, $fileupload_allowedtypes, $fileupload_maxk, $doubleCheckReferers;
@@ -3144,4 +3147,4 @@
/*
  * $Log: _functions_evoupgrade.php,v $
  */

Jul 26, 2012 06:15

Yep, a nasty error that was fixed in trunk but somehow squeezed into "stable" branch :)

Here's the function from trunk.

PHP

function invalidate_pagecaches()
{
    global $DB$Settings$servertimenow;
 
    // get current server time
    $timestamp = ( empty( $servertimenow ) ? time() : $servertimenow );
 
    // get all blog ids
    if( $blog_ids $DB->get_col'SELECT blog_ID FROM T_blogs' ) )
    {    // build invalidate query
        $query 'REPLACE INTO T_coll_settings ( cset_coll_ID, cset_name, cset_value ) VALUES';
        foreach( $blog_ids as $blog_id )
        {
            $query .= ' ('.$blog_id.', "last_invalidation_timestamp", '.$timestamp.' ),';
        }
        $query substr$query0strlen$query ) - );
        $DB->query$query'Invalidate blogs\'s page caches' );
    }
 
    // Invalidate general cache content also
    $Settings->set'last_invalidation_timestamp'$timestamp );
    $Settings->dbupdate();
}

Jul 29, 2012 00:04

I just upgraded and had the same issue.

...so after the error everything seems to be running properly. Do I need to do something?

Jul 29, 2012 00:11

v4.1.5b fixes that error

...so after the error everything seems to be running properly. Do I need to do something?

Yes, the only problem was in the function mentioned above/

Jul 29, 2012 00:33

I'm not clear on what exactly I need to do - sorry. I already deleted the install folder as everything seemed to be working - I can re-upload it if needed, but my installation shows the new version 4.1.5 running and I'm not experiencing any errors.

Can you please advise.

Jul 29, 2012 04:56

...nevermind - I saw and ran the update - everything went through fine. Thnx

Aug 06, 2012 13:53

Hello,
Updated from 4.12 to 4.15b and get the same error. So what to do? Ignore or change code?

thx for yer time

micha

Aug 06, 2012 20:37

@micha69

Are you talking about this 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 '), (4, "last_invalidation_timestamp", ), (5, "last_invalidation_timestamp", ),' at line 1(Errno=1064)
Your query: Invalidate blogs's page caches
REPLACE INTO evo_coll_settings ( cset_coll_ID, cset_name, cset_value )

You should [u]only[/u] see it during install/upgrade.


Form is loading...

powered by b2evolution – This forum is powered by b2evolution CMS, a complete engine for your website.