• unknown's avatar
    Bug#20752: BENCHMARK with many iterations returns too quickly · 7b8717ac
    unknown authored
    In BENCHMARK(count, expr), count could overflow/wrap-around.
    Patch changes to a sufficiently large data-type. Adds a warning
    for negative count values.
    
    
    mysql-test/r/func_str.result:
      show that a negative 'count' for BENCHMARK(count, expr)
      throws a warning and returns NULL.
    mysql-test/t/func_str.test:
      show that a negative 'count' for BENCHMARK(count, expr)
      throws a warning and returns NULL.
    sql/item_func.cc:
      use ulonglong rather than ulong in BENCHMARK(count, expr)
      throw warning on negative 'count'; return SQL-NULL.
    7b8717ac
func_str.result 93.1 KB