v6 sqlite upsert returns incorrect value for UUID values on subsequent upserts #12426
Open
2 of 7 tasks
Labels
Great SSCCE
This issue has a great SSCCE/MCVE/reprex posted and therefore deserves extra attention! :)
type: bug
Issue Description
Under sequelize v6, when using sqlite for upserts and a UUID primary key, it seems like subsequent upserts with the same data are not returning the first instance UUID/pk value, and instead a returning a new UUID.
This appears to differ under
postrgres
, which under subsequent requests is returning the original pk/UUID.What are you doing?
Here is the link to the SSCCE for this issue: sequelize/sequelize-sscce#87
Unfortunately v6 isn't available yet in that project, and attempting to update failed, so I was only able to test v6 locally for sqlite and v5 for postgres under the SSCCE repo.
Here's the heart of it
What do you expect to happen?
I expect
f2
to be the same instance (or at least have the same values) asf1
, as an upsert withreturning: true
should bring back the created/updated record.What is actually happening?
The id values differ between subsequent runs.
Additional context
The second call isn't creating a new record in the database (the unique constraint is working), but the upsert result isn't bringing back the expected response.
Environment
Issue Template Checklist
How does this problem relate to dialects?
Would you be willing to resolve this issue by submitting a Pull Request?
The text was updated successfully, but these errors were encountered: