-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
demo: strange XORM or DB bug #33259
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
demo: strange XORM or DB bug #33259
Conversation
|
If there are no |
| user30EmptyRepo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{OwnerID: 30, Name: "empty"}) | ||
| user30EmptyRepo.IsEmpty = true | ||
| user30EmptyRepo.DefaultBranch = "no-such" | ||
| _, err := db.GetEngine(db.DefaultContext).ID(user30EmptyRepo.ID).Update(user30EmptyRepo) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| _, err := db.GetEngine(db.DefaultContext).ID(user30EmptyRepo.ID).Update(user30EmptyRepo) | |
| _, err := db.GetEngine(db.DefaultContext).ID(user30EmptyRepo.ID).Cols("is_empty", "default_branch").Update(user30EmptyRepo) |
| user30EmptyRepo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{OwnerID: 30, Name: "empty"}) | ||
| user30EmptyRepo.IsEmpty = true | ||
| user30EmptyRepo.DefaultBranch = "no-such" | ||
| _, err := db.GetEngine(db.DefaultContext).ID(user30EmptyRepo.ID).Update(user30EmptyRepo) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| _, err := db.GetEngine(db.DefaultContext).ID(user30EmptyRepo.ID).Update(user30EmptyRepo) | |
| _, err := db.GetEngine(db.DefaultContext).ID(user30EmptyRepo.ID).Cols("is_empty", "default_branch").Update(user30EmptyRepo) |
But |
It's something right. It's also weird if |
These 2 code blocks are exactly the same, but the one in TestEmptyRepoAddFile fails to update database, the
xorm.execfunction only generates about 8-9 columns in the SQL (nois_emptycolumn)