\OCP\DB\QueryBuilder\IExpressionBuilder::eq and the $type param
Open
Nobody has claimed this yet.
1. to develop
26-feedback
bug
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
How to use GitHub
- Please use the 👍 reaction to show that you are affected by the same issue.
- Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
- Subscribe to receive notifications on status change and new comments.
Steps to reproduce
- Join two tables on
a.x = b.ywhere a.x is an int and b.y is a varchar
Expected behaviour
Using an explicit type for \OCP\DB\QueryBuilder\IExpressionBuilder::eq I might expect the expressions to be type cased so the comparison works.
Actual behaviour
This blows up on postgres (at least, possibly also on strict mysql).
Ref https://github.com/nextcloud/mail/pull/2970
Ref https://github.com/nextcloud/mail/pull/2796
cc @nickvergessen
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Begin with \OCP\DB\QueryBuilder\IExpressionBuilder::eq and reproduce the int/varchar join on PostgreSQL; compare how its explicit $type is currently interpreted. Clarify the intended casting semantics, then verify that the comparison works on PostgreSQL and strict MySQL.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mysql, php, postgresql
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100