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
BREAK should terminate the nested FOREACH loop
BREAK is ignored in nested FOREACH loop
2024-07-25 16:26:21 2024-07-25 14:26:21.064 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=Number=1} 2024-07-25 16:26:21 2024-07-25 14:26:21.064 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=Letter=A} 2024-07-25 16:26:21 2024-07-25 14:26:21.064 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=### Number=1, Letter=A} 2024-07-25 16:26:21 2024-07-25 14:26:21.064 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=Letter=B} 2024-07-25 16:26:21 2024-07-25 14:26:21.064 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=### Number=1, Letter=B} 2024-07-25 16:26:21 2024-07-25 14:26:21.064 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=Letter=C} 2024-07-25 16:26:21 2024-07-25 14:26:21.064 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=### Number=1, Letter=C} 2024-07-25 16:26:21 2024-07-25 14:26:21.064 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=Number=2} 2024-07-25 16:26:21 2024-07-25 14:26:21.064 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=Letter=A} 2024-07-25 16:26:21 2024-07-25 14:26:21.065 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=Hello World 1} 2024-07-25 16:26:21 2024-07-25 14:26:21.065 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=### Number=2, Letter=A} 2024-07-25 16:26:21 2024-07-25 14:26:21.065 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=Letter=B} 2024-07-25 16:26:21 2024-07-25 14:26:21.065 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=Hello World 1} 2024-07-25 16:26:21 2024-07-25 14:26:21.065 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=Hello World 2} 2024-07-25 16:26:21 2024-07-25 14:26:21.065 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=THIS SHOULD NEVER HAPPEN!!!} 2024-07-25 16:26:21 2024-07-25 14:26:21.065 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=### Number=2, Letter=B} 2024-07-25 16:26:21 2024-07-25 14:26:21.066 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=Letter=C} 2024-07-25 16:26:21 2024-07-25 14:26:21.066 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=Hello World 1} 2024-07-25 16:26:21 2024-07-25 14:26:21.066 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=### Number=2, Letter=C} 2024-07-25 16:26:21 2024-07-25 14:26:21.066 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=Number=3} 2024-07-25 16:26:21 2024-07-25 14:26:21.066 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=Letter=A} 2024-07-25 16:26:21 2024-07-25 14:26:21.066 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=### Number=3, Letter=A} 2024-07-25 16:26:21 2024-07-25 14:26:21.066 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=Letter=B} 2024-07-25 16:26:21 2024-07-25 14:26:21.066 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=### Number=3, Letter=B} 2024-07-25 16:26:21 2024-07-25 14:26:21.066 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=Letter=C} 2024-07-25 16:26:21 2024-07-25 14:26:21.066 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=### Number=3, Letter=C} 2024-07-25 16:26:21 2024-07-25 14:26:21.066 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=END}
LET $numbers = [1, 2, 3]; LET $letters = ['A', 'B', 'C'];
FOREACH ($number IN $numbers) { CONSOLE.log map('DEBUG', 'Number=' + $number.asString());
FOREACH ($letter IN $letters) { CONSOLE.log map('DEBUG', 'Letter=' + $letter);
IF ($number = 2) { CONSOLE.log map('DEBUG', 'Hello World 1'); IF ($letter = 'B') { CONSOLE.log map('DEBUG', 'Hello World 2'); BREAK; } IF ($letter = 'B') { CONSOLE.log map('DEBUG', 'THIS SHOULD NEVER HAPPEN!!!'); } } CONSOLE.log map('DEBUG', '### Number=' + $number.asString() + ', Letter=' + $letter);
} }
CONSOLE.log map('DEBUG', 'END');
The text was updated successfully, but these errors were encountered:
This is the same issue as #1672. 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
BREAK should terminate the nested FOREACH loop
Actual behavior
BREAK is ignored in nested FOREACH loop
2024-07-25 16:26:21 2024-07-25 14:26:21.064 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=Number=1}
2024-07-25 16:26:21 2024-07-25 14:26:21.064 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=Letter=A}
2024-07-25 16:26:21 2024-07-25 14:26:21.064 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=### Number=1, Letter=A}
2024-07-25 16:26:21 2024-07-25 14:26:21.064 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=Letter=B}
2024-07-25 16:26:21 2024-07-25 14:26:21.064 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=### Number=1, Letter=B}
2024-07-25 16:26:21 2024-07-25 14:26:21.064 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=Letter=C}
2024-07-25 16:26:21 2024-07-25 14:26:21.064 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=### Number=1, Letter=C}
2024-07-25 16:26:21 2024-07-25 14:26:21.064 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=Number=2}
2024-07-25 16:26:21 2024-07-25 14:26:21.064 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=Letter=A}
2024-07-25 16:26:21 2024-07-25 14:26:21.065 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=Hello World 1}
2024-07-25 16:26:21 2024-07-25 14:26:21.065 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=### Number=2, Letter=A}
2024-07-25 16:26:21 2024-07-25 14:26:21.065 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=Letter=B}
2024-07-25 16:26:21 2024-07-25 14:26:21.065 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=Hello World 1}
2024-07-25 16:26:21 2024-07-25 14:26:21.065 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=Hello World 2}
2024-07-25 16:26:21 2024-07-25 14:26:21.065 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=THIS SHOULD NEVER HAPPEN!!!}
2024-07-25 16:26:21 2024-07-25 14:26:21.065 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=### Number=2, Letter=B}
2024-07-25 16:26:21 2024-07-25 14:26:21.066 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=Letter=C}
2024-07-25 16:26:21 2024-07-25 14:26:21.066 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=Hello World 1}
2024-07-25 16:26:21 2024-07-25 14:26:21.066 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=### Number=2, Letter=C}
2024-07-25 16:26:21 2024-07-25 14:26:21.066 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=Number=3}
2024-07-25 16:26:21 2024-07-25 14:26:21.066 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=Letter=A}
2024-07-25 16:26:21 2024-07-25 14:26:21.066 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=### Number=3, Letter=A}
2024-07-25 16:26:21 2024-07-25 14:26:21.066 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=Letter=B}
2024-07-25 16:26:21 2024-07-25 14:26:21.066 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=### Number=3, Letter=B}
2024-07-25 16:26:21 2024-07-25 14:26:21.066 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=Letter=C}
2024-07-25 16:26:21 2024-07-25 14:26:21.066 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=### Number=3, Letter=C}
2024-07-25 16:26:21 2024-07-25 14:26:21.066 INFO [ConsoleStatement] <ArcadeDB_0> {DEBUG=END}
Steps to reproduce
LET $numbers = [1, 2, 3];
LET $letters = ['A', 'B', 'C'];
FOREACH ($number IN $numbers) {
CONSOLE.log map('DEBUG', 'Number=' + $number.asString());
FOREACH ($letter IN $letters) {
CONSOLE.log map('DEBUG', 'Letter=' + $letter);
}
}
CONSOLE.log map('DEBUG', 'END');
The text was updated successfully, but these errors were encountered: