File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ public function parse(Parser $parser)
7474 $ this ->trimChar = $ lexer ->token ->value ;
7575 }
7676
77- if ($ this ->leading || $ this ->trailing || $ this ->both || $ this ->trimChar ) {
77+ if ($ this ->leading || $ this ->trailing || $ this ->both || ( $ this ->trimChar !== false ) ) {
7878 $ parser ->match (Lexer::T_FROM );
7979 }
8080
Original file line number Diff line number Diff line change @@ -172,6 +172,11 @@ public function testFunctionalExpressionsSupportedInWherePart(): void
172172 $ this ->assertValidDQL ("SELECT u.name FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE TRIM(u.name) = 'someone' " );
173173 }
174174
175+ public function testTrimFalsyString (): void
176+ {
177+ $ this ->assertValidDQL ("SELECT u.name FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE TRIM('0' FROM u.name) = 'someone' " );
178+ }
179+
175180 public function testArithmeticExpressionsSupportedInWherePart (): void
176181 {
177182 $ this ->assertValidDQL ('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE ((u.id + 5000) * u.id + 3) < 10000000 ' );
You can’t perform that action at this time.
0 commit comments