You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current version of ScriptUtils.splitSqlScript tries to take into account BEGIN...END blocks. However, it treats any END as an end of the block, even if it's END IF or END LOOP, so that the following one-statement script
BEGIN
rec_loop: LOOP
FETCH blah;
IF something_wrong THEN LEAVE rec_loop; END IF;
do_something_else;
END LOOP;
END;
Is incorrectly split into following "statements":
BEGIN
rec_loop: LOOP
FETCH blah;
IF something_wrong THEN LEAVE rec_loop; END IF
-----------------------------------------------------------------
do_something_else
-----------------------------------------------------------------
END LOOP
-----------------------------------------------------------------
END
This is also broken for the case when a special statement separator is used (like GO in MSSQL tradition, / in Oracle tradition or @ in DB2).
The following statement is not split over @ sign as when it comes to the separator, the algorithm counted more ENDs than BEGINs and and since the balance is not zero, it is not splitting the code:
BEGIN
rec_loop: LOOP
FETCH blah;
IF something_wrong THEN LEAVE rec_loop; END IF;
do_something_else;
END LOOP;
END;
@
CALL something();
@
Relevant log output
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered:
Thanks for taking the time to fill out this bug report! Before submitting a bug, please make sure there is no existing issue for the one you encountered and it has been discussed with the team via discussions or Slack.
Module
Core
Testcontainers version
1.19.1
Using the latest Testcontainers version?
Yes
Host OS
not relevant
Host Arch
not relevant
Docker version
What happened?
Current version of
ScriptUtils.splitSqlScript
tries to take into accountBEGIN...END
blocks. However, it treats anyEND
as an end of the block, even if it'sEND IF
orEND LOOP
, so that the following one-statement scriptBEGIN rec_loop: LOOP FETCH blah; IF something_wrong THEN LEAVE rec_loop; END IF; do_something_else; END LOOP; END;
Is incorrectly split into following "statements":
This is also broken for the case when a special statement separator is used (like
GO
in MSSQL tradition,/
in Oracle tradition or@
in DB2).The following statement is not split over
@
sign as when it comes to the separator, the algorithm counted moreEND
s thanBEGIN
s and and since the balance is not zero, it is not splitting the code:BEGIN rec_loop: LOOP FETCH blah; IF something_wrong THEN LEAVE rec_loop; END IF; do_something_else; END LOOP; END; @ CALL something(); @
Relevant log output
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: