SQL Expressions: Add setting to limit length of query (#110165)
sql_expression_query_length_limit Set the maximum length of a SQL query that can be used in a SQL expression. Default is 10000 characters. A setting of 0 means no limit.
This commit is contained in:
@@ -441,6 +441,9 @@ type Cfg struct {
|
||||
// SQLExpressionOutputCellLimit is the maximum number of cells (rows × columns) that can be outputted by a SQL expression.
|
||||
SQLExpressionOutputCellLimit int64
|
||||
|
||||
// SQLExpressionQueryLengthLimit is the maximum length of a SQL query that can be used in a SQL expression.
|
||||
SQLExpressionQueryLengthLimit int64
|
||||
|
||||
// SQLExpressionTimeoutSeconds is the duration a SQL expression will run before timing out
|
||||
SQLExpressionTimeout time.Duration
|
||||
|
||||
@@ -830,6 +833,7 @@ func (cfg *Cfg) readExpressionsSettings() {
|
||||
cfg.SQLExpressionCellLimit = expressions.Key("sql_expression_cell_limit").MustInt64(100000)
|
||||
cfg.SQLExpressionOutputCellLimit = expressions.Key("sql_expression_output_cell_limit").MustInt64(100000)
|
||||
cfg.SQLExpressionTimeout = expressions.Key("sql_expression_timeout").MustDuration(time.Second * 10)
|
||||
cfg.SQLExpressionQueryLengthLimit = expressions.Key("sql_expression_query_length_limit").MustInt64(10000)
|
||||
}
|
||||
|
||||
type AnnotationCleanupSettings struct {
|
||||
|
||||
Reference in New Issue
Block a user