propelorm / Propel2

Propel2 is an open-source high-performance Object-Relational Mapping (ORM) for modern PHP
http://propelorm.org/
MIT License
1.26k stars 396 forks source link

Added `isSelfSelected` property to the `clear` method #1814

Closed herasimenko1987 closed 2 years ago

herasimenko1987 commented 2 years ago

Added the isSelfSelected property to the Propel\Runtime\ActiveQuery\ModelCriteria::clear() method to avoid an empty select SQL statement after the clear() method was executed.

dereuromark commented 2 years ago

@mringler what do you think? We might have added that regression in the beta release or so (introduced https://github.com/propelorm/Propel2/commit/7adbf508c5fb4adfd3d230e8c8c22b2124e025ef#diff-a78edcaf139f6ea10981a3295fef70ad21b894d09311f28605bdf90ae16daf12R426, refactored https://github.com/propelorm/Propel2/commit/3caa4bf1d67495fc3ca56fb272b019ba3c51fac4 )

mringler commented 2 years ago

@dereuromark That's possible, yes. I think I just reset it to the previous state, but who knows.

@herasimenko1987 It would be great if you could add a test for this. But either way, thank you for finding and fixing it!

herasimenko1987 commented 2 years ago

@mringler, will add a test next week.

codecov-commenter commented 2 years ago

Codecov Report

Merging #1814 (a476367) into master (a1a69bd) will decrease coverage by 0.01%. The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1814      +/-   ##
============================================
- Coverage     87.84%   87.83%   -0.02%     
- Complexity     7816     7836      +20     
============================================
  Files           281      281              
  Lines         22715    22748      +33     
============================================
+ Hits          19955    19981      +26     
- Misses         2760     2767       +7     
Flag Coverage Δ
5-max 87.83% <0.00%> (-0.02%) :arrow_down:
7.4 87.83% <0.00%> (-0.02%) :arrow_down:
agnostic 68.54% <0.00%> (-0.01%) :arrow_down:
mysql 70.53% <0.00%> (-0.02%) :arrow_down:
pgsql 70.42% <0.00%> (-0.02%) :arrow_down:
sqlite 68.46% <0.00%> (-0.02%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/Propel/Runtime/ActiveQuery/ModelCriteria.php 95.53% <0.00%> (-0.14%) :arrow_down:
...c/Propel/Runtime/Collection/CollectionIterator.php 52.50% <0.00%> (-4.26%) :arrow_down:
src/Propel/Runtime/Collection/Collection.php 94.77% <0.00%> (-0.50%) :arrow_down:
src/Propel/Runtime/Map/TableMap.php 98.85% <0.00%> (ø)
src/Propel/Runtime/Util/PropelModelPager.php 65.62% <0.00%> (ø)
src/Propel/Runtime/DataFetcher/PDODataFetcher.php 82.00% <0.00%> (ø)
src/Propel/Generator/Builder/Util/SchemaReader.php 91.24% <0.00%> (ø)
src/Propel/Runtime/Collection/OnDemandIterator.php 93.54% <0.00%> (ø)
...rc/Propel/Runtime/DataFetcher/ArrayDataFetcher.php 88.00% <0.00%> (ø)
...c/Propel/Generator/Builder/Util/PropelTemplate.php 76.47% <0.00%> (ø)
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a1a69bd...a476367. Read the comment docs.