1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.1

into  a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1
This commit is contained in:
jani@a88-113-38-195.elisa-laajakaista.fi
2007-02-03 00:58:09 +02:00
251 changed files with 3776 additions and 3551 deletions

View File

@@ -22,13 +22,15 @@
#include <my_dir.h>
/*
#if !defined(__attribute__) && (defined(__cplusplus) || !defined(__GNUC__) || __GNUC__ == 2 && __GNUC_MINOR__ < 8)
Disable __attribute__() on non-gcc compilers.
*/
#if !defined(__attribute__) && !defined(__GNUC__)
#define __attribute__(A)
#endif
*/
#define HEART_STRING_BUFFER 100
struct mysql_heartbeat_context
{
pthread_t heartbeat_thread;
@@ -62,7 +64,6 @@ pthread_handler_t mysql_heartbeat(void *p)
x++;
}
DBUG_RETURN(0);
}
@@ -82,6 +83,7 @@ pthread_handler_t mysql_heartbeat(void *p)
static int daemon_example_plugin_init(void *p)
{
DBUG_ENTER("daemon_example_plugin_init");
struct mysql_heartbeat_context *con;
pthread_attr_t attr; /* Thread attributes */
@@ -92,9 +94,11 @@ static int daemon_example_plugin_init(void *p)
struct st_plugin_int *plugin= (struct st_plugin_int *)p;
con= (struct mysql_heartbeat_context *)my_malloc(sizeof(struct mysql_heartbeat_context), MYF(0));
con= (struct mysql_heartbeat_context *)
my_malloc(sizeof(struct mysql_heartbeat_context), MYF(0));
fn_format(heartbeat_filename, "mysql-heartbeat", "", ".log", MY_REPLACE_EXT | MY_UNPACK_FILENAME);
fn_format(heartbeat_filename, "mysql-heartbeat", "", ".log",
MY_REPLACE_EXT | MY_UNPACK_FILENAME);
unlink(heartbeat_filename);
con->heartbeat_file= my_open(heartbeat_filename, O_CREAT|O_RDWR, MYF(0));
@@ -118,12 +122,12 @@ static int daemon_example_plugin_init(void *p)
/* now create the thread */
if (pthread_create(&con->heartbeat_thread, &attr, mysql_heartbeat, (void *)con) != 0)
if (pthread_create(&con->heartbeat_thread, &attr, mysql_heartbeat,
(void *)con) != 0)
{
fprintf(stderr,"Could not create heartbeat thread!\n");
exit(0);
}
plugin->data= (void *)con;
DBUG_RETURN(0);
@@ -142,12 +146,14 @@ static int daemon_example_plugin_init(void *p)
1 failure (cannot happen)
*/
static int daemon_example_plugin_deinit(void *p)
{
DBUG_ENTER("daemon_example_plugin_deinit");
char buffer[HEART_STRING_BUFFER];
struct st_plugin_int *plugin= (struct st_plugin_int *)p;
struct mysql_heartbeat_context *con= (struct mysql_heartbeat_context *)plugin->data;
struct mysql_heartbeat_context *con=
(struct mysql_heartbeat_context *)plugin->data;
time_t result= time(NULL);
struct tm tm_tmp;
@@ -165,12 +171,12 @@ static int daemon_example_plugin_deinit(void *p)
my_write(con->heartbeat_file, buffer, strlen(buffer), MYF(0));
my_close(con->heartbeat_file, MYF(0));
my_free((char *)con, MYF(0));
DBUG_RETURN(0);
}
struct st_mysql_daemon daemon_example_plugin=
{ MYSQL_DAEMON_INTERFACE_VERSION };