• unknown's avatar
    Bug #30234: Unexpected behavior using DELETE with AS and USING · 1af4c9dc
    unknown authored
      
    DELETE FROM ... USING ... statements with the following type of 
    ambiguous aliasing gave unexpected results:
    DELETE FROM t1 AS alias USING t1, t2 AS alias WHERE t1.a = alias.a;
    This query would leave table t1 intact but delete rows from t2.
    Fixed by changing DELETE FROM ... USING syntax so that only alias 
    references (as opposed to alias declarations) may be used in FROM.
    
    
    mysql-test/r/delete.result:
      Bug#30234: Test Result
    mysql-test/t/delete.test:
      Bug#30234: Test Case
    sql/sql_yacc.yy:
      Bug#30234:
      - Added parser rule table_alias_ref_list that contains a list of table 
        aliases only.
      - Added parser rule table_alias_ref that sets the TL_OPTION_ALIAS in 
        order to turn off semantic checking that applies only for table names.
    1af4c9dc
delete.test 7.04 KB