Thanks, Dave. The fix looks correct to me. I don't think this bug will ever cause any problems seen by the users. The only thing that happens is that the state machine considers the second '
' in '-' as part of the comment and ignores it, which is fine. But it's still good to have it fixed.
Another issue with this code is that it sets tokenFound = "/" if there are no more characters after the first '
'. I think this is a copy/paste error from the case for "/*", and it should have set tokenFound to "" instead. But again, this doesn't really cause any problems, since the only tokens we care about when calling this method are "select", "values", "insert", "update", "delete" and "call".
Dag, you probably know this code better. Does the above analysis sound about right?