Skip to content

Commit 6880861

Browse files
committed
Fix empty SET operations now throw error.
1 parent c905f56 commit 6880861

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/Components/SetOperation.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,11 @@ public static function parse(Parser $parser, TokensList $list, array $options =
139139
$parser->error('Unexpected token.', $commaLastSeenAt);
140140
}
141141

142+
// We got a SET operation without any assignment
143+
if ($ret === []) {
144+
$parser->error('Missing assignment in SET operation.', $list->tokens[$list->idx]);
145+
}
146+
142147
return $ret;
143148
}
144149

tests/data/parser/parseUpdateEmptySet.out

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,14 @@
171171
},
172172
"errors": {
173173
"lexer": [],
174-
"parser": []
174+
"parser": [
175+
[
176+
"Missing assignment in SET operation.",
177+
{
178+
"@type": "@7"
179+
},
180+
0
181+
]
182+
]
175183
}
176184
}

0 commit comments

Comments
 (0)