• unknown's avatar
    Fix bug#11709 View was ordered by wrong column. · 4c741718
    unknown authored
    When searching column to sort on, item was compared to field under view
    column, but not the column itself. Because names of view column and underlaid
    field may differ, it leads to possibly choosing wrong column for sorting on.
    
    This patch makes Item_direct_view_ref::eq(Item *item,...) compare
    item's name with it's own name proir to comparing to *ref item.
    
    
    sql/item.cc:
      Fix bug #11709 View was ordered by wrong column
    sql/item.h:
      Fix bug #11709 View was ordered by wrong column
    mysql-test/t/view.test:
      Test case for bug #11709 View was ordered by wrong column.
    mysql-test/r/view.result:
      Test case for bug #11709 View was ordered by wrong column.
    4c741718
item.h 64.3 KB