Merge branch '5.5' into 10.0

This commit is contained in:
Sergei Golubchik 2015-12-13 00:10:40 +01:00
commit 1623995158
80 changed files with 1022 additions and 258 deletions

View file

@ -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);
@ -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);

View file

@ -262,7 +262,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

View file

@ -59,9 +59,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;

View file

@ -25,9 +25,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
@ -254,6 +254,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