From 8e77b78a901b24a029f996ae593864fe1c500af7 Mon Sep 17 00:00:00 2001 From: Nikhil Saraf <1028334+nikhilsaraf@users.noreply.github.com> Date: Fri, 24 Jan 2020 18:01:32 +0530 Subject: [PATCH] 11 - add single quote to marketIDs in sql query --- plugins/volumeFilter.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/volumeFilter.go b/plugins/volumeFilter.go index 0e2244867..379931f10 100644 --- a/plugins/volumeFilter.go +++ b/plugins/volumeFilter.go @@ -234,7 +234,11 @@ type dailyValues struct { } func (f *volumeFilter) dailyValuesByDate(dateUTC string) (*dailyValues, error) { - marketIdsSqlValue := strings.Join(f.marketIDs, ",") + marketIDsQuoted := []string{} + for _, mid := range f.marketIDs { + marketIDsQuoted = append(marketIDsQuoted, fmt.Sprintf("'%s'", mid)) + } + marketIdsSqlValue := strings.Join(marketIDsQuoted, ",") row := f.db.QueryRow(database.SqlQueryDailyValues, marketIdsSqlValue, dateUTC, f.action) var baseVol sql.NullFloat64