summaryrefslogtreecommitdiff
path: root/storage/spider
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-05-04 15:23:26 +0200
committerSergei Golubchik <serg@mariadb.org>2016-05-04 15:23:26 +0200
commit87e3e67f434628768b5125fbab7e8862fa60da1a (patch)
treedf19b8bcac9988d83270ed1da05f765bfc4e8624 /storage/spider
parent80da57cc4f0c717ee3e01ac5abccc859b88a2fbf (diff)
parentcee9ab9d85a8d75290b0d60bc7af26c8cf179a1d (diff)
downloadmariadb-git-87e3e67f434628768b5125fbab7e8862fa60da1a.tar.gz
Merge branch '10.0' into 10.1
Diffstat (limited to 'storage/spider')
-rw-r--r--storage/spider/hs_client/fatal.cpp20
-rw-r--r--storage/spider/hs_client/fatal.hpp2
-rw-r--r--storage/spider/hs_client/socket.cpp2
-rw-r--r--storage/spider/spd_conn.cc34
-rw-r--r--storage/spider/spd_db_conn.cc4
-rw-r--r--storage/spider/spd_ping_table.cc4
-rw-r--r--storage/spider/spd_table.cc16
-rw-r--r--storage/spider/spd_trx.cc12
8 files changed, 36 insertions, 58 deletions
diff --git a/storage/spider/hs_client/fatal.cpp b/storage/spider/hs_client/fatal.cpp
index bec031153e4..260a2e75372 100644
--- a/storage/spider/hs_client/fatal.cpp
+++ b/storage/spider/hs_client/fatal.cpp
@@ -26,26 +26,6 @@ const int opt_syslog = LOG_ERR | LOG_PID | LOG_CONS;
*/
void
-fatal_exit(const String& message)
-{
- fprintf(stderr, "FATAL_EXIT: %s\n", message.ptr());
-/*
- syslog(opt_syslog, "FATAL_EXIT: %s", message.ptr());
-*/
- _exit(1);
-}
-
-void
-fatal_exit(const char *message)
-{
- fprintf(stderr, "FATAL_EXIT: %s\n", message);
-/*
- syslog(opt_syslog, "FATAL_EXIT: %s", message);
-*/
- _exit(1);
-}
-
-void
fatal_abort(const String& message)
{
fprintf(stderr, "FATAL_COREDUMP: %s\n", message.ptr());
diff --git a/storage/spider/hs_client/fatal.hpp b/storage/spider/hs_client/fatal.hpp
index a75c56bddad..e1190ae49c1 100644
--- a/storage/spider/hs_client/fatal.hpp
+++ b/storage/spider/hs_client/fatal.hpp
@@ -22,8 +22,6 @@
namespace dena {
-void fatal_exit(const String& message);
-void fatal_exit(const char *message);
void fatal_abort(const String& message);
void fatal_abort(const char *message);
diff --git a/storage/spider/hs_client/socket.cpp b/storage/spider/hs_client/socket.cpp
index 2082d1f024e..c61b39d140f 100644
--- a/storage/spider/hs_client/socket.cpp
+++ b/storage/spider/hs_client/socket.cpp
@@ -67,7 +67,7 @@ socket_args::set(const config& conf)
message.append(node);
message.q_append(":", sizeof(":") - 1);
message.append(port);
- fatal_exit(message);
+ fatal_abort(message);
}
}
}
diff --git a/storage/spider/spd_conn.cc b/storage/spider/spd_conn.cc
index c5c47064403..2f7fdb62ad4 100644
--- a/storage/spider/spd_conn.cc
+++ b/storage/spider/spd_conn.cc
@@ -2706,7 +2706,7 @@ void *spider_bg_sts_action(
SPIDER_TRX *trx;
int error_num = 0, roop_count;
ha_spider spider;
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__SUNPRO_CC)
int *need_mons;
SPIDER_CONN **conns;
uint *conn_link_idx;
@@ -2733,7 +2733,7 @@ void *spider_bg_sts_action(
my_thread_init();
DBUG_ENTER("spider_bg_sts_action");
/* init start */
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__SUNPRO_CC)
#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
if (!(need_mons = (int *)
spider_bulk_malloc(spider_current_trx, 21, MYF(MY_WME),
@@ -2777,7 +2777,7 @@ void *spider_bg_sts_action(
share->bg_sts_init = FALSE;
pthread_mutex_unlock(&share->sts_mutex);
my_thread_end();
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__SUNPRO_CC)
spider_free(NULL, need_mons, MYF(MY_WME));
#endif
DBUG_RETURN(NULL);
@@ -2801,7 +2801,7 @@ void *spider_bg_sts_action(
my_pthread_setspecific_ptr(THR_THD, NULL);
#endif
my_thread_end();
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__SUNPRO_CC)
spider_free(NULL, need_mons, MYF(MY_WME));
#endif
DBUG_RETURN(NULL);
@@ -2866,7 +2866,7 @@ void *spider_bg_sts_action(
my_pthread_setspecific_ptr(THR_THD, NULL);
#endif
my_thread_end();
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__SUNPRO_CC)
spider_free(NULL, need_mons, MYF(MY_WME));
#endif
DBUG_RETURN(NULL);
@@ -2897,7 +2897,7 @@ void *spider_bg_sts_action(
my_pthread_setspecific_ptr(THR_THD, NULL);
#endif
my_thread_end();
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__SUNPRO_CC)
spider_free(NULL, need_mons, MYF(MY_WME));
#endif
DBUG_RETURN(NULL);
@@ -3088,7 +3088,7 @@ void *spider_bg_crd_action(
int error_num = 0, roop_count;
ha_spider spider;
TABLE table;
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__SUNPRO_CC)
int *need_mons;
SPIDER_CONN **conns;
uint *conn_link_idx;
@@ -3115,7 +3115,7 @@ void *spider_bg_crd_action(
my_thread_init();
DBUG_ENTER("spider_bg_crd_action");
/* init start */
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__SUNPRO_CC)
#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
if (!(need_mons = (int *)
spider_bulk_malloc(spider_current_trx, 22, MYF(MY_WME),
@@ -3159,7 +3159,7 @@ void *spider_bg_crd_action(
share->bg_crd_init = FALSE;
pthread_mutex_unlock(&share->crd_mutex);
my_thread_end();
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__SUNPRO_CC)
spider_free(NULL, need_mons, MYF(MY_WME));
#endif
DBUG_RETURN(NULL);
@@ -3183,7 +3183,7 @@ void *spider_bg_crd_action(
my_pthread_setspecific_ptr(THR_THD, NULL);
#endif
my_thread_end();
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__SUNPRO_CC)
spider_free(NULL, need_mons, MYF(MY_WME));
#endif
DBUG_RETURN(NULL);
@@ -3252,7 +3252,7 @@ void *spider_bg_crd_action(
my_pthread_setspecific_ptr(THR_THD, NULL);
#endif
my_thread_end();
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__SUNPRO_CC)
spider_free(NULL, need_mons, MYF(MY_WME));
#endif
DBUG_RETURN(NULL);
@@ -3283,7 +3283,7 @@ void *spider_bg_crd_action(
my_pthread_setspecific_ptr(THR_THD, NULL);
#endif
my_thread_end();
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__SUNPRO_CC)
spider_free(NULL, need_mons, MYF(MY_WME));
#endif
DBUG_RETURN(NULL);
@@ -3417,7 +3417,7 @@ int spider_create_mon_threads(
{
char link_idx_str[SPIDER_SQL_INT_LEN];
int link_idx_str_length;
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__SUNPRO_CC)
spider_string conv_name_str(share->table_name_length +
SPIDER_SQL_INT_LEN + 1);
conv_name_str.set_charset(system_charset_info);
@@ -3748,7 +3748,7 @@ int spider_conn_first_link_idx(
int roop_count, active_links = 0;
longlong balance_total = 0, balance_val;
double rand_val;
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__SUNPRO_CC)
int *link_idxs, link_idx;
long *balances;
#else
@@ -3756,7 +3756,7 @@ int spider_conn_first_link_idx(
long balances[link_count];
#endif
DBUG_ENTER("spider_conn_first_link_idx");
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__SUNPRO_CC)
if (!(link_idxs = (int *)
spider_bulk_malloc(spider_current_trx, 24, MYF(MY_WME),
&link_idxs, sizeof(int) * link_count,
@@ -3782,7 +3782,7 @@ int spider_conn_first_link_idx(
if (active_links == 0)
{
DBUG_PRINT("info",("spider all links are failed"));
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__SUNPRO_CC)
spider_free(spider_current_trx, link_idxs, MYF(MY_WME));
#endif
DBUG_RETURN(-1);
@@ -3811,7 +3811,7 @@ int spider_conn_first_link_idx(
}
DBUG_PRINT("info",("spider first link_idx=%d", link_idxs[roop_count]));
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__SUNPRO_CC)
link_idx = link_idxs[roop_count];
spider_free(spider_current_trx, link_idxs, MYF(MY_WME));
DBUG_RETURN(link_idx);
diff --git a/storage/spider/spd_db_conn.cc b/storage/spider/spd_db_conn.cc
index 9f46e55ca09..c29172a474a 100644
--- a/storage/spider/spd_db_conn.cc
+++ b/storage/spider/spd_db_conn.cc
@@ -9294,7 +9294,7 @@ int spider_db_udf_ping_table(
{
int init_sql_alloc_size =
spider_param_init_sql_alloc_size(trx->thd, share->init_sql_alloc_size);
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__SUNPRO_CC)
spider_string sql_str(init_sql_alloc_size);
sql_str.set_charset(system_charset_info);
spider_string where_str(init_sql_alloc_size);
@@ -9517,7 +9517,7 @@ int spider_db_udf_ping_table_mon_next(
SPIDER_SHARE *share = table_mon->share;
int init_sql_alloc_size =
spider_param_init_sql_alloc_size(thd, share->init_sql_alloc_size);
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__SUNPRO_CC)
spider_string sql_str(init_sql_alloc_size);
sql_str.set_charset(thd->variables.character_set_client);
#else
diff --git a/storage/spider/spd_ping_table.cc b/storage/spider/spd_ping_table.cc
index 41c5c240dd3..f59f7760359 100644
--- a/storage/spider/spd_ping_table.cc
+++ b/storage/spider/spd_ping_table.cc
@@ -241,7 +241,7 @@ void spider_release_ping_table_mon_list(
DBUG_PRINT("info", ("spider link_idx=%d", link_idx));
link_idx_str_length = my_sprintf(link_idx_str, (link_idx_str, "%010d",
link_idx));
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__SUNPRO_CC)
spider_string conv_name_str(conv_name_length + link_idx_str_length + 1);
conv_name_str.set_charset(system_charset_info);
#else
@@ -1362,7 +1362,7 @@ int spider_ping_table_mon_from_table(
link_idx_str_length = my_sprintf(link_idx_str, (link_idx_str, "%010d",
link_idx));
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__SUNPRO_CC)
spider_string conv_name_str(conv_name_length + link_idx_str_length + 1);
conv_name_str.set_charset(system_charset_info);
*((char *)(conv_name_str.ptr() + conv_name_length + link_idx_str_length)) =
diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc
index fa712575610..54dd1089b7e 100644
--- a/storage/spider/spd_table.cc
+++ b/storage/spider/spd_table.cc
@@ -3703,7 +3703,7 @@ int spider_create_conn_keys(
#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
char *tmp_hs_r_name, *tmp_hs_w_name;
#endif
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__SUNPRO_CC)
uint *conn_keys_lengths;
#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
uint *hs_r_conn_keys_lengths;
@@ -3717,7 +3717,7 @@ int spider_create_conn_keys(
#endif
#endif
DBUG_ENTER("spider_create_conn_keys");
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__SUNPRO_CC)
if (!(conn_keys_lengths =
(uint *) spider_bulk_alloc_mem(spider_current_trx, 44,
__func__, __FILE__, __LINE__, MYF(MY_WME),
@@ -3806,7 +3806,7 @@ int spider_create_conn_keys(
#endif
NullS))
) {
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__SUNPRO_CC)
spider_free(spider_current_trx, conn_keys_lengths, MYF(MY_WME));
#endif
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
@@ -3823,7 +3823,7 @@ int spider_create_conn_keys(
sizeof(uint) * share->all_link_count);
#endif
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__SUNPRO_CC)
spider_free(spider_current_trx, conn_keys_lengths, MYF(MY_WME));
#endif
@@ -4676,7 +4676,7 @@ SPIDER_SHARE *spider_get_share(
share->link_count, SPIDER_LINK_STATUS_OK);
if (search_link_idx == -1)
{
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__SUNPRO_CC)
char *db, *table_name;
if (!(db = (char *)
spider_bulk_malloc(spider_current_trx, 48, MYF(MY_WME),
@@ -4702,7 +4702,7 @@ SPIDER_SHARE *spider_get_share(
table_name[table_share->table_name.length] = '\0';
my_printf_error(ER_SPIDER_ALL_LINKS_FAILED_NUM,
ER_SPIDER_ALL_LINKS_FAILED_STR, MYF(0), db, table_name);
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__SUNPRO_CC)
spider_free(spider->trx, db, MYF(MY_WME));
#endif
*error_num = ER_SPIDER_ALL_LINKS_FAILED_NUM;
@@ -5100,7 +5100,7 @@ SPIDER_SHARE *spider_get_share(
share->link_count, SPIDER_LINK_STATUS_OK);
if (search_link_idx == -1)
{
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__SUNPRO_CC)
char *db, *table_name;
if (!(db = (char *)
spider_bulk_malloc(spider_current_trx, 50, MYF(MY_WME),
@@ -5123,7 +5123,7 @@ SPIDER_SHARE *spider_get_share(
table_name[table_share->table_name.length] = '\0';
my_printf_error(ER_SPIDER_ALL_LINKS_FAILED_NUM,
ER_SPIDER_ALL_LINKS_FAILED_STR, MYF(0), db, table_name);
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__SUNPRO_CC)
spider_free(spider->trx, db, MYF(MY_WME));
#endif
*error_num = ER_SPIDER_ALL_LINKS_FAILED_NUM;
diff --git a/storage/spider/spd_trx.cc b/storage/spider/spd_trx.cc
index d7127fa0084..18b6fd5ec89 100644
--- a/storage/spider/spd_trx.cc
+++ b/storage/spider/spd_trx.cc
@@ -3710,7 +3710,7 @@ int spider_check_trx_and_get_conn(
{
TABLE *table = spider->get_table();
TABLE_SHARE *table_share = table->s;
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__SUNPRO_CC)
char *db, *table_name;
if (!(db = (char *)
spider_bulk_malloc(spider_current_trx, 57, MYF(MY_WME),
@@ -3732,7 +3732,7 @@ int spider_check_trx_and_get_conn(
table_name[table_share->table_name.length] = '\0';
my_printf_error(ER_SPIDER_ALL_LINKS_FAILED_NUM,
ER_SPIDER_ALL_LINKS_FAILED_STR, MYF(0), db, table_name);
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__SUNPRO_CC)
spider_free(trx, db, MYF(MY_WME));
#endif
DBUG_RETURN(ER_SPIDER_ALL_LINKS_FAILED_NUM);
@@ -3869,7 +3869,7 @@ int spider_check_trx_and_get_conn(
{
TABLE *table = spider->get_table();
TABLE_SHARE *table_share = table->s;
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__SUNPRO_CC)
char *db, *table_name;
if (!(db = (char *)
spider_bulk_malloc(spider_current_trx, 57, MYF(MY_WME),
@@ -3891,7 +3891,7 @@ int spider_check_trx_and_get_conn(
table_name[table_share->table_name.length] = '\0';
my_printf_error(ER_SPIDER_LINK_MON_JUST_NG_NUM,
ER_SPIDER_LINK_MON_JUST_NG_STR, MYF(0), db, table_name);
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__SUNPRO_CC)
spider_free(trx, db, MYF(MY_WME));
#endif
DBUG_RETURN(ER_SPIDER_LINK_MON_JUST_NG_NUM);
@@ -4015,7 +4015,7 @@ int spider_check_trx_and_get_conn(
{
TABLE *table = spider->get_table();
TABLE_SHARE *table_share = table->s;
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__SUNPRO_CC)
char *db, *table_name;
if (!(db = (char *)
spider_bulk_malloc(spider_current_trx, 57, MYF(MY_WME),
@@ -4037,7 +4037,7 @@ int spider_check_trx_and_get_conn(
table_name[table_share->table_name.length] = '\0';
my_printf_error(ER_SPIDER_LINK_MON_JUST_NG_NUM,
ER_SPIDER_LINK_MON_JUST_NG_STR, MYF(0), db, table_name);
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__SUNPRO_CC)
spider_free(trx, db, MYF(MY_WME));
#endif
DBUG_RETURN(ER_SPIDER_LINK_MON_JUST_NG_NUM);