Skip to content

Commit b34416d

Browse files
author
Mohit Joshi
committedFeb 14, 2019
Bug#29013375 - CONTRIBUTION BY FACEBOOK: STORE ALL_PERSISTED_VARIABLES.TEST COUNTERS IN VA ..
Description : This diff changes all_persisted_variables.test to limit the number of hardcoded values in the test output by putting them into local variables. New patches that are then rebased on top which add new system variables do not need to change as many lines of the original test case, making it easier on the rebase process. Also removed the entries for Bugs that were fixed and modified the queries to included the server variables cthat were not tested due to open bugs. Reviewed by: Parakh Agarwal <parakh.agarwal@oracle.com> RB: 21493
1 parent 004e7fd commit b34416d

File tree

2 files changed

+28
-47
lines changed

2 files changed

+28
-47
lines changed
 

‎mysql-test/r/all_persisted_variables.result

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,31 +29,25 @@ CREATE TABLE all_vars (id INT PRIMARY KEY AUTO_INCREMENT, var_name VARCHAR(64),
2929
INSERT INTO all_vars (var_name, var_value)
3030
SELECT * FROM performance_schema.global_variables
3131
WHERE variable_name NOT IN
32-
('keyring_operations',
33-
'mandatory_roles',
34-
'innodb_ft_aux_table',
35-
'innodb_ft_user_stopword_table',
36-
'innodb_tmpdir',
37-
'innodb_ft_server_stopword_table',
38-
'rbr_exec_mode')
32+
('rbr_exec_mode')
3933
AND variable_name NOT LIKE 'ndb_%'
4034
ORDER BY variable_name;
4135

42-
include/assert.inc ['Expect 554 variables in the table. Due to open Bugs, we are checking for 547']
36+
include/assert.inc [Expect 500+ variables in the table. Due to open Bugs, we are checking for fewer ]
4337

4438
# Test SET PERSIST
4539

46-
include/assert.inc [Expect 377 persisted variables in the table. Due to open Bugs, we are checking for 372]
40+
include/assert.inc [Expect 377 persisted variables in the table.]
4741

4842
************************************************************
4943
* 3. Restart server, it must preserve the persisted variable
5044
* settings. Verify persisted configuration.
5145
************************************************************
5246
# restart
5347

54-
include/assert.inc [Expect 372 persisted variables in persisted_variables table.]
55-
include/assert.inc [Expect 372 persisted variables shown as PERSISTED in variables_info table.]
56-
include/assert.inc [Expect 372 persisted variables with matching peristed and global values.]
48+
include/assert.inc [Expect 377 persisted variables in persisted_variables table.]
49+
include/assert.inc [Expect 377 persisted variables shown as PERSISTED in variables_info table.]
50+
include/assert.inc [Expect 377 persisted variables with matching peristed and global values.]
5751

5852
************************************************************
5953
* 4. Test RESET PERSIST IF EXISTS. Verify persisted variable

‎mysql-test/t/all_persisted_variables.test

Lines changed: 22 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# removed.
2020
# 5. Clean up.
2121

22-
# Note - Currently there are 571 global variables
22+
# Note - Currently there are $total_global_vars global variables
2323
# -> SELECT COUNT(*) FROM performance_schema.global_variables
2424
# In future, if a new global variable is added, it will be automatically
2525
# picked up from performance_schema.global_variables table.
@@ -102,32 +102,29 @@ while($var_id <= $count_vars)
102102

103103
CREATE TABLE all_vars (id INT PRIMARY KEY AUTO_INCREMENT, var_name VARCHAR(64), var_value VARCHAR(1024));
104104

105-
# Currently we are not able to test the below 11 global variables because of
106-
# open bugs (listed below). Once the bugs are fixed,
107-
# below query must be modified.
105+
# Currently we are not able to test below global variables
106+
# 1. rbr_exec_mode
107+
#
108+
# because of open bugs (listed below).
108109
#
109-
# Bug#27512616 - SET PERSIST COMMAND FAILS TO MAP DEFAULT(NULL) VALUES IN MYSQLD-AUTO.CNF
110-
# Bug#27523095 - SET PERSIST MANDATORY_ROLES FAILS TO START THE SERVER
111110
# Bug#27534122 - RBR_EXEC_MODE DOES NOT SUPPORT GLOBAL SCOPE
112-
# Bug#27534041 - SET GLOBAL INNODB_MONITOR_ENABLE CAUSES SERVER TO CRASH
111+
#
112+
# Once the bugs is fixed, below $bug_var_count must be modified along with the query.
113+
114+
--let $bug_var_count=1
115+
--expr $expected_var_count=$total_global_vars - $bug_var_count
113116

114117
INSERT INTO all_vars (var_name, var_value)
115118
SELECT * FROM performance_schema.global_variables
116119
WHERE variable_name NOT IN
117-
('keyring_operations',
118-
'mandatory_roles',
119-
'innodb_ft_aux_table',
120-
'innodb_ft_user_stopword_table',
121-
'innodb_tmpdir',
122-
'innodb_ft_server_stopword_table',
123-
'rbr_exec_mode')
120+
('rbr_exec_mode')
124121
AND variable_name NOT LIKE 'ndb_%'
125122
ORDER BY variable_name;
126123

127124
--let $count_vars= `SELECT COUNT(*) FROM all_vars;`
128125
--echo
129-
--let $assert_text= 'Expect 554 variables in the table. Due to open Bugs, we are checking for 547'
130-
--let $assert_cond= [SELECT COUNT(*) as count FROM all_vars, count, 1] = $total_global_vars-7
126+
--let $assert_text= Expect 500+ variables in the table. Due to open Bugs, we are checking for fewer
127+
--let $assert_cond= [SELECT COUNT(*) as count FROM all_vars, count, 1] = $expected_var_count
131128
--source include/assert.inc
132129

133130
--echo
@@ -144,26 +141,16 @@ while($var_id <= $count_vars)
144141
}
145142
# Below 4 tests have default value as "" and these variables can't be set to
146143
# empty value. Hence, setting them seperately.
147-
SET PERSIST innodb_monitor_enable= "latch";
144+
SET PERSIST innodb_monitor_enable="latch";
148145
SET PERSIST innodb_monitor_disable="latch";
149146
SET PERSIST innodb_monitor_reset="latch";
150147
SET PERSIST innodb_monitor_reset_all="latch";
151148

