Forums

Relevanssi - A Better Search
[resolved] Error on update (wp 3.5 - Relevanssi 3.1) (9 posts)

  1. Rics1983
    Member
    Posted 5 months ago #

    Hi Mikko!
    I was updating to the new version of relevanssi, and although on a website went smoooth, on another i got this error message:

    [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 ''typeitem' ('type', 'item')' at line 1]
    ALTER TABLE tableprefix_relevanssi ADD INDEX 'typeitem' ('type', 'item')

    http://wordpress.org/extend/plugins/relevanssi/

  2. ruud@joyo
    Member
    Posted 5 months ago #

    Hi Mikko, I just got the same error.

    Tried some adjustments to your code:
    $wpdb->query("ALTER TABLE " . $relevanssi_variables['relevanssi_table'] . " ADD INDEX typeitem (type, item);");

    works in MySQL 5.0.51a-3ubuntu5.4

  3. ruud@joyo
    Member
    Posted 5 months ago #

    In relevanssi.php line 114

  4. Frank Staude
    Member
    Posted 5 months ago #

    Hello,

    i have the same error in my error_log after the update.

    [Tue Dec 18 16:44:25 2012] [warn] mod_fcgid: stderr: WordPress-Datenbank-Fehler 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 ''typeitem' ('type', 'item')' at line 1 f\xc3\xbcr Abfrage ALTER TABLE wp_relevanssi ADD INDEX 'typeitem' ('type', 'item') von require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), call_user_func_array, relevanssi_check_old_data
    [Tue Dec 18 16:45:25 2012] [warn] mod_fcgid: stderr: WordPress-Datenbank-Fehler 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 ''typeitem' ('type', 'item')' at line 1 f\xc3\xbcr Abfrage ALTER TABLE wp_relevanssi ADD INDEX 'typeitem' ('type', 'item') von require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), call_user_func_array, relevanssi_check_old_data

    Frank

  5. jrf
    Member
    Posted 5 months ago #

    Same issue here, error log flooded.... WP 3.4.2

    @ruud I've made a small improvement on your code, this should work for most MySql versions:

    File relevanssi.php:

    Find line 114 and replace with:

    if ($res == 0) $wpdb->query("ALTER TABLE %%" . $relevanssi_variables['relevanssi_table'] . "%% ADD INDEX %%typeitem%% (%%type%%, %%item%%);");

    ** IMPORTANT UPDATE **
    DARN! The symbol needed in the query is the symbol used in this markdown editor for indicating code... so the line of code will never show properly....

    Anyways, I've changed the symbol to %% in the code example above. Replace this in live code to a backtick "`"

    Hope this will display correctly now...

    Hope this helps!

    Smile,
    Juliette

  6. Mikko Saari
    Member
    Plugin Author

    Posted 5 months ago #

    Thanks. The code as written seemed to work just fine on my site, but looks like it isn't universally ok. I'll do a quick update soon.

  7. Mikko Saari
    Member
    Plugin Author

    Posted 5 months ago #

    3.1.1 fixes this.

  8. Rics1983
    Member
    Posted 5 months ago #

    Thank you, i'll check asap.

  9. jrf
    Member
    Posted 5 months ago #

    Thanks!

Reply

You must log in to post.

About this Plugin

About this Topic