Skip to content

馃悰 Incorrect insertion of FragmentInterface parameters into WHERE IN queries#145

Description

@iGrog

No duplicates 馃ゲ.

  • I have searched for a similar issue in our bug tracker and didn't find any solutions.

Database

MySQL

What happened?

A bug happened!

FragmentInterface parameters are not functioning properly in WHERE IN queries:

    // $guid implements FragmentInterface
    $guid1 = Guid::fromString('0189a22f-1bd0-7005-959a-46860de7d841');
    $guid2 = Guid::fromString('015033e7-a2f0-9ad2-fa9e-e075f4d07a6a');
    $ids = [$guid2]; 
    $select = $this->repository
            ->select()
            ->where('categoryGuid', $guid1);
            ->andWhere('someGuid', 'IN', new Parameter($ids))
            ->fetchData();

Actual behavior:

WHERE `CategoryGuid` = UUID_TO_BIN('018c11c6-0cae-725e-b885-499e53e8ec5f') 
AND SomeGuid` IN ('018c11c6-5657-7fdc-b2fd-7a6909c1683f') 

Expected behavior:

All FragmentInterface objects correctly inserted into the query (added UUID_TO_BIN also in IN parameters)

WHERE `CategoryGuid` = UUID_TO_BIN('018c11c6-0cae-725e-b885-499e53e8ec5f') 
AND SomeGuid` IN (UUID_TO_BIN('018c11c6-5657-7fdc-b2fd-7a6909c1683f')) 

Version

database 2.0
PHP 8.2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

  • Status
    Released

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions