mirror of
https://github.com/discourse/discourse-data-explorer.git
synced 2025-03-06 17:39:08 +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,11 +1180,17 @@ SQL
|
|||||||
opts[:explain] = true if params[:explain] == "true"
|
opts[:explain] = true if params[:explain] == "true"
|
||||||
|
|
||||||
opts[:limit] =
|
opts[:limit] =
|
||||||
if params[:limit]
|
if params[:format] == "csv"
|
||||||
params[:limit] == "ALL" ? "ALL" : params[:limit].to_i
|
if params[:limit].present?
|
||||||
elsif params[:format] == "csv"
|
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
|
DataExplorer::QUERY_RESULT_MAX_LIMIT
|
||||||
end
|
end
|
||||||
|
elsif params[:limit].present?
|
||||||
|
params[:limit] == "ALL" ? "ALL" : params[:limit].to_i
|
||||||
|
end
|
||||||
|
|
||||||
result = DataExplorer.run_query(query, query_params, opts)
|
result = DataExplorer.run_query(query, query_params, opts)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user