-
-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
uuid_binary_ordered_time not working with IN expression #164
Comments
I'm not familiar enough with how the query builder works with the I know you can't use bound parameters in the |
This seems to work... maybe we should wrap this into a customized type allowing this transformation on array's? |
I'm encountering this issue now as well in Symfony 5.x, using the latest versions of uuid-doctrine
This happens for me when using the doctrine's paginator, which performs a WHERE IN query when |
@ToshY I just installed Ramsey UUID because I thought there's something wrong with the Symfony UID component. I'll start investigating what's going on and I'll try to come up with a PR for the doctrine paginator. |
Was anyone able to figure out a solution for this? |
I didn't have the final solution, but my snippet works to solve the issue locally. We just need to find a way to put it into the normal flow of doctrine. I am not at the project any more that had this issue, so it will be a bit harder for me to test this. But if you need some help, I will try to remember what the issue was. |
I'm currently running into this issue mentioned above. Versions used doctrine/dbal:3.8.3, doctrine/orm:2.13.5, ramsey/uuid:4.2.3, ramsey/uuid-doctrine:1.8.2, php:7.4 as well as 8.1. A joined table having an id (AI int), 2x Example code which works: $qb = $em->createQueryBuilder();
$qry = $qb->select('me')
->from('App\Entity\MyEntity', 'me')
->where("me.field1 = :my_id");
$qb->setParameter("my_id", $my_id, 'uuid_binary_ordered_time'); Example code which doesn't work (as in returns nothing): $qb = $em->createQueryBuilder();
$qry = $qb->select('me')
->from('App\Entity\MyEntity', 'me')
->where("me.field1 IN (:multiple_ids)");
$qb->setParameter("multiple_ids", $my_ids);
// $my_ids being a Doctrine collection; but tested with a "naked" array of ids, too The query as is works fine when running via phpmyadmin for example, so the passed values are correct. Anyone having a hint for me? @jaapio 's code didn't work for me neither. |
The following worked for me:
(ramsey/uuid-doctrine: 2.0.0, doctrine/orm: 2.19.5) |
|
Hi,
I have an entity with its identifier sets as
uuid_binary_ordered_time
. When I try to use aIN
expression with queryBuilder, I cannot get it work.I try with different ways but none of them works well: I get no results.
First attempt:
Second attempt:
I can make it work with the ugly following code, but for performance reasons (and for avoiding tricky code 😂 ) I prefer to make it work using IN clause:
Is this a known bug?
Before posting this issue I have searched the issued and found a possible answer here #18 (comment) but it doesn't work.
The text was updated successfully, but these errors were encountered: