mirror of
https://github.com/discourse/discourse-data-explorer.git
synced 2025-03-06 09:29:12 +00:00
FIX: limit maximum number of CSV rows correctly.
bbea8884db9a6ebfc9d651305cd301aba7c0a329
This commit is contained in:
parent
bbea8884db
commit
96a8d1862e
12
plugin.rb
12
plugin.rb
@ -1180,10 +1180,16 @@ SQL
|
||||
opts[:explain] = true if params[:explain] == "true"
|
||||
|
||||
opts[:limit] =
|
||||
if params[:limit]
|
||||
if params[:format] == "csv"
|
||||
if params[:limit].present?
|
||||
limit = params[:limit].to_i
|
||||
limit = DataExplorer::QUERY_RESULT_MAX_LIMIT if limit > DataExplorer::QUERY_RESULT_MAX_LIMIT
|
||||
limit
|
||||
else
|
||||
DataExplorer::QUERY_RESULT_MAX_LIMIT
|
||||
end
|
||||
elsif params[:limit].present?
|
||||
params[:limit] == "ALL" ? "ALL" : params[:limit].to_i
|
||||
elsif params[:format] == "csv"
|
||||
DataExplorer::QUERY_RESULT_MAX_LIMIT
|
||||
end
|
||||
|
||||
result = DataExplorer.run_query(query, query_params, opts)
|
||||
|
Loading…
x
Reference in New Issue
Block a user