Bug #785 day() doesnt work under certain queries
Submitted: 3 Jul 2003 4:57 Modified: 3 Jul 2003 17:25
Reporter: [ name withheld ] Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:mysqld Ver 3.23.47-max-debug OS:Windows (win2K)
Assigned to: CPU Architecture:Any

[3 Jul 2003 4:57] [ name withheld ]
Description:
when i run some complex query, the function day() refuses to work, if i remove it, it works fine. in other simpler queries day() just works fine.

here's the query:
SELECT *, content.date as date, content_loc.region_id as region_id,  content_loc.country_id as country_id, DAY(date) as day, MONTH(date) as month, YEAR(date) as year

FROM content , content_loc
WHERE content.content_id = content.content_id AND content.content_id=$id

MySQL tells me the following:

You have an error in your SQL syntax near '(date) as day, MONTH(date) as month, YEAR(date) as year FROM conten' at line 1

------------

i'm sure it's a bug. because if i only remove day(), the query works just fine.

How to repeat:
i have no idea, but if someone wants my table structure i'll gladly provide him with it. only with this query day() doesn't work.
[3 Jul 2003 17:25] Michael Widenius
Sorry, but the bug system is not the appropriate forum for asking
support questions. Your problem is not the result of a bug.
For a list of more appropriate places to ask for help using MySQL
products, please visit http://www.mysql.com/support/

Thank you for your interest in MySQL.

MySQL doesn't have a DAY() function, so I have to assume you are doing something wrong in the queries where you think you are using DAY().

Another option is that DAY() is an UDF function that isn't always loaded into MySQL.