Bug #80826 delimiter-error is still (or again) existing
Submitted: 22 Mar 2016 20:05 Modified: 28 Mar 2016 6:59
Reporter: Kai Neumann Email Updates:
Status: Not a Bug Impact on me:
None 
Category:Connector / NET Severity:S3 (Non-critical)
Version:v6.9.8 OS:Windows (x64 german)
Assigned to: CPU Architecture:Any
Tags: delimiter connector error syntax

[22 Mar 2016 20:05] Kai Neumann
Description:
Bug #46429 is still alive in current connectors.
Please see the last both comments on Bug #46429.
But I got this error also if I change the delimiter to a singel character
(see below -> '|')

server is v5.6.29

I tried to add two triggers to a existing table:
(got skript from MYSQL Workbench 6.3.6 "Synchronize Model")

error:
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 'DELIMITER |                                                                     ' at line 1

code
************************************************************
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;                                                                                                                   
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;                                                                                                    
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';                                                                                                  
DELIMITER |                                                                                                                                                                
                                                                                                                                                                           
USE `elite_db`|                                                                                                                                                            
CREATE DEFINER = CURRENT_USER TRIGGER `elite_db`.`tbCommodityData_AFTER_INSERT` AFTER INSERT ON `tbCommodityData` FOR EACH ROW                                             
BEGIN                                                                                                                                                                      
	INSERT INTO `elite_db`.`tbPriceHistory`                                                                                                                                 
	(`station_id`, `commodity_id`, `Sell`, `Buy`, `Demand`, `DemandLevel`, `Supply`, `SupplyLevel`, `Sources_id`, `timestamp`)                                              
	VALUES                                                                                                                                                                  
	(NEW.`station_id`, NEW.`commodity_id`, NEW.`Sell`, NEW.`Buy`, NEW.`Demand`, NEW.`DemandLevel`, NEW.`Supply`, NEW.`SupplyLevel`, NEW.`Sources_id`, NEW.`timestamp`);	    
END|                                                                                                                                                                       
                                                                                                                                                                           
USE `elite_db`|                                                                                                                                                            
CREATE DEFINER = CURRENT_USER TRIGGER `elite_db`.`tbCommodityData_AFTER_UPDATE` AFTER UPDATE ON `tbCommodityData` FOR EACH ROW                                             
BEGIN                                                                                                                                                                      
    IF (NEW.Sell <> OLD.Sell) OR (NEW.Buy <> OLD.Buy) OR (NEW.Sources_id <> OLD.Sources_id) OR                                                                             
       (TIMESTAMPDIFF(hour, OLD.timestamp, NEW.timestamp) > 24) THEN                                                                                                       
		INSERT INTO `elite_db`.`tbPriceHistory`                                                                                                                             
		(`station_id`, `commodity_id`, `Sell`, `Buy`, `Demand`, `DemandLevel`, `Supply`, `SupplyLevel`, `Sources_id`, `timestamp`)                                          
		VALUES                                                                                                                                                              
		(NEW.`station_id`, NEW.`commodity_id`, NEW.`Sell`, NEW.`Buy`, NEW.`Demand`, NEW.`DemandLevel`, NEW.`Supply`, NEW.`SupplyLevel`, NEW.`Sources_id`, NEW.`timestamp`);	
	END IF;                                                                                                                                                                 
END|                                                                                                                                                                       
                                                                                                                                                                           
DELIMITER ;                                                                                                                                                                
                                                                                                                                                              
SET SQL_MODE=@OLD_SQL_MODE;                                                                                                                                                
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;                                                                                                                            
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;                                               *****************************************************************                                                                                       

How to repeat:
Add a trigger with changing the delimiter to a table.
Use the .net connector v6.9.8 under c#/VS2013.
[22 Mar 2016 20:08] Kai Neumann
Edit:

I tried this with different combinations:

DELIMITER $$
DELIMITER $$\n
DELIMITER $$\r\n
DELIMITER |
DELIMITER |\n
DELIMITER |\r\n
[22 Mar 2016 21:31] Kai Neumann
I tried this also with connector v6.3.9 - same result.
Maybe I have a constellation which has got no profit from the fix of Bug #46429

tested variants:
DELIMITER $
DELIMITER $\n
DELIMITER $$
DELIMITER $$\n
[23 Mar 2016 11:47] Kai Neumann
Probably I'm wrong.

I took the MySqlCommand instead of using the MySqlScript.
I didn't test it yet, but I assume the problem was sitting
in front of the keyboard - sorry for this.
[28 Mar 2016 6:59] Chiranjeevi Battula
Hello Cay Liethmann,

Thank you for the bug report.
I tried to reproduce the issue at my end using Visual Studio 2013 (C#.Net) and Connector/Net 6.9.8, MySqlScript but not seeing any issues in DELIMITER.
Please use MySqlScript instead of MySqlCommand.

Thanks,
Chiranjeevi.