152149
--enable_warnings
153150
--enable_query_log
154151
--echo
155-
--let $buggy_global_vars = 5
156-
--expr $expected_total_persistent_vars = $total_persistent_vars - $buggy_global_vars
157-
--let $assert_text= Expect $total_persistent_vars persisted variables in the table. Due to open Bugs, we are checking for $expected_total_persistent_vars
158-
159-
# Below are the persisted variables we are unable to test at the moment due to
160-
# existing Bugs.
161-
# 1. keyring_operations (Bug#27523095)
162-
# 2. mandatory_roles (Bug#27523095)
163-
# 3. innodb_ft_aux_table (Bug#27512616)
164-
# 4. innodb_ft_user_stopword_table (Bug#27512616)
165-
# 5. innodb_ft_server_stopword_table (Bug#27512616)
166-
--let $assert_cond= [SELECT COUNT(*) as count FROM performance_schema.persisted_variables, count, 1] = $expected_total_persistent_vars
152+
--let $assert_text= Expect $total_persistent_vars persisted variables in the table.
153+
--let $assert_cond= [SELECT COUNT(*) as count FROM performance_schema.persisted_variables, count, 1] = $total_persistent_vars
167154
--source include/assert.inc
168155

169156
--echo
@@ -176,16 +163,16 @@ SET PERSIST innodb_monitor_reset_all="latch";
176163
--source include/wait_until_connected_again.inc
177164

178165
--echo
179-
--let $assert_text= Expect $expected_total_persistent_vars persisted variables in persisted_variables table.
180-
--let $assert_cond= [SELECT COUNT(*) as count FROM performance_schema.persisted_variables, count, 1] = $expected_total_persistent_vars
166+
--let $assert_text= Expect $total_persistent_vars persisted variables in persisted_variables table.
167+
--let $assert_cond= [SELECT COUNT(*) as count FROM performance_schema.persisted_variables, count, 1] = $total_persistent_vars
181168
--source include/assert.inc
182169

183-
--let $assert_text= Expect $expected_total_persistent_vars persisted variables shown as PERSISTED in variables_info table.
184-
--let $assert_cond= [SELECT COUNT(*) as count FROM performance_schema.variables_info WHERE variable_source="PERSISTED", count, 1] = $expected_total_persistent_vars
170+
--let $assert_text= Expect $total_persistent_vars persisted variables shown as PERSISTED in variables_info table.
171+
--let $assert_cond= [SELECT COUNT(*) as count FROM performance_schema.variables_info WHERE variable_source="PERSISTED", count, 1] = $total_persistent_vars
185172
--source include/assert.inc
186173

187-
--let $assert_text= Expect $expected_total_persistent_vars persisted variables with matching peristed and global values.
188-
--let $assert_cond= [SELECT COUNT(*) as count FROM performance_schema.variables_info vi JOIN performance_schema.persisted_variables pv JOIN performance_schema.global_variables gv ON vi.variable_name=pv.variable_name AND vi.variable_name=gv.variable_name AND pv.variable_value=gv.variable_value WHERE vi.variable_source="PERSISTED", count, 1] = $expected_total_persistent_vars
174+
--let $assert_text= Expect $total_persistent_vars persisted variables with matching peristed and global values.
175+
--let $assert_cond= [SELECT COUNT(*) as count FROM performance_schema.variables_info vi JOIN performance_schema.persisted_variables pv JOIN performance_schema.global_variables gv ON vi.variable_name=pv.variable_name AND vi.variable_name=gv.variable_name AND pv.variable_value=gv.variable_value WHERE vi.variable_source="PERSISTED", count, 1] = $total_persistent_vars
189176
--source include/assert.inc
190177

191178
--echo

0 commit comments

Comments
 (0)
Please sign in to comment.