• Igor Babaev's avatar
    MDEV-27086 "No database selected" when using UNION of CTEs to define table · 0dae4163
    Igor Babaev authored
    This bug concerned only CREATE TABLE statements of the form
      CREATE TABLE <table name> AS <with clause> <union>.
    For such a statement not all references to CTE used in <union> were resolved.
    As a result a bogus message was reported for the first unresolved reference.
    This happened because for such statements the function resolving references
    to CTEs LEX::check_cte_dependencies_and_resolve_references() was called
    prematurely in the parser.
    
    Approved by Oleksandr Byelkin <sanja@mariadb.com>
    0dae4163
sql_yacc.yy 520 KB