2
0

Hstore can have empty keys

This commit is contained in:
Josh Leverette
2019-05-20 11:30:25 -07:00
parent 8faa4453fc
commit 56f4f0b9d3
+3 -7
View File
@@ -296,13 +296,9 @@ func parseHstore(s string) (k []string, v []Text, err error) {
case hsKey: case hsKey:
switch r { switch r {
case '"': //End of the key case '"': //End of the key
if buf.Len() == 0 { keys = append(keys, buf.String())
err = errors.New("Empty Key is invalid") buf = bytes.Buffer{}
} else { state = hsSep
keys = append(keys, buf.String())
buf = bytes.Buffer{}
state = hsSep
}
case '\\': //Potential escaped character case '\\': //Potential escaped character
n, end := p.Consume() n, end := p.Consume()
switch { switch {