This is a clean-up task that can be easily done after
There are two pairs of very similar rules:
- opt_if_exists vs opt_if_exists_table_element
- opt_if_not_exists vs opt_if_not_exists_table_element
which all handle IF EXISTS and IF NOT EXISTS clauses.
The "opt_if_xxx_table_element" rules use Lex->check_exists as a storage and are used in column and key context of ALTER TABLE:
The "opt_if_xxx" rules are based on DDL_options_st and used in a schema object context:
We'll modify sql_yacc.yy to use the DDL_options_st based rules in all contexts and will get rid of:
- The "opt_if_exists_table_element" rule
- The "opt_if_not_exists_table_element" rule
- The "check_exists" member in LEX.