Page 1 of 1

TMyScript and Delimiter

Posted: Sun 21 Sep 2008 21:02
by rshera
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

Posted: Mon 22 Sep 2008 10:28
by Dimon
Thank you for information. We have reproduced this problem and fixed it. This fix will be included in the next MyDAC build.

Posted: Mon 22 Sep 2008 19:40
by rshera
Thanks Dimon
That's great.
Robert