I am experiencing a number of errors in my syslog that may be pointing at vars.module. These messages always occur during cron runs.

Error 1: 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 '= 0' at line 1 query: SELECT name FROM system WHERE type = 'module' AND schema = 0 in /srv/www/htdocs/drupal6/sites/all/modules/vars/vars.module on line 537.

Error 2: array_fill(): Number of elements must be positive in /srv/www/htdocs/drupal6/includes/database.inc on line 252.

Error 3: implode(): Invalid arguments passed in /srv/www/htdocs/drupal6/includes/database.inc on line 252.

Error 4: 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 ')' at line 1 query: SELECT * FROM variable_default WHERE module IN () in /srv/www/htdocs/drupal6/sites/all/modules/vars/vars.module on line 545.

The line being referenced in the first error reported is as follows:

$query = db_query("SELECT name FROM {system} WHERE type = 'module' AND schema = %d", SCHEMA_UNINSTALLED);

Any help would be appreciated.

Thank you,

-Matthew C Moss-

Comments

clkeenan’s picture

Im having this exact same problem. Did you find a fix?

clkeenan’s picture

Checking in to see if there is an update on this error

marcred’s picture

Version: 6.x-2.0-alpha7 » 6.x-2.x-dev
Status: Active » Needs review

Try to change the word schema by schema_version (like it appears in the system table):

$query = db_query("SELECT name FROM {system} WHERE type = 'module' AND schema_version = %d", SCHEMA_UNINSTALLED);

Anonymous’s picture

Title: Syslog - Error in SQL syntax; line 537 of vars.module » The query doesn't use the correct field name, and the code doesn't check if there are row matching the query

The query doesn't use the correct field name, but the code should also check if there is any row matching the first query.