• unknown's avatar
    Fix bug#7672 Unknown column error in order clause · f3f84ed8
    unknown authored
    When fixing Item_func_plus in ORDER BY clause field c is searched in all
    opened tables, but because c is an alias it wasn't found there.
    
    This patch adds a flag to select_lex which allows Item_field::fix_fields() 
    to look up in select's item_list to find aliased fields.
    
    
    sql/item.cc:
      Fix bug#7672 Unknown column error in order clause
      When fixing fields in ORDER BY clause allow Item_field::fix_fields() to look up items in select's item list to find aliased fields.
    sql/sql_lex.cc:
       Fix bug#7672 Unknown column error in order clause
    sql/sql_lex.h:
      Fix bug#7672 Unknown column error in order clause
      Added flag to select_lex allowing Item_field::fix_fields to look up items in select's item list.
    sql/sql_select.cc:
      Fix bug#7672 Unknown column error in order clause
    mysql-test/t/select.test:
      Test case for bug#7672 Unknown column error in order clause
    mysql-test/r/select.result:
      Test case for bug#7672 Unknown column error in order clause
    f3f84ed8
sql_select.cc 218 KB