Bug #57675 Search and Replace: Index was out of range
Submitted: 23 Oct 2010 3:27 Modified: 23 Oct 2010 8:02
Reporter: Luc Labonté Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:5.2.29CE Revision: 6756 OS:Windows (Win 7 ultimate x64 English)
Assigned to: CPU Architecture:Any
Tags: length; search replace

[23 Oct 2010 3:27] Luc Labonté
Description:

Error message from MySQL Workbench Unexpected Error window:

" Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: length "

How to repeat:

SQL script is stored and edited on the local HDD.
MYSQL Workbench run from local unit

Edit->Find->Find and replace

Find: joueur_id           // the word to find exist several time in the script
Replace with: idJoueur

uncheck Ignore case
uncheck Enable RegEx Support

click on Replace All

Also, cursor was on line 352/744
colon 38/38
(about the middle of the page)

Also, I restarted the application and retry. Still the same!
the "find previous" and "find next" on the search and replace window work.
but not the buttons with "replace all" and "replace"
Even with ignore case checked did not work and also with an other SQL file.

Suggested fix:
humm, I've had similar errors in some code... seems like an index is going over the maximum length of an array... 

to put length -1 or < instead of <= in a loop...

Or could something else...
but thanks!
[23 Oct 2010 8:02] Valeriy Kravchuk
This is a duplicate of bug #56898.