mysqldump incorrect drop trigger

Bug #1504202 reported by Alexander
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL Server
Unknown
Unknown
Percona Server moved to https://jira.percona.com/projects/PS
Status tracked in 5.7
5.1
Invalid
Undecided
Unassigned
5.5
Invalid
Undecided
Unassigned
5.6
Triaged
Medium
Unassigned
5.7
Triaged
Medium
Unassigned

Bug Description

mysql is allow to use trigger names that contains dots.
But when mysqldump generate sql file that contains triggers with dots it add something like this:

/*!50032 DROP TRIGGER IF EXISTS trigger.with.dots */;

It is incorrect sql statement. Name with dots must be in quotes:

/*!50032 DROP TRIGGER IF EXISTS `trigger.with.dots` */;

Revision history for this message
Valerii Kravchuk (valerii-kravchuk) wrote :

This is easy to confirm. Just create trigger like this in some database:

create database tri;
use tri;
create table t1(id int);
create trigger `trigger.with.dots` before insert on t1 for each row set @a=1;

and then dump with --add-drop-trigger option:

mysqldump --triggers --no-data --no-create-info --add-drop-trigger -uroot -proot -P3314 tri

to see these:

/*!50032 DROP TRIGGER IF EXISTS trigger.with.dots */;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 trigger `trigger.with.dots` before insert on t1 for each row set @a=1 */;;
...

tags: added: upstream
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-1656

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.