diff options
| author | Alexander Barkov <bar@mnogosearch.org> | 2013-02-01 12:49:04 +0400 |
|---|---|---|
| committer | Alexander Barkov <bar@mnogosearch.org> | 2013-02-01 12:49:04 +0400 |
| commit | f09ae60d306bb559700e64a8fa43148286760693 (patch) | |
| tree | 5e71a59a2477216cfcaffb7165e95250a7cd71c8 | |
| parent | 3d8ef8bf2f9bf2aef5e80136cb2e63ec72f1e341 (diff) | |
| download | mariadb-git-f09ae60d306bb559700e64a8fa43148286760693.tar.gz | |
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
| -rw-r--r-- | storage/connect/ha_connect.cc | 13 | ||||
| -rw-r--r-- | storage/connect/user_connect.cc | 3 | ||||
| -rw-r--r-- | storage/connect/user_connect.h | 2 |
3 files changed, 6 insertions, 12 deletions
diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 86142240c64..14cf110f032 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -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
diff --git a/storage/connect/user_connect.cc b/storage/connect/user_connect.cc index e7a09f93886..e1a8d6d6c8b 100644 --- a/storage/connect/user_connect.cc +++ b/storage/connect/user_connect.cc @@ -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
diff --git a/storage/connect/user_connect.h b/storage/connect/user_connect.h index e0701bf85f3..621835b103f 100644 --- a/storage/connect/user_connect.h +++ b/storage/connect/user_connect.h @@ -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
|
