| 1 |
/***************************************************************************** |
| 2 |
|
| 3 |
Copyright (c) 2012, 2026, Oracle and/or its affiliates. |
| 4 |
|
| 5 |
This program is free software; you can redistribute it and/or modify it under |
| 6 |
the terms of the GNU General Public License, version 2.0, as published by the |
| 7 |
Free Software Foundation. |
| 8 |
|
| 9 |
This program is designed to work with certain software (including |
| 10 |
but not limited to OpenSSL) that is licensed under separate terms, |
| 11 |
as designated in a particular file or component or in included license |
| 12 |
documentation. The authors of MySQL hereby grant you an additional |
| 13 |
permission to link the program and your derivative works with the |
| 14 |
separately licensed software that they have either included with |
| 15 |
the program or referenced in the documentation. |
| 16 |
|
| 17 |
This program is distributed in the hope that it will be useful, but WITHOUT |
| 18 |
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 19 |
FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, |
| 20 |
for more details. |
| 21 |
|
| 22 |
You should have received a copy of the GNU General Public License along with |
| 23 |
this program; if not, write to the Free Software Foundation, Inc., |
| 24 |
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 25 |
|
| 26 |
*****************************************************************************/ |
| 27 |
|
| 28 |
/** @file include/dict0stats_bg.ic |
| 29 |
Code used for background table and index stats gathering. |
| 30 |
|
| 31 |
Created Feb 8, 2013 Marko Makela |
| 32 |
*******************************************************/ |
| 33 |
|
| 34 |
#include "dict0dict.h" |
| 35 |
#include "dict0mem.h" |
| 36 |
|
| 37 |
/** Request the background collection of statistics to stop for a table. |
| 38 |
@retval true when no background process is active |
| 39 |
@retval false when it is not safe to modify the table definition */ |
| 40 |
static inline bool dict_stats_stop_bg(dict_table_t *table) /*!< in/out: table */ |
| 41 |
{ |
| 42 |
ut_ad(!srv_read_only_mode); |
| 43 |
ut_ad(dict_sys_mutex_own()); |
| 44 |
|
| 45 |
if (!(table->stats_bg_flag & BG_STAT_IN_PROGRESS)) { |
| 46 |
return (true); |
| 47 |
} |
| 48 |
|
| 49 |
table->stats_bg_flag |= BG_STAT_SHOULD_QUIT; |
| 50 |
return (false); |
| 51 |
} |