sort split on empty string terurnt array of one empty string

This commit is contained in:
ycc 2021-11-03 15:11:48 +01:00
parent 523f25edde
commit cac8a47bbe

2
pg.go
View File

@ -232,7 +232,7 @@ func (t *TableInfo) buildSelect(key string, columns []string, restriction string
if restriction != "" {
query += " where " + restriction
}
if len(sortkeys) > 0 {
if len(sortkeys) > 0 && len(sortkeys[0]) > 0 {
query += " order by " + strings.Join(sortkeys, ",")
}
if len(dir) > 0 {