-
-
Notifications
You must be signed in to change notification settings - Fork 505
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
Fix wrong handling for nullable fields in upsert and update #2318
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alcaeus
changed the title
Fix wrong handling for nullable fields in upsert
Fix wrong handling for nullable fields in upsert and update
May 31, 2021
I'll have to give the CI pipeline for 2.x a look... |
Co-authored-by: wuchen90 <wu.chen@agriconomie.com>
alcaeus
force-pushed
the
gh-2310
branch
4 times, most recently
from
June 2, 2021 11:47
fc8be44
to
36e03a6
Compare
@malarzm finally managed to fix the bug and the build, so this is ready for a review. |
malarzm
approved these changes
Jun 8, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one ended up bigger than I've expected :)
alcaeus
added a commit
to alcaeus/mongodb-odm
that referenced
this pull request
Jun 29, 2021
* 2.2.x: Fix handling of upserts during scheduling for deletion (doctrine#2334) Fix wrong handling for nullable fields in upsert and update (doctrine#2318) [2.2] Fix builds (doctrine#2319) Allow mixed value in $not operator (doctrine#2307) Fix errors with nullable typed associations (doctrine#2302) Fix using null values in partial filter expressions (doctrine#2300) Fix preparation of $elemMatch operators in queries (doctrine#2298) Fix query preparation when in elemMatch (doctrine#2299) Fix mapping of the nullable option for XML driver Fix documentation for uploadFromFile Correctly handle write concern specified in defaultCommitOptions (doctrine#2294) Fix invalid strict comparison when validating mappings Update storage-strategies.rst Update working-with-objects.rst Test serialization of lock/version fields Fix locking when ClassMetadata is unserialized
alcaeus
added a commit
to alcaeus/mongodb-odm
that referenced
this pull request
Jun 29, 2021
* 2.2.x: Fix handling of upserts during scheduling for deletion (doctrine#2334) Fix wrong handling for nullable fields in upsert and update (doctrine#2318) [2.2] Fix builds (doctrine#2319) Allow mixed value in $not operator (doctrine#2307) Fix errors with nullable typed associations (doctrine#2302) Fix using null values in partial filter expressions (doctrine#2300) Fix preparation of $elemMatch operators in queries (doctrine#2298) Fix query preparation when in elemMatch (doctrine#2299) Fix mapping of the nullable option for XML driver Fix documentation for uploadFromFile Correctly handle write concern specified in defaultCommitOptions (doctrine#2294) Fix invalid strict comparison when validating mappings Update storage-strategies.rst Update working-with-objects.rst Test serialization of lock/version fields Fix locking when ClassMetadata is unserialized
alcaeus
added a commit
to alcaeus/mongodb-odm
that referenced
this pull request
Jun 29, 2021
* 2.2.x: Fix handling of upserts during scheduling for deletion (doctrine#2334) Fix wrong handling for nullable fields in upsert and update (doctrine#2318) [2.2] Fix builds (doctrine#2319) Allow mixed value in $not operator (doctrine#2307) Fix errors with nullable typed associations (doctrine#2302) Fix using null values in partial filter expressions (doctrine#2300) Fix preparation of $elemMatch operators in queries (doctrine#2298) Fix query preparation when in elemMatch (doctrine#2299) Fix mapping of the nullable option for XML driver Fix documentation for uploadFromFile Correctly handle write concern specified in defaultCommitOptions (doctrine#2294) Fix invalid strict comparison when validating mappings Update storage-strategies.rst Update working-with-objects.rst Test serialization of lock/version fields Fix locking when ClassMetadata is unserialized
alcaeus
added a commit
to alcaeus/mongodb-odm
that referenced
this pull request
Jun 29, 2021
* 2.2.x: Fix handling of upserts during scheduling for deletion (doctrine#2334) Fix wrong handling for nullable fields in upsert and update (doctrine#2318) [2.2] Fix builds (doctrine#2319) Allow mixed value in $not operator (doctrine#2307) Fix errors with nullable typed associations (doctrine#2302) Fix using null values in partial filter expressions (doctrine#2300) Fix preparation of $elemMatch operators in queries (doctrine#2298) Fix query preparation when in elemMatch (doctrine#2299) Fix mapping of the nullable option for XML driver Fix documentation for uploadFromFile Correctly handle write concern specified in defaultCommitOptions (doctrine#2294) Fix invalid strict comparison when validating mappings Update storage-strategies.rst Update working-with-objects.rst Test serialization of lock/version fields Fix locking when ClassMetadata is unserialized
alcaeus
added a commit
to alcaeus/mongodb-odm
that referenced
this pull request
Aug 2, 2021
* 2.2.x: Fix wrong assertion (doctrine#2335) Fix handling of upserts during scheduling for deletion (doctrine#2334) Fix wrong handling for nullable fields in upsert and update (doctrine#2318) [2.2] Fix builds (doctrine#2319) Allow mixed value in $not operator (doctrine#2307) Fix errors with nullable typed associations (doctrine#2302) Fix using null values in partial filter expressions (doctrine#2300) Fix preparation of $elemMatch operators in queries (doctrine#2298) Fix query preparation when in elemMatch (doctrine#2299) Fix mapping of the nullable option for XML driver Fix documentation for uploadFromFile Correctly handle write concern specified in defaultCommitOptions (doctrine#2294) Fix invalid strict comparison when validating mappings Update storage-strategies.rst Update working-with-objects.rst Test serialization of lock/version fields Fix locking when ClassMetadata is unserialized
alcaeus
added a commit
that referenced
this pull request
Aug 5, 2021
* Fix locking when ClassMetadata is unserialized Caching / unserializing ClassMetadata broke locking functionality Fixes #2278 * Test serialization of lock/version fields * Update working-with-objects.rst Detach doc text from code block * Update storage-strategies.rst * Fix invalid strict comparison when validating mappings * Correctly handle write concern specified in defaultCommitOptions (#2294) * Fix documentation for uploadFromFile * Fix mapping of the nullable option for XML driver * Fix query preparation when in elemMatch (#2299) * Fix preparation of $elemMatch operators in queries (#2298) * Fix using null values in partial filter expressions (#2300) * Fix errors with nullable typed associations (#2302) * Fix initialising nullable associations * Fix error when merging documents with uninitialised typed properties * Allow mixed value in $not operator (#2307) * [2.2] Fix builds (#2319) * Fix wrong handling for nullable fields in upsert and update (#2318) * Comprehensively test nullable behaviour for embedOne Co-authored-by: wuchen90 <wu.chen@agriconomie.com> * Fix handling of nullable fields for upsert Co-authored-by: wuchen90 <wu.chen@agriconomie.com> * Fix handling of upserts during scheduling for deletion (#2334) * Fix handling of upserts during scheduling for deletion * Added test * Fix wrong assertion (#2335) This was uncovered by Psalm testing when merging 2.2.x up into 2.3.x. * Remove psalm-baseline.xml Co-authored-by: buffcode <buffcode@users.noreply.github.com> Co-authored-by: Laurens Stötzel <l.stoetzel@meeva.de> Co-authored-by: Maciej Malarz <malarzm@gmail.com> Co-authored-by: jeeiex <78592605+jeeiex@users.noreply.github.com> Co-authored-by: Claudio Zizza <859964+SenseException@users.noreply.github.com> Co-authored-by: Gocha Ossinkine <ossinkine@ya.ru> Co-authored-by: Ryan RAJKOMAR <rrajkomar@users.noreply.github.com> Co-authored-by: wuchen90 <wu.chen@agriconomie.com> Co-authored-by: Fran Moreno <franmomu@gmail.com> Co-authored-by: Bernhard Schussek <bschussek@gmail.com>
alcaeus
added a commit
that referenced
this pull request
Aug 5, 2021
* 2.2.x: Fix wrong assertion (#2335) Fix handling of upserts during scheduling for deletion (#2334) Fix wrong handling for nullable fields in upsert and update (#2318) [2.2] Fix builds (#2319) Allow mixed value in $not operator (#2307) Fix errors with nullable typed associations (#2302) Fix using null values in partial filter expressions (#2300) Fix preparation of $elemMatch operators in queries (#2298) Fix query preparation when in elemMatch (#2299) Fix mapping of the nullable option for XML driver Fix documentation for uploadFromFile Correctly handle write concern specified in defaultCommitOptions (#2294) Fix invalid strict comparison when validating mappings Update storage-strategies.rst Update working-with-objects.rst Test serialization of lock/version fields Fix locking when ClassMetadata is unserialized
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
#2310 reported another instance of #2301, but on closer inspection it turns out that this was not the same bug but the same symptoms. The bug was wrong handling of
null
values during anupsert
. I found two separate issues:null
when the upsert results in a new document, which causes the bug described in Nullable embedded document not initialized when using aggregations #2310,null
on update but rather unset, which also causes the bug described in Nullable embedded document not initialized when using aggregations #2310,null
on upsert when they shouldn't.I've kept the tests added in #2316 and expanded them to cover all insert, upsert, and update scenarios. I've also added new tests to
UpsertTest
to specifically test for the behaviour unrelated to typed properties.