TMyScript and Delimiter
Posted: 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
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