Closed (fixed)
Project:
Event
Version:
5.x-2.x-dev
Component:
Basic Event
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Jul 2007 at 13:03 UTC
Updated:
24 Jul 2007 at 12:17 UTC
Hi,
after upgrading event from 5.x-1.x-dev to 5.x-2.x-dev now i am getting lot of php error logs in my recent logs when someone tries to access any event. e.g. http://www.example.com/drupal/event/2007/10/26/month/all/all
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 'HAVING (event_start >= '2007-10-01 00:00:00' AND event_start <= '2007-10-31 23:5' at line 1 query: SELECT DISTINCT(n.nid), n.uid, n.title, n.type, e.event_start, e.event_start AS event_start_orig, e.event_end, e.event_end AS event_end_orig, e.timezone, 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 19800 SECOND AS e in /home/example/public_html/drupal/includes/database.mysql.inc on line 172.
is it bug or am i making any mistake anywhere. My php version is 4.4.2 and mysql 4.1
--rafi
Comments
Comment #1
chaos21in commentedThrough "devel module" i found the exact mysql query which is producing that error, it is:
at event_get_events_event . The weired part is this error is NOT coming if user is admin, for everyone else the error is coming irrespective of whether person logged in or not, and what role he/she has.
--rafi
HTH
--rafi
Comment #2
chaos21in commentedHi,
Can somebody please fix this problem, as it is freaking me out now. The main part of my site is these event management and now that is screwed, even the main event page http://www.example.com/drupal/event is giving such mysql errors. If i run same mysql queries directly in database using phpmyadmin or if user logged in is admin then it works fine. I dont see any permission related problem here as before or after upgradation i have done no changes of that sort.
Please somebody fix it as soon as possible.
PS: i made a big mistake and not taken backup of my database before upgradation.
--rafi
Comment #3
chaos21in commentedOk i finally figured out where exactly is the problem. It is indeed a badly formed sql query. I gave permission to run devel module to a non-admin user and saw what are the sql queries it is querying. And then run the same sql through phpmyadmin, and was surprised to see it is indeed giving syntax errors there as well. The erroneous sql query it was trying to run is:
but due to wrong placement of one of the closing of brackets it is giving syntax error. The closing of totally last bracket should be closing just before "Having" and not at the end. So the correct sql statement should be (in my opinion) :
I run this query in phpmyadmin and it is running perfectly giving same set of results what admin is getting. (Note that all events are accessible to all users according to my user permission settings)
Now please some one fix this bug and updat the cvs so that i can download.
--rafi
Comment #4
gerhard killesreiter commentedThese errors are generated by an unfortunate interaction between Drupal's regex for access rules and the SQL queries that event moudle 5.2 provides. I'll try to resolve them,
Comment #5
killes@www.drop.org commentedIt is actually not a regexp, but still it is a core issue. I've filed an issue with a patch over here: http://drupal.org/node/158133
Please test it and report if it fixes your problem on the other issue.
Comment #6
chaos21in commentedPerfect ...It works absolutely fine with me...Thanks a lot Killes for this patch....
:)
--rafi
Comment #7
chaos21in commentedComment #8
(not verified) commented