• Georgi Kodinov's avatar
    Bug#37943: Reproducible mysqld crash/sigsegv in sel_trees_can_be_ored · 73be5f95
    Georgi Kodinov authored
                
    When analyzing the possible index use cases the server was re-using an internal structure.
    This is wrong, as this internal structure gets updated during the analysis.
    Fixed by making a copy of the internal structure for every place it needs to be used.
    Also stopped the generation of empty SEL_TREE structures that unnecessary 
    complicate the analysis.
    
    mysql-test/r/index_merge.result:
      Bug#37943: test case
    mysql-test/t/index_merge.test:
      Bug#37943: test case
    sql/opt_range.cc:
      Bug#37943: 
       - Make copy constructors for SEL_TREE and sub-structures and use them when OR-ing trees.
       - don't generate empty SEL_TREEs. Return NULL instead.
    73be5f95
index_merge.test 15.6 KB