Просмотр исходного кода

use const for rowlimit in sql engine

Marcus Efraimsson 7 лет назад
Родитель
Сommit
e43feb7bfa
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      pkg/tsdb/sql_engine.go

+ 2 - 2
pkg/tsdb/sql_engine.go

@@ -100,6 +100,8 @@ var NewSqlQueryEndpoint = func(config *SqlQueryEndpointConfiguration, rowTransfo
 	return &queryEndpoint, nil
 	return &queryEndpoint, nil
 }
 }
 
 
+const rowLimit = 1000000
+
 // Query is the main function for the SqlQueryEndpoint
 // Query is the main function for the SqlQueryEndpoint
 func (e *sqlQueryEndpoint) Query(ctx context.Context, dsInfo *models.DataSource, tsdbQuery *TsdbQuery) (*Response, error) {
 func (e *sqlQueryEndpoint) Query(ctx context.Context, dsInfo *models.DataSource, tsdbQuery *TsdbQuery) (*Response, error) {
 	result := &Response{
 	result := &Response{
@@ -164,7 +166,6 @@ func (e *sqlQueryEndpoint) transformToTable(query *Query, rows *core.Rows, resul
 		return err
 		return err
 	}
 	}
 
 
-	rowLimit := 1000000
 	rowCount := 0
 	rowCount := 0
 	timeIndex := -1
 	timeIndex := -1
 
 
@@ -225,7 +226,6 @@ func (e *sqlQueryEndpoint) transformToTimeSeries(query *Query, rows *core.Rows,
 		return err
 		return err
 	}
 	}
 
 
-	rowLimit := 1000000
 	rowCount := 0
 	rowCount := 0
 	timeIndex := -1
 	timeIndex := -1
 	metricIndex := -1
 	metricIndex := -1