• unknown's avatar
    Bug#26093 (SELECT BENCHMARK() for SELECT statements does not produce valid · 0a93be28
    unknown authored
      results)
    
    Before this fix, the function BENCHMARK() would fail to evaluate expressions
    like "(select avg(a) from t1)" in debug builds (with an assert),
    or would report a time of zero in non debug builds.
    
    The root cause is that evaluation of DECIMAL_RESULT expressions was not
    supported in Item_func_benchmark::val_int().
    
    This has been fixed by this change.
    
    
    mysql-test/r/func_misc.result:
      Added support for DECIMAL_RESULT in Item_func_benchmark::val_int()
    mysql-test/t/func_misc.test:
      Added support for DECIMAL_RESULT in Item_func_benchmark::val_int()
    sql/item_func.cc:
      Added support for DECIMAL_RESULT in Item_func_benchmark::val_int()
    0a93be28
item_func.cc 129 KB