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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
4e421687
Commit
4e421687
authored
Nov 06, 2015
by
Sergei Petrunia
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #112 from openquery/MDEV-8981
MDEV-8981: Analyze stmt - cycles can overflow
parents
b80cc31a
0b8144a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
sql/sql_analyze_stmt.h
sql/sql_analyze_stmt.h
+10
-2
No files found.
sql/sql_analyze_stmt.h
View file @
4e421687
...
@@ -47,6 +47,14 @@ protected:
...
@@ -47,6 +47,14 @@ protected:
ulonglong
count
;
ulonglong
count
;
ulonglong
cycles
;
ulonglong
cycles
;
ulonglong
last_start
;
ulonglong
last_start
;
void
cycles_stop_tracking
()
{
ulonglong
end
=
my_timer_cycles
();
cycles
+=
end
-
last_start
;
if
(
unlikely
(
end
<
last_start
))
cycles
+=
ULONGLONG_MAX
;
}
public:
public:
Exec_time_tracker
()
:
count
(
0
),
cycles
(
0
)
{}
Exec_time_tracker
()
:
count
(
0
),
cycles
(
0
)
{}
...
@@ -59,7 +67,7 @@ public:
...
@@ -59,7 +67,7 @@ public:
void
stop_tracking
()
void
stop_tracking
()
{
{
count
++
;
count
++
;
cycles
+=
my_timer_cycles
()
-
last_start
;
cycles
_stop_tracking
()
;
}
}
// interface for getting the time
// interface for getting the time
...
@@ -93,7 +101,7 @@ public:
...
@@ -93,7 +101,7 @@ public:
*/
*/
void
stop_tracking
()
void
stop_tracking
()
{
{
cycles
+=
my_timer_cycles
()
-
last_start
;
cycles
_stop_tracking
()
;
}
}
};
};
...
...
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