• unknown's avatar
    Fix bug #11864 non unique names are allowed in subquery · 3fba3d98
    unknown authored
    Column names weren't checked for uniqueness for subqueries.
    
    Code for names uniqueness checking used for view creation moved into 
    separate function named check_duplicate_names(). It's called on 
    preparation of subqueries to check uniqueness of names. If duplicate names 
    are found then error is raised.
    
    
    sql/sql_derived.cc:
      Fix bug #11864 non unique names are allowed in subquery
      Added check for names uniqueness in select list.
    sql/sql_view.cc:
      Fix bug #11864 non unique names are allowed in subquery
      Code for checking uniqueness of names in item list moved into separate function to make in available for use from other places.
    sql/sql_view.h:
       Fix bug #11864 non unique names are allowed in subquery
      Added check_duplicate_names() function prototype.
    mysql-test/t/derived.test:
      Fixed test case results after bug fix #11864
      Added test case for bug#11864 non unique names are allowed in subquery.
    mysql-test/t/select_safe.test:
      Fixed test case results after bug fix #11864
    mysql-test/r/derived.result:
      Added test case for bug #11864 non unique names are allowed in subquery.
      Fixed test case results after bug fix #11864
    mysql-test/r/select_safe.result:
      Fixed test case results after bug fix #11864
    3fba3d98
sql_view.h 1.38 KB