Skip to content
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

fixed FirstOrCreate not handled error when table is not exists #5367

Merged

Conversation

ophum
Copy link
Contributor

@ophum ophum commented May 23, 2022

  • Do only one thing
  • Non breaking API changes
  • Tested

What did this pull request do?

In FirstOrCreate, result.Error of queryTx.Find is not nil, but not assign to tx.Error.
I fixed result.Error assign to tx.Error.

https://github.com/ophum/gorm/blob/8edc4825256aa0dcc0f74bd3e92b7fc59ba09241/finisher_api.go#L319

User Case Description

when using a table that does not exist.

finisher_api.go Outdated Show resolved Hide resolved
@jinzhu jinzhu merged commit dc1ae39 into go-gorm:master May 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants