Uh oh!
There was an error while loading. Please reload this page.
Fetch lastInsertId only when id null - #13086
Conversation
nickvergessen
commented
Dec 17, 2018
I always wonder if we should have a separate model for stuff that does nto have an autoincrement ID or no ID at all. |
rullzer
commented
Dec 17, 2018
Isn't |
By default |
rullzer
commented
Dec 17, 2018
So then how does this fix it? As on insert of new data it will anyways be null right? |
nickvergessen
commented
Dec 17, 2018
Well @rullzer the problem is the social app uses this for a model without autoincrement, the column is not even in 32bit integer anymore: |
rullzer
commented
Dec 20, 2018
Ah it is set there. OK. Yeah I think having a special entity would make sense. But for now lets do this. |
When id column has no autoincrement flag query for lastInsertId fails on postgres because no value has been generated. Call lastInsertId only if id is null. Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Some implementations typehint getId to integer but default is null. Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
8fcef56 to
8a952b7Comparekesselb
commented
Dec 27, 2018
/backport to stable15 |
backport to stable15 in #13278 |
When id column has no autoincrement flag query for lastInsertId fails
on postgres because no value has been generated. Call lastInsertId only
if id is null.
Could you consider a backport? Social App does not work on postgres without this like reported here #12465 (comment). Not sure how "safe" it is to backport it.