Commit 993dd378 authored by Kentoku SHIBA's avatar Kentoku SHIBA

fix for MariaDB 10.0.7 building errors

parent 4e9e5615
...@@ -8718,7 +8718,9 @@ ulonglong ha_spider::table_flags() const ...@@ -8718,7 +8718,9 @@ ulonglong ha_spider::table_flags() const
HA_HAS_RECORDS | HA_HAS_RECORDS |
HA_PARTIAL_COLUMN_READ | HA_PARTIAL_COLUMN_READ |
#ifdef HA_CAN_BULK_ACCESS #ifdef HA_CAN_BULK_ACCESS
#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
(support_bulk_access_hs() ? HA_CAN_BULK_ACCESS : 0) | (support_bulk_access_hs() ? HA_CAN_BULK_ACCESS : 0) |
#endif
#endif #endif
SPIDER_CAN_BG_SEARCH | SPIDER_CAN_BG_SEARCH |
SPIDER_CAN_BG_INSERT | SPIDER_CAN_BG_INSERT |
...@@ -10614,10 +10616,14 @@ int ha_spider::info_push( ...@@ -10614,10 +10616,14 @@ int ha_spider::info_push(
DBUG_PRINT("info",("spider this=%p", this)); DBUG_PRINT("info",("spider this=%p", this));
#ifdef HA_CAN_BULK_ACCESS #ifdef HA_CAN_BULK_ACCESS
if ( if (
#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS
#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
info_type != INFO_KIND_HS_RET_FIELDS &&
#endif
#endif
info_type != INFO_KIND_BULK_ACCESS_BEGIN && info_type != INFO_KIND_BULK_ACCESS_BEGIN &&
info_type != INFO_KIND_BULK_ACCESS_CURRENT && info_type != INFO_KIND_BULK_ACCESS_CURRENT &&
info_type != INFO_KIND_BULK_ACCESS_END && info_type != INFO_KIND_BULK_ACCESS_END
info_type != INFO_KIND_HS_RET_FIELDS
) { ) {
if (!is_bulk_access_clone) if (!is_bulk_access_clone)
{ {
...@@ -10796,12 +10802,16 @@ int ha_spider::info_push( ...@@ -10796,12 +10802,16 @@ int ha_spider::info_push(
) { ) {
DBUG_RETURN(error_num); DBUG_RETURN(error_num);
} }
#ifdef HA_CAN_BULK_ACCESS
#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
memset( memset(
bulk_access_link_current->spider->result_list.hs_r_bulk_open_index, 0, bulk_access_link_current->spider->result_list.hs_r_bulk_open_index, 0,
share->link_bitmap_size); share->link_bitmap_size);
memset( memset(
bulk_access_link_current->spider->result_list.hs_w_bulk_open_index, 0, bulk_access_link_current->spider->result_list.hs_w_bulk_open_index, 0,
share->link_bitmap_size); share->link_bitmap_size);
#endif
#endif
/* /*
#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET) #if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
if ((error_num = bulk_access_link_current->spider->reset_hs_strs_pos( if ((error_num = bulk_access_link_current->spider->reset_hs_strs_pos(
...@@ -12078,10 +12088,12 @@ int ha_spider::sync_from_clone_source( ...@@ -12078,10 +12088,12 @@ int ha_spider::sync_from_clone_source(
low_priority = spider->low_priority; low_priority = spider->low_priority;
memcpy(conns, spider->conns, memcpy(conns, spider->conns,
sizeof(SPIDER_CONN *) * share->link_count); sizeof(SPIDER_CONN *) * share->link_count);
#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
memcpy(hs_r_conns, spider->hs_r_conns, memcpy(hs_r_conns, spider->hs_r_conns,
sizeof(SPIDER_CONN *) * share->link_count); sizeof(SPIDER_CONN *) * share->link_count);
memcpy(hs_w_conns, spider->hs_w_conns, memcpy(hs_w_conns, spider->hs_w_conns,
sizeof(SPIDER_CONN *) * share->link_count); sizeof(SPIDER_CONN *) * share->link_count);
#endif
spider_thread_id = spider->spider_thread_id; spider_thread_id = spider->spider_thread_id;
trx_conn_adjustment = spider->trx_conn_adjustment; trx_conn_adjustment = spider->trx_conn_adjustment;
#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET) #if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
...@@ -12134,6 +12146,8 @@ int ha_spider::sync_from_clone_source( ...@@ -12134,6 +12146,8 @@ int ha_spider::sync_from_clone_source(
external_lock_cnt = spider->external_lock_cnt; external_lock_cnt = spider->external_lock_cnt;
} }
#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS
#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
if (spider->hs_pushed_ret_fields_num < MAX_FIELDS) if (spider->hs_pushed_ret_fields_num < MAX_FIELDS)
{ {
SPIDER_HS_UINT32_INFO tmp_info; SPIDER_HS_UINT32_INFO tmp_info;
...@@ -12144,6 +12158,8 @@ int ha_spider::sync_from_clone_source( ...@@ -12144,6 +12158,8 @@ int ha_spider::sync_from_clone_source(
DBUG_RETURN(error_num); DBUG_RETURN(error_num);
} }
} }
#endif
#endif
DBUG_PRINT("info",("spider bulk_access_link->spider->dbton_handler=%p", DBUG_PRINT("info",("spider bulk_access_link->spider->dbton_handler=%p",
dbton_handler)); dbton_handler));
DBUG_PRINT("info",("spider ptr bulk_access_link->spider->dbton_handler=%p", DBUG_PRINT("info",("spider ptr bulk_access_link->spider->dbton_handler=%p",
......
...@@ -5605,7 +5605,6 @@ int spider_db_bulk_bulk_insert( ...@@ -5605,7 +5605,6 @@ int spider_db_bulk_bulk_insert(
) { ) {
int error_num = 0, first_insert_link_idx = -1, tmp_error_num; int error_num = 0, first_insert_link_idx = -1, tmp_error_num;
int roop_count2; int roop_count2;
SPIDER_RESULT_LIST *result_list = &spider->result_list;
SPIDER_SHARE *share = spider->share; SPIDER_SHARE *share = spider->share;
SPIDER_CONN *conn, *first_insert_conn = NULL; SPIDER_CONN *conn, *first_insert_conn = NULL;
TABLE *table = spider->get_table(); TABLE *table = spider->get_table();
...@@ -5645,6 +5644,7 @@ int spider_db_bulk_bulk_insert( ...@@ -5645,6 +5644,7 @@ int spider_db_bulk_bulk_insert(
if (conn->conn_kind != SPIDER_CONN_KIND_MYSQL) if (conn->conn_kind != SPIDER_CONN_KIND_MYSQL)
{ {
uint roop_count; uint roop_count;
SPIDER_RESULT_LIST *result_list = &spider->result_list;
DBUG_PRINT("info",("spider conn=%p", conn)); DBUG_PRINT("info",("spider conn=%p", conn));
DBUG_PRINT("info",("spider result_list->hs_upd_rows=%llu", DBUG_PRINT("info",("spider result_list->hs_upd_rows=%llu",
result_list->hs_upd_rows)); result_list->hs_upd_rows));
...@@ -6584,9 +6584,9 @@ int spider_db_bulk_direct_update( ...@@ -6584,9 +6584,9 @@ int spider_db_bulk_direct_update(
#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET) #if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
if (!spider_bit_is_set(spider->do_hs_direct_update, roop_count)) if (!spider_bit_is_set(spider->do_hs_direct_update, roop_count))
{ {
#endif
if (!counted) if (!counted)
{ {
#endif
*update_rows = spider->conns[roop_count]->db_conn->affected_rows(); *update_rows = spider->conns[roop_count]->db_conn->affected_rows();
DBUG_PRINT("info", ("spider update_rows = %u", *update_rows)); DBUG_PRINT("info", ("spider update_rows = %u", *update_rows));
counted = TRUE; counted = TRUE;
...@@ -9953,7 +9953,9 @@ int spider_db_bulk_open_handler( ...@@ -9953,7 +9953,9 @@ int spider_db_bulk_open_handler(
int link_idx int link_idx
) { ) {
int error_num = 0; int error_num = 0;
#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
bool opening_index = FALSE; bool opening_index = FALSE;
#endif
DBUG_ENTER("spider_db_bulk_open_handler"); DBUG_ENTER("spider_db_bulk_open_handler");
DBUG_PRINT("info",("spider spider=%p", spider)); DBUG_PRINT("info",("spider spider=%p", spider));
DBUG_PRINT("info",("spider conn=%p", conn)); DBUG_PRINT("info",("spider conn=%p", conn));
......
...@@ -26,6 +26,10 @@ ...@@ -26,6 +26,10 @@
#define SPIDER_HAS_SHOW_SIMPLE_FUNC #define SPIDER_HAS_SHOW_SIMPLE_FUNC
#endif #endif
#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 100007
#define SPIDER_HAS_DISCOVER_TABLE_STRUCTURE_COMMENT
#endif
#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 100004 #if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 100004
#define SPIDER_HAS_TIME_STATUS #define SPIDER_HAS_TIME_STATUS
#define SPIDER_HAS_DECIMAL_OPERATION_RESULTS_VALUE_TYPE #define SPIDER_HAS_DECIMAL_OPERATION_RESULTS_VALUE_TYPE
......
...@@ -4323,10 +4323,12 @@ SPIDER_SHARE *spider_get_share( ...@@ -4323,10 +4323,12 @@ SPIDER_SHARE *spider_get_share(
&result_list->tmp_table_created, &result_list->tmp_table_created,
sizeof(uchar) * share->link_bitmap_size, sizeof(uchar) * share->link_bitmap_size,
#ifdef HA_CAN_BULK_ACCESS #ifdef HA_CAN_BULK_ACCESS
#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
&result_list->hs_r_bulk_open_index, &result_list->hs_r_bulk_open_index,
sizeof(uchar) * share->link_bitmap_size, sizeof(uchar) * share->link_bitmap_size,
&result_list->hs_w_bulk_open_index, &result_list->hs_w_bulk_open_index,
sizeof(uchar) * share->link_bitmap_size, sizeof(uchar) * share->link_bitmap_size,
#endif
#endif #endif
&result_list->sql_kind_backup, sizeof(uint) * share->link_count, &result_list->sql_kind_backup, sizeof(uint) * share->link_count,
&spider->dbton_handler, &spider->dbton_handler,
...@@ -4762,10 +4764,12 @@ SPIDER_SHARE *spider_get_share( ...@@ -4762,10 +4764,12 @@ SPIDER_SHARE *spider_get_share(
&result_list->tmp_table_created, &result_list->tmp_table_created,
sizeof(uchar) * share->link_bitmap_size, sizeof(uchar) * share->link_bitmap_size,
#ifdef HA_CAN_BULK_ACCESS #ifdef HA_CAN_BULK_ACCESS
#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
&result_list->hs_r_bulk_open_index, &result_list->hs_r_bulk_open_index,
sizeof(uchar) * share->link_bitmap_size, sizeof(uchar) * share->link_bitmap_size,
&result_list->hs_w_bulk_open_index, &result_list->hs_w_bulk_open_index,
sizeof(uchar) * share->link_bitmap_size, sizeof(uchar) * share->link_bitmap_size,
#endif
#endif #endif
&result_list->sql_kind_backup, sizeof(uint) * share->link_count, &result_list->sql_kind_backup, sizeof(uint) * share->link_count,
&spider->dbton_handler, &spider->dbton_handler,
...@@ -8049,8 +8053,13 @@ int spider_discover_table_structure( ...@@ -8049,8 +8053,13 @@ int spider_discover_table_structure(
{ {
DBUG_RETURN(ER_SPIDER_UNKNOWN_NUM); DBUG_RETURN(ER_SPIDER_UNKNOWN_NUM);
} }
#ifdef SPIDER_HAS_DISCOVER_TABLE_STRUCTURE_COMMENT
if (!(part_syntax = generate_partition_syntax(part_info, &part_syntax_len,
FALSE, TRUE, info, NULL, NULL)))
#else
if (!(part_syntax = generate_partition_syntax(part_info, &part_syntax_len, if (!(part_syntax = generate_partition_syntax(part_info, &part_syntax_len,
FALSE, TRUE, info, NULL))) FALSE, TRUE, info, NULL)))
#endif
{ {
DBUG_RETURN(HA_ERR_OUT_OF_MEM); DBUG_RETURN(HA_ERR_OUT_OF_MEM);
} }
......
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