Getting this error on cron runs:

WD cron: PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for   [error]
the right syntax to use near '%d' at line 1: 
    SELECT COUNT(DISTINCT bundle_md5) AS advagg_count
    FROM advagg_bundles
    WHERE timestamp < %d
  ; Array
(
    [0] => 1345939666
)
 in advagg_cron() (line 310 of advagg.module).

Comments

AlvaroDeMendoza’s picture

It seems like a mistake on syntax porting on advagg.module at line 305+-. I don't know how to roll the patch. Change

// Prune old bundles
  $bundles_removed += db_query("
    SELECT COUNT(DISTINCT bundle_md5) AS advagg_count
    FROM advagg_bundles
    WHERE timestamp < %d
  ", array($max_bundle_time))->fetchField();

for this

 // Prune old bundles
  $bundles_removed += db_query("SELECT COUNT(DISTINCT bundle_md5) AS advagg_count FROM {advagg_bundles} WHERE timestamp = :timestamp", array(':timestamp' => $max_bundle_time))->fetchField();
shunting’s picture

This made the error go away for me. Thanks.

markhalliwell’s picture

Title: MySQL error on cron run » [META] AdvAgg D7 - Cron
Assigned: Unassigned » markhalliwell
Status: Active » Needs review

I'll review this once a few other issues have been settled.

I'm renaming this issue to become the meta issue for #1171546: AdvAgg - D7 Port/Re-write and placing it on the issue summary of that issue. This will need to be fixed before a stable release can be made.

mikeytown2’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Status: Needs review » Fixed

Fixed in the latest 7.x-2.x #1171546-105: AdvAgg - D7 Port/Re-write

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.