• Sreeharsha Ramanavarapu's avatar
    Bug #24380263: INCORRECT BEHAVIOR WITH PARAMETER AND · 8bb95e9a
    Sreeharsha Ramanavarapu authored
                   DERIVED TABLE IN JOIN
    
    ISSUE:
    ------
    This problem occurs under the following conditions:
    1) A parameter is used in the select-list of a derived table.
    2) The derived table is part of a JOIN.
    
    SOLUTION:
    ---------
    When a derived table is materialized, a temporary table is
    created. This temporary table creates a field each for the
    items in the select-list of the derived table. This set of
    fields is later used to setup the join.
    
    Currently no field is created in the temporary table if a
    parameter is used in the select-list.
    
    Create a field for the parameter. By default Item_param's
    result type in a prepared statement is set to
    STRING_RESULT. This can change during the execute phase
    depending on the user variable. But since the execute phase
    creates its own temporary table, it will be handled
    separately.
    
    This is a backport of the fix for BUG#22392374.
    8bb95e9a
sql_select.cc 581 KB