diff options
author | unknown <guilhem@mysql.com> | 2004-06-18 23:50:04 +0200 |
---|---|---|
committer | unknown <guilhem@mysql.com> | 2004-06-18 23:50:04 +0200 |
commit | 83f485968f643cc87573d57be6944ff32b18d79a (patch) | |
tree | 5c90f764ac83bc68c87d34eac6dafe250ad13884 /VC++Files | |
parent | 408dad07a949a570c59e5f660d648c4df727625c (diff) | |
download | mariadb-git-83f485968f643cc87573d57be6944ff32b18d79a.tar.gz |
API change: mysql_shutdown() now requires a 2nd argument, the shutdown level.
mysqld >=4.1.3 will however understand shutdown requests sent by clients <4.1.3.
And mysqld <4.1.3 will understand shutdown requests sent by clients >=4.1.3
(it will ignore the level). Those shutdown level are just PLACEHOLDERS now.
So this change is just to make the 4.1 API suitable before it is frozen. Later
we will actually implement the shutdown levels.
VC++Files/winmysqladmin/main.cpp:
2nd argument to mysql_shutdown()
VC++Files/winmysqladmin/mysql.h:
2nd argument to mysql_shutdown()
VC++Files/winmysqladmin/mysql_com.h:
Several types of shutdown now.
include/mysql_com.h:
SHUTDOWN_DEFAULT is now 0 instead of 255, this saves one test in sql_parse.cc
libmysql/libmysql.c:
correcting mistake (how come that my tests still all worked with this? - should recheck, for curiosity).
sql/sql_parse.cc:
with SHUTDOWN_DEFAULT==0, no need for testing packet_length.
Diffstat (limited to 'VC++Files')
-rw-r--r-- | VC++Files/winmysqladmin/main.cpp | 2 | ||||
-rw-r--r-- | VC++Files/winmysqladmin/mysql.h | 4 | ||||
-rw-r--r-- | VC++Files/winmysqladmin/mysql_com.h | 21 |
3 files changed, 25 insertions, 2 deletions
diff --git a/VC++Files/winmysqladmin/main.cpp b/VC++Files/winmysqladmin/main.cpp index 6ca29659255..dfb2004a780 100644 --- a/VC++Files/winmysqladmin/main.cpp +++ b/VC++Files/winmysqladmin/main.cpp @@ -1196,7 +1196,7 @@ bool __fastcall TForm1::Shutd() if (IsConnect)
{
mysql_kill(MySQL,mysql_thread_id(MySQL));
- mysql_shutdown(MySQL);
+ mysql_shutdown(MySQL, SHUTDOWN_DEFAULT); StatusLine->SimpleText = "";
}
diff --git a/VC++Files/winmysqladmin/mysql.h b/VC++Files/winmysqladmin/mysql.h index e83babb8fa8..f01b55f5d3f 100644 --- a/VC++Files/winmysqladmin/mysql.h +++ b/VC++Files/winmysqladmin/mysql.h @@ -229,7 +229,9 @@ int STDCALL mysql_real_query(MYSQL *mysql, const char *q, unsigned int length); int STDCALL mysql_create_db(MYSQL *mysql, const char *DB); int STDCALL mysql_drop_db(MYSQL *mysql, const char *DB); -int STDCALL mysql_shutdown(MYSQL *mysql); +int STDCALL mysql_shutdown(MYSQL *mysql, + enum enum_shutdown_level + shutdown_level); int STDCALL mysql_dump_debug_info(MYSQL *mysql); int STDCALL mysql_refresh(MYSQL *mysql, unsigned int refresh_options); diff --git a/VC++Files/winmysqladmin/mysql_com.h b/VC++Files/winmysqladmin/mysql_com.h index 2a1471f735d..7d7d77898c3 100644 --- a/VC++Files/winmysqladmin/mysql_com.h +++ b/VC++Files/winmysqladmin/mysql_com.h @@ -155,6 +155,27 @@ enum enum_field_types { FIELD_TYPE_DECIMAL, FIELD_TYPE_TINY, #define FIELD_TYPE_CHAR FIELD_TYPE_TINY /* For compability */ #define FIELD_TYPE_INTERVAL FIELD_TYPE_ENUM /* For compability */ +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= 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_CRITICAL_BUFFERS= 10, /* flush MyISAM buffs (no corruption) */ + SHUTDOWN_WAIT_ALL_BUFFERS= 20, /* flush InnoDB buffers */ + SHUTDOWN_WAIT_STATEMENTS= 30, /* wait for existing updating stmts to finish */ + SHUTDOWN_WAIT_TRANSACTIONS= 40, /* wait for existing trans to finish */ + SHUTDOWN_WAIT_CONNECTIONS= 50 /* wait for existing connections to finish */ +}; + extern unsigned long max_allowed_packet; extern unsigned long net_buffer_length; |