Error query by UUID in batched queries #13552
Labels
bug/2-confirmed
Bug has been reproduced and confirmed.
domain/client
Issue in the "Client" domain: Prisma Client, Prisma Studio etc.
kind/bug
A reported bug.
tech/engines
Issue for tech Engines.
topic: batching
topic: uuid
Bug description
Prisma can't understand that two different strings could be the same UUID in particular cases.
Strings "11111111111111111111111111111111" and "11111111-1111-1111-1111-111111111111" are the same UUID and are treated equally by Postgres.
A bug appears when Prisma trying to batch a few
findUnique({where: {id}});
queries, whereid
is UUID srting without dashes, like thereSELECT "public"."Cup"."id" FROM "public"."Cup" WHERE "public"."Cup"."id" IN ($1,$2)
Even if records with ids passed to the request above exist in DB Prisma will return null, while following request
SELECT "public"."Cup"."id" FROM "public"."Cup" WHERE "public"."Cup"."id" = $1 OFFSET $2
with the same ids as in the previous one will return records.I've created a little repository where is possible to reproduce the bug, some logs from that:
How to reproduce
Expected behavior
Batched queries should return records that exist in DB.
Prisma information
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: