-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Added DELIMITER support in jdbc script runner #241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Is anyone ever gonna take a look at this? |
Sorry but I do not understand the change. Can you please explain it further? |
What does the current code do? How is this a problem? delimiter |
CREATE TRIGGER testref BEFORE INSERT ON test1
FOR EACH ROW
BEGIN
INSERT INTO test2 SET a2 = NEW.a1;
DELETE FROM test3 WHERE a3 = NEW.a1;
UPDATE test4 SET b4 = b4 + 1 WHERE a4 = NEW.a1;
END;
|
delimiter ; Currently, the code executes the script as follows: -- part 1
delimiter |
CREATE TRIGGER testref BEFORE INSERT ON test1
FOR EACH ROW
BEGIN
INSERT INTO test2 SET a2 = NEW.a1;
-- part 2
DELETE FROM test3 WHERE a3 = NEW.a1;
-- part 3
UPDATE test4 SET b4 = b4 + 1 WHERE a4 = NEW.a1;
-- part 4
END;
-- part 5
|
delimiter ; This would cause a lot of errors and is not what you want the program to do. What does this patch do? Remember the SQL from before? The ScriptRunner now executes the script as follows: -- part 1
delimiter |
-- part 2
CREATE TRIGGER testref BEFORE INSERT ON test1
FOR EACH ROW
BEGIN
INSERT INTO test2 SET a2 = NEW.a1;
DELETE FROM test3 WHERE a3 = NEW.a1;
UPDATE test4 SET b4 = b4 + 1 WHERE a4 = NEW.a1;
END;
|
-- part 3
delimiter ; Now you can create triggers and stored procedures with this. |
Clear as water :) |
Added DELIMITER support in jdbc script runner
thank you for merging |
A very good comment from #355. |
PR #355 doesn't really address the issue - if you use that change it means (at least for mysql) you have to create native client incompatible files. See this issue in migrations. I created a follow up issue to address this head on |
Added DELIMITER support in jdbc script runner
With this, you can create triggers and stored procedures.