diff options
author | unknown <guilhem@mysql.com> | 2004-06-15 11:35:23 +0200 |
---|---|---|
committer | unknown <guilhem@mysql.com> | 2004-06-15 11:35:23 +0200 |
commit | aba49a6c0bf31b7b9c481058be660661797c8e77 (patch) | |
tree | 5975f12541afcd6e853432cf20d0f88672d428f7 /include/mysql_com.h | |
parent | 10ce930c531ad7adee2cb1990f611abd0a731434 (diff) | |
download | mariadb-git-aba49a6c0bf31b7b9c481058be660661797c8e77.tar.gz |
API change: mysql_shutdown() now needs a 2nd parameter, the shutdown level.
Server will however still accept shutdown without specified level; so that old
mysqladmin can still shut server down.
I would like your comments on the names of shutdown level which I chose. You
are welcome to propose better names. Please however check WL#709 before.
Reason for the names I propose is to be accurate, thus leaving possibility
for other levels which we may imagine in the future; that's why I have rejected
names like "fast", "smart", "graceful" so far. My position is that WAIT_ALL_BUFFERS
or WAIT_CRITICAL_BUFFERS say what the shutdown does, whereas for "smart", "fast" you
need to remember what it does.
This should be pushed in 4.1.3 but only after your comments.
client/mysqladmin.c:
2nd parameter for mysql_shutdown()
include/mysql.h:
2nd paramater for mysql_shutdown()
include/mysql_com.h:
4 types of shutdown
libmysql/libmysql.c:
passing the requested shutdown level
sql/sql_parse.cc:
check for the shutdown level in dispatch_command(). Though its value is ignored for now.
tools/mysqlmanager.c:
2nd parameter to mysql_shutdown
Diffstat (limited to 'include/mysql_com.h')
-rw-r--r-- | include/mysql_com.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/mysql_com.h b/include/mysql_com.h index d354a979cd1..bfd38f4f0fc 100644 --- a/include/mysql_com.h +++ b/include/mysql_com.h @@ -223,6 +223,26 @@ enum enum_field_types { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY, #define FIELD_TYPE_INTERVAL MYSQL_TYPE_ENUM #define FIELD_TYPE_GEOMETRY MYSQL_TYPE_GEOMETRY +enum enum_shutdown_level { + /* + We want levels to be in growing order of gracefulness. 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. + */ + SHUTDOWN_DEFAULT= 255, /* 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_CRITICAL_BUFFERS= 10, /* flush MyISAM buffs (no corruption) */ + SHUTDOWN_WAIT_ALL_BUFFERS= 20, /* flush InnoDB buffers */ + SHUTDOWN_WAIT_TRANSACTIONS= 30, /* wait for existing trans to finish */ + SHUTDOWN_WAIT_CONNECTIONS= 40 /* wait for existing connections to finish */ +}; + /* options for mysql_set_option */ enum enum_mysql_set_option { |