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
5aae304f
Commit
5aae304f
authored
Nov 22, 2017
by
Aleksey Midenkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SQL: low timer resolution hack for THD::start_time [#307]
Windows platform is suffered with this problem.
parent
3d513159
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
3 deletions
+35
-3
sql/sql_class.h
sql/sql_class.h
+28
-2
sql/table.cc
sql/table.cc
+7
-1
No files found.
sql/sql_class.h
View file @
5aae304f
...
...
@@ -3323,11 +3323,37 @@ class THD :public Statement,
inline
ulong
query_start_sec_part
()
{
query_start_sec_part_used
=
1
;
return
start_time_sec_part
;
}
MYSQL_TIME
query_start_TIME
();
void
start_time_inc
()
{
++
start_time_sec_part
;
if
(
start_time_sec_part
==
HRTIME_RESOLUTION
)
{
++
start_time
;
start_time_sec_part
=
0
;
}
}
bool
start_time_ge
(
my_time_t
secs
,
ulong
usecs
)
{
return
(
start_time
==
secs
&&
start_time_sec_part
>=
usecs
)
||
start_time
>
secs
;
}
inline
void
set_current_time
()
{
my_hrtime_t
hrtime
=
my_hrtime
();
start_time
=
hrtime_to_my_time
(
hrtime
);
start_time_sec_part
=
hrtime_sec_part
(
hrtime
);
my_time_t
secs
=
hrtime_to_my_time
(
hrtime
);
ulong
usecs
=
hrtime_sec_part
(
hrtime
);
if
(
start_time_ge
(
secs
,
usecs
))
{
start_time_inc
();
}
else
{
start_time
=
secs
;
start_time_sec_part
=
usecs
;
}
#ifdef HAVE_PSI_THREAD_INTERFACE
PSI_THREAD_CALL
(
set_thread_start_time
)(
start_time
);
#endif
...
...
sql/table.cc
View file @
5aae304f
...
...
@@ -8536,8 +8536,14 @@ void TR_table::store_data(ulonglong trx_id, ulonglong commit_id, timeval commit_
timeval
start_time
=
{
thd
->
start_time
,
thd
->
start_time_sec_part
};
store
(
FLD_TRX_ID
,
trx_id
);
store
(
FLD_COMMIT_ID
,
commit_id
);
store
(
FLD_COMMIT_TS
,
commit_ts
);
store
(
FLD_BEGIN_TS
,
start_time
);
if
(
thd
->
start_time_ge
(
commit_ts
.
tv_sec
,
commit_ts
.
tv_usec
))
{
thd
->
start_time_inc
();
commit_ts
.
tv_sec
=
thd
->
start_time
;
commit_ts
.
tv_usec
=
thd
->
start_time_sec_part
;
}
store
(
FLD_COMMIT_TS
,
commit_ts
);
store_iso_level
(
thd
->
tx_isolation
);
}
...
...
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