Debian Codegraph @

mysql-test/suite/perfschema/include/socket_event_dbg.inc

raw
1 # include/socket_event.inc
2 #
3 # Auxiliary routine
4 # - running some statement in connection con1
5 # and checking the changes for the client_connction" entry belonging to con1
6 # within socket_summary_by_instance and
7 # - checking if the changes to values caused by the statement execution are
8 # reasonable and stable
9 #
10 # Requirements:
11 # 1. Have socket_summary_by_instance_func running
12 # 2. Have a connection con1
13 # @con1_object_instance_begin needs to be the OBJECT_INSTANCE_BEGIN
14 # value of the "client_connction" entry belonging to con1 within
15 # socket_summary_by_instance.
16 # 3. $statement needs to contain the statement to be executed by con1.
17 #
18
19 let $my_errno= 0;
20
21 let $loop_round= 1;
22 while($loop_round <= $loop_rounds)
23 {
24
25 if (!$my_socket_debug)
26 {
27 --disable_query_log
28 }
29
30 # Collect the current state
31 #==========================
32 eval $truncate;
33 eval $insert_before;
34
35 # Run the operation
36 #==================
37 if($is_connect)
38 {
39 let $statement= Connect (con1,$connect_host,$connect_user,,$connect_db,,);
40 # Some statements fail with ER_ACCESS_DENIED_ERROR
41 --disable_abort_on_error
42 --connect (con1,$connect_host,$connect_user,,$connect_db,,)
43 --enable_abort_on_error
44 let $my_errno= $mysql_errno;
45 }
46 if(!$is_connect)
47 {
48 --connection con1
49 # Print the statement outcome once.
50 if($loop_round == 1)
51 {
52 --enable_query_log
53 --enable_result_log
54 --horizontal_results
55 }
56 # One of the statements to be checked is expected to fail with ER_NO_SUCH_TABLE.
57 --disable_abort_on_error
58 eval $statement;
59 --enable_abort_on_error
60
61 if (!$my_socket_debug)
62 {
63 --disable_query_log
64 --disable_result_log
65 }
66 }
67
68 # Wait till the operation is really finished. We expect that there will be no
69 # changes to the statistics of the additional connection after this point of time.
70 #=================================================================================
71
72 --connection default
73 if($my_errno)
74 {
75 # Wait a bit and hope that the counter maintenence is finished.
76 --sleep 3
77 }
78 if(!$my_errno)
79 {
80 --source ../include/wait_till_sleep.inc
81 }
82
83 # Various checks
84 #===============
85 # 1. Check statistics in general
86 #-------------------------------
87 # ../include/socket_summary_check.inc also inserts the 'After' state into
88 # mysqltest.my_socket_summary_by_instance.
89 --source ../include/socket_summary_check_dbg.inc
90
91 if (!$my_socket_debug)
92 {
93 --disable_query_log
94 --disable_result_log
95 }
96
97 if($is_connect)
98 {
99 eval $get_object_instance_begin;
100 eval $insert_pseudo_before;
101 }
102
103 eval $insert_delta;
104 # Correct the values of the columns statement and run
105 eval
106 UPDATE mysqltest.socket_summary_by_instance_detail
107 SET statement = '$statement'
108 WHERE statement IS NULL;
109 eval
110 UPDATE mysqltest.socket_summary_by_instance_detail
111 SET run = $loop_round
112 WHERE run IS NULL;
113
114 if($is_connect)
115 {
116 if(!$my_errno)
117 {
118 --connection con1
119 --disconnect con1
120 --source include/wait_until_disconnected.inc
121 --connection default
122 }
123 }
124 inc $loop_round;
125
126 }
127
128 --enable_query_log
129 --enable_result_log
130