Bug #11910 Function mod is executed with a space before ( without IGNORE_SPACE set
Submitted: 13 Jul 2005 11:47 Modified: 26 Jul 2005 17:59
Reporter: Renato Botelho Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:4.1.12 OS:Any (All)
Assigned to: Assigned Account CPU Architecture:Any

[13 Jul 2005 11:47] Renato Botelho
Description:
I migrated my mysql 4.0 to 4.1 and start with this problem.

I don't have IGNORE_SPACE set and just function mod is executed fine with or without space before (

I have a table named mod and if it's not fixed I'll need to change a program and re-distribute this via cdrom to a lot of customers and it's a very bad idea.

How to repeat:
mysql> select VERSION();
+-----------+
| VERSION() |
+-----------+
| 4.1.12    |
+-----------+
1 row in set (0.01 sec)

mysql> select * from abs;
Empty set (0.00 sec)

mysql> select * from mod;
ERROR 1064 (42000): 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 'mod' at line 1
mysql> select abs(10.4);
+-----------+
| abs(10.4) |
+-----------+
|      10.4 |
+-----------+
1 row in set (0.00 sec)

mysql> select abs (10.4);
ERROR 1064 (42000): 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 '(10.4)' at line 1
mysql> select mod(4,2);
+----------+
| mod(4,2) |
+----------+
|        0 |
+----------+
1 row in set (0.00 sec)

mysql> select mod (4,2);
+-----------+
| mod (4,2) |
+-----------+
|         0 |
+-----------+
1 row in set (0.00 sec)
[13 Jul 2005 17:45] Jorge del Conde
I was able to reproduce this bug using 4.1.13bk:

mysql> select mod(4,2);
+----------+
| mod(4,2) |
+----------+
|        0 |
+----------+
1 row in set (0.00 sec)

mysql> select mod (4,2);
+-----------+
| mod (4,2) |
+-----------+
|         0 |
+-----------+
1 row in set (0.00 sec)

mysql> select abs(10.4);
+-----------+
| abs(10.4) |
+-----------+
|      10.4 |
+-----------+
1 row in set (0.01 sec)

mysql> select abs (10.4);
ERROR 1064 (42000): 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 '(10.4)' at line 1
mysql>
[13 Jul 2005 17:45] Jorge del Conde
I reproduced this bug under Linux & Win32
[26 Jul 2005 17:59] Sergei Golubchik
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments
to the original bug instead.

Thank you for your interest in MySQL.

Additional info:

a duplicate of bug#10198