• Alexey Kopytov's avatar
    Bug #50335: Assertion `!(order->used & map)' in eq_ref_table · f380b946
    Alexey Kopytov authored
     
    The problem was in an incorrect debug assertion. The expression 
    used in the failing assertion states that when finding 
    references matching ORDER BY expressions, there can be only one 
    reference to a single table. But that does not make any sense, 
    all test cases for this bug are valid examples with multiple 
    identical WHERE expressions referencing the same table which
    are also present in the ORDER BY list. 
     
    Fixed by removing the failing assertion. We also have to take 
    care of the 'found' counter so that we count multiple 
    references only once. We rely on this fact later in 
    eq_ref_table(). 
    
    mysql-test/r/join.result:
      Added a test case for bug #50335.
    mysql-test/t/join.test:
      Added a test case for bug #50335.
    sql/sql_select.cc:
      Removing the assertion in eq_ref_table() as it does not make
      any sense. We also have to take care of the 'found' counter so 
      that we count multiple references only once. We rely on this 
      fact later in eq_ref_table().
    f380b946
join.test 35.4 KB