Skip to content
New issue

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

Allow arithmetic expressions within IN operator #9242

Merged
merged 6 commits into from
Dec 27, 2021

Conversation

webda2l
Copy link
Contributor

@webda2l webda2l commented Dec 12, 2021

Replace and close #6476

@derrabus
Copy link
Member

Would it be possible to add a functional test for this feature? I'd feel better if we actually executed the generated query on a real database.

@derrabus derrabus added the DQL label Dec 14, 2021
@webda2l
Copy link
Contributor Author

webda2l commented Dec 14, 2021

Sure, functional tests added. But maybe in failure because not ran in local, I'll see with the CI

@derrabus
Copy link
Member

You should be able to run the SQLite tests locally though.

@webda2l webda2l force-pushed the arithmetic-in-expression-fix branch from 1f7aa62 to e1bda97 Compare December 15, 2021 19:40
@webda2l
Copy link
Contributor Author

webda2l commented Dec 15, 2021

After rebase, local tests with sqlite are ok.

david@laptop:~/Works/orm$ vendor/bin/phpunit -c ci/github/phpunit/sqlite.xml
PHPUnit 9.5.10 by Sebastian Bergmann and contributors.

Warning:       Your XML configuration validates against a deprecated schema.
Suggestion:    Migrate your XML configuration using "--migrate-configuration"!

...................................................
Using DB driver Doctrine\DBAL\Driver\PDO\SQLite\Driver
..........   61 / 3597 (  1%)
.............................................................  122 / 3597 (  3%)
.............................................................  183 / 3597 (  5%)
.............................................................  244 / 3597 (  6%)
.........SS..................................................  305 / 3597 (  8%)
.............................................................  366 / 3597 ( 10%)
.............................................................  427 / 3597 ( 11%)
..............S.........SSSS.S...............................  488 / 3597 ( 13%)
.............................................................  549 / 3597 ( 15%)
.............................................................  610 / 3597 ( 16%)
......SS.....................................................  671 / 3597 ( 18%)
.............................................................  732 / 3597 ( 20%)
.............................................................  793 / 3597 ( 22%)
.............................................................  854 / 3597 ( 23%)
.............................................................  915 / 3597 ( 25%)
.............................................................  976 / 3597 ( 27%)
............................................................. 1037 / 3597 ( 28%)
.............................................S.SSSSSSSSSSSS.. 1098 / 3597 ( 30%)
............................................................. 1159 / 3597 ( 32%)
............................................................. 1220 / 3597 ( 33%)
..SS.................................S....................... 1281 / 3597 ( 35%)
...................S......................................... 1342 / 3597 ( 37%)
.........................................S................... 1403 / 3597 ( 39%)
............................................................. 1464 / 3597 ( 40%)
............................................................. 1525 / 3597 ( 42%)
.............................................S..SS........... 1586 / 3597 ( 44%)
....S..................................................S..... 1647 / 3597 ( 45%)
...........S.................................SS.............. 1708 / 3597 ( 47%)
............................................................. 1769 / 3597 ( 49%)
............................................................. 1830 / 3597 ( 50%)
............................................................. 1891 / 3597 ( 52%)
............................................................. 1952 / 3597 ( 54%)
......................................SSSSSSS................ 2013 / 3597 ( 55%)
............................................................. 2074 / 3597 ( 57%)
...........................S................................. 2135 / 3597 ( 59%)
............................................................. 2196 / 3597 ( 61%)
............................................................. 2257 / 3597 ( 62%)
..........................SS.........................S....... 2318 / 3597 ( 64%)
............SSS..............................IISS............ 2379 / 3597 ( 66%)
.............S.................SSS........................... 2440 / 3597 ( 67%)
............................................................. 2501 / 3597 ( 69%)
............................................................. 2562 / 3597 ( 71%)
............................................................. 2623 / 3597 ( 72%)
............................................................. 2684 / 3597 ( 74%)
............................................................. 2745 / 3597 ( 76%)
............................................................. 2806 / 3597 ( 78%)
............................................................. 2867 / 3597 ( 79%)
............................................................. 2928 / 3597 ( 81%)
............................................................. 2989 / 3597 ( 83%)
............................................................. 3050 / 3597 ( 84%)
............................................................. 3111 / 3597 ( 86%)
............................................................. 3172 / 3597 ( 88%)
............................................................. 3233 / 3597 ( 89%)
............................................................. 3294 / 3597 ( 91%)
............................................................. 3355 / 3597 ( 93%)
.............................S.......S.......S.......S....... 3416 / 3597 ( 94%)
..................S.............S............................ 3477 / 3597 ( 96%)
............................................................. 3538 / 3597 ( 98%)
...........................................................   3597 / 3597 (100%)

Time: 00:12.754, Memory: 434.50 MB

OK, but incomplete, skipped, or risky tests!
Tests: 3597, Assertions: 13035, Skipped: 62, Incomplete: 2.

@webda2l webda2l marked this pull request as ready for review December 16, 2021 09:09
@derrabus derrabus added this to the 2.11.0 milestone Dec 21, 2021
@derrabus derrabus changed the title Allow arithmetic expressions within IN operator (#6476 continue) Allow arithmetic expressions within IN operator Dec 21, 2021
@beberlei beberlei merged commit 92ff9c9 into doctrine:2.11.x Dec 27, 2021
@beberlei
Copy link
Member

@webda2l @astepin thank you both!

@webda2l webda2l deleted the arithmetic-in-expression-fix branch December 27, 2021 18:07
@webda2l
Copy link
Contributor Author

webda2l commented Dec 27, 2021

Thanks to the Doctrine team likewise!

derrabus added a commit to derrabus/orm that referenced this pull request Dec 28, 2021
* 2.11.x:
  Fix return type (doctrine#9295)
  Synchronize Psalm baseline (doctrine#9296)
  Fix union type on QueryExpressionVisitorTest::testWalkComparison() (doctrine#9294)
  Allow arithmetic expressions within IN operator (doctrine#9242)
  Bump reusable workflows
derrabus added a commit to derrabus/orm that referenced this pull request Dec 28, 2021
* 2.11.x:
  Leverage get_debug_type() (doctrine#9297)
  Fix return type (doctrine#9295)
  Synchronize Psalm baseline (doctrine#9296)
  Fix union type on QueryExpressionVisitorTest::testWalkComparison() (doctrine#9294)
  Allow arithmetic expressions within IN operator (doctrine#9242)
  Bump reusable workflows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants