summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2015-12-29 19:37:11 +0400
committerAlexander Barkov <bar@mariadb.org>2015-12-29 19:37:11 +0400
commit2ba7ed77aab05004f0c853a77850e325b78a1892 (patch)
tree943659d76215e16d0d1946c28683c562debeff34 /plugin
parent63f0669fd6dc430b60ffd5de0bff9854622a1c1a (diff)
parent1bb66ea88c4679d6bd3ad1472d75983e66f679ae (diff)
downloadmariadb-git-2ba7ed77aab05004f0c853a77850e325b78a1892.tar.gz
Merge remote-tracking branch 'origin/10.1' into 10.2
Diffstat (limited to 'plugin')
-rw-r--r--plugin/auth_socket/CMakeLists.txt2
-rw-r--r--plugin/auth_socket/auth_socket.c2
-rw-r--r--plugin/daemon_example/daemon_example.cc14
-rw-r--r--plugin/feedback/feedback.cc2
-rw-r--r--plugin/feedback/feedback.h6
-rw-r--r--plugin/feedback/sender_thread.cc7
6 files changed, 20 insertions, 13 deletions
diff --git a/plugin/auth_socket/CMakeLists.txt b/plugin/auth_socket/CMakeLists.txt
index 547b1b8e3bf..bfded6a5555 100644
--- a/plugin/auth_socket/CMakeLists.txt
+++ b/plugin/auth_socket/CMakeLists.txt
@@ -65,5 +65,5 @@ ENDIF()
ENDIF()
IF(ok)
- MYSQL_ADD_PLUGIN(auth_socket auth_socket.c MODULE_ONLY)
+ MYSQL_ADD_PLUGIN(auth_socket auth_socket.c)
ENDIF()
diff --git a/plugin/auth_socket/auth_socket.c b/plugin/auth_socket/auth_socket.c
index 601b76b6b5c..f04b1d9d2a1 100644
--- a/plugin/auth_socket/auth_socket.c
+++ b/plugin/auth_socket/auth_socket.c
@@ -105,7 +105,7 @@ static struct st_mysql_auth socket_auth_handler=
socket_auth
};
-maria_declare_plugin(socket_auth)
+maria_declare_plugin(auth_socket)
{
MYSQL_AUTHENTICATION_PLUGIN,
&socket_auth_handler,
diff --git a/plugin/daemon_example/daemon_example.cc b/plugin/daemon_example/daemon_example.cc
index ffa9789a0e9..cdea632c8f4 100644
--- a/plugin/daemon_example/daemon_example.cc
+++ b/plugin/daemon_example/daemon_example.cc
@@ -1,4 +1,5 @@
-/* Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights
+ reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -46,7 +47,6 @@ pthread_handler_t mysql_heartbeat(void *p)
DBUG_ENTER("mysql_heartbeat");
struct mysql_heartbeat_context *con= (struct mysql_heartbeat_context *)p;
char buffer[HEART_STRING_BUFFER];
- unsigned int x= 0;
time_t result;
struct tm tm_tmp;
@@ -65,7 +65,6 @@ pthread_handler_t mysql_heartbeat(void *p)
tm_tmp.tm_min,
tm_tmp.tm_sec);
my_write(con->heartbeat_file, (uchar*) buffer, strlen(buffer), MYF(0));
- x++;
}
DBUG_RETURN(0);
@@ -130,7 +129,7 @@ static int daemon_example_plugin_init(void *p __attribute__ ((unused)))
(void *)con) != 0)
{
fprintf(stderr,"Could not create heartbeat thread!\n");
- exit(0);
+ DBUG_RETURN(1);
}
plugin->data= (void *)con;
@@ -174,6 +173,13 @@ static int daemon_example_plugin_deinit(void *p __attribute__ ((unused)))
tm_tmp.tm_min,
tm_tmp.tm_sec);
my_write(con->heartbeat_file, (uchar*) buffer, strlen(buffer), MYF(0));
+
+ /*
+ Need to wait for the hearbeat thread to terminate before closing
+ the file it writes to and freeing the memory it uses.
+ */
+ pthread_join(con->heartbeat_thread, NULL);
+
my_close(con->heartbeat_file, MYF(0));
my_free(con);
diff --git a/plugin/feedback/feedback.cc b/plugin/feedback/feedback.cc
index dcfa9e07476..28a907a9d93 100644
--- a/plugin/feedback/feedback.cc
+++ b/plugin/feedback/feedback.cc
@@ -265,7 +265,7 @@ static int init(void *p)
startup_interval= debug_startup_interval;
first_interval= debug_first_interval;
interval= debug_interval;
- user_info= "mysql-test";
+ user_info= const_cast<char*>("mysql-test");
}
#endif
diff --git a/plugin/feedback/feedback.h b/plugin/feedback/feedback.h
index 9ac2997c158..bb3f896288d 100644
--- a/plugin/feedback/feedback.h
+++ b/plugin/feedback/feedback.h
@@ -65,9 +65,9 @@ class Url {
extern Url **urls;
extern uint url_count;
-extern time_t startup_interval;
-extern time_t first_interval;
-extern time_t interval;
+extern ulong startup_interval;
+extern ulong first_interval;
+extern ulong interval;
/* these are used to communicate with the background thread */
extern mysql_mutex_t sleep_mutex;
diff --git a/plugin/feedback/sender_thread.cc b/plugin/feedback/sender_thread.cc
index bbf7f567811..773ae887891 100644
--- a/plugin/feedback/sender_thread.cc
+++ b/plugin/feedback/sender_thread.cc
@@ -26,9 +26,9 @@ static my_thread_id thd_thread_id; ///< its thread_id
static size_t needed_size= 20480;
-time_t startup_interval= 60*5; ///< in seconds (5 minutes)
-time_t first_interval= 60*60*24; ///< in seconds (one day)
-time_t interval= 60*60*24*7; ///< in seconds (one week)
+ulong startup_interval= 60*5; ///< in seconds (5 minutes)
+ulong first_interval= 60*60*24; ///< in seconds (one day)
+ulong interval= 60*60*24*7; ///< in seconds (one week)
/**
reads the rows from a table and puts them, concatenated, in a String
@@ -255,6 +255,7 @@ ret:
{
if (tables.table)
free_tmp_table(thd, tables.table);
+ thd->cleanup_after_query();
/*
clean up, free the thd.
reset all thread local status variables to minimize