summaryrefslogtreecommitdiff
path: root/include/mysql_com.h
diff options
context:
space:
mode:
authorguilhem@mysql.com <>2004-08-19 01:03:43 +0200
committerguilhem@mysql.com <>2004-08-19 01:03:43 +0200
commitf5228a60e6bc939c4489c1b81c9e9c547783357e (patch)
treea4b00773d2e10dde018f4ff9daea518c66024f02 /include/mysql_com.h
parent05d75947b2b4b4cf4f4a7585e03d394b44e08b46 (diff)
downloadmariadb-git-f5228a60e6bc939c4489c1b81c9e9c547783357e.tar.gz
Very small API change: changing the values in enum enum_shutdown_level;
as this enum is not really usable yet (as MySQL server supports only one shutdown level), and as SHUTDOWN_DEFAULT is still left to 0, this change should disturb no user. Later (in 4.1.4 or 4.1.5) code will be pushed to implement graceful shutdown using this enum.
Diffstat (limited to 'include/mysql_com.h')
-rw-r--r--include/mysql_com.h43
1 files changed, 27 insertions, 16 deletions
diff --git a/include/mysql_com.h b/include/mysql_com.h
index 47231ef31c6..fa25db5f11a 100644
--- a/include/mysql_com.h
+++ b/include/mysql_com.h
@@ -223,25 +223,32 @@ enum enum_field_types { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY,
#define FIELD_TYPE_INTERVAL MYSQL_TYPE_ENUM
#define FIELD_TYPE_GEOMETRY MYSQL_TYPE_GEOMETRY
+
+/* Shutdown/kill enums and constants */
+
+/* Bits for THD::killable. */
+#define KILLABLE_CONNECT (unsigned char)(1 << 0)
+#define KILLABLE_TRANS (unsigned char)(1 << 1)
+#define KILLABLE_LOCK_TABLE (unsigned char)(1 << 2)
+#define KILLABLE_UPDATE (unsigned char)(1 << 3)
+
enum enum_shutdown_level {
/*
- We want levels to be in growing order of hardness. So we leave room
- for future intermediate levels. For now, escalating one level is += 10;
- later if we insert new levels in between we will need a function
- next_shutdown_level(level). Note that DEFAULT does not respect the
- growing property.
+ We want levels to be in growing order of hardness (because we use number
+ comparisons). Note that DEFAULT does not respect the growing property, but
+ it's ok.
*/
- SHUTDOWN_DEFAULT= 0, /* mapped to WAIT_ALL_BUFFERS for now */
- /*
- Here is the list in growing order (the next does the previous plus
- something). WAIT_ALL_BUFFERS is what we have now. Others are "this MySQL
- server does not support this shutdown level yet".
- */
- SHUTDOWN_WAIT_CONNECTIONS= 10, /* wait for existing connections to finish */
- SHUTDOWN_WAIT_TRANSACTIONS= 20, /* wait for existing trans to finish */
- SHUTDOWN_WAIT_STATEMENTS= 30, /* wait for existing updating stmts to finish */
- SHUTDOWN_WAIT_ALL_BUFFERS= 40, /* flush InnoDB buffers */
- SHUTDOWN_WAIT_CRITICAL_BUFFERS= 50, /* flush MyISAM buffs (no corruption) */
+ SHUTDOWN_DEFAULT= 0,
+ /* wait for existing connections to finish */
+ SHUTDOWN_WAIT_CONNECTIONS= KILLABLE_CONNECT,
+ /* wait for existing trans to finish */
+ SHUTDOWN_WAIT_TRANSACTIONS= KILLABLE_TRANS,
+ /* wait for existing updates to finish (=> no partial MyISAM update) */
+ SHUTDOWN_WAIT_UPDATES= KILLABLE_UPDATE,
+ /* flush InnoDB buffers and other storage engines' buffers*/
+ SHUTDOWN_WAIT_ALL_BUFFERS= (KILLABLE_UPDATE << 1),
+ /* don't flush InnoDB buffers, flush other storage engines' buffers*/
+ SHUTDOWN_WAIT_CRITICAL_BUFFERS= (KILLABLE_UPDATE << 1) + 1,
/* Now the 2 levels of the KILL command */
#if MYSQL_VERSION_ID >= 50000
KILL_QUERY= 254,
@@ -249,6 +256,10 @@ enum enum_shutdown_level {
KILL_CONNECTION= 255
};
+/* Same value and type (0, enum_shutdown_level) but not same meaning */
+#define NOT_KILLED SHUTDOWN_DEFAULT
+
+
/* options for mysql_set_option */
enum enum_mysql_set_option
{