|
104 | 104 | eval SELECT "let \$result_pattern= $result_pattern ;" AS "";
|
105 | 105 | SELECT '--source include/wait_slave_status.inc' AS "";
|
106 | 106 |
|
107 |
| -# We accept to wait maximum 30 seconds (0.2 sec/loop). |
108 |
| -let $max_wait= 150; |
109 |
| -while ($max_wait) |
110 |
| -{ |
111 |
| - let $my_val= `SHOW SLAVE STATUS`; |
112 |
| - # Now we have the first record of the SHOW result set as one fat string |
113 |
| - # within the variable $my_val. |
114 |
| - |
115 |
| - eval SET @my_val = '$my_val'; |
116 |
| - # DEBUG eval SELECT @my_val AS "response to SHOW SLAVE STATUS"; |
| 107 | +let $show_type= SLAVE STATUS; |
| 108 | +let $show_pattern= $result_pattern; |
| 109 | +--enable_query_log |
117 | 110 |
|
118 |
| - eval SELECT @my_val LIKE $result_pattern INTO @success; |
119 |
| - # @success is '1' if we have a match |
120 |
| - # '0' if we have no match |
121 |
| - # DEBUG SELECT @success; |
| 111 | +--source include/wait_show_pattern.inc |
122 | 112 |
|
123 |
| - let $success= `SELECT @success`; |
124 |
| - let $no_success= `SELECT @success = 0`; |
125 |
| - if ($success) |
126 |
| - { |
127 |
| - # We reached the expected result and want to jump out of the loop |
128 |
| - # without unneeded sleeps. |
129 |
| - # Attention: Do not set $max_wait to 0, because "while" with negative value |
130 |
| - # does not work. |
131 |
| - let $max_wait= 1; |
132 |
| - } |
133 |
| - if ($no_success) |
134 |
| - { |
135 |
| - # We did not reach the expected result and will have to sleep again |
136 |
| - # or jump out of the loop, when max_wait is exhausted. |
137 |
| - real_sleep 0.2; |
138 |
| - } |
139 |
| - dec $max_wait; |
140 |
| -} |
141 |
| ---enable_query_log |
142 |
| -if ($no_success) |
| 113 | +if (!$success) |
143 | 114 | {
|
144 | 115 | let $message= ! Attention: Timeout in wait_slave_status.inc.
|
145 | 116 | | Possible reasons with decreasing probability:
|
146 |
| - | - The LIKE pattern ($result_pattern) is wrong, because the |
| 117 | + | - The LIKE pattern is wrong, because the |
147 | 118 | | testcase was altered or the layout of the
|
148 | 119 | | SHOW SLAVE STATUS result set changed.
|
149 | 120 | | - There is a new bug within the replication.
|
150 |
| - | - We met an extreme testing environment and $max_wait is |
| 121 | + | - We met an extreme testing environment and timeout is |
151 | 122 | | too small.;
|
152 | 123 | --source include/show_msg80.inc
|
153 | 124 | --echo DEBUG INFO START (wait_slave_status.inc):
|
|
0 commit comments