• Norvald H. Ryeng's avatar
    Bug#13031606 VALUES() IN A SELECT STATEMENT CRASHES SERVER · 2e72df37
    Norvald H. Ryeng authored
    Problem: Grouping results by VALUES(alias for string literal) causes
    the server to crash.
    
    Item_insert_values is not constructed to handle other types of
    arguments than field and reference to field. In this case, the
    argument is an Item_string, and this causes
    Item_insert_values::fix_fields() to crash.
    
    Fix: Issue an error message when the argument to Item_insert_values is
    not a field or a reference to a field.
    
    This is slightly in breach with documentation, which states that
    VALUES should return NULL, but the error message is only issued in
    cases where the server otherwise would crash, so there is no change in
    behavior for queries that already work. Future versions will restrict
    syntax so that using VALUES in this way is illegal.
    2e72df37
item.cc 213 KB