Skip to content

ManyToManyPersister don't generate proper matching query for "in" #11031

@mpoiriert

Description

@mpoiriert

Bug Report

Q A
BC Break no
Version 2.16.2

Summary

Matching criteria in ManyToManyPersister (maybe other) doesn't work with "in".

Error is here:

$whereClauses[] = sprintf('te.%s %s ?', $field, $operator);

Current behavior

When using in the value is not in using "(:value)" but just :value

Error would be something like this:

or the right syntax to use near '? LIMIT 1' at line 1

How to reproduce

Do a matching request with a criteria with in:

$this->collection
            ->matching(
                Criteria::create()
                    ->where(
                        Criteria::expr()
                            ->in(
                                'status',
                               [$value1, $value2]
                            )
                    )
            )
            ->count();

Expected behavior

Query shoudl be generated properly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions