1
0
mirror of https://github.com/MariaDB/server.git synced 2025-11-25 17:25:02 +03:00
Files
mariadb/sql/sql_analyze_stmt.h
Daniel Black 0b8144a472 MDEV-8981: Analyze stmt - cycles can overflow
A 64bit counter can overflow within the time of a query
so lets take it that the measurement is the small value
rather than an order 1e12 millisecond query.

tested with:

int main()
{
  ulonglong start = ULONGLONG_MAX - 30;
  ulonglong end = 600;
  ulonglong cycles = 10000;

  cycles += end - start;
  if (unlikely(end < start))
     cycles += ULONGLONG_MAX;

  printf("cycles %llu\n", cycles);
}
2015-10-24 11:45:21 +11:00

12 KiB