We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
24.6.1
Official Docker image
Should immediately terminate the FOREACH loop when reaching the BREAK statement
The execution continues, and BREAK is ignored as seen in this console output:
2024-07-25 16:10:05 2024-07-25 14:10:05.721 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=Element=1} 2024-07-25 16:10:05 2024-07-25 14:10:05.721 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=After IF} 2024-07-25 16:10:05 2024-07-25 14:10:05.721 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=Element=2} 2024-07-25 16:10:05 2024-07-25 14:10:05.721 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=Hello World} 2024-07-25 16:10:05 2024-07-25 14:10:05.721 INFO [ConsoleStatement] <ArcadeDB_0> {REMOVE=This should never be reached} 2024-07-25 16:10:05 2024-07-25 14:10:05.721 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=After IF} 2024-07-25 16:10:05 2024-07-25 14:10:05.721 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=Element=3} 2024-07-25 16:10:05 2024-07-25 14:10:05.721 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=After IF} 2024-07-25 16:10:05 2024-07-25 14:10:05.721 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=END}
If the CONSOLE.log following the BREAK statement is removed, then the BREAK statement is executed as expected and the FOREACH loop is terminated.
LET $list = [1, 2, 3];
FOREACH ($element IN $list) { CONSOLE.log map('DEBUG', 'Element=' + $element.asString());
IF ($element = 2) { CONSOLE.log map('DEBUG', 'Hello World'); BREAK; CONSOLE.log map('REMOVE', 'This should never be reached'); }
CONSOLE.log map('DEBUG', 'After IF'); }
CONSOLE.log map('DEBUG', 'END');
The text was updated successfully, but these errors were encountered:
This is the same issue as #1673. The break doesn't really break in some cases. Working on a fix.
Sorry, something went wrong.
fix: sql script break statement
e0eb1ab
Fixed issues #1672 and #1673
Fixed.
lvca
No branches or pull requests
ArcadeDB Version:
24.6.1
OS and JDK Version:
Official Docker image
Expected behavior
Should immediately terminate the FOREACH loop when reaching the BREAK statement
Actual behavior
The execution continues, and BREAK is ignored as seen in this console output:
2024-07-25 16:10:05 2024-07-25 14:10:05.721 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=Element=1}
2024-07-25 16:10:05 2024-07-25 14:10:05.721 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=After IF}
2024-07-25 16:10:05 2024-07-25 14:10:05.721 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=Element=2}
2024-07-25 16:10:05 2024-07-25 14:10:05.721 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=Hello World}
2024-07-25 16:10:05 2024-07-25 14:10:05.721 INFO [ConsoleStatement] <ArcadeDB_0> {REMOVE=This should never be reached}
2024-07-25 16:10:05 2024-07-25 14:10:05.721 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=After IF}
2024-07-25 16:10:05 2024-07-25 14:10:05.721 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=Element=3}
2024-07-25 16:10:05 2024-07-25 14:10:05.721 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=After IF}
2024-07-25 16:10:05 2024-07-25 14:10:05.721 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=END}
Steps to reproduce
If the CONSOLE.log following the BREAK statement is removed, then the BREAK statement is executed as expected and the FOREACH loop is terminated.
LET $list = [1, 2, 3];
FOREACH ($element IN $list) {
CONSOLE.log map('DEBUG', 'Element=' + $element.asString());
IF ($element = 2) {
CONSOLE.log map('DEBUG', 'Hello World');
BREAK;
CONSOLE.log map('REMOVE', 'This should never be reached');
}
CONSOLE.log map('DEBUG', 'After IF');
}
CONSOLE.log map('DEBUG', 'END');
The text was updated successfully, but these errors were encountered: