midenok / mariadb

MariaDB server is a community developed fork of MySQL server. Started by core members of the original MySQL team, MariaDB actively works with outside developers to deliver the most featureful, stable, and sanely licensed open SQL server in the industry.
GNU General Public License v2.0
0 stars 0 forks source link

Remove SELECT_LEX_UNIT from Table_ident #67

Open midenok opened 4 years ago

midenok commented 4 years ago

This member SELECT_LEX_UNIT *sel is used for derived table parsing. add_table_to_list() uses it. Qualified_column_ident::resolve_type_ref() calls add_table_to_list() so descendants of Table_ident also must have it.

There is another strange ctor:

  Table_ident(THD *thd, const LEX_CSTRING *db_arg,
                     const LEX_CSTRING *table_arg,
             bool force)
    :table(*table_arg), sel((SELECT_LEX_UNIT *)0)
  {
    if (!force && (thd->client_capabilities & CLIENT_NO_SCHEMA))
      db= null_clex_str;
    else
      db= *db_arg;
  }

which is used in many places. It initializes db with null in case there is no schema.