List:Commits« Previous MessageNext Message »
From:Bernt M. Johnsen Date:June 15 2009 3:14pm
Subject:bzr push into mysql-5.0-bugteam branch (bernt.johnsen:2772 to 2773)
Bug#32357
View as plain text  
 2773 Bernt M. Johnsen	2009-06-15
      Bug#32357 Prepared for push on 5.0-bugteam branch

    modified:
      mysql-test/t/disabled.def
 2772 Georgi Kodinov	2009-06-15
      Bug #44810: index merge and order by with low sort_buffer_size
      crashes server!
      
      The problem affects the scenario when index merge is followed by a filesort
      and the sort buffer is not big enough for all the sort keys.
      In this case the filesort function will read the data to the end through the 
      index merge quick access method (and thus closing the cursor etc), 
      but will leave the pointer to the quick select method in place.
      It will then create a temporary file to hold the results of the filesort and
      will add it as a sort output file (in sort.io_cache).
      Note that filesort will copy the original 'sort' structure in an automatic
      variable and restore it after it's done.
      As a result at exiting filesort() we have a sort.io_cache filled in and 
      nothing else (as a result of close of the cursors at end of reading data 
      through index merge).
      Now create_sort_index() will note that there is a select and will clean it up
      (as it's been used already by filesort() reading the data in). While doing that
      a special case in the index merge destructor will clean up the sort.io_cache,
      assuming it's an output of the index merge method and is not needed anymore.
      As a result the code that tries to read the data back from the filesort output 
      will get no data in both memory and disk and will crash.
            
      Fixed similarly to how filesort() does it : by copying the sort.io_cache structure
      to a local variable, removing the pointer to the io_cache (so that it's not freed 
      by QUICK_INDEX_MERGE_SELECT::~QUICK_INDEX_MERGE_SELECT) and restoring the original 
      structure (together with the valid pointer) after the cleanup is done.
      This is a safe thing to do because all the structures are already cleaned up by
      hitting the end of the index merge's read method (QUICK_INDEX_MERGE_SELECT::get_next()) 
      and the cleanup code being written in a way that tolerates repeating cleanups.
     @ mysql-test/r/index_merge.result
        Bug #44810: test case
     @ mysql-test/t/index_merge.test
        Bug #44810: test case
     @ sql/sql_select.cc
        Bug #44810: preserve the io_cache produced by filesort while cleaning up
        the index merge quick access method (QUICK_INDEX_MERGE_SELECT).

    modified:
      mysql-test/r/index_merge.result
      mysql-test/t/index_merge.test
      sql/sql_select.cc
=== modified file 'mysql-test/t/disabled.def'
--- a/mysql-test/t/disabled.def	2009-05-15 10:06:11 +0000
+++ b/mysql-test/t/disabled.def	2009-06-15 15:14:00 +0000
@@ -16,6 +16,5 @@ im_daemon_life_cycle : Bug#20294: Instan
 im_options_set       : Bug#20294: Instance manager tests fail randomly
 im_options_unset     : Bug#20294: Instance manager tests fail randomly
 im_utils             : Bug#20294: Instance manager tests fail randomly
-ndb_backup_print     : Bug#32357: ndb_backup_print test fails sometimes in pushbuild
 rpl_log_pos          : Bug#8693 Test 'rpl_log_pos' fails sometimes
 kill                 : Bug#29149 Test "kill" fails on Windows


Attachment: [text/bzr-bundle] bzr/bernt.johnsen@sun.com-20090615151400-68kp1si7je1mivp4.bundle
Thread
bzr push into mysql-5.0-bugteam branch (bernt.johnsen:2772 to 2773)Bug#32357Bernt M. Johnsen15 Jun