Skip to content

Commit

Permalink
Try to discribe issue5546
Browse files Browse the repository at this point in the history
  • Loading branch information
Zacama committed Jul 27, 2022
1 parent 3c6eb14 commit c68d147
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/delete_test.go
Expand Up @@ -256,3 +256,15 @@ func TestDeleteReturning(t *testing.T) {
t.Errorf("failed to delete data, current count %v", count)
}
}

func TestDeleteReturningTry(t *testing.T) {
if DB.Dialector.Name() != "sqlite" && DB.Dialector.Name() != "postgres" {
return
}

var results []Company
DB.Clauses(clauses.Returing{}).Where(&Company{Name: "try"}).Delete(&results)
// len(results) == 0 and the raw sql does not contain RETURING


}

0 comments on commit c68d147

Please sign in to comment.