• Oleg Smirnov's avatar
    MDEV-32382 FederatedX error on pushdown of statements having CTE · 855356ca
    Oleg Smirnov authored
    Pushing down statements to FederatedX engine is implemented by
    printing either SELECT_LEX or SELECT_LEX_UNIT into a string and
    sending that string to the engine. In the case of pushing down a
    single SELECT having a CTE (WITH clause) there was a problem, because
    normally single SELECTs were printed using SELECT_LEX::print().
    But CTEs are stored in the upper unit of the SELECT_LEX -
    SELECT_LEX_UNIT, so they were not unfolded in the string produced.
    
    The solution is to invoke SELECT_LEX_UNIT::print() when pushing down
    single SELECT statements (but not those which are parts of units),
    so the possible CTEs are unfolded and printed.
    
    Reviewed by Sergei Petrunia (sergey@mariadb.com)
    855356ca
federatedx_create_handlers.result 36 KB