Hi Elena, On Thu, Jul 19, 2012 at 03:58:21PM +0400, Sergei Petrunia wrote:
I've made a patch that fixes both BUG#992942 and MDEV-325. ... The code is at: bzr+ssh://bazaar.launchpad.net/~maria-captains/maria/5.5-show-explain-test1
it is based on 5.5-show-explain, so SHOW EXPLAIN part can be tested, too.
I've now also pushed a patch for MDEV-298 there. This means, now there are patches for all existing SHOW EXPLAIN issues. I need a round of testing for all this. It is ok to combine testing of MDEV-325 and MDEV-298, however: Fix for MDEV-298 is not a regular fix. Usually, fixes are expected to be a full solution of the problem, i.e. after the fix everything should work. However, ORDER/GROUP BY code is structured so that it makes a decision about whether to do "Using filesort" at a very late stage. This means, there is no way SHOW EXPLAIN could always be true about "Using filesort". Actually, even EXPLAIN is known to lie for certain queries). The "right" solution would be to move the decision-making code, but I'm afraid this could open a big can of worms, and it will go outside of the scope of SHOW EXPLAIN patch, so I didn't do it. Instead, I've coded what I think is a best approximation: SHOW EXPLAIN should produce correct results in all but the most complicated cases. I'm still interested in testcases which show that EXPLAIN doesn't match SHOW EXPLAIN but I will need to examine them to see whether they will be considered SHOW EXPLAIN's (or EXPLAIN's) bugs. BR Sergei -- Sergei Petrunia, Software Developer Monty Program AB, http://askmonty.org Blog: http://s.petrunia.net/blog