Skip to content

Fix different column for nulls bug in create documents#524

Merged
abnegate merged 9 commits intomainfrom
fix-create-documents-nulls
Feb 12, 2025
Merged

Fix different column for nulls bug in create documents#524
abnegate merged 9 commits intomainfrom
fix-create-documents-nulls

Conversation

@PineappleIOnic
Copy link
Contributor

Create documents constructs the column list based on all documents however there is a chance that values don't exist on a document (because of it not being required) meaning it doesn't get set in the bindValues resulting in a diff between the number of values expected and the number of values given.

This PR fixes that by making a column list of all the documents and checking against that when binding values, if a value doesn't exist it will be set as null within the bindValues. Validators from the database adapter should catch if a value is required or doesn't exist at all so we don't need to check that.

Tests have been added to make sure that this fixes the bug explained.

@PineappleIOnic PineappleIOnic marked this pull request as ready for review February 12, 2025 02:43
@abnegate abnegate mentioned this pull request Feb 12, 2025
@abnegate abnegate merged commit 0eed7f1 into main Feb 12, 2025
15 checks passed
@abnegate abnegate deleted the fix-create-documents-nulls branch February 12, 2025 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants