Bug #5891 Triggers stop working if change to sql_mode
Submitted: 5 Oct 2004 3:02 Modified: 3 Aug 2005 17:54
Reporter: Peter Gulutzan
Status: Closed
Category:Server Severity:S3 (Non-critical)
Version:5.0.2-alpha-debug OS:Linux (SuSE 8.2)
Assigned to: Bugs System Target Version:

[5 Oct 2004 3:02] Peter Gulutzan
Description:
If I create a trigger depending on an SQL_MODE='ANSI' 
setting, such as use of ""s for delimiting, I get an 
error later when I have SQL_MODE='' setting. 

How to repeat:
mysql> set sql_mode='ansi';// 
Query OK, 0 rows affected (0.00 sec) 
 
mysql> create table x10 ("x10 column" int);// 
Query OK, 0 rows affected (0.67 sec) 
 
mysql> create trigger x10_bi before insert on x10 for each row set new . "x10 column" = 
5;// 
Query OK, 0 rows affected (0.01 sec) 
 
mysql> quit// 
Bye 
pgulutzan@d-142-59-78-116:/tmp> /usr/local/mysql/bin/mysql --user=root 
Welcome to the MySQL monitor.  Commands end with ; or \g. 
Your MySQL connection id is 7 to server version: 5.0.2-alpha-debug 
 
Type 'help;' or '\h' for help. Type '\c' to clear the buffer. 
 
mysql> use db5; 
Database changed 
 
mysql> insert into x10 values (0); 
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 '"x10 column" 
= 5' at line 1
[5 Oct 2004 10:18] Victoria Reznichenko
Verified with 5.0.2-alpha-debug-log
[22 Jul 2005 14:35] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/27471
[27 Jul 2005 9:25] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/27625
[28 Jul 2005 23:44] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/27693
[29 Jul 2005 0:09] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/27695
[29 Jul 2005 22:16] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/27729
[29 Jul 2005 22:39] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/27730
[30 Jul 2005 9:59] Oleksandr Byelkin
Thank you for bugreport

bugfix pushed to 5.0.11
[3 Aug 2005 17:54] Jon Stephens
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

Documented bugfix in 5.0.11 changelog; closed.