← Back to team overview

mahara-contributors team mailing list archive

[Bug 1399311] Re: SQL syntax error in cron_event_log_expire on key word SECONDS

 

Thank you Aaron!

-- 
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:
  Confirmed
Status in Mahara 1.10 series:
  Confirmed
Status in Mahara 1.8 series:
  Confirmed
Status in Mahara 1.9 series:
  Confirmed
Status in Mahara 15.04 series:
  Confirmed

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