summaryrefslogtreecommitdiff
path: root/plugin/feedback
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-11-18 22:03:02 +0100
committerSergei Golubchik <serg@mariadb.org>2015-11-18 22:03:02 +0100
commitab476a8d107b3e5b591944b2b5eb3a21d6d003a1 (patch)
tree966c077afce804cbaf0fc46ecab09c3d1da36a13 /plugin/feedback
parentf91798dd1c9e178061ba58c88a42b9cb3701385d (diff)
parent43a5090980ac0ab9695587979b9068b6bf849d64 (diff)
downloadmariadb-git-ab476a8d107b3e5b591944b2b5eb3a21d6d003a1.tar.gz
Merge branch '5.5' into 10.0
Diffstat (limited to 'plugin/feedback')
-rw-r--r--plugin/feedback/feedback.cc33
-rw-r--r--plugin/feedback/feedback.h4
-rw-r--r--plugin/feedback/sender_thread.cc7
3 files changed, 41 insertions, 3 deletions
diff --git a/plugin/feedback/feedback.cc b/plugin/feedback/feedback.cc
index f644bd597d9..1a2504c5f6f 100644
--- a/plugin/feedback/feedback.cc
+++ b/plugin/feedback/feedback.cc
@@ -22,6 +22,10 @@ extern ST_SCHEMA_TABLE schema_tables[];
namespace feedback {
+#ifndef DBUG_OFF
+ulong debug_startup_interval, debug_first_interval, debug_interval;
+#endif
+
char server_uid_buf[SERVER_UID_SIZE+1]; ///< server uid will be written here
/* backing store for system variables */
@@ -250,6 +254,18 @@ static int init(void *p)
prepare_linux_info();
+#ifndef DBUG_OFF
+ if (startup_interval != debug_startup_interval ||
+ first_interval != debug_first_interval ||
+ interval != debug_interval)
+ {
+ startup_interval= debug_startup_interval;
+ first_interval= debug_first_interval;
+ interval= debug_interval;
+ user_info= "mysql-test";
+ }
+#endif
+
url_count= 0;
if (*url)
{
@@ -348,12 +364,29 @@ static MYSQL_SYSVAR_ULONG(send_retry_wait, send_retry_wait, PLUGIN_VAR_RQCMDARG,
"Wait this many seconds before retrying a failed send.",
NULL, NULL, 60, 1, 60*60*24, 1);
+#ifndef DBUG_OFF
+static MYSQL_SYSVAR_ULONG(debug_startup_interval, debug_startup_interval,
+ PLUGIN_VAR_RQCMDARG, "for debugging only",
+ NULL, NULL, startup_interval, 1, INT_MAX32, 1);
+static MYSQL_SYSVAR_ULONG(debug_first_interval, debug_first_interval,
+ PLUGIN_VAR_RQCMDARG, "for debugging only",
+ NULL, NULL, first_interval, 1, INT_MAX32, 1);
+static MYSQL_SYSVAR_ULONG(debug_interval, debug_interval,
+ PLUGIN_VAR_RQCMDARG, "for debugging only",
+ NULL, NULL, interval, 1, INT_MAX32, 1);
+#endif
+
static struct st_mysql_sys_var* settings[] = {
MYSQL_SYSVAR(server_uid),
MYSQL_SYSVAR(user_info),
MYSQL_SYSVAR(url),
MYSQL_SYSVAR(send_timeout),
MYSQL_SYSVAR(send_retry_wait),
+#ifndef DBUG_OFF
+ MYSQL_SYSVAR(debug_startup_interval),
+ MYSQL_SYSVAR(debug_first_interval),
+ MYSQL_SYSVAR(debug_interval),
+#endif
NULL
};
diff --git a/plugin/feedback/feedback.h b/plugin/feedback/feedback.h
index c2091afdedc..52ab32dfb2b 100644
--- a/plugin/feedback/feedback.h
+++ b/plugin/feedback/feedback.h
@@ -59,6 +59,10 @@ class Url {
extern Url **urls;
extern uint url_count;
+extern time_t startup_interval;
+extern time_t first_interval;
+extern time_t interval;
+
/* these are used to communicate with the background thread */
extern mysql_mutex_t sleep_mutex;
extern mysql_cond_t sleep_condition;
diff --git a/plugin/feedback/sender_thread.cc b/plugin/feedback/sender_thread.cc
index 465bdfa8feb..415c1f2e3c2 100644
--- a/plugin/feedback/sender_thread.cc
+++ b/plugin/feedback/sender_thread.cc
@@ -25,9 +25,9 @@ static my_thread_id thd_thread_id; ///< its thread_id
static size_t needed_size= 20480;
-static const time_t startup_interval= 60*5; ///< in seconds (5 minutes)
-static const time_t first_interval= 60*60*24; ///< in seconds (one day)
-static const time_t interval= 60*60*24*7; ///< in seconds (one week)
+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)
/**
reads the rows from a table and puts them, concatenated, in a String
@@ -124,6 +124,7 @@ static int prepare_for_fill(TABLE_LIST *tables)
if (!tables->table)
return 1;
+ tables->select_lex= thd->lex->current_select;
tables->table->pos_in_table_list= tables;
return 0;