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
c965dc34
Commit
c965dc34
authored
Jan 18, 2005
by
gluh@gluh.mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for bug #7981: SHOW GLOBAL STATUS crashes server
parent
b2dbddc3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
30 deletions
+20
-30
mysql-test/r/information_schema.result
mysql-test/r/information_schema.result
+3
-0
mysql-test/t/information_schema.test
mysql-test/t/information_schema.test
+5
-0
sql/sql_show.cc
sql/sql_show.cc
+12
-30
No files found.
mysql-test/r/information_schema.result
View file @
c965dc34
...
@@ -676,3 +676,6 @@ variable_name
...
@@ -676,3 +676,6 @@ variable_name
character_set_database
character_set_database
collation_database
collation_database
skip_show_database
skip_show_database
show global status like "Threads_running";
Variable_name Value
Threads_running 1
mysql-test/t/information_schema.test
View file @
c965dc34
...
@@ -354,3 +354,8 @@ show open tables where `table` like "user";
...
@@ -354,3 +354,8 @@ show open tables where `table` like "user";
show
status
variable_name
where
variable_name
like
"%database%"
;
show
status
variable_name
where
variable_name
like
"%database%"
;
# test for 'show variables ... where'
# test for 'show variables ... where'
show
variables
variable_name
where
variable_name
like
"%database%"
;
show
variables
variable_name
where
variable_name
like
"%database%"
;
#
# Bug #7981:SHOW GLOBAL STATUS crashes server
#
show
global
status
like
"Threads_running"
;
sql/sql_show.cc
View file @
c965dc34
...
@@ -1534,25 +1534,6 @@ static bool show_status_array(THD *thd, const char *wild,
...
@@ -1534,25 +1534,6 @@ static bool show_status_array(THD *thd, const char *wild,
}
}
bool
mysqld_show
(
THD
*
thd
,
const
char
*
wild
,
show_var_st
*
variables
,
enum
enum_var_type
value_type
,
pthread_mutex_t
*
mutex
,
struct
system_status_var
*
status_var
,
TABLE
*
table
)
{
DBUG_ENTER
(
"mysqld_show"
);
ha_update_statistics
();
/* Export engines statistics */
pthread_mutex_lock
(
mutex
);
if
(
show_status_array
(
thd
,
wild
,
variables
,
value_type
,
status_var
,
""
,
table
))
goto
err
;
pthread_mutex_unlock
(
mutex
);
DBUG_RETURN
(
FALSE
);
err:
pthread_mutex_unlock
(
mutex
);
DBUG_RETURN
(
TRUE
);
}
/* collect status for all running threads */
/* collect status for all running threads */
void
calc_sum_of_all_status
(
STATUS_VAR
*
to
)
void
calc_sum_of_all_status
(
STATUS_VAR
*
to
)
...
@@ -2874,10 +2855,14 @@ int fill_open_tables(THD *thd, TABLE_LIST *tables, COND *cond)
...
@@ -2874,10 +2855,14 @@ int fill_open_tables(THD *thd, TABLE_LIST *tables, COND *cond)
int
fill_variables
(
THD
*
thd
,
TABLE_LIST
*
tables
,
COND
*
cond
)
int
fill_variables
(
THD
*
thd
,
TABLE_LIST
*
tables
,
COND
*
cond
)
{
{
DBUG_ENTER
(
"fill_variables"
);
DBUG_ENTER
(
"fill_variables"
);
int
res
=
0
;
LEX
*
lex
=
thd
->
lex
;
LEX
*
lex
=
thd
->
lex
;
const
char
*
wild
=
lex
->
wild
?
lex
->
wild
->
ptr
()
:
NullS
;
const
char
*
wild
=
lex
->
wild
?
lex
->
wild
->
ptr
()
:
NullS
;
int
res
=
mysqld_show
(
thd
,
wild
,
init_vars
,
lex
->
option_type
,
ha_update_statistics
();
/* Export engines statistics */
&
LOCK_global_system_variables
,
0
,
tables
->
table
);
pthread_mutex_lock
(
&
LOCK_global_system_variables
);
res
=
show_status_array
(
thd
,
wild
,
init_vars
,
lex
->
option_type
,
0
,
""
,
tables
->
table
);
pthread_mutex_unlock
(
&
LOCK_global_system_variables
);
DBUG_RETURN
(
res
);
DBUG_RETURN
(
res
);
}
}
...
@@ -2889,17 +2874,14 @@ int fill_status(THD *thd, TABLE_LIST *tables, COND *cond)
...
@@ -2889,17 +2874,14 @@ int fill_status(THD *thd, TABLE_LIST *tables, COND *cond)
const
char
*
wild
=
lex
->
wild
?
lex
->
wild
->
ptr
()
:
NullS
;
const
char
*
wild
=
lex
->
wild
?
lex
->
wild
->
ptr
()
:
NullS
;
int
res
=
0
;
int
res
=
0
;
STATUS_VAR
tmp
;
STATUS_VAR
tmp
;
ha_update_statistics
();
/* Export engines statistics */
pthread_mutex_lock
(
&
LOCK_status
);
if
(
lex
->
option_type
==
OPT_GLOBAL
)
if
(
lex
->
option_type
==
OPT_GLOBAL
)
{
pthread_mutex_lock
(
&
LOCK_status
);
calc_sum_of_all_status
(
&
tmp
);
calc_sum_of_all_status
(
&
tmp
);
}
res
=
show_status_array
(
thd
,
wild
,
status_vars
,
OPT_GLOBAL
,
res
=
mysqld_show
(
thd
,
wild
,
status_vars
,
OPT_GLOBAL
,
&
LOCK_status
,
(
lex
->
option_type
==
OPT_GLOBAL
?
(
lex
->
option_type
==
OPT_GLOBAL
?
&
tmp
:
&
thd
->
status_var
),
""
,
tables
->
table
);
&
tmp
:
&
thd
->
status_var
),
tables
->
table
);
pthread_mutex_unlock
(
&
LOCK_status
);
if
(
lex
->
option_type
==
OPT_GLOBAL
)
pthread_mutex_unlock
(
&
LOCK_status
);
DBUG_RETURN
(
res
);
DBUG_RETURN
(
res
);
}
}
...
...
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