From aba49a6c0bf31b7b9c481058be660661797c8e77 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 15 Jun 2004 11:35:23 +0200 Subject: 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 --- libmysql/libmysql.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'libmysql') diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index eb8368977e9..1e8244e670b 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -1285,10 +1285,13 @@ mysql_drop_db(MYSQL *mysql, const char *db) int STDCALL -mysql_shutdown(MYSQL *mysql) +mysql_shutdown(MYSQL *mysql, enum enum_shutdown_level shutdown_level) { + uchar level[1]; + level[0]= (uchar) shutdown_level; DBUG_ENTER("mysql_shutdown"); - DBUG_RETURN(simple_command(mysql,COM_SHUTDOWN,0,0,0)); + DBUG_RETURN(simple_command(mysql, COM_SHUTDOWN, + &level, 1, 0)); } -- cgit v1.2.1