nextcloud / nextcloud/server

\OCP\DB\QueryBuilder\IExpressionBuilder::eq and the $type param

Open
#20,598 4 comments 1 reaction 0 assignees View on GitHub

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
  1. Join two tables on a.x = b.y where 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.