• unknown's avatar
    Bug #31253: crash comparing datetime to double · 2e8ca84e
    unknown authored
    convert(<invalid time>, datetime) in WHERE caused crash as function
    returned (void*)NULL, but did not flag SQL NULL. It does now.
    
    
    mysql-test/r/type_datetime.result:
      show that convert() to datetime in a WHERE-clause will no longer crash
      the server on invalid input.
    mysql-test/t/type_datetime.test:
      show that convert() to datetime in a WHERE-clause will no longer crash
      the server on invalid input.
    sql/item.cc:
      When failing to process time values, do not just return (void*)NULL,
      but flag SQL NULL as well so no caller will try to process the 0x0L.
      This makes behaviour for Item::Item::val_decimal_from_date() and
      Item::Item::val_decimal_from_time() identical.
    2e8ca84e
item.cc 186 KB