Everything was working fine before migrating to a new site. But now I get the error below. Let me give some release information before proceeding:

Drupal: 6.13
Event Module: 6.x-2.x-dev
MySQL: 4.0.27
PHP: 4.4.7

I suspect the MySQL database but is there a way to fix it or get a workaround since my hosting provider won't upgrade it?

Here is the error I am getting:

* user warning: 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 'AS event_start_user, e.event_end - INTERVAL IF(tz.is_dst, tz.of query: SELECT n.nid, n.uid, n.title, n.type, e.event_start AS event_start_orig, e.event_end AS event_end_orig, e.timezone, e.has_time, e.has_end_date, tz.offset AS offset, tz.offset_dst AS offset_dst, tz.dst_region, tz.is_dst, e.event_start - INTERVAL IF(tz.is_dst, tz.offset_dst, tz.offset) HOUR_SECOND AS event_start_utc, e.event_end - INTERVAL IF(tz.is_dst, tz.offset_dst, tz.offset) HOUR_SECOND AS event_end_utc, e.event_start - INTERVAL IF(tz.is_dst, tz.offset_dst, tz.offset) HOUR_SECOND + INTERVAL 0 SECOND AS event_start_user, e.event_end - INTERVAL IF(tz.is_dst, tz.offset_dst, tz.offset) HOUR_SECOND + INTERVAL 0 SECOND AS event_end_user, e.event_start - INTERVAL IF(tz.is_dst, tz.offset_dst, tz.offset) HOUR_SECOND + INTERVAL -14400 SECOND AS event_start_site, e.event_end - INTERVAL IF(tz.is_dst, tz.offset in /home/xxx/public_html/newsite/modules/event/event_database.mysql.inc on line 74.
* user warning: 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 '(e.event_start, '2009-07-17 20:31:25') AS time_left, DATEDIFF(e query: SELECT n.nid, n.uid, n.title, n.type, n.status, n.changed, e.event_start, e.event_end, e.timezone, e.has_time, e.has_end_date, TIMEDIFF(e.event_start, '2009-07-17 20:31:25') AS time_left, DATEDIFF(e.event_start, '2009-07-17 20:31:25') AS days_left FROM node n INNER JOIN event e ON n.nid = e.nid WHERE n.status = 1 AND (((e.event_start <> e.event_end) AND ('2009-07-17 20:31:25' >= e.event_start AND '2009-07-17 20:31:25' < e.event_end)) OR ((e.event_start = e.event_end) AND ('2009-07-17 20:31:25' <= e.event_start + INTERVAL 7200 SECOND)) OR e.event_start >= '2009-07-17 20:31:25') AND n.type IN ('event') ORDER BY event_start LIMIT 0, 6 in /home/xxx/public_html/newsite/modules/event/event_database.mysql.inc on line 122.

Comments

hutch’s picture


MySQL: 4.0.27
PHP: 4.4.7

Old MYSQL and old PHP
That is likely to be the reason, the PHP might be OK but mysql needs to be 4.1.x or greater
There was a big jump between 4.0.x and 4.1.x

killes@www.drop.org’s picture

Status: Active » Closed (won't fix)

Yes, mysql 4.1 or better is a requirement for event.module. The status screen will tell you this. There is no workaround. Please ask your hoster to upgrade the software. Neither mysql 4 nor php 4 are supported anymore by their respective vendors.

SanDiego’s picture

Yes, I actually confirmed that this was due to TIMEDIFF and DATEDIFF not being implemented in 4.0. I was able to create a workaround by using

SEC_TO_TIME( (TO_DAYS(e.event_start)*24*3600+TIME_TO_SEC(e.event_start)) - (TO_DAYS('%s')*24*3600+TIME_TO_SEC('%s'))) AS time_left

instead of TIMEDIFF, and

(TO_DAYS(e.event_start) - TO_DAYS('%s')) AS days_left

instead of DATEDIFF. However after fixing this I am having more problems. MySQL 4.0 will likely be a bigger problem than I though. Hopefully the hosting company would upgrade it..