Commit f09ae60d authored by Alexander Barkov's avatar Alexander Barkov

Fixing to use my_interval_timer() instead of ftime().

The later is not portable (e.g. it does not exist on FreeBSD)

modified:
  storage/connect/ha_connect.cc
  storage/connect/user_connect.cc
  storage/connect/user_connect.h
parent 3d8ef8bf
......@@ -2462,9 +2462,7 @@ int ha_connect::rnd_init(bool scan)
} // endif g
xp->nrd= xp->fnd= xp->nfd= 0;
#ifndef __FreeBSD__
ftime(&xp->tb1);
#endif
xp->tb1= my_interval_timer();
DBUG_RETURN(0);
} // end of rnd_init
......@@ -2545,14 +2543,11 @@ int ha_connect::rnd_next(uchar *buf)
#ifndef DBUG_OFF
if (rc || !(xp->nrd++ % 16384)) {
#ifndef __FreeBSD__
ftime(&xp->tb2);
#endif
double elapsed= (double) (xp->tb2.time - xp->tb1.time)
+ ((double) (xp->tb2.millitm - xp->tb1.millitm) / 1000.0);
ulonglong tb2= my_interval_timer();
double elapsed= (double) (tb2 - xp->tb1) / 1000000000ULL;
DBUG_PRINT("rnd_next", ("rc=%d nrd=%u fnd=%u nfd=%u sec=%.3lf\n",
rc, xp->nrd, xp->fnd, xp->nfd, elapsed));
xp->tb1= xp->tb2;
xp->tb1= tb2;
xp->fnd= xp->nfd= 0;
} // endif nrd
#endif
......
......@@ -76,8 +76,7 @@ user_connect::user_connect(THD *thd, const char *dbn)
// Statistics
nrd= fnd= nfd= 0;
bzero((char*) &tb1, sizeof(struct timeb));
bzero((char*) &tb2, sizeof(struct timeb));
tb1= 0;
} // end of user_connect constructor
......
......@@ -75,6 +75,6 @@ protected:
int count; // if used by several handlers
// Statistics
ulong nrd, fnd, nfd;
struct timeb tb1, tb2;
ulonglong tb1;
}; // end of user_connect class definition
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment