Bug #34091 5.0.41-MAX
Submitted: 27 Jan 2008 15:14 Modified: 28 Jan 2008 5:23
Reporter: Rafael MUZA Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.0.41 OS:Other (POWERBUILDER-7.0)
Assigned to: CPU Architecture:Any
Tags: 5.0.41, MAX, powerbuilder

[27 Jan 2008 15:14] Rafael MUZA
Description:
I am using powerbuilder 7.0 and use following statment.
Error when i use MAX function.

How to repeat:
Error Message:  
[MySQL][ODBC 3.51 Driver][mysqld-5.0.41--log]FUNCTION winwork1.max does not exist

Code : 
select max(item_id) into :It from item ;
[28 Jan 2008 5:23] Valeriy Kravchuk
This is not a bug. Compare:

mysql> select max(item_id) from item;
+--------------+
| max(item_id) |
+--------------+
|         NULL |
+--------------+
1 row in set (0.03 sec)

mysql> select max (item_id) from item;
ERROR 1305 (42000): FUNCTION test.max does not exist

So, do not put space after function name or set proper SQL mode, IGNORE_SPACE (http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html).