• Anurag Shekhar's avatar
    Bug#41305 server crashes when inserting duplicate row into a merge table · aa13f72b
    Anurag Shekhar authored
    This problem comes while inserting a duplicate row in merge table 
    without key but the child table has a primary key. 
    While forming the error message handler tries to locate the key field
    which is creating this problem but as there is no key on the merge
    table there is a segmentation fault.
    
    mysql-test/r/merge.result:
      Updated results with new test for this bug.
    mysql-test/t/merge.test:
      Added new test to test error generated from a key on child table 
      where merge table doesn't have any key.
    storage/myisammrg/ha_myisammrg.cc:
      Added a new check to see if the value of error key is higher than 
      the number of key in merge table and if it is the error key set 
      to MAX_KEY. The error message generation routine treats MAX_KEY as 
      unknown key and doesn't tries to access this in key_info.
    aa13f72b
ha_myisammrg.cc 41 KB