Commit ce38addd authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-9617 solaris sparc build fails on 10.0

Spider:
  SunPro only supports array declarations with
  constant size. Spider already has a workaround for
  that, inside #ifdef _MSC_VER. Enable this code
  also for __SUNPRO_CC

Connect:
  Don't use anonymous union.
  Cast for mmap.
  Don't pass gcc-ish -W... options to SunPro
parent 7b58fd5e
...@@ -45,6 +45,7 @@ add_definitions( -DHUGE_SUPPORT -DZIP_SUPPORT -DPIVOT_SUPPORT ) ...@@ -45,6 +45,7 @@ add_definitions( -DHUGE_SUPPORT -DZIP_SUPPORT -DPIVOT_SUPPORT )
# OS specific C flags, definitions and source files. # OS specific C flags, definitions and source files.
# #
IF(UNIX) IF(UNIX)
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
# Bar: -Wfatal-errors removed (does not present in gcc on solaris10) # Bar: -Wfatal-errors removed (does not present in gcc on solaris10)
if(WITH_WARNINGS) if(WITH_WARNINGS)
add_definitions(-Wall -Wextra -Wmissing-declarations) add_definitions(-Wall -Wextra -Wmissing-declarations)
...@@ -71,6 +72,7 @@ IF(UNIX) ...@@ -71,6 +72,7 @@ IF(UNIX)
#message(STATUS "CONNECT: GCC: Some warnings disabled") #message(STATUS "CONNECT: GCC: Some warnings disabled")
endif(WITH_WARNINGS) endif(WITH_WARNINGS)
endif()
add_definitions( -DUNIX -DLINUX -DUBUNTU ) add_definitions( -DUNIX -DLINUX -DUBUNTU )
......
...@@ -190,8 +190,8 @@ bool CloseMemMap(void *memory, size_t dwSize) ...@@ -190,8 +190,8 @@ bool CloseMemMap(void *memory, size_t dwSize)
{ {
if (memory) { if (memory) {
// All this must be redesigned // All this must be redesigned
int rc = msync(memory, dwSize, MS_SYNC); int rc = msync((char*)memory, dwSize, MS_SYNC);
return (munmap(memory, dwSize) < 0) ? true : false; return (munmap((char*)memory, dwSize) < 0) ? true : false;
} else } else
return false; return false;
......
...@@ -1279,7 +1279,7 @@ bool XINDEX::MapInit(PGLOBAL g) ...@@ -1279,7 +1279,7 @@ bool XINDEX::MapInit(PGLOBAL g)
IOFF *noff = (IOFF*)mbase; IOFF *noff = (IOFF*)mbase;
// Position the memory base at the offset of this index // Position the memory base at the offset of this index
mbase += noff[id].Low; mbase += noff[id].v.Low;
} // endif id } // endif id
// Now start the mapping process. // Now start the mapping process.
...@@ -2347,10 +2347,10 @@ bool XFILE::Open(PGLOBAL g, char *filename, int id, MODE mode) ...@@ -2347,10 +2347,10 @@ bool XFILE::Open(PGLOBAL g, char *filename, int id, MODE mode)
return true; return true;
} // endif } // endif
NewOff.Low = (int)ftell(Xfile); NewOff.v.Low = (int)ftell(Xfile);
if (trace) if (trace)
htrc("XFILE Open: NewOff.Low=%d\n", NewOff.Low); htrc("XFILE Open: NewOff.v.Low=%d\n", NewOff.v.Low);
} else if (mode == MODE_WRITE) { } else if (mode == MODE_WRITE) {
if (id >= 0) { if (id >= 0) {
...@@ -2358,10 +2358,10 @@ bool XFILE::Open(PGLOBAL g, char *filename, int id, MODE mode) ...@@ -2358,10 +2358,10 @@ bool XFILE::Open(PGLOBAL g, char *filename, int id, MODE mode)
memset(noff, 0, sizeof(noff)); memset(noff, 0, sizeof(noff));
Write(g, noff, sizeof(IOFF), MAX_INDX, rc); Write(g, noff, sizeof(IOFF), MAX_INDX, rc);
fseek(Xfile, 0, SEEK_END); fseek(Xfile, 0, SEEK_END);
NewOff.Low = (int)ftell(Xfile); NewOff.v.Low = (int)ftell(Xfile);
if (trace) if (trace)
htrc("XFILE Open: NewOff.Low=%d\n", NewOff.Low); htrc("XFILE Open: NewOff.v.Low=%d\n", NewOff.v.Low);
} // endif id } // endif id
...@@ -2373,10 +2373,10 @@ bool XFILE::Open(PGLOBAL g, char *filename, int id, MODE mode) ...@@ -2373,10 +2373,10 @@ bool XFILE::Open(PGLOBAL g, char *filename, int id, MODE mode)
} // endif MAX_INDX } // endif MAX_INDX
if (trace) if (trace)
htrc("XFILE Open: noff[%d].Low=%d\n", id, noff[id].Low); htrc("XFILE Open: noff[%d].v.Low=%d\n", id, noff[id].v.Low);
// Position the cursor at the offset of this index // Position the cursor at the offset of this index
if (fseek(Xfile, noff[id].Low, SEEK_SET)) { if (fseek(Xfile, noff[id].v.Low, SEEK_SET)) {
sprintf(g->Message, MSG(FUNC_ERRNO), errno, "Xseek"); sprintf(g->Message, MSG(FUNC_ERRNO), errno, "Xseek");
return true; return true;
} // endif } // endif
...@@ -2566,14 +2566,14 @@ bool XHUGE::Open(PGLOBAL g, char *filename, int id, MODE mode) ...@@ -2566,14 +2566,14 @@ bool XHUGE::Open(PGLOBAL g, char *filename, int id, MODE mode)
return true; return true;
} // endif } // endif
NewOff.Low = (int)rc; NewOff.v.Low = (int)rc;
NewOff.High = (int)high; NewOff.v.High = (int)high;
} else if (mode == MODE_WRITE) { } else if (mode == MODE_WRITE) {
if (id >= 0) { if (id >= 0) {
// New not sep index file. Write the header. // New not sep index file. Write the header.
memset(noff, 0, sizeof(noff)); memset(noff, 0, sizeof(noff));
rc = WriteFile(Hfile, noff, sizeof(noff), &drc, NULL); rc = WriteFile(Hfile, noff, sizeof(noff), &drc, NULL);
NewOff.Low = (int)drc; NewOff.v.Low = (int)drc;
} // endif id } // endif id
} else if (mode == MODE_READ && id >= 0) { } else if (mode == MODE_READ && id >= 0) {
...@@ -2586,8 +2586,8 @@ bool XHUGE::Open(PGLOBAL g, char *filename, int id, MODE mode) ...@@ -2586,8 +2586,8 @@ bool XHUGE::Open(PGLOBAL g, char *filename, int id, MODE mode)
} // endif rc } // endif rc
// Position the cursor at the offset of this index // Position the cursor at the offset of this index
rc = SetFilePointer(Hfile, noff[id].Low, rc = SetFilePointer(Hfile, noff[id].v.Low,
(PLONG)&noff[id].High, FILE_BEGIN); (PLONG)&noff[id].v.High, FILE_BEGIN);
if (rc == INVALID_SET_FILE_POINTER) { if (rc == INVALID_SET_FILE_POINTER) {
sprintf(g->Message, MSG(FUNC_ERRNO), GetLastError(), "SetFilePointer"); sprintf(g->Message, MSG(FUNC_ERRNO), GetLastError(), "SetFilePointer");
...@@ -2649,7 +2649,7 @@ bool XHUGE::Open(PGLOBAL g, char *filename, int id, MODE mode) ...@@ -2649,7 +2649,7 @@ bool XHUGE::Open(PGLOBAL g, char *filename, int id, MODE mode)
if (id >= 0) { if (id >= 0) {
// New not sep index file. Write the header. // New not sep index file. Write the header.
memset(noff, 0, sizeof(noff)); memset(noff, 0, sizeof(noff));
NewOff.Low = write(Hfile, &noff, sizeof(noff)); NewOff.v.Low = write(Hfile, &noff, sizeof(noff));
} // endif id } // endif id
if (trace) if (trace)
......
...@@ -66,9 +66,9 @@ typedef struct index_def : public BLOCK { ...@@ -66,9 +66,9 @@ typedef struct index_def : public BLOCK {
typedef struct index_off { typedef struct index_off {
union { union {
#if defined(WORDS_BIGENDIAN) #if defined(WORDS_BIGENDIAN)
struct {int High; int Low;}; struct {int High; int Low;} v;
#else // !WORDS_BIGENDIAN #else // !WORDS_BIGENDIAN
struct {int Low; int High;}; struct {int Low; int High;} v;
#endif //!WORDS_BIGENDIAN #endif //!WORDS_BIGENDIAN
longlong Val; // File position longlong Val; // File position
}; // end of union }; // end of union
......
...@@ -2706,7 +2706,7 @@ void *spider_bg_sts_action( ...@@ -2706,7 +2706,7 @@ void *spider_bg_sts_action(
SPIDER_TRX *trx; SPIDER_TRX *trx;
int error_num = 0, roop_count; int error_num = 0, roop_count;
ha_spider spider; ha_spider spider;
#ifdef _MSC_VER #if defined(_MSC_VER) || defined(__SUNPRO_CC)
int *need_mons; int *need_mons;
SPIDER_CONN **conns; SPIDER_CONN **conns;
uint *conn_link_idx; uint *conn_link_idx;
...@@ -2733,7 +2733,7 @@ void *spider_bg_sts_action( ...@@ -2733,7 +2733,7 @@ void *spider_bg_sts_action(
my_thread_init(); my_thread_init();
DBUG_ENTER("spider_bg_sts_action"); DBUG_ENTER("spider_bg_sts_action");
/* init start */ /* init start */
#ifdef _MSC_VER #if defined(_MSC_VER) || defined(__SUNPRO_CC)
#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET) #if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
if (!(need_mons = (int *) if (!(need_mons = (int *)
spider_bulk_malloc(spider_current_trx, 21, MYF(MY_WME), spider_bulk_malloc(spider_current_trx, 21, MYF(MY_WME),
...@@ -2777,7 +2777,7 @@ void *spider_bg_sts_action( ...@@ -2777,7 +2777,7 @@ void *spider_bg_sts_action(
share->bg_sts_init = FALSE; share->bg_sts_init = FALSE;
pthread_mutex_unlock(&share->sts_mutex); pthread_mutex_unlock(&share->sts_mutex);
my_thread_end(); my_thread_end();
#ifdef _MSC_VER #if defined(_MSC_VER) || defined(__SUNPRO_CC)
spider_free(NULL, need_mons, MYF(MY_WME)); spider_free(NULL, need_mons, MYF(MY_WME));
#endif #endif
DBUG_RETURN(NULL); DBUG_RETURN(NULL);
...@@ -2801,7 +2801,7 @@ void *spider_bg_sts_action( ...@@ -2801,7 +2801,7 @@ void *spider_bg_sts_action(
my_pthread_setspecific_ptr(THR_THD, NULL); my_pthread_setspecific_ptr(THR_THD, NULL);
#endif #endif
my_thread_end(); my_thread_end();
#ifdef _MSC_VER #if defined(_MSC_VER) || defined(__SUNPRO_CC)
spider_free(NULL, need_mons, MYF(MY_WME)); spider_free(NULL, need_mons, MYF(MY_WME));
#endif #endif
DBUG_RETURN(NULL); DBUG_RETURN(NULL);
...@@ -2866,7 +2866,7 @@ void *spider_bg_sts_action( ...@@ -2866,7 +2866,7 @@ void *spider_bg_sts_action(
my_pthread_setspecific_ptr(THR_THD, NULL); my_pthread_setspecific_ptr(THR_THD, NULL);
#endif #endif
my_thread_end(); my_thread_end();
#ifdef _MSC_VER #if defined(_MSC_VER) || defined(__SUNPRO_CC)
spider_free(NULL, need_mons, MYF(MY_WME)); spider_free(NULL, need_mons, MYF(MY_WME));
#endif #endif
DBUG_RETURN(NULL); DBUG_RETURN(NULL);
...@@ -2897,7 +2897,7 @@ void *spider_bg_sts_action( ...@@ -2897,7 +2897,7 @@ void *spider_bg_sts_action(
my_pthread_setspecific_ptr(THR_THD, NULL); my_pthread_setspecific_ptr(THR_THD, NULL);
#endif #endif
my_thread_end(); my_thread_end();
#ifdef _MSC_VER #if defined(_MSC_VER) || defined(__SUNPRO_CC)
spider_free(NULL, need_mons, MYF(MY_WME)); spider_free(NULL, need_mons, MYF(MY_WME));
#endif #endif
DBUG_RETURN(NULL); DBUG_RETURN(NULL);
...@@ -3088,7 +3088,7 @@ void *spider_bg_crd_action( ...@@ -3088,7 +3088,7 @@ void *spider_bg_crd_action(
int error_num = 0, roop_count; int error_num = 0, roop_count;
ha_spider spider; ha_spider spider;
TABLE table; TABLE table;
#ifdef _MSC_VER #if defined(_MSC_VER) || defined(__SUNPRO_CC)
int *need_mons; int *need_mons;
SPIDER_CONN **conns; SPIDER_CONN **conns;
uint *conn_link_idx; uint *conn_link_idx;
...@@ -3115,7 +3115,7 @@ void *spider_bg_crd_action( ...@@ -3115,7 +3115,7 @@ void *spider_bg_crd_action(
my_thread_init(); my_thread_init();
DBUG_ENTER("spider_bg_crd_action"); DBUG_ENTER("spider_bg_crd_action");
/* init start */ /* init start */
#ifdef _MSC_VER #if defined(_MSC_VER) || defined(__SUNPRO_CC)
#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET) #if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
if (!(need_mons = (int *) if (!(need_mons = (int *)
spider_bulk_malloc(spider_current_trx, 22, MYF(MY_WME), spider_bulk_malloc(spider_current_trx, 22, MYF(MY_WME),
...@@ -3159,7 +3159,7 @@ void *spider_bg_crd_action( ...@@ -3159,7 +3159,7 @@ void *spider_bg_crd_action(
share->bg_crd_init = FALSE; share->bg_crd_init = FALSE;
pthread_mutex_unlock(&share->crd_mutex); pthread_mutex_unlock(&share->crd_mutex);
my_thread_end(); my_thread_end();
#ifdef _MSC_VER #if defined(_MSC_VER) || defined(__SUNPRO_CC)
spider_free(NULL, need_mons, MYF(MY_WME)); spider_free(NULL, need_mons, MYF(MY_WME));
#endif #endif
DBUG_RETURN(NULL); DBUG_RETURN(NULL);
...@@ -3183,7 +3183,7 @@ void *spider_bg_crd_action( ...@@ -3183,7 +3183,7 @@ void *spider_bg_crd_action(
my_pthread_setspecific_ptr(THR_THD, NULL); my_pthread_setspecific_ptr(THR_THD, NULL);
#endif #endif
my_thread_end(); my_thread_end();
#ifdef _MSC_VER #if defined(_MSC_VER) || defined(__SUNPRO_CC)
spider_free(NULL, need_mons, MYF(MY_WME)); spider_free(NULL, need_mons, MYF(MY_WME));
#endif #endif
DBUG_RETURN(NULL); DBUG_RETURN(NULL);
...@@ -3252,7 +3252,7 @@ void *spider_bg_crd_action( ...@@ -3252,7 +3252,7 @@ void *spider_bg_crd_action(
my_pthread_setspecific_ptr(THR_THD, NULL); my_pthread_setspecific_ptr(THR_THD, NULL);
#endif #endif
my_thread_end(); my_thread_end();
#ifdef _MSC_VER #if defined(_MSC_VER) || defined(__SUNPRO_CC)
spider_free(NULL, need_mons, MYF(MY_WME)); spider_free(NULL, need_mons, MYF(MY_WME));
#endif #endif
DBUG_RETURN(NULL); DBUG_RETURN(NULL);
...@@ -3283,7 +3283,7 @@ void *spider_bg_crd_action( ...@@ -3283,7 +3283,7 @@ void *spider_bg_crd_action(
my_pthread_setspecific_ptr(THR_THD, NULL); my_pthread_setspecific_ptr(THR_THD, NULL);
#endif #endif
my_thread_end(); my_thread_end();
#ifdef _MSC_VER #if defined(_MSC_VER) || defined(__SUNPRO_CC)
spider_free(NULL, need_mons, MYF(MY_WME)); spider_free(NULL, need_mons, MYF(MY_WME));
#endif #endif
DBUG_RETURN(NULL); DBUG_RETURN(NULL);
...@@ -3417,7 +3417,7 @@ int spider_create_mon_threads( ...@@ -3417,7 +3417,7 @@ int spider_create_mon_threads(
{ {
char link_idx_str[SPIDER_SQL_INT_LEN]; char link_idx_str[SPIDER_SQL_INT_LEN];
int link_idx_str_length; 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_string conv_name_str(share->table_name_length +
SPIDER_SQL_INT_LEN + 1); SPIDER_SQL_INT_LEN + 1);
conv_name_str.set_charset(system_charset_info); conv_name_str.set_charset(system_charset_info);
...@@ -3748,7 +3748,7 @@ int spider_conn_first_link_idx( ...@@ -3748,7 +3748,7 @@ int spider_conn_first_link_idx(
int roop_count, active_links = 0; int roop_count, active_links = 0;
longlong balance_total = 0, balance_val; longlong balance_total = 0, balance_val;
double rand_val; double rand_val;
#ifdef _MSC_VER #if defined(_MSC_VER) || defined(__SUNPRO_CC)
int *link_idxs, link_idx; int *link_idxs, link_idx;
long *balances; long *balances;
#else #else
...@@ -3756,7 +3756,7 @@ int spider_conn_first_link_idx( ...@@ -3756,7 +3756,7 @@ int spider_conn_first_link_idx(
long balances[link_count]; long balances[link_count];
#endif #endif
DBUG_ENTER("spider_conn_first_link_idx"); DBUG_ENTER("spider_conn_first_link_idx");
#ifdef _MSC_VER #if defined(_MSC_VER) || defined(__SUNPRO_CC)
if (!(link_idxs = (int *) if (!(link_idxs = (int *)
spider_bulk_malloc(spider_current_trx, 24, MYF(MY_WME), spider_bulk_malloc(spider_current_trx, 24, MYF(MY_WME),
&link_idxs, sizeof(int) * link_count, &link_idxs, sizeof(int) * link_count,
...@@ -3782,7 +3782,7 @@ int spider_conn_first_link_idx( ...@@ -3782,7 +3782,7 @@ int spider_conn_first_link_idx(
if (active_links == 0) if (active_links == 0)
{ {
DBUG_PRINT("info",("spider all links are failed")); 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)); spider_free(spider_current_trx, link_idxs, MYF(MY_WME));
#endif #endif
DBUG_RETURN(-1); DBUG_RETURN(-1);
...@@ -3811,7 +3811,7 @@ int spider_conn_first_link_idx( ...@@ -3811,7 +3811,7 @@ int spider_conn_first_link_idx(
} }
DBUG_PRINT("info",("spider first link_idx=%d", link_idxs[roop_count])); 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]; link_idx = link_idxs[roop_count];
spider_free(spider_current_trx, link_idxs, MYF(MY_WME)); spider_free(spider_current_trx, link_idxs, MYF(MY_WME));
DBUG_RETURN(link_idx); DBUG_RETURN(link_idx);
......
...@@ -9294,7 +9294,7 @@ int spider_db_udf_ping_table( ...@@ -9294,7 +9294,7 @@ int spider_db_udf_ping_table(
{ {
int init_sql_alloc_size = int init_sql_alloc_size =
spider_param_init_sql_alloc_size(trx->thd, share->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); spider_string sql_str(init_sql_alloc_size);
sql_str.set_charset(system_charset_info); sql_str.set_charset(system_charset_info);
spider_string where_str(init_sql_alloc_size); spider_string where_str(init_sql_alloc_size);
...@@ -9517,7 +9517,7 @@ int spider_db_udf_ping_table_mon_next( ...@@ -9517,7 +9517,7 @@ int spider_db_udf_ping_table_mon_next(
SPIDER_SHARE *share = table_mon->share; SPIDER_SHARE *share = table_mon->share;
int init_sql_alloc_size = int init_sql_alloc_size =
spider_param_init_sql_alloc_size(thd, share->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); spider_string sql_str(init_sql_alloc_size);
sql_str.set_charset(thd->variables.character_set_client); sql_str.set_charset(thd->variables.character_set_client);
#else #else
......
...@@ -241,7 +241,7 @@ void spider_release_ping_table_mon_list( ...@@ -241,7 +241,7 @@ void spider_release_ping_table_mon_list(
DBUG_PRINT("info", ("spider link_idx=%d", link_idx)); DBUG_PRINT("info", ("spider link_idx=%d", link_idx));
link_idx_str_length = my_sprintf(link_idx_str, (link_idx_str, "%010d", link_idx_str_length = my_sprintf(link_idx_str, (link_idx_str, "%010d",
link_idx)); 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); spider_string conv_name_str(conv_name_length + link_idx_str_length + 1);
conv_name_str.set_charset(system_charset_info); conv_name_str.set_charset(system_charset_info);
#else #else
...@@ -1362,7 +1362,7 @@ int spider_ping_table_mon_from_table( ...@@ -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_str_length = my_sprintf(link_idx_str, (link_idx_str, "%010d",
link_idx)); 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); spider_string conv_name_str(conv_name_length + link_idx_str_length + 1);
conv_name_str.set_charset(system_charset_info); conv_name_str.set_charset(system_charset_info);
*((char *)(conv_name_str.ptr() + conv_name_length + link_idx_str_length)) = *((char *)(conv_name_str.ptr() + conv_name_length + link_idx_str_length)) =
......
...@@ -3703,7 +3703,7 @@ int spider_create_conn_keys( ...@@ -3703,7 +3703,7 @@ int spider_create_conn_keys(
#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET) #if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
char *tmp_hs_r_name, *tmp_hs_w_name; char *tmp_hs_r_name, *tmp_hs_w_name;
#endif #endif
#ifdef _MSC_VER #if defined(_MSC_VER) || defined(__SUNPRO_CC)
uint *conn_keys_lengths; uint *conn_keys_lengths;
#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET) #if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
uint *hs_r_conn_keys_lengths; uint *hs_r_conn_keys_lengths;
...@@ -3717,7 +3717,7 @@ int spider_create_conn_keys( ...@@ -3717,7 +3717,7 @@ int spider_create_conn_keys(
#endif #endif
#endif #endif
DBUG_ENTER("spider_create_conn_keys"); DBUG_ENTER("spider_create_conn_keys");
#ifdef _MSC_VER #if defined(_MSC_VER) || defined(__SUNPRO_CC)
if (!(conn_keys_lengths = if (!(conn_keys_lengths =
(uint *) spider_bulk_alloc_mem(spider_current_trx, 44, (uint *) spider_bulk_alloc_mem(spider_current_trx, 44,
__func__, __FILE__, __LINE__, MYF(MY_WME), __func__, __FILE__, __LINE__, MYF(MY_WME),
...@@ -3806,7 +3806,7 @@ int spider_create_conn_keys( ...@@ -3806,7 +3806,7 @@ int spider_create_conn_keys(
#endif #endif
NullS)) NullS))
) { ) {
#ifdef _MSC_VER #if defined(_MSC_VER) || defined(__SUNPRO_CC)
spider_free(spider_current_trx, conn_keys_lengths, MYF(MY_WME)); spider_free(spider_current_trx, conn_keys_lengths, MYF(MY_WME));
#endif #endif
DBUG_RETURN(HA_ERR_OUT_OF_MEM); DBUG_RETURN(HA_ERR_OUT_OF_MEM);
...@@ -3823,7 +3823,7 @@ int spider_create_conn_keys( ...@@ -3823,7 +3823,7 @@ int spider_create_conn_keys(
sizeof(uint) * share->all_link_count); sizeof(uint) * share->all_link_count);
#endif #endif
#ifdef _MSC_VER #if defined(_MSC_VER) || defined(__SUNPRO_CC)
spider_free(spider_current_trx, conn_keys_lengths, MYF(MY_WME)); spider_free(spider_current_trx, conn_keys_lengths, MYF(MY_WME));
#endif #endif
...@@ -4676,7 +4676,7 @@ SPIDER_SHARE *spider_get_share( ...@@ -4676,7 +4676,7 @@ SPIDER_SHARE *spider_get_share(
share->link_count, SPIDER_LINK_STATUS_OK); share->link_count, SPIDER_LINK_STATUS_OK);
if (search_link_idx == -1) if (search_link_idx == -1)
{ {
#ifdef _MSC_VER #if defined(_MSC_VER) || defined(__SUNPRO_CC)
char *db, *table_name; char *db, *table_name;
if (!(db = (char *) if (!(db = (char *)
spider_bulk_malloc(spider_current_trx, 48, MYF(MY_WME), spider_bulk_malloc(spider_current_trx, 48, MYF(MY_WME),
...@@ -4702,7 +4702,7 @@ SPIDER_SHARE *spider_get_share( ...@@ -4702,7 +4702,7 @@ SPIDER_SHARE *spider_get_share(
table_name[table_share->table_name.length] = '\0'; table_name[table_share->table_name.length] = '\0';
my_printf_error(ER_SPIDER_ALL_LINKS_FAILED_NUM, my_printf_error(ER_SPIDER_ALL_LINKS_FAILED_NUM,
ER_SPIDER_ALL_LINKS_FAILED_STR, MYF(0), db, table_name); 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)); spider_free(spider->trx, db, MYF(MY_WME));
#endif #endif
*error_num = ER_SPIDER_ALL_LINKS_FAILED_NUM; *error_num = ER_SPIDER_ALL_LINKS_FAILED_NUM;
...@@ -5100,7 +5100,7 @@ SPIDER_SHARE *spider_get_share( ...@@ -5100,7 +5100,7 @@ SPIDER_SHARE *spider_get_share(
share->link_count, SPIDER_LINK_STATUS_OK); share->link_count, SPIDER_LINK_STATUS_OK);
if (search_link_idx == -1) if (search_link_idx == -1)
{ {
#ifdef _MSC_VER #if defined(_MSC_VER) || defined(__SUNPRO_CC)
char *db, *table_name; char *db, *table_name;
if (!(db = (char *) if (!(db = (char *)
spider_bulk_malloc(spider_current_trx, 50, MYF(MY_WME), spider_bulk_malloc(spider_current_trx, 50, MYF(MY_WME),
...@@ -5123,7 +5123,7 @@ SPIDER_SHARE *spider_get_share( ...@@ -5123,7 +5123,7 @@ SPIDER_SHARE *spider_get_share(
table_name[table_share->table_name.length] = '\0'; table_name[table_share->table_name.length] = '\0';
my_printf_error(ER_SPIDER_ALL_LINKS_FAILED_NUM, my_printf_error(ER_SPIDER_ALL_LINKS_FAILED_NUM,
ER_SPIDER_ALL_LINKS_FAILED_STR, MYF(0), db, table_name); 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)); spider_free(spider->trx, db, MYF(MY_WME));
#endif #endif
*error_num = ER_SPIDER_ALL_LINKS_FAILED_NUM; *error_num = ER_SPIDER_ALL_LINKS_FAILED_NUM;
......
...@@ -3710,7 +3710,7 @@ int spider_check_trx_and_get_conn( ...@@ -3710,7 +3710,7 @@ int spider_check_trx_and_get_conn(
{ {
TABLE *table = spider->get_table(); TABLE *table = spider->get_table();
TABLE_SHARE *table_share = table->s; TABLE_SHARE *table_share = table->s;
#ifdef _MSC_VER #if defined(_MSC_VER) || defined(__SUNPRO_CC)
char *db, *table_name; char *db, *table_name;
if (!(db = (char *) if (!(db = (char *)
spider_bulk_malloc(spider_current_trx, 57, MYF(MY_WME), spider_bulk_malloc(spider_current_trx, 57, MYF(MY_WME),
...@@ -3732,7 +3732,7 @@ int spider_check_trx_and_get_conn( ...@@ -3732,7 +3732,7 @@ int spider_check_trx_and_get_conn(
table_name[table_share->table_name.length] = '\0'; table_name[table_share->table_name.length] = '\0';
my_printf_error(ER_SPIDER_ALL_LINKS_FAILED_NUM, my_printf_error(ER_SPIDER_ALL_LINKS_FAILED_NUM,
ER_SPIDER_ALL_LINKS_FAILED_STR, MYF(0), db, table_name); 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)); spider_free(trx, db, MYF(MY_WME));
#endif #endif
DBUG_RETURN(ER_SPIDER_ALL_LINKS_FAILED_NUM); DBUG_RETURN(ER_SPIDER_ALL_LINKS_FAILED_NUM);
...@@ -3869,7 +3869,7 @@ int spider_check_trx_and_get_conn( ...@@ -3869,7 +3869,7 @@ int spider_check_trx_and_get_conn(
{ {
TABLE *table = spider->get_table(); TABLE *table = spider->get_table();
TABLE_SHARE *table_share = table->s; TABLE_SHARE *table_share = table->s;
#ifdef _MSC_VER #if defined(_MSC_VER) || defined(__SUNPRO_CC)
char *db, *table_name; char *db, *table_name;
if (!(db = (char *) if (!(db = (char *)
spider_bulk_malloc(spider_current_trx, 57, MYF(MY_WME), spider_bulk_malloc(spider_current_trx, 57, MYF(MY_WME),
...@@ -3891,7 +3891,7 @@ int spider_check_trx_and_get_conn( ...@@ -3891,7 +3891,7 @@ int spider_check_trx_and_get_conn(
table_name[table_share->table_name.length] = '\0'; table_name[table_share->table_name.length] = '\0';
my_printf_error(ER_SPIDER_LINK_MON_JUST_NG_NUM, my_printf_error(ER_SPIDER_LINK_MON_JUST_NG_NUM,
ER_SPIDER_LINK_MON_JUST_NG_STR, MYF(0), db, table_name); 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)); spider_free(trx, db, MYF(MY_WME));
#endif #endif
DBUG_RETURN(ER_SPIDER_LINK_MON_JUST_NG_NUM); DBUG_RETURN(ER_SPIDER_LINK_MON_JUST_NG_NUM);
...@@ -4015,7 +4015,7 @@ int spider_check_trx_and_get_conn( ...@@ -4015,7 +4015,7 @@ int spider_check_trx_and_get_conn(
{ {
TABLE *table = spider->get_table(); TABLE *table = spider->get_table();
TABLE_SHARE *table_share = table->s; TABLE_SHARE *table_share = table->s;
#ifdef _MSC_VER #if defined(_MSC_VER) || defined(__SUNPRO_CC)
char *db, *table_name; char *db, *table_name;
if (!(db = (char *) if (!(db = (char *)
spider_bulk_malloc(spider_current_trx, 57, MYF(MY_WME), spider_bulk_malloc(spider_current_trx, 57, MYF(MY_WME),
...@@ -4037,7 +4037,7 @@ int spider_check_trx_and_get_conn( ...@@ -4037,7 +4037,7 @@ int spider_check_trx_and_get_conn(
table_name[table_share->table_name.length] = '\0'; table_name[table_share->table_name.length] = '\0';
my_printf_error(ER_SPIDER_LINK_MON_JUST_NG_NUM, my_printf_error(ER_SPIDER_LINK_MON_JUST_NG_NUM,
ER_SPIDER_LINK_MON_JUST_NG_STR, MYF(0), db, table_name); 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)); spider_free(trx, db, MYF(MY_WME));
#endif #endif
DBUG_RETURN(ER_SPIDER_LINK_MON_JUST_NG_NUM); DBUG_RETURN(ER_SPIDER_LINK_MON_JUST_NG_NUM);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment