Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type p2cReader struct {
func (r *p2cReader) getTimePeriod(query *remote.Query) (string, string, error) {

var tselSQL = "SELECT COUNT() AS CNT, (intDiv(toUInt32(ts), %d) * %d) * 1000 as t"
var twhereSQL = "WHERE date >= toDate(%d) AND ts >= toDateTime(%d) AND ts <= toDateTime(%d)"
var twhereSQL = "WHERE date >= toDate(%d) AND ts >= toDateTime(%d) AND ts <= toDateTime(%d) AND date <= toDate(%d)"
var err error
tstart := query.StartTimestampMs / 1000
tend := query.EndTimestampMs / 1000
Expand All @@ -45,7 +45,7 @@ func (r *p2cReader) getTimePeriod(query *remote.Query) (string, string, error) {
}

selectSQL := fmt.Sprintf(tselSQL, taggr, taggr)
whereSQL := fmt.Sprintf(twhereSQL, tstart, tstart, tend)
whereSQL := fmt.Sprintf(twhereSQL, tstart, tstart, tend, tend)

return selectSQL, whereSQL, nil
}
Expand Down