[11.x] Removed null safe operator from whereNotMorphedTo #52454
Closed
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.
Issue Summary:
We identified an issue with the whereNotMorphedTo method in the Laravel framework. The issue stems from the use of the null safe operator <=>, which is not compatible with SQLite and PostgreSQL databases. This operator, while functioning correctly in MySQL, causes errors when used with other database systems.
The following error message was encountered during execution:
PDOException: SQLSTATE[HY000]: General error: 1 near ">": syntax error in vendor/laravel/framework/src/Illuminate/Database/Connection.php:407Solution:
To ensure cross-database compatibility and to avoid unexpected errors, we propose removing or replacing the null safe operator <=> in the whereNotMorphedTo method. This change will enhance the framework's reliability across different database systems.
References:
This issue was discussed and partially addressed in a previous PR: #42878, which initially proposed the use of the null safe operator.