| 5243 | /* Inform processlist and the client that some progress has been made */ |
| 5244 | |
| 5245 | extern "C" void thd_progress_report(MYSQL_THD thd, |
| 5246 | ulonglong progress, ulonglong max_progress) |
| 5247 | { |
| 5248 | if (thd->stmt_arena != thd->progress.arena) |
| 5249 | return; |
| 5250 | if (thd->progress.max_counter != max_progress) // Simple optimization |
| 5251 | { |
| 5252 | /* |
| 5253 | Better to not wait in the unlikely event that LOCK_thd_data is locked |
| 5254 | as Galera can potentially have this locked for a long time. |
| 5255 | Progress counters will fix themselves after the next call. |
| 5256 | */ |
| 5257 | if (mysql_mutex_trylock(&thd->LOCK_thd_data)) |
| 5258 | return; |
| 5259 | thd->progress.counter= progress; |
| 5260 | thd->progress.max_counter= max_progress; |
| 5261 | mysql_mutex_unlock(&thd->LOCK_thd_data); |
| 5262 | } |
| 5263 | else |
| 5264 | thd->progress.counter= progress; |
| 5265 | |
| 5266 | if (thd->progress.report) |
| 5267 | thd_send_progress(thd); |
| 5268 | } |
| 5269 | |
| 5270 | /** |
| 5271 | Move to next stage in process list handling |
no test coverage detected