2
0

Merge pull request #536 from coder543/master

Hstore can have empty keys
This commit is contained in:
Jack Christensen
2019-05-20 16:26:08 -05:00
committed by GitHub
+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 {