forked from mirror/gorm
Fix empty string as order clause
This commit is contained in:
parent
66d5b42ee9
commit
d03afd173f
|
@ -360,6 +360,11 @@ func TestOrderAndPluck(t *testing.T) {
|
|||
t.Errorf("Order with multiple orders")
|
||||
}
|
||||
|
||||
var ages6 []int64
|
||||
if err := scopedb.Order("").Pluck("age", &ages6).Error; err != nil {
|
||||
t.Errorf("An empty string as order clause produces invalid queries")
|
||||
}
|
||||
|
||||
DB.Model(User{}).Select("name, age").Find(&[]User{})
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue