mirror of
https://github.com/jackc/pgx.git
synced 2025-05-23 16:01:06 +00:00
Handles empty aclitems
This commit is contained in:
parent
b12a1bb8bc
commit
9b8e3043ba
@ -3022,6 +3022,12 @@ func decodeAclItemArray(vr *ValueReader) []AclItem {
|
||||
}
|
||||
|
||||
str := vr.ReadString(vr.Len())
|
||||
|
||||
// short-circuit empty array
|
||||
if str == "{}" {
|
||||
return []AclItem{}
|
||||
}
|
||||
|
||||
// remove the '{' at the front and the '}' at the end
|
||||
str = str[1 : len(str)-1]
|
||||
strs := strings.Split(str, ",")
|
||||
|
@ -662,6 +662,9 @@ func TestAclArrayDecoding(t *testing.T) {
|
||||
tests := []struct {
|
||||
query []pgx.AclItem
|
||||
}{
|
||||
{
|
||||
[]pgx.AclItem{},
|
||||
},
|
||||
{
|
||||
[]pgx.AclItem{"=r/postgres"},
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user