MCPcopy Create free account
hub / github.com/MariaDB/server / thd_progress_report

Function thd_progress_report

sql/sql_class.cc:5245–5268  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5243/* Inform processlist and the client that some progress has been made */
5244
5245extern "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

Callers 5

copy_data_between_tablesFunction · 0.85
read_fixed_lengthFunction · 0.85
read_sep_fieldFunction · 0.85
_ma_report_progressFunction · 0.85

Calls 1

thd_send_progressFunction · 0.85

Tested by

no test coverage detected