Fixes panic/fatal error concurrent map writes in SQL data sources when multiple
queries are executed concurrently and you interpolate SQL query before executing it.
Fixes#35469
return"",fmt.Errorf("missing time column argument for macro %v",name)
}
returnfmt.Sprintf("%s BETWEEN '%s' AND '%s'",args[0],m.timeRange.GetFromAsTimeUTC().Format(time.RFC3339),m.timeRange.GetToAsTimeUTC().Format(time.RFC3339)),nil
returnfmt.Sprintf("%s BETWEEN '%s' AND '%s'",args[0],timeRange.GetFromAsTimeUTC().Format(time.RFC3339),timeRange.GetToAsTimeUTC().Format(time.RFC3339)),nil
return"",fmt.Errorf("missing time column argument for macro %v",name)
}
returnfmt.Sprintf("%s BETWEEN FROM_UNIXTIME(%d) AND FROM_UNIXTIME(%d)",args[0],m.timeRange.GetFromAsSecondsEpoch(),m.timeRange.GetToAsSecondsEpoch()),nil
returnfmt.Sprintf("%s BETWEEN FROM_UNIXTIME(%d) AND FROM_UNIXTIME(%d)",args[0],timeRange.GetFromAsSecondsEpoch(),timeRange.GetToAsSecondsEpoch()),nil
return"",fmt.Errorf("missing time column argument for macro %v",name)
}
returnfmt.Sprintf("%s BETWEEN '%s' AND '%s'",args[0],m.timeRange.GetFromAsTimeUTC().Format(time.RFC3339Nano),m.timeRange.GetToAsTimeUTC().Format(time.RFC3339Nano)),nil
returnfmt.Sprintf("%s BETWEEN '%s' AND '%s'",args[0],timeRange.GetFromAsTimeUTC().Format(time.RFC3339Nano),timeRange.GetToAsTimeUTC().Format(time.RFC3339Nano)),nil