-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Fetch lastInsertId only when id null #13086
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
Conversation
|
I always wonder if we should have a separate model for stuff that does nto have an autoincrement ID or no ID at all. |
|
Isn't |
By default |
|
So then how does this fix it? As on insert of new data it will anyways be null right? |
|
Well @rullzer the problem is the social app uses this for a model without autoincrement, the column is not even in 32bit integer anymore: |
|
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 <[email protected]>
Some implementations typehint getId to integer but default is null. Signed-off-by: Daniel Kesselberg <[email protected]>
8fcef56 to
8a952b7
Compare
|
/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.