Description:
MySQL Workbench encounters an Unexpected Error with the message:
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
This happens when running a standard SELECT query with JOIN, GROUP BY, ORDER BY, and LIMIT.
The query executes successfully and returns results, but Workbench crashes with the error popup
when displaying the result set.
How to repeat:
1. Open MySQL Workbench.
2. Connect to database.
3. Run a SELECT query with JOIN, GROUP BY, ORDER BY, and LIMIT (see example below).
4. Workbench executes but shows an "Index out of range" error after displaying results.
Suggested fix:
Ensure Workbench handles result grid rendering correctly when queries return small result sets with LIMIT.
The query itself runs fine on MySQL server, so this looks like a Workbench UI bug rather than a SQL error.
Possible fix: add a safeguard to prevent index-out-of-range exception in the result grid handler.