File tree Expand file tree Collapse file tree 3 files changed +28
-5
lines changed Expand file tree Collapse file tree 3 files changed +28
-5
lines changed Original file line number Diff line number Diff line change 1
1
select plugin_status from information_schema.plugins where plugin_name='feedback';
2
2
plugin_status
3
3
ACTIVE
4
+ SELECT variable_value INTO @feedback_used FROM information_schema.feedback where variable_name = 'FEEDBACK used';
5
+ SELECT variable_value = @feedback_used + 1 FROM information_schema.feedback where variable_name = 'FEEDBACK used';
6
+ variable_value = @feedback_used + 1
7
+ 1
4
8
select * from information_schema.feedback where variable_name like 'feed%'
5
- and variable_name not like '%_uid';
9
+ and variable_name not like '%_uid' and variable_name not like 'FEEDBACK used' ;
6
10
VARIABLE_NAME VARIABLE_VALUE
7
- FEEDBACK used 1
8
11
FEEDBACK version 1.1
9
12
FEEDBACK_SEND_RETRY_WAIT 60
10
13
FEEDBACK_SEND_TIMEOUT 60
Original file line number Diff line number Diff line change 1
1
select plugin_status from information_schema.plugins where plugin_name='feedback';
2
2
plugin_status
3
3
ACTIVE
4
+ SELECT variable_value INTO @feedback_used FROM information_schema.feedback where variable_name = 'FEEDBACK used';
5
+ SELECT variable_value = @feedback_used + 1 FROM information_schema.feedback where variable_name = 'FEEDBACK used';
6
+ variable_value = @feedback_used + 1
7
+ 1
4
8
select * from information_schema.feedback where variable_name like 'feed%'
5
- and variable_name not like '%_uid';
9
+ and variable_name not like '%_uid' and variable_name not like 'FEEDBACK used' ;
6
10
VARIABLE_NAME VARIABLE_VALUE
7
- FEEDBACK used 2
8
11
FEEDBACK version 1.1
9
12
FEEDBACK_SEND_RETRY_WAIT 60
10
13
FEEDBACK_SEND_TIMEOUT 60
Original file line number Diff line number Diff line change @@ -4,7 +4,24 @@ if (`select count(*) = 0 from information_schema.plugins where plugin_name = 'fe
4
4
}
5
5
6
6
select plugin_status from information_schema.plugins where plugin_name='feedback';
7
+
8
+ # Every SELECT from INFORMATION_SCHEMA.FEEDBACK increases the value of 'FEEDBACK used'.
9
+ # We cannot record the actual value, because the test can be executed more than once,
10
+ # but we can check that the value indeed increases as expected.
11
+ # There is still a room for some race condition, e.g. if at the very moment
12
+ # between first SELECT to store the value and the next SELECT to check that it increases,
13
+ # the feedback plugin is activated. But the probability of it is close to 0,
14
+ # so lets get back to it if it ever happens.
15
+
16
+ # Lets say the plugin was used X times before this SELECT
17
+ SELECT variable_value INTO @feedback_used FROM information_schema.feedback where variable_name = 'FEEDBACK used';
18
+
19
+ # Now $feedback_used == X+1, and 'FEEDBACK used' is also X+1. And variable_value is increased again when we run the next SELECT
20
+ SELECT variable_value = @feedback_used + 1 FROM information_schema.feedback where variable_name = 'FEEDBACK used';
21
+
22
+ # Now when we are happy with 'FEEDBACK used', we can check everything else
23
+
7
24
--replace_result https http
8
25
--sorted_result
9
26
select * from information_schema.feedback where variable_name like 'feed%'
10
- and variable_name not like '%_uid';
27
+ and variable_name not like '%_uid' and variable_name not like 'FEEDBACK used' ;
You can’t perform that action at this time.
0 commit comments