[Koha-bugs] [Bug 7802] A MySQLism is used to get the current date.

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Mar 10 20:45:10 CET 2014


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7802

--- Comment #29 from Galen Charlton <gmcharlt at gmail.com> ---
Comment on attachment 22816
  --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=22816
Bug 7802: Remove CUR_DATE() and CURRENT_DATE() MySQLisms, replace by CAST(now()
AS date).

Review of attachment 22816:
 --> (http://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=7802&attachment=22816)
-----------------------------------------------------------------

::: misc/cronjobs/longoverdue.pl
@@ +130,5 @@
>      SELECT items.itemnumber, borrowernumber, date_due
>        FROM issues, items
>       WHERE items.itemnumber = issues.itemnumber
> +      AND  DATE_SUB(CAST(now() AS date), INTERVAL ? DAY)  > date_due
> +      AND  DATE_SUB(CAST(now() AS date), INTERVAL ? DAY) <= date_due

DATE_SUB() is not portable to PostgreSQL.  As implied by my previous comment,
I'm much more interested in seeing patches that provably improve portability of
the SQL, not ones that just search-and-replace.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list