Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
45ef99db
Commit
45ef99db
authored
Jan 24, 2007
by
sunny
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for Bug# 23666. On Windows ut_usectime returns secs
and usecs relative to the UNIX epoch (which is Jan, 1 1970).
parent
51c93813
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
11 deletions
+54
-11
srv/srv0srv.c
srv/srv0srv.c
+3
-3
ut/ut0ut.c
ut/ut0ut.c
+51
-8
No files found.
srv/srv0srv.c
View file @
45ef99db
...
@@ -1818,15 +1818,15 @@ srv_export_innodb_status(void)
...
@@ -1818,15 +1818,15 @@ srv_export_innodb_status(void)
export_vars
.
innodb_row_lock_waits
=
srv_n_lock_wait_count
;
export_vars
.
innodb_row_lock_waits
=
srv_n_lock_wait_count
;
export_vars
.
innodb_row_lock_current_waits
export_vars
.
innodb_row_lock_current_waits
=
srv_n_lock_wait_current_count
;
=
srv_n_lock_wait_current_count
;
export_vars
.
innodb_row_lock_time
=
srv_n_lock_wait_time
/
1000
0
;
export_vars
.
innodb_row_lock_time
=
srv_n_lock_wait_time
/
1000
;
if
(
srv_n_lock_wait_count
>
0
)
{
if
(
srv_n_lock_wait_count
>
0
)
{
export_vars
.
innodb_row_lock_time_avg
=
(
ulint
)
export_vars
.
innodb_row_lock_time_avg
=
(
ulint
)
(
srv_n_lock_wait_time
/
1000
0
/
srv_n_lock_wait_count
);
(
srv_n_lock_wait_time
/
1000
/
srv_n_lock_wait_count
);
}
else
{
}
else
{
export_vars
.
innodb_row_lock_time_avg
=
0
;
export_vars
.
innodb_row_lock_time_avg
=
0
;
}
}
export_vars
.
innodb_row_lock_time_max
export_vars
.
innodb_row_lock_time_max
=
srv_n_lock_max_wait_time
/
1000
0
;
=
srv_n_lock_max_wait_time
/
1000
;
export_vars
.
innodb_rows_read
=
srv_n_rows_read
;
export_vars
.
innodb_rows_read
=
srv_n_rows_read
;
export_vars
.
innodb_rows_inserted
=
srv_n_rows_inserted
;
export_vars
.
innodb_rows_inserted
=
srv_n_rows_inserted
;
export_vars
.
innodb_rows_updated
=
srv_n_rows_updated
;
export_vars
.
innodb_rows_updated
=
srv_n_rows_updated
;
...
...
ut/ut0ut.c
View file @
45ef99db
...
@@ -20,6 +20,55 @@ Created 5/11/1994 Heikki Tuuri
...
@@ -20,6 +20,55 @@ Created 5/11/1994 Heikki Tuuri
ibool
ut_always_false
=
FALSE
;
ibool
ut_always_false
=
FALSE
;
#ifdef __WIN__
/*********************************************************************
NOTE: The Windows epoch starts from 1601/01/01 whereas the Unix
epoch starts from 1970/1/1. For selection of constant see:
http://support.microsoft.com/kb/167296/ */
#define WIN_TO_UNIX_DELTA_USEC ((ib_longlong) 11644473600000000ULL)
/*********************************************************************
This is the Windows version of gettimeofday(2).*/
static
int
ut_gettimeofday
(
/*============*/
/* out: 0 if all OK else -1 */
struct
timeval
*
tv
,
/* out: Values are relative to Unix epoch */
void
*
tz
)
/* in: not used */
{
FILETIME
ft
;
ib_longlong
tm
;
if
(
!
tv
)
{
errno
=
EINVAL
;
return
(
-
1
);
}
GetSystemTimeAsFileTime
(
&
ft
);
tm
=
(
ib_longlong
)
ft
.
dwHighDateTime
<<
32
;
tm
|=
ft
.
dwLowDateTime
;
ut_a
(
tm
>=
0
);
/* If tm wraps over to negative, the quotient / 10
does not work */
tm
/=
10
;
/* Convert from 100 nsec periods to usec */
/* If we don't convert to the Unix epoch the value for
struct timeval::tv_sec will overflow.*/
tm
-=
WIN_TO_UNIX_DELTA_USEC
;
tv
->
tv_sec
=
(
long
)
(
tm
/
1000000L
);
tv
->
tv_usec
=
(
long
)
(
tm
%
1000000L
);
return
(
0
);
}
#else
#define ut_gettimeofday gettimeofday
#endif
#ifndef UNIV_HOTBACKUP
#ifndef UNIV_HOTBACKUP
/*********************************************************************
/*********************************************************************
Display an SQL identifier.
Display an SQL identifier.
...
@@ -85,17 +134,11 @@ ut_usectime(
...
@@ -85,17 +134,11 @@ ut_usectime(
ulint
*
sec
,
/* out: seconds since the Epoch */
ulint
*
sec
,
/* out: seconds since the Epoch */
ulint
*
ms
)
/* out: microseconds since the Epoch+*sec */
ulint
*
ms
)
/* out: microseconds since the Epoch+*sec */
{
{
#ifdef __WIN__
SYSTEMTIME
st
;
GetLocalTime
(
&
st
);
*
sec
=
(
ulint
)
st
.
wSecond
;
*
ms
=
(
ulint
)
st
.
wMilliseconds
;
#else
struct
timeval
tv
;
struct
timeval
tv
;
gettimeofday
(
&
tv
,
NULL
);
ut_gettimeofday
(
&
tv
,
NULL
);
*
sec
=
(
ulint
)
tv
.
tv_sec
;
*
sec
=
(
ulint
)
tv
.
tv_sec
;
*
ms
=
(
ulint
)
tv
.
tv_usec
;
*
ms
=
(
ulint
)
tv
.
tv_usec
;
#endif
}
}
/**************************************************************
/**************************************************************
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment