[Debugging] introduced test case that shows join reaction counter breaks when run with count on morphables #260
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.
Hi @antonkomarev, this PR is to demonstrate some breaks that are happening when the
joinReactionCounterOfType
is called with thewithCount
method on morphable relations. The issue is not apparent when run in the in-memory database but when you switch to a mysql connection it shows up.The error that shows up is
Illuminate\Database\QueryException: SQLSTATE[HY093]: Invalid parameter number (Connection: mysql, SQL: select
articles.*, (select count(*) from
morphable_entitieswhere
articles.
id=
morphable_entities.
morphable_idand
morphable_entities.
morphable_type= 1) as
morphable_entities_count, COALESCE(reaction_like.count, 0) as reaction_like_count, COALESCE(reaction_like.weight, 0) as reaction_like_weight from
articlesleft join
love_reactant_reaction_countersas
reaction_likeon
reaction_like.
reactant_id=
articles.
love_reactant_idand
reaction_like.
reaction_type_id= ? order by
reaction_like_countasc)