Comment 2 for bug 1181576

Revision history for this message
Andrew Davidoff (davidoff) wrote :

With the caveat that I don't fully understand why the history here, I think this commit is what broke this, at least for me:

commit 523cb5d118cdbb0e0cb22564bd1b78fed4e5440c
Author: Frederic Descamps <email address hidden>
Date: Wed Oct 3 11:20:44 2012 +0200

    fix a bug for reporting

That commit adds a leading newline to the query search that's looking for the type of statement. Ex:

- if (new_query.find("SELECT ") != std::string::npos)
+ if (new_query.find("\nSELECT ") != std::string::npos)
     {
                nr_select++;
                nr_select_faster+= faster;
                nr_select_slower+= slower;
     }

I haven't looked at C++ in years but as far as I can tell, there's no reason there'd every be a leading newline here unless there was one in the slow log, and in my case, that doesn't seem to happen.

I am hesitant to say fixing this is as simple as removing the leading newlines in these find calls because there must be a good reason the commit was made in the first place, but I do not understand it at the moment.