• Evgeny Potemkin's avatar
    Bug#37870: Usage of uninitialized value caused failed assertion. · d0c490e5
    Evgeny Potemkin authored
    The convert_constant_item function converts a constant to integer using
    field for condition like 'field = a_constant'. In some cases the
    convert_constant_item is called for a subquery when outer select is already
    being executed, so convert_constant_item saves field's value to prevent its
    corruption. For EXPLAIN and at the prepare phase field's value isn't
    initialized yet, thus when convert_constant_item tries to restore saved
    value it fails assertion.
    
    Now the convert_constant_item doesn't save/restore field's value if it's
    haven't been read yet. Outer constant values are always saved.
    d0c490e5
explain.result 8.65 KB