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
3395ab73
Commit
3395ab73
authored
Jan 03, 2018
by
Sergei Golubchik
Committed by
Aleksey Midenkov
Jan 09, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
small cleanup: backup_query_start_time()
parent
e52a237f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
23 deletions
+17
-23
sql/sp_head.cc
sql/sp_head.cc
+2
-2
sql/sql_class.h
sql/sql_class.h
+15
-21
No files found.
sql/sp_head.cc
View file @
3395ab73
...
...
@@ -3289,7 +3289,7 @@ sp_instr_stmt::execute(THD *thd, uint *nextp)
Save start time info for the CALL statement and overwrite it with the
current time for log_slow_statement() to log the individual query timing.
*/
thd
->
ge
t_time
(
&
time_info
);
thd
->
backup_query_star
t_time
(
&
time_info
);
thd
->
set_time
();
}
thd
->
store_slow_query_state
(
&
backup_state
);
...
...
@@ -3357,7 +3357,7 @@ sp_instr_stmt::execute(THD *thd, uint *nextp)
}
/* Restore the original query start time */
if
(
thd
->
enable_slow_log
)
thd
->
se
t_time
(
&
time_info
);
thd
->
restore_query_star
t_time
(
&
time_info
);
DBUG_RETURN
(
res
||
thd
->
is_error
());
}
...
...
sql/sql_class.h
View file @
3395ab73
...
...
@@ -2080,12 +2080,21 @@ struct wait_for_commit
Structure to store the start time for a query
*/
typedef
struct
struct
QUERY_START_TIME_INFO
{
my_time_t
start_time
;
ulong
start_time_sec_part
;
ulong
start_time_sec_part
;
ulonglong
start_utime
,
utime_after_lock
;
}
QUERY_START_TIME_INFO
;
void
backup_query_start_time
(
QUERY_START_TIME_INFO
*
backup
)
{
*
backup
=
*
this
;
}
void
restore_query_start_time
(
QUERY_START_TIME_INFO
*
backup
)
{
*
this
=
*
backup
;
}
};
extern
"C"
void
my_message_sql
(
uint
error
,
const
char
*
str
,
myf
MyFlags
);
...
...
@@ -2097,7 +2106,8 @@ extern "C" void my_message_sql(uint error, const char *str, myf MyFlags);
class
THD
:
public
Statement
,
public
MDL_context_owner
,
public
Open_tables_state
public
Open_tables_state
,
public
QUERY_START_TIME_INFO
{
private:
inline
bool
is_stmt_prepare
()
const
...
...
@@ -2322,12 +2332,10 @@ class THD :public Statement,
uint32
file_id
;
// for LOAD DATA INFILE
/* remote (peer) port */
uint16
peer_port
;
my_time_t
start_time
;
// start_time and its sec_part
ulong
start_time_sec_part
;
// are almost always used separately
my_hrtime_t
user_time
;
// track down slow pthread_create
ulonglong
prior_thr_create_utime
,
thr_create_utime
;
ulonglong
start_utime
,
utime_after_lock
,
utime_after_query
;
ulonglong
utime_after_query
;
// Process indicator
struct
{
...
...
@@ -3410,20 +3418,6 @@ class THD :public Statement,
MYSQL_SET_STATEMENT_LOCK_TIME
(
m_statement_psi
,
(
utime_after_lock
-
start_utime
));
}
void
get_time
(
QUERY_START_TIME_INFO
*
time_info
)
{
time_info
->
start_time
=
start_time
;
time_info
->
start_time_sec_part
=
start_time_sec_part
;
time_info
->
start_utime
=
start_utime
;
time_info
->
utime_after_lock
=
utime_after_lock
;
}
void
set_time
(
QUERY_START_TIME_INFO
*
time_info
)
{
start_time
=
time_info
->
start_time
;
start_time_sec_part
=
time_info
->
start_time_sec_part
;
start_utime
=
time_info
->
start_utime
;
utime_after_lock
=
time_info
->
utime_after_lock
;
}
ulonglong
current_utime
()
{
return
microsecond_interval_timer
();
}
/* Tell SHOW PROCESSLIST to show time from this point */
...
...
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