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 11select plugin_status from information_schema.plugins where plugin_name='feedback';
22plugin_status
33ACTIVE
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
48select * 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' ;
610VARIABLE_NAME VARIABLE_VALUE
7- FEEDBACK used 1
811FEEDBACK version 1.1
912FEEDBACK_SEND_RETRY_WAIT 60
1013FEEDBACK_SEND_TIMEOUT 60
Original file line number Diff line number Diff line change 11select plugin_status from information_schema.plugins where plugin_name='feedback';
22plugin_status
33ACTIVE
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
48select * 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' ;
610VARIABLE_NAME VARIABLE_VALUE
7- FEEDBACK used 2
811FEEDBACK version 1.1
912FEEDBACK_SEND_RETRY_WAIT 60
1013FEEDBACK_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
44}
55
66select 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+
724--replace_result https http
825--sorted_result
926select * 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