← Back to team overview

mahara-contributors team mailing list archive

[Bug 1399311] A change has been merged

 

Reviewed:  https://reviews.mahara.org/4089
Committed: http://gitorious.org/mahara/mahara/commit/36345b8e40f35cbc09ed9f2e1a754a03854011e4
Submitter: Aaron Wells (aaronw@xxxxxxxxxxxxxxx)
Branch:    1.9_STABLE

commit 36345b8e40f35cbc09ed9f2e1a754a03854011e4
Author: Aaron Wells <aaronw@xxxxxxxxxxxxxxx>
Date:   Fri Dec 12 11:05:34 2014 +1300

Fix MySQL syntax error in cron task

Bug 1399311

Change-Id: I8d66b266d6de3dedb9069f852c5540a139ebb1e5

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1399311

Title:
  SQL syntax error in cron_event_log_expire on key word SECONDS

Status in Mahara ePortfolio:
  Fix Committed
Status in Mahara 1.10 series:
  Fix Committed
Status in Mahara 1.8 series:
  Fix Committed
Status in Mahara 1.9 series:
  Fix Committed
Status in Mahara 15.04 series:
  Fix Committed

Bug description:
  Mahara v1.10.0, Linux, MySQL.

  We run Mahara on MySQL, and we get this error with our Cron :

  {code}
  [INF] b8 (lib/cron.php:137) Running core cron cron_event_log_expire
  [WAR] b8 (lib/errors.php:745) Failed to get a recordset: mysqli error: [1064: 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 'SECONDS' at line 1] in EXECUTE("DELETE FROM "mhr_event_log" WHERE time < CURRENT_DATE - INTERVAL 31536000 SECONDS")
  [WAR] b8 (lib/errors.php:745) Command was: DELETE FROM "mhr_event_log" WHERE time < CURRENT_DATE - INTERVAL 31536000 SECONDS
  Call stack (most recent first):
    * log_message("Failed to get a recordset: mysqli error: [1064: Yo...", 8, true, true) at /app/apache2/htdocs/portfolio/lib/errors.php:95
    * log_warn("Failed to get a recordset: mysqli error: [1064: Yo...") at /app/apache2/htdocs/portfolio/lib/errors.php:745
    * SQLException->__construct("Failed to get a recordset: mysqli error: [1064: Yo...") at /app/apache2/htdocs/portfolio/lib/dml.php:959
    * delete_records_sql("DELETE FROM "mhr_event_log" WHERE time < CURRENT_D...", null) at /app/apache2/htdocs/portfolio/lib/dml.php:936
    * delete_records_select("event_log", "time < CURRENT_DATE - INTERVAL 31536000 SECONDS") at /app/apache2/htdocs/portfolio/lib/mahara.php:3746
    * cron_event_log_expire() at /app/apache2/htdocs/portfolio/lib/cron.php:142

  
  In the cron_event_log_expire() method of /lib/mahara.php, the key word "SECONDS" is used; it should be "SECOND", shouldn't it?

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1399311/+subscriptions


References