TMyScript and Delimiter

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
rshera
Posts: 8
Joined: Sat 01 Jul 2006 21:04
Contact:

TMyScript and Delimiter

Post by rshera » Sun 21 Sep 2008 21:02

Hi
There seems to be an inconsistency in the way the delimiter statement is handled by TMyScript. The following script will work correctly in MySQL Query Browser, but not in TMyScript (v550):

use test;

delimiter ;

drop view if exists aaa_test_view;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW aaa_test_view AS
select
`t1`.`i` AS `i`,
`t1`.`v` AS `v`
from
`t1`;



drop procedure if exists aaa_test_proc;

delimiter $$

CREATE DEFINER = 'root'@'localhost' PROCEDURE `aaa_test_proc`()
DETERMINISTIC
CONTAINS SQL
SQL SECURITY DEFINER
COMMENT ''
BEGIN
SELECT
t2.i,
t2.v
FROM
t2;

END $$

delimiter ;

GRANT SELECT ON test.aaa_test_view TO 'root'@'loclahost';

With the delimiter statement removed, it works as expected. With the delimiter statement included as shown, it seems to skip the following "drop if exists..." line.

I know I don't need the delimiter line, but some scripts can contain an extra line like this by mistake (copying and pasting from somewhere else), and having them then not execute a following statement would cause problems.

Rob

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Mon 22 Sep 2008 10:28

Thank you for information. We have reproduced this problem and fixed it. This fix will be included in the next MyDAC build.

rshera
Posts: 8
Joined: Sat 01 Jul 2006 21:04
Contact:

Post by rshera » Mon 22 Sep 2008 19:40

Thanks Dimon
That's great.
Robert

Post Reply