Select must be specific about what fields it wants

This commit is contained in:
Jakob Borg 2015-09-10 15:55:25 +02:00
parent 201ff39b80
commit 30d0e5d298

View File

@ -414,7 +414,25 @@ func getReport(db *sql.DB) map[string]interface{} {
var compilers []string
var builders []string
rows, err := db.Query(`SELECT * FROM Reports WHERE Received > now() - '1 day'::INTERVAL`)
fields := []string{
"Received",
"UniqueID",
"Version",
"LongVersion",
"Platform",
"NumFolders",
"NumDevices",
"TotFiles",
"FolderMaxFiles",
"TotMiB",
"FolderMaxMiB",
"MemoryUsageMiB",
"SHA256Perf",
"MemorySize",
"Date",
}
rows, err := db.Query(`SELECT ` + strings.Join(fields, ",") + ` FROM Reports WHERE Received > now() - '1 day'::INTERVAL`)
if err != nil {
log.Println("sql:", err)
return nil