The row-limit policy in query_limit/no_query_limit did not specify WHERE
the limit should be applied, so LLMs could put LIMIT/ROWNUM/TOP inside
subqueries, truncating the data feeding aggregation (limiting accessed
rows instead of the final result set).
- query_limit/no_query_limit: limit must be applied only to the outermost
query; never inside subqueries, derived tables or CTEs; add conditional
per-group top-N note (window functions where supported)
- process_check (template.yaml + Oracle override): step 4 now verifies
limit placement
- sql_examples: add nested-aggregation bad/good examples for all 11
engines showing the limit on the outer query only
- Oracle: fix invalid GROUP BY...WHERE ROWNUM example and wrong
ROWNUM-before-ORDER BY few-shot answers (wrap with outer query)
1.Add parameter: GENERATE_SQL_QUERY_LIMIT_ENABLED (default value is True to control data return Limit 1000 rows)
2.Use different SQL example templates based on different data sources.