Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
8dfe9332
Commit
8dfe9332
authored
Jun 20, 2004
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge joreland@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/jonas/src/mysql-4.1
parents
397f88c3
55afd242
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
79 additions
and
10 deletions
+79
-10
Makefile.am
Makefile.am
+1
-1
VC++Files/winmysqladmin/main.cpp
VC++Files/winmysqladmin/main.cpp
+1
-1
VC++Files/winmysqladmin/mysql.h
VC++Files/winmysqladmin/mysql.h
+3
-1
VC++Files/winmysqladmin/mysql_com.h
VC++Files/winmysqladmin/mysql_com.h
+21
-0
client/mysqladmin.c
client/mysqladmin.c
+1
-1
extra/perror.c
extra/perror.c
+1
-1
include/mysql.h
include/mysql.h
+3
-1
include/mysql_com.h
include/mysql_com.h
+21
-0
libmysql/libmysql.c
libmysql/libmysql.c
+4
-2
sql/sql_parse.cc
sql/sql_parse.cc
+22
-1
tools/mysqlmanager.c
tools/mysqlmanager.c
+1
-1
No files found.
Makefile.am
View file @
8dfe9332
...
...
@@ -36,7 +36,7 @@ linked_sources = linked_client_sources linked_server_sources \
CLEANFILES
=
$(linked_sources)
# This is just so that the linking is done early.
config.h
:
$(linked_sources)
all-local
:
$(linked_sources)
linked_include_sources
:
cd
include
;
$(MAKE)
link_sources
...
...
VC++Files/winmysqladmin/main.cpp
View file @
8dfe9332
...
...
@@ -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
=
""
;
}
...
...
VC++Files/winmysqladmin/mysql.h
View file @
8dfe9332
...
...
@@ -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
);
...
...
VC++Files/winmysqladmin/mysql_com.h
View file @
8dfe9332
...
...
@@ -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
;
...
...
client/mysqladmin.c
View file @
8dfe9332
...
...
@@ -509,7 +509,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
!
stat
(
pidfile
,
&
pidfile_status
))
last_modified
=
pidfile_status
.
st_mtime
;
if
(
mysql_shutdown
(
mysql
))
if
(
mysql_shutdown
(
mysql
,
SHUTDOWN_DEFAULT
))
{
my_printf_error
(
0
,
"shutdown failed; error: '%s'"
,
MYF
(
ME_BELL
),
mysql_error
(
mysql
));
...
...
extra/perror.c
View file @
8dfe9332
...
...
@@ -256,7 +256,7 @@ int main(int argc,char *argv[])
else
{
if
(
verbose
)
printf
(
"MyS
ql
error: %3d = %s
\n
"
,
code
,
msg
);
printf
(
"MyS
QL
error: %3d = %s
\n
"
,
code
,
msg
);
else
puts
(
msg
);
}
...
...
include/mysql.h
View file @
8dfe9332
...
...
@@ -453,7 +453,9 @@ int STDCALL mysql_add_slave(MYSQL* mysql, const char* host,
const
char
*
user
,
const
char
*
passwd
);
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
);
...
...
include/mysql_com.h
View file @
8dfe9332
...
...
@@ -223,6 +223,27 @@ 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
=
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 */
};
/* options for mysql_set_option */
enum
enum_mysql_set_option
{
...
...
libmysql/libmysql.c
View file @
8dfe9332
...
...
@@ -1284,10 +1284,12 @@ 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
];
DBUG_ENTER
(
"mysql_shutdown"
);
DBUG_RETURN
(
simple_command
(
mysql
,
COM_SHUTDOWN
,
0
,
0
,
0
));
level
[
0
]
=
(
uchar
)
shutdown_level
;
DBUG_RETURN
(
simple_command
(
mysql
,
COM_SHUTDOWN
,
(
char
*
)
level
,
1
,
0
));
}
...
...
sql/sql_parse.cc
View file @
8dfe9332
...
...
@@ -1308,6 +1308,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
if
(
command
!=
COM_STATISTICS
&&
command
!=
COM_PING
)
query_id
++
;
thread_running
++
;
/* TODO: set thd->lex->sql_command to SQLCOM_END here */
VOID
(
pthread_mutex_unlock
(
&
LOCK_thread_count
));
thd
->
server_status
&=
...
...
@@ -1478,6 +1479,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
thd
->
query_length
=
length
;
thd
->
query
=
packet
;
thd
->
query_id
=
query_id
++
;
/* TODO: set thd->lex->sql_command to SQLCOM_END here */
VOID
(
pthread_mutex_unlock
(
&
LOCK_thread_count
));
#ifndef EMBEDDED_LIBRARY
mysql_parse
(
thd
,
packet
,
length
);
...
...
@@ -1631,10 +1633,28 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
}
#ifndef EMBEDDED_LIBRARY
case
COM_SHUTDOWN
:
{
statistic_increment
(
com_other
,
&
LOCK_status
);
if
(
check_global_access
(
thd
,
SHUTDOWN_ACL
))
break
;
/* purecov: inspected */
DBUG_PRINT
(
"quit"
,(
"Got shutdown command"
));
/*
If the client is < 4.1.3, it is going to send us no argument; then
packet_length is 1, packet[0] is the end 0 of the packet. Note that
SHUTDOWN_DEFAULT is 0. If client is >= 4.1.3, the shutdown level is in
packet[0].
*/
enum
enum_shutdown_level
level
=
(
enum
enum_shutdown_level
)
(
uchar
)
packet
[
0
];
DBUG_PRINT
(
"quit"
,(
"Got shutdown command for level %u"
,
level
));
if
(
level
==
SHUTDOWN_DEFAULT
)
level
=
SHUTDOWN_WAIT_ALL_BUFFERS
;
// soon default will be configurable
else
if
(
level
!=
SHUTDOWN_WAIT_ALL_BUFFERS
)
{
my_error
(
ER_NOT_SUPPORTED_YET
,
MYF
(
0
),
"this shutdown level"
);
send_error
(
thd
);
break
;
}
DBUG_PRINT
(
"quit"
,(
"Got shutdown command for level %u"
,
level
));
mysql_log
.
write
(
thd
,
command
,
NullS
);
send_eof
(
thd
);
#ifdef __WIN__
...
...
@@ -1650,6 +1670,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
kill_mysql
();
error
=
TRUE
;
break
;
}
#endif
case
COM_STATISTICS
:
{
...
...
tools/mysqlmanager.c
View file @
8dfe9332
...
...
@@ -687,7 +687,7 @@ HANDLE_DECL(handle_stop_exec)
error
=
"Process not running"
;
goto
err
;
}
if
(
mysql_shutdown
(
&
e
->
mysql
))
if
(
mysql_shutdown
(
&
e
->
mysql
,
SHUTDOWN_DEFAULT
))
{
/* e->th=0; */
/* th may be a struct */
pthread_mutex_unlock
(
&
e
->
lock
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment