Bug #5891 Triggers stop working if change to sql_mode
Submitted: 5 Oct 2004 1:02 Modified: 3 Aug 2005 15:54
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.2-alpha-debug OS:Linux (SuSE 8.2)
Assigned to: Oleksandr Byelkin CPU Architecture:Any

[5 Oct 2004 1: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 8:18] MySQL Verification Team
Verified with 5.0.2-alpha-debug-log
[22 Jul 2005 12: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 7: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 21: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
[28 Jul 2005 22: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 20: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 20: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 7:59] Oleksandr Byelkin
Thank you for bugreport

bugfix pushed to 5.0.11
[3 Aug 2005 15: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.