Skip to content

Commit e2f900c

Browse files
author
Christopher Powers
committed
WL#6629 Performance Schema, Status Variables
1 parent f8612a7 commit e2f900c

File tree

453 files changed

+16310
-1849
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

453 files changed

+16310
-1849
lines changed

include/mysql/plugin.h

+25-3
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ typedef struct st_mysql_xid MYSQL_XID;
7979
Plugin API. Common for all plugin types.
8080
*/
8181

82-
#define MYSQL_PLUGIN_INTERFACE_VERSION 0x0105
82+
#define MYSQL_PLUGIN_INTERFACE_VERSION 0x0106
8383

8484
/*
8585
The allowable types of plugins
@@ -135,7 +135,7 @@ __MYSQL_DECLARE_PLUGIN(NAME, \
135135
#define mysql_declare_plugin_end ,{0,0,0,0,0,0,0,0,0,0,0,0,0}}
136136

137137
/**
138-
declarations for SHOW STATUS support in plugins
138+
Declarations for SHOW STATUS support in plugins
139139
*/
140140
enum enum_mysql_show_type
141141
{
@@ -154,12 +154,34 @@ enum enum_mysql_show_type
154154
#endif
155155
};
156156

157-
struct st_mysql_show_var {
157+
/**
158+
Status variable scope.
159+
Only GLOBAL status variable scope is available in plugins.
160+
*/
161+
enum enum_mysql_show_scope
162+
{
163+
SHOW_SCOPE_UNDEF,
164+
SHOW_SCOPE_GLOBAL
165+
#ifdef MYSQL_SERVER
166+
/* Server-only values. Not supported in plugins. */
167+
,
168+
SHOW_SCOPE_SESSION,
169+
SHOW_SCOPE_ALL
170+
#endif
171+
};
172+
173+
/**
174+
SHOW STATUS Server status variable
175+
*/
176+
struct st_mysql_show_var
177+
{
158178
const char *name;
159179
char *value;
160180
enum enum_mysql_show_type type;
181+
enum enum_mysql_show_scope scope;
161182
};
162183

184+
#define SHOW_VAR_MAX_NAME_LEN 64
163185
#define SHOW_VAR_FUNC_BUFF_SIZE 1024
164186
typedef int (*mysql_show_var_func)(MYSQL_THD, struct st_mysql_show_var*, char *);
165187

include/mysql/plugin_audit.h.pp

+8-1
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,17 @@
1616
SHOW_CHAR, SHOW_CHAR_PTR,
1717
SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE
1818
};
19-
struct st_mysql_show_var {
19+
enum enum_mysql_show_scope
20+
{
21+
SHOW_SCOPE_UNDEF,
22+
SHOW_SCOPE_GLOBAL
23+
};
24+
struct st_mysql_show_var
25+
{
2026
const char *name;
2127
char *value;
2228
enum enum_mysql_show_type type;
29+
enum enum_mysql_show_scope scope;
2330
};
2431
typedef int (*mysql_show_var_func)(void*, struct st_mysql_show_var*, char *);
2532
struct st_mysql_sys_var;

include/mysql/plugin_auth.h.pp

+8-1
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,17 @@
1616
SHOW_CHAR, SHOW_CHAR_PTR,
1717
SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE
1818
};
19-
struct st_mysql_show_var {
19+
enum enum_mysql_show_scope
20+
{
21+
SHOW_SCOPE_UNDEF,
22+
SHOW_SCOPE_GLOBAL
23+
};
24+
struct st_mysql_show_var
25+
{
2026
const char *name;
2127
char *value;
2228
enum enum_mysql_show_type type;
29+
enum enum_mysql_show_scope scope;
2330
};
2431
typedef int (*mysql_show_var_func)(void*, struct st_mysql_show_var*, char *);
2532
struct st_mysql_sys_var;

include/mysql/plugin_ftparser.h.pp

+8-1
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,17 @@
1616
SHOW_CHAR, SHOW_CHAR_PTR,
1717
SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE
1818
};
19-
struct st_mysql_show_var {
19+
enum enum_mysql_show_scope
20+
{
21+
SHOW_SCOPE_UNDEF,
22+
SHOW_SCOPE_GLOBAL
23+
};
24+
struct st_mysql_show_var
25+
{
2026
const char *name;
2127
char *value;
2228
enum enum_mysql_show_type type;
29+
enum enum_mysql_show_scope scope;
2330
};
2431
typedef int (*mysql_show_var_func)(void*, struct st_mysql_show_var*, char *);
2532
struct st_mysql_sys_var;

include/mysql/plugin_query_rewrite.h.pp

+8-1
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,17 @@
1616
SHOW_CHAR, SHOW_CHAR_PTR,
1717
SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE
1818
};
19-
struct st_mysql_show_var {
19+
enum enum_mysql_show_scope
20+
{
21+
SHOW_SCOPE_UNDEF,
22+
SHOW_SCOPE_GLOBAL
23+
};
24+
struct st_mysql_show_var
25+
{
2026
const char *name;
2127
char *value;
2228
enum enum_mysql_show_type type;
29+
enum enum_mysql_show_scope scope;
2330
};
2431
typedef int (*mysql_show_var_func)(void*, struct st_mysql_show_var*, char *);
2532
struct st_mysql_sys_var;

mysql-test/extra/rpl_tests/rpl_semi_sync_ack_thread.inc

+2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ TRUNCATE t1;
1212

1313
# Verify ack thread receives acknowledgements correctly
1414
--let $assert_text= rpl_semi_sync_master_yes_tx increases 4
15+
--disable_warnings
1516
--let $assert_cond= VARIABLE_VALUE = $yes_tx+4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = "rpl_semi_sync_master_yes_tx"
17+
--enable_warnings
1618
--source include/assert.inc
1719

1820
--source include/rpl_sync.inc

mysql-test/extra/rpl_tests/rpl_semi_sync_after_sync.test

+12
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ SET DEBUG_SYNC= "now WAIT_FOR after_sync_done";
1515

1616
show status like "rpl_semi_sync_master_yes_tx";
1717
--let $assert_text= rpl_semi_sync_master_yes_tx increased 1
18+
--disable_warnings
1819
--let $assert_cond= VARIABLE_VALUE = $yes_tx+1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = "rpl_semi_sync_master_yes_tx"
20+
--enable_warnings
1921
--source include/assert.inc
2022

2123
--let $assert_text= Table is empty right now.
@@ -37,7 +39,9 @@ SET DEBUG_SYNC= "now SIGNAL end";
3739

3840
# Varify that after_commit hook is not executed.
3941
--let $assert_text= rpl_semi_sync_master_yes_tx increased only 1
42+
--disable_warnings
4043
--let $assert_cond= VARIABLE_VALUE = $yes_tx+1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = "rpl_semi_sync_master_yes_tx"
44+
--enable_warnings
4145
--source include/assert.inc
4246

4347
TRUNCATE t1;
@@ -62,7 +66,9 @@ INSERT INTO t1 VALUES(2);
6266
SET DEBUG_SYNC= "now WAIT_FOR after_sync_done";
6367

6468
--let $assert_text= rpl_semi_sync_master_yes_tx increased 1
69+
--disable_warnings
6570
--let $assert_cond= VARIABLE_VALUE = $yes_tx+1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = "rpl_semi_sync_master_yes_tx"
71+
--enable_warnings
6672
--source include/assert.inc
6773

6874
--let $assert_text= Table is empty right now.
@@ -84,7 +90,9 @@ SET DEBUG_SYNC= "now SIGNAL end";
8490

8591
# Varify that after_commit hook is not executed.
8692
--let $assert_text= rpl_semi_sync_master_yes_tx increased only 1
93+
--disable_warnings
8794
--let $assert_cond= VARIABLE_VALUE = $yes_tx+1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = "rpl_semi_sync_master_yes_tx"
95+
--enable_warnings
8896
--source include/assert.inc
8997

9098
TRUNCATE t1;
@@ -110,11 +118,15 @@ SET DEBUG_SYNC= "now WAIT_FOR engine_commit_done";
110118
--source include/assert.inc
111119

112120
--let $assert_text= rpl_semi_sync_master_yes_tx was not increased
121+
--disable_warnings
113122
--let $assert_cond= VARIABLE_VALUE = $yes_tx FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = "rpl_semi_sync_master_yes_tx"
123+
--enable_warnings
114124
--source include/assert.inc
115125

116126
--let $assert_text= rpl_semi_sync_master_no_tx was not increased
127+
--disable_warnings
117128
--let $assert_cond= VARIABLE_VALUE = $no_tx FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = "rpl_semi_sync_master_no_tx"
129+
--enable_warnings
118130
--source include/assert.inc
119131

120132
SET DEBUG_SYNC= "now SIGNAL end";

mysql-test/include/check_qep.inc

+2
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,12 @@ eval $query;
3535
let $cost=
3636
query_get_value(SHOW STATUS LIKE 'Last_query_cost', Value, 1);
3737

38+
--disable_warnings
3839
let $reads=
3940
`select sum(variable_value)
4041
from information_schema.session_status
4142
where VARIABLE_NAME like 'Handler_read%'`;
43+
--enable_warnings
4244

4345
#echo Cost: $cost, Handler_reads: $reads;
4446

0 commit comments

Comments
 (0)