ganapathi / rpms / mariadb

Forked from rpms/mariadb 3 years ago
Clone

Blame SOURCES/mariadb-spider_on_armv7hl.patch

6145a4
Fix for:
6145a4
https://jira.mariadb.org/browse/MDEV-18737
6145a4
Taken from:
6145a4
https://github.com/MariaDB/server/commit/ddce85907611e0533d6226de7f53e751cf173f6a
6145a4
6145a4
6145a4
6145a4
6145a4
6145a4
From 3faf5d4c1c3274a20a92cb3eb7eb2de6140894d6 Mon Sep 17 00:00:00 2001
6145a4
From: Kentoku SHIBA <kentokushiba@gmail.com>
6145a4
Date: Thu, 25 Jul 2019 22:52:45 +0900
6145a4
Subject: [PATCH] MDEV-18737 Spider "Out of memory" on armv7hl (#1363)
6145a4
6145a4
This is an issue of memory alignment of variable argument when calling my_multi_malloc().
6145a4
The fix is strictly casting allocating size to "uint".
6145a4
---
6145a4
 storage/spider/ha_spider.cc            |  36 +++--
6145a4
 storage/spider/spd_conn.cc             |  69 +++++-----
6145a4
 storage/spider/spd_copy_tables.cc      |  25 ++--
6145a4
 storage/spider/spd_db_conn.cc          |  13 +-
6145a4
 storage/spider/spd_db_handlersocket.cc |   4 +-
6145a4
 storage/spider/spd_db_mysql.cc         |  10 +-
6145a4
 storage/spider/spd_db_oracle.cc        |  24 ++--
6145a4
 storage/spider/spd_direct_sql.cc       |  78 +++++------
6145a4
 storage/spider/spd_group_by_handler.cc |   7 +-
6145a4
 storage/spider/spd_ping_table.cc       |  36 +++--
6145a4
 storage/spider/spd_table.cc            | 134 ++++++++++---------
6145a4
 storage/spider/spd_trx.cc              | 173 +++++++++++++------------
6145a4
 12 files changed, 327 insertions(+), 282 deletions(-)
6145a4
6145a4
diff --git a/storage/spider/ha_spider.cc b/storage/spider/ha_spider.cc
6145a4
index 967d2c6e5de..e04f0c8ef55 100644
6145a4
--- a/storage/spider/ha_spider.cc
6145a4
+++ b/storage/spider/ha_spider.cc
6145a4
@@ -394,15 +394,24 @@ int ha_spider::open(
6145a4
   {
6145a4
     if (!(searched_bitmap = (uchar *)
6145a4
       spider_bulk_malloc(spider_current_trx, 15, MYF(MY_WME),
6145a4
-        &searched_bitmap, sizeof(uchar) * no_bytes_in_map(table->read_set),
6145a4
-        &ft_discard_bitmap, sizeof(uchar) * no_bytes_in_map(table->read_set),
6145a4
-        &position_bitmap, sizeof(uchar) * no_bytes_in_map(table->read_set),
6145a4
-        &partition_handler_share, sizeof(SPIDER_PARTITION_HANDLER_SHARE),
6145a4
-        &idx_read_bitmap, sizeof(uchar) * no_bytes_in_map(table->read_set),
6145a4
-        &idx_write_bitmap, sizeof(uchar) * no_bytes_in_map(table->read_set),
6145a4
-        &rnd_read_bitmap, sizeof(uchar) * no_bytes_in_map(table->read_set),
6145a4
-        &rnd_write_bitmap, sizeof(uchar) * no_bytes_in_map(table->read_set),
6145a4
-        &pt_handler_share_handlers, sizeof(ha_spider *) * part_num,
6145a4
+        &searched_bitmap,
6145a4
+          (uint) sizeof(uchar) * no_bytes_in_map(table->read_set),
6145a4
+        &ft_discard_bitmap,
6145a4
+          (uint) sizeof(uchar) * no_bytes_in_map(table->read_set),
6145a4
+        &position_bitmap,
6145a4
+          (uint) sizeof(uchar) * no_bytes_in_map(table->read_set),
6145a4
+        &partition_handler_share,
6145a4
+          (uint) sizeof(SPIDER_PARTITION_HANDLER_SHARE),
6145a4
+        &idx_read_bitmap,
6145a4
+          (uint) sizeof(uchar) * no_bytes_in_map(table->read_set),
6145a4
+        &idx_write_bitmap,
6145a4
+          (uint) sizeof(uchar) * no_bytes_in_map(table->read_set),
6145a4
+        &rnd_read_bitmap,
6145a4
+          (uint) sizeof(uchar) * no_bytes_in_map(table->read_set),
6145a4
+        &rnd_write_bitmap,
6145a4
+          (uint) sizeof(uchar) * no_bytes_in_map(table->read_set),
6145a4
+        &pt_handler_share_handlers,
6145a4
+          (uint) sizeof(ha_spider *) * part_num,
6145a4
         NullS))
6145a4
     ) {
6145a4
       error_num = HA_ERR_OUT_OF_MEM;
6145a4
@@ -11317,7 +11326,7 @@ int ha_spider::create(
6145a4
     if (!(tmp_share.static_key_cardinality = (longlong *)
6145a4
       spider_bulk_malloc(spider_current_trx, 246, MYF(MY_WME),
6145a4
         &tmp_share.static_key_cardinality,
6145a4
-          sizeof(*tmp_share.static_key_cardinality) * form->s->keys,
6145a4
+          (uint) (sizeof(*tmp_share.static_key_cardinality) * form->s->keys),
6145a4
         NullS))
6145a4
     ) {
6145a4
       error_num = HA_ERR_OUT_OF_MEM;
6145a4
@@ -12126,7 +12135,8 @@ int ha_spider::info_push(
6145a4
           spider_free(spider_current_trx, hs_pushed_ret_fields, MYF(0));
6145a4
         if (!(hs_pushed_ret_fields = (uint32 *)
6145a4
           spider_bulk_malloc(spider_current_trx, 17, MYF(MY_WME),
6145a4
-          &hs_pushed_ret_fields, sizeof(uint32) * hs_pushed_ret_fields_num,
6145a4
+          &hs_pushed_ret_fields,
6145a4
+            (uint) (sizeof(uint32) * hs_pushed_ret_fields_num),
6145a4
           NullS))
6145a4
         ) {
6145a4
           DBUG_RETURN(HA_ERR_OUT_OF_MEM);
6145a4
@@ -13690,8 +13700,8 @@ SPIDER_BULK_ACCESS_LINK *ha_spider::create_bulk_access_link()
6145a4
 */
6145a4
   if (!(bulk_access_link = (SPIDER_BULK_ACCESS_LINK *)
6145a4
     spider_bulk_malloc(spider_current_trx, 168, MYF(MY_WME),
6145a4
-    &bulk_access_link, sizeof(SPIDER_BULK_ACCESS_LINK),
6145a4
-    &ref, ALIGN_SIZE(ref_length) * 2,
6145a4
+    &bulk_access_link, (uint) (sizeof(SPIDER_BULK_ACCESS_LINK)),
6145a4
+    &ref, (uint) (ALIGN_SIZE(ref_length) * 2),
6145a4
     NullS))
6145a4
   ) {
6145a4
     goto error_bulk_malloc;
6145a4
diff --git a/storage/spider/spd_conn.cc b/storage/spider/spd_conn.cc
6145a4
index 911c9bc95ac..f8ca9108061 100644
6145a4
--- a/storage/spider/spd_conn.cc
6145a4
+++ b/storage/spider/spd_conn.cc
6145a4
@@ -470,30 +470,30 @@ SPIDER_CONN *spider_create_conn(
6145a4
 #endif
6145a4
     if (!(conn = (SPIDER_CONN *)
6145a4
       spider_bulk_malloc(spider_current_trx, 18, MYF(MY_WME | MY_ZEROFILL),
6145a4
-        &conn, sizeof(*conn),
6145a4
-        &tmp_name, share->conn_keys_lengths[link_idx] + 1,
6145a4
-        &tmp_host, share->tgt_hosts_lengths[link_idx] + 1,
6145a4
+        &conn, (uint) (sizeof(*conn)),
6145a4
+        &tmp_name, (uint) (share->conn_keys_lengths[link_idx] + 1),
6145a4
+        &tmp_host, (uint) (share->tgt_hosts_lengths[link_idx] + 1),
6145a4
         &tmp_username,
6145a4
-          share->tgt_usernames_lengths[link_idx] + 1,
6145a4
+          (uint) (share->tgt_usernames_lengths[link_idx] + 1),
6145a4
         &tmp_password,
6145a4
-          share->tgt_passwords_lengths[link_idx] + 1,
6145a4
-        &tmp_socket, share->tgt_sockets_lengths[link_idx] + 1,
6145a4
+          (uint) (share->tgt_passwords_lengths[link_idx] + 1),
6145a4
+        &tmp_socket, (uint) (share->tgt_sockets_lengths[link_idx] + 1),
6145a4
         &tmp_wrapper,
6145a4
-          share->tgt_wrappers_lengths[link_idx] + 1,
6145a4
-        &tmp_ssl_ca, share->tgt_ssl_cas_lengths[link_idx] + 1,
6145a4
+          (uint) (share->tgt_wrappers_lengths[link_idx] + 1),
6145a4
+        &tmp_ssl_ca, (uint) (share->tgt_ssl_cas_lengths[link_idx] + 1),
6145a4
         &tmp_ssl_capath,
6145a4
-          share->tgt_ssl_capaths_lengths[link_idx] + 1,
6145a4
+          (uint) (share->tgt_ssl_capaths_lengths[link_idx] + 1),
6145a4
         &tmp_ssl_cert,
6145a4
-          share->tgt_ssl_certs_lengths[link_idx] + 1,
6145a4
+          (uint) (share->tgt_ssl_certs_lengths[link_idx] + 1),
6145a4
         &tmp_ssl_cipher,
6145a4
-          share->tgt_ssl_ciphers_lengths[link_idx] + 1,
6145a4
+          (uint) (share->tgt_ssl_ciphers_lengths[link_idx] + 1),
6145a4
         &tmp_ssl_key,
6145a4
-          share->tgt_ssl_keys_lengths[link_idx] + 1,
6145a4
+          (uint) (share->tgt_ssl_keys_lengths[link_idx] + 1),
6145a4
         &tmp_default_file,
6145a4
-          share->tgt_default_files_lengths[link_idx] + 1,
6145a4
+          (uint) (share->tgt_default_files_lengths[link_idx] + 1),
6145a4
         &tmp_default_group,
6145a4
-          share->tgt_default_groups_lengths[link_idx] + 1,
6145a4
-        &need_mon, sizeof(int),
6145a4
+          (uint) (share->tgt_default_groups_lengths[link_idx] + 1),
6145a4
+        &need_mon, (uint) (sizeof(int)),
6145a4
         NullS))
6145a4
     ) {
6145a4
       *error_num = HA_ERR_OUT_OF_MEM;
6145a4
@@ -592,13 +592,13 @@ SPIDER_CONN *spider_create_conn(
6145a4
   } else if (conn_kind == SPIDER_CONN_KIND_HS_READ) {
6145a4
     if (!(conn = (SPIDER_CONN *)
6145a4
       spider_bulk_malloc(spider_current_trx, 19, MYF(MY_WME | MY_ZEROFILL),
6145a4
-        &conn, sizeof(*conn),
6145a4
-        &tmp_name, share->hs_read_conn_keys_lengths[link_idx] + 1,
6145a4
-        &tmp_host, share->tgt_hosts_lengths[link_idx] + 1,
6145a4
-        &tmp_socket, share->hs_read_socks_lengths[link_idx] + 1,
6145a4
+        &conn, (uint) (sizeof(*conn)),
6145a4
+        &tmp_name, (uint) (share->hs_read_conn_keys_lengths[link_idx] + 1),
6145a4
+        &tmp_host, (uint) (share->tgt_hosts_lengths[link_idx] + 1),
6145a4
+        &tmp_socket, (uint) (share->hs_read_socks_lengths[link_idx] + 1),
6145a4
         &tmp_wrapper,
6145a4
-          share->tgt_wrappers_lengths[link_idx] + 1,
6145a4
-        &need_mon, sizeof(int),
6145a4
+          (uint) (share->tgt_wrappers_lengths[link_idx] + 1),
6145a4
+        &need_mon, (uint) (sizeof(int)),
6145a4
         NullS))
6145a4
     ) {
6145a4
       *error_num = HA_ERR_OUT_OF_MEM;
6145a4
@@ -634,13 +634,13 @@ SPIDER_CONN *spider_create_conn(
6145a4
   } else {
6145a4
     if (!(conn = (SPIDER_CONN *)
6145a4
       spider_bulk_malloc(spider_current_trx, 20, MYF(MY_WME | MY_ZEROFILL),
6145a4
-        &conn, sizeof(*conn),
6145a4
-        &tmp_name, share->hs_write_conn_keys_lengths[link_idx] + 1,
6145a4
-        &tmp_host, share->tgt_hosts_lengths[link_idx] + 1,
6145a4
-        &tmp_socket, share->hs_write_socks_lengths[link_idx] + 1,
6145a4
+        &conn, (uint) (sizeof(*conn)),
6145a4
+        &tmp_name, (uint) (share->hs_write_conn_keys_lengths[link_idx] + 1),
6145a4
+        &tmp_host, (uint) (share->tgt_hosts_lengths[link_idx] + 1),
6145a4
+        &tmp_socket, (uint) (share->hs_write_socks_lengths[link_idx] + 1),
6145a4
         &tmp_wrapper,
6145a4
-          share->tgt_wrappers_lengths[link_idx] + 1,
6145a4
-        &need_mon, sizeof(int),
6145a4
+          (uint) (share->tgt_wrappers_lengths[link_idx] + 1),
6145a4
+        &need_mon, (uint) (sizeof(int)),
6145a4
         NullS))
6145a4
     ) {
6145a4
       *error_num = HA_ERR_OUT_OF_MEM;
6145a4
@@ -3634,13 +3634,16 @@ int spider_create_mon_threads(
6145a4
       }
6145a4
       if (!(share->bg_mon_thds = (THD **)
6145a4
         spider_bulk_malloc(spider_current_trx, 23, MYF(MY_WME | MY_ZEROFILL),
6145a4
-          &share->bg_mon_thds, sizeof(THD *) * share->all_link_count,
6145a4
-          &share->bg_mon_threads, sizeof(pthread_t) * share->all_link_count,
6145a4
-          &share->bg_mon_mutexes, sizeof(pthread_mutex_t) *
6145a4
-            share->all_link_count,
6145a4
-          &share->bg_mon_conds, sizeof(pthread_cond_t) * share->all_link_count,
6145a4
+          &share->bg_mon_thds,
6145a4
+            (uint) (sizeof(THD *) * share->all_link_count),
6145a4
+          &share->bg_mon_threads,
6145a4
+            (uint) (sizeof(pthread_t) * share->all_link_count),
6145a4
+          &share->bg_mon_mutexes,
6145a4
+            (uint) (sizeof(pthread_mutex_t) * share->all_link_count),
6145a4
+          &share->bg_mon_conds,
6145a4
+            (uint) (sizeof(pthread_cond_t) * share->all_link_count),
6145a4
           &share->bg_mon_sleep_conds,
6145a4
-            sizeof(pthread_cond_t) * share->all_link_count,
6145a4
+            (uint) (sizeof(pthread_cond_t) * share->all_link_count),
6145a4
           NullS))
6145a4
       ) {
6145a4
         error_num = HA_ERR_OUT_OF_MEM;
6145a4
diff --git a/storage/spider/spd_copy_tables.cc b/storage/spider/spd_copy_tables.cc
6145a4
index 13c53220b16..1a472e2c12b 100644
6145a4
--- a/storage/spider/spd_copy_tables.cc
6145a4
+++ b/storage/spider/spd_copy_tables.cc
6145a4
@@ -390,12 +390,15 @@ int spider_udf_get_copy_tgt_tables(
6145a4
   do {
6145a4
     if (!(table_conn = (SPIDER_COPY_TABLE_CONN *)
6145a4
       spider_bulk_malloc(spider_current_trx, 25, MYF(MY_WME | MY_ZEROFILL),
6145a4
-        &table_conn, sizeof(SPIDER_COPY_TABLE_CONN),
6145a4
-        &tmp_share, sizeof(SPIDER_SHARE),
6145a4
-        &tmp_connect_info, sizeof(char *) * SPIDER_TMP_SHARE_CHAR_PTR_COUNT,
6145a4
-        &tmp_connect_info_length, sizeof(uint) * SPIDER_TMP_SHARE_UINT_COUNT,
6145a4
-        &tmp_long, sizeof(long) * SPIDER_TMP_SHARE_LONG_COUNT,
6145a4
-        &tmp_longlong, sizeof(longlong) * SPIDER_TMP_SHARE_LONGLONG_COUNT,
6145a4
+        &table_conn, (uint) (sizeof(SPIDER_COPY_TABLE_CONN)),
6145a4
+        &tmp_share, (uint) (sizeof(SPIDER_SHARE)),
6145a4
+        &tmp_connect_info,
6145a4
+          (uint) (sizeof(char *) * SPIDER_TMP_SHARE_CHAR_PTR_COUNT),
6145a4
+        &tmp_connect_info_length,
6145a4
+          (uint) (sizeof(uint) * SPIDER_TMP_SHARE_UINT_COUNT),
6145a4
+        &tmp_long, (uint) (sizeof(long) * SPIDER_TMP_SHARE_LONG_COUNT),
6145a4
+        &tmp_longlong,
6145a4
+          (uint) (sizeof(longlong) * SPIDER_TMP_SHARE_LONGLONG_COUNT),
6145a4
         NullS))
6145a4
     ) {
6145a4
       spider_sys_index_end(table_tables);
6145a4
@@ -706,12 +709,12 @@ int spider_udf_copy_tables_create_table_list(
6145a4
   if (!(copy_tables->link_idxs[0] = (int *)
6145a4
     spider_bulk_malloc(spider_current_trx, 26, MYF(MY_WME | MY_ZEROFILL),
6145a4
       &copy_tables->link_idxs[0],
6145a4
-        sizeof(int) * copy_tables->link_idx_count[0],
6145a4
+        (uint) (sizeof(int) * copy_tables->link_idx_count[0]),
6145a4
       &copy_tables->link_idxs[1],
6145a4
-        sizeof(int) * copy_tables->link_idx_count[1],
6145a4
-      &tmp_name_ptr, sizeof(char) * (
6145a4
+        (uint) (sizeof(int) * copy_tables->link_idx_count[1]),
6145a4
+      &tmp_name_ptr, (uint) (sizeof(char) * (
6145a4
         spider_table_name_length * 2 + copy_tables->database_length + 3
6145a4
-      ),
6145a4
+      )),
6145a4
       NullS))
6145a4
   ) {
6145a4
     my_error(ER_OUT_OF_RESOURCES, MYF(0), HA_ERR_OUT_OF_MEM);
6145a4
@@ -906,7 +909,7 @@ long long spider_copy_tables_body(
6145a4
 
6145a4
   if (!(copy_tables = (SPIDER_COPY_TABLES *)
6145a4
     spider_bulk_malloc(spider_current_trx, 27, MYF(MY_WME | MY_ZEROFILL),
6145a4
-      &copy_tables, sizeof(SPIDER_COPY_TABLES),
6145a4
+      &copy_tables, (uint) (sizeof(SPIDER_COPY_TABLES)),
6145a4
       NullS))
6145a4
   ) {
6145a4
     my_error(ER_OUT_OF_RESOURCES, MYF(0), HA_ERR_OUT_OF_MEM);
6145a4
diff --git a/storage/spider/spd_db_conn.cc b/storage/spider/spd_db_conn.cc
6145a4
index cc4599ce0b3..f7178293b05 100644
6145a4
--- a/storage/spider/spd_db_conn.cc
6145a4
+++ b/storage/spider/spd_db_conn.cc
6145a4
@@ -2643,7 +2643,8 @@ int spider_db_fetch_for_item_sum_func(
6145a4
           if (!spider->direct_aggregate_item_first)
6145a4
           {
6145a4
             if (!spider_bulk_malloc(spider_current_trx, 240, MYF(MY_WME),
6145a4
-              &spider->direct_aggregate_item_first, sizeof(SPIDER_ITEM_HLD),
6145a4
+              &spider->direct_aggregate_item_first,
6145a4
+              (uint) (sizeof(SPIDER_ITEM_HLD)),
6145a4
               NullS)
6145a4
             ) {
6145a4
               DBUG_RETURN(HA_ERR_OUT_OF_MEM);
6145a4
@@ -2662,7 +2663,7 @@ int spider_db_fetch_for_item_sum_func(
6145a4
           {
6145a4
             if (!spider_bulk_malloc(spider_current_trx, 241, MYF(MY_WME),
6145a4
               &spider->direct_aggregate_item_current->next,
6145a4
-              sizeof(SPIDER_ITEM_HLD), NullS)
6145a4
+              (uint) (sizeof(SPIDER_ITEM_HLD)), NullS)
6145a4
             ) {
6145a4
               DBUG_RETURN(HA_ERR_OUT_OF_MEM);
6145a4
             }
6145a4
@@ -4034,8 +4035,8 @@ int spider_db_store_result(
6145a4
       current->field_count = field_count;
6145a4
       if (!(position = (SPIDER_POSITION *)
6145a4
         spider_bulk_malloc(spider_current_trx, 7, MYF(MY_WME | MY_ZEROFILL),
6145a4
-          &position, sizeof(SPIDER_POSITION) * page_size,
6145a4
-          &tmp_row, sizeof(char*) * field_count,
6145a4
+          &position, (uint) (sizeof(SPIDER_POSITION) * page_size),
6145a4
+          &tmp_row, (uint) (sizeof(SPIDER_DB_ROW) * field_count),
6145a4
           NullS))
6145a4
       )
6145a4
         DBUG_RETURN(HA_ERR_OUT_OF_MEM);
6145a4
@@ -10814,8 +10815,8 @@ int spider_db_udf_copy_tables(
6145a4
   DBUG_ENTER("spider_db_udf_copy_tables");
6145a4
   if (!(last_row_pos = (ulong *)
6145a4
     spider_bulk_malloc(spider_current_trx, 30, MYF(MY_WME),
6145a4
-      &last_row_pos, sizeof(ulong) * table->s->fields,
6145a4
-      &last_lengths, sizeof(ulong) * table->s->fields,
6145a4
+      &last_row_pos, (uint) (sizeof(ulong) * table->s->fields),
6145a4
+      &last_lengths, (uint) (sizeof(ulong) * table->s->fields),
6145a4
       NullS))
6145a4
   ) {
6145a4
     my_error(ER_OUT_OF_RESOURCES, MYF(0), HA_ERR_OUT_OF_MEM);
6145a4
diff --git a/storage/spider/spd_db_handlersocket.cc b/storage/spider/spd_db_handlersocket.cc
6145a4
index 1e42838f40a..1e88ad4a59a 100644
6145a4
--- a/storage/spider/spd_db_handlersocket.cc
6145a4
+++ b/storage/spider/spd_db_handlersocket.cc
6145a4
@@ -505,8 +505,8 @@ SPIDER_DB_ROW *spider_db_handlersocket_row::clone()
6145a4
     DBUG_RETURN(NULL);
6145a4
   }
6145a4
   if (!spider_bulk_malloc(spider_current_trx, 169, MYF(MY_WME),
6145a4
-    &clone_row->hs_row, sizeof(SPIDER_HS_STRING_REF) * field_count,
6145a4
-    &tmp_char, row_size,
6145a4
+    &clone_row->hs_row, (uint) (sizeof(SPIDER_HS_STRING_REF) * field_count),
6145a4
+    &tmp_char, (uint) (row_size),
6145a4
     NullS)
6145a4
   ) {
6145a4
     delete clone_row;
6145a4
diff --git a/storage/spider/spd_db_mysql.cc b/storage/spider/spd_db_mysql.cc
6145a4
index 1b62b4a9bd5..947a614f11e 100644
6145a4
--- a/storage/spider/spd_db_mysql.cc
6145a4
+++ b/storage/spider/spd_db_mysql.cc
6145a4
@@ -523,9 +523,9 @@ SPIDER_DB_ROW *spider_db_mbase_row::clone()
6145a4
     row_size = record_size + field_count;
6145a4
   }
6145a4
   if (!spider_bulk_malloc(spider_current_trx, 29, MYF(MY_WME),
6145a4
-    &clone_row->row, sizeof(char*) * field_count,
6145a4
-    &tmp_char, row_size,
6145a4
-    &clone_row->lengths, sizeof(ulong) * field_count,
6145a4
+    &clone_row->row, (uint) (sizeof(char*) * field_count),
6145a4
+    &tmp_char, (uint) (row_size),
6145a4
+    &clone_row->lengths, (uint) (sizeof(ulong) * field_count),
6145a4
     NullS)
6145a4
   ) {
6145a4
     delete clone_row;
6145a4
@@ -13519,7 +13519,7 @@ int spider_mbase_handler::init_union_table_name_pos()
6145a4
   if (!union_table_name_pos_first)
6145a4
   {
6145a4
     if (!spider_bulk_malloc(spider_current_trx, 236, MYF(MY_WME),
6145a4
-      &union_table_name_pos_first, sizeof(SPIDER_INT_HLD),
6145a4
+      &union_table_name_pos_first, (uint) (sizeof(SPIDER_INT_HLD)),
6145a4
       NullS)
6145a4
     ) {
6145a4
       DBUG_RETURN(HA_ERR_OUT_OF_MEM);
6145a4
@@ -13540,7 +13540,7 @@ int spider_mbase_handler::set_union_table_name_pos()
6145a4
     if (!union_table_name_pos_current->next)
6145a4
     {
6145a4
       if (!spider_bulk_malloc(spider_current_trx, 237, MYF(MY_WME),
6145a4
-        &union_table_name_pos_current->next, sizeof(SPIDER_INT_HLD),
6145a4
+        &union_table_name_pos_current->next, (uint) (sizeof(SPIDER_INT_HLD)),
6145a4
         NullS)
6145a4
       ) {
6145a4
         DBUG_RETURN(HA_ERR_OUT_OF_MEM);
6145a4
diff --git a/storage/spider/spd_db_oracle.cc b/storage/spider/spd_db_oracle.cc
6145a4
index 08d7d3e083d..d869afc61f4 100644
6145a4
--- a/storage/spider/spd_db_oracle.cc
6145a4
+++ b/storage/spider/spd_db_oracle.cc
6145a4
@@ -588,16 +588,16 @@ int spider_db_oracle_row::init()
6145a4
   if (
6145a4
     !(ind = (sb2 *)
6145a4
       spider_bulk_malloc(spider_current_trx, 161, MYF(MY_WME | MY_ZEROFILL),
6145a4
-        &ind, sizeof(sb2) * field_count,
6145a4
-        &rlen, sizeof(ub2) * field_count,
6145a4
-        &coltp, sizeof(ub2) * field_count,
6145a4
-        &colsz, sizeof(ub2) * field_count,
6145a4
-        &row_size, sizeof(ulong) * field_count,
6145a4
-        &val, sizeof(char *) * field_count,
6145a4
-        &tmp_val, MAX_FIELD_WIDTH * field_count,
6145a4
-        &defnp, sizeof(OCIDefine *) * field_count,
6145a4
-        &lobhp, sizeof(OCILobLocator *) * field_count,
6145a4
-        &colhp, sizeof(OCIParam *) * field_count,
6145a4
+        &ind, (uint) (sizeof(sb2) * field_count),
6145a4
+        &rlen, (uint) (sizeof(ub2) * field_count),
6145a4
+        &coltp, (uint) (sizeof(ub2) * field_count),
6145a4
+        &colsz, (uint) (sizeof(ub2) * field_count),
6145a4
+        &row_size, (uint) (sizeof(ulong) * field_count),
6145a4
+        &val, (uint) (sizeof(char *) * field_count),
6145a4
+        &tmp_val, (uint) (MAX_FIELD_WIDTH * field_count),
6145a4
+        &defnp, (uint) (sizeof(OCIDefine *) * field_count),
6145a4
+        &lobhp, (uint) (sizeof(OCILobLocator *) * field_count),
6145a4
+        &colhp, (uint) (sizeof(OCIParam *) * field_count),
6145a4
         NullS)
6145a4
     ) ||
6145a4
     !(val_str = new spider_string[field_count])
6145a4
@@ -12487,7 +12487,7 @@ int spider_oracle_handler::init_union_table_name_pos()
6145a4
   if (!union_table_name_pos_first)
6145a4
   {
6145a4
     if (!spider_bulk_malloc(spider_current_trx, 238, MYF(MY_WME),
6145a4
-      &union_table_name_pos_first, sizeof(SPIDER_INT_HLD),
6145a4
+      &union_table_name_pos_first, (uint) (sizeof(SPIDER_INT_HLD)),
6145a4
       NullS)
6145a4
     ) {
6145a4
       DBUG_RETURN(HA_ERR_OUT_OF_MEM);
6145a4
@@ -12508,7 +12508,7 @@ int spider_oracle_handler::set_union_table_name_pos()
6145a4
     if (!union_table_name_pos_current->next)
6145a4
     {
6145a4
       if (!spider_bulk_malloc(spider_current_trx, 239, MYF(MY_WME),
6145a4
-        &union_table_name_pos_current->next, sizeof(SPIDER_INT_HLD),
6145a4
+        &union_table_name_pos_current->next, (uint) (sizeof(SPIDER_INT_HLD)),
6145a4
         NullS)
6145a4
       ) {
6145a4
         DBUG_RETURN(HA_ERR_OUT_OF_MEM);
6145a4
diff --git a/storage/spider/spd_direct_sql.cc b/storage/spider/spd_direct_sql.cc
6145a4
index 7237d0877a7..7bf0b91a4a7 100644
6145a4
--- a/storage/spider/spd_direct_sql.cc
6145a4
+++ b/storage/spider/spd_direct_sql.cc
6145a4
@@ -1,4 +1,5 @@
6145a4
-/* Copyright (C) 2009-2018 Kentoku Shiba
6145a4
+/* Copyright (C) 2009-2019 Kentoku Shiba
6145a4
+   Copyright (C) 2019 MariaDB corp
6145a4
 
6145a4
   This program is free software; you can redistribute it and/or modify
6145a4
   it under the terms of the GNU General Public License as published by
6145a4
@@ -117,31 +118,32 @@ int spider_udf_direct_sql_create_table_list(
6145a4
 #if MYSQL_VERSION_ID < 50500
6145a4
   if (!(direct_sql->db_names = (char**)
6145a4
     spider_bulk_malloc(spider_current_trx, 31, MYF(MY_WME | MY_ZEROFILL),
6145a4
-      &direct_sql->db_names, sizeof(char*) * table_count,
6145a4
-      &direct_sql->table_names, sizeof(char*) * table_count,
6145a4
-      &direct_sql->tables, sizeof(TABLE*) * table_count,
6145a4
-      &tmp_name_ptr, sizeof(char) * (
6145a4
+      &direct_sql->db_names, (uint) (sizeof(char*) * table_count),
6145a4
+      &direct_sql->table_names, (uint) (sizeof(char*) * table_count),
6145a4
+      &direct_sql->tables, (uint) (sizeof(TABLE*) * table_count),
6145a4
+      &tmp_name_ptr, (uint) (sizeof(char) * (
6145a4
         table_name_list_length +
6145a4
         thd->db_length * table_count +
6145a4
         2 * table_count
6145a4
-      ),
6145a4
-      &direct_sql->iop, sizeof(int) * table_count,
6145a4
+      )),
6145a4
+      &direct_sql->iop, (uint) (sizeof(int) * table_count),
6145a4
       NullS))
6145a4
   )
6145a4
 #else
6145a4
   if (!(direct_sql->db_names = (char**)
6145a4
     spider_bulk_malloc(spider_current_trx, 31, MYF(MY_WME | MY_ZEROFILL),
6145a4
-      &direct_sql->db_names, sizeof(char*) * table_count,
6145a4
-      &direct_sql->table_names, sizeof(char*) * table_count,
6145a4
-      &direct_sql->tables, sizeof(TABLE*) * table_count,
6145a4
-      &tmp_name_ptr, sizeof(char) * (
6145a4
+      &direct_sql->db_names, (uint) (sizeof(char*) * table_count),
6145a4
+      &direct_sql->table_names, (uint) (sizeof(char*) * table_count),
6145a4
+      &direct_sql->tables, (uint) (sizeof(TABLE*) * table_count),
6145a4
+      &tmp_name_ptr, (uint) (sizeof(char) * (
6145a4
         table_name_list_length +
6145a4
         SPIDER_THD_db_length(thd) * table_count +
6145a4
         2 * table_count
6145a4
-      ),
6145a4
-      &direct_sql->iop, sizeof(int) * table_count,
6145a4
-      &direct_sql->table_list, sizeof(TABLE_LIST) * table_count,
6145a4
-      &direct_sql->real_table_bitmap, sizeof(uchar) * ((table_count + 7) / 8),
6145a4
+      )),
6145a4
+      &direct_sql->iop, (uint) (sizeof(int) * table_count),
6145a4
+      &direct_sql->table_list, (uint) (sizeof(TABLE_LIST) * table_count),
6145a4
+      &direct_sql->real_table_bitmap,
6145a4
+        (uint) (sizeof(uchar) * ((table_count + 7) / 8)),
6145a4
       NullS))
6145a4
   )
6145a4
 #endif
6145a4
@@ -412,23 +414,23 @@ SPIDER_CONN *spider_udf_direct_sql_create_conn(
6145a4
 #endif
6145a4
     if (!(conn = (SPIDER_CONN *)
6145a4
       spider_bulk_malloc(spider_current_trx, 32, MYF(MY_WME | MY_ZEROFILL),
6145a4
-        &conn, sizeof(*conn),
6145a4
-        &tmp_name, direct_sql->conn_key_length + 1,
6145a4
-        &tmp_host, direct_sql->tgt_host_length + 1,
6145a4
-        &tmp_username, direct_sql->tgt_username_length + 1,
6145a4
-        &tmp_password, direct_sql->tgt_password_length + 1,
6145a4
-        &tmp_socket, direct_sql->tgt_socket_length + 1,
6145a4
-        &tmp_wrapper, direct_sql->tgt_wrapper_length + 1,
6145a4
-        &tmp_ssl_ca, direct_sql->tgt_ssl_ca_length + 1,
6145a4
-        &tmp_ssl_capath, direct_sql->tgt_ssl_capath_length + 1,
6145a4
-        &tmp_ssl_cert, direct_sql->tgt_ssl_cert_length + 1,
6145a4
-        &tmp_ssl_cipher, direct_sql->tgt_ssl_cipher_length + 1,
6145a4
-        &tmp_ssl_key, direct_sql->tgt_ssl_key_length + 1,
6145a4
+        &conn, (uint) (sizeof(*conn)),
6145a4
+        &tmp_name, (uint) (direct_sql->conn_key_length + 1),
6145a4
+        &tmp_host, (uint) (direct_sql->tgt_host_length + 1),
6145a4
+        &tmp_username, (uint) (direct_sql->tgt_username_length + 1),
6145a4
+        &tmp_password, (uint) (direct_sql->tgt_password_length + 1),
6145a4
+        &tmp_socket, (uint) (direct_sql->tgt_socket_length + 1),
6145a4
+        &tmp_wrapper, (uint) (direct_sql->tgt_wrapper_length + 1),
6145a4
+        &tmp_ssl_ca, (uint) (direct_sql->tgt_ssl_ca_length + 1),
6145a4
+        &tmp_ssl_capath, (uint) (direct_sql->tgt_ssl_capath_length + 1),
6145a4
+        &tmp_ssl_cert, (uint) (direct_sql->tgt_ssl_cert_length + 1),
6145a4
+        &tmp_ssl_cipher, (uint) (direct_sql->tgt_ssl_cipher_length + 1),
6145a4
+        &tmp_ssl_key, (uint) (direct_sql->tgt_ssl_key_length + 1),
6145a4
         &tmp_default_file,
6145a4
-          direct_sql->tgt_default_file_length + 1,
6145a4
+          (uint) (direct_sql->tgt_default_file_length + 1),
6145a4
         &tmp_default_group,
6145a4
-          direct_sql->tgt_default_group_length + 1,
6145a4
-        &need_mon, sizeof(int),
6145a4
+          (uint) (direct_sql->tgt_default_group_length + 1),
6145a4
+        &need_mon, (uint) (sizeof(int)),
6145a4
         NullS))
6145a4
     ) {
6145a4
       *error_num = HA_ERR_OUT_OF_MEM;
6145a4
@@ -439,12 +441,12 @@ SPIDER_CONN *spider_udf_direct_sql_create_conn(
6145a4
   } else {
6145a4
     if (!(conn = (SPIDER_CONN *)
6145a4
       spider_bulk_malloc(spider_current_trx, 33, MYF(MY_WME | MY_ZEROFILL),
6145a4
-        &conn, sizeof(*conn),
6145a4
-        &tmp_name, direct_sql->conn_key_length + 1,
6145a4
-        &tmp_host, direct_sql->tgt_host_length + 1,
6145a4
-        &tmp_socket, direct_sql->tgt_socket_length + 1,
6145a4
-        &tmp_wrapper, direct_sql->tgt_wrapper_length + 1,
6145a4
-        &need_mon, sizeof(int),
6145a4
+        &conn, (uint) (sizeof(*conn)),
6145a4
+        &tmp_name, (uint) (direct_sql->conn_key_length + 1),
6145a4
+        &tmp_host, (uint) (direct_sql->tgt_host_length + 1),
6145a4
+        &tmp_socket, (uint) (direct_sql->tgt_socket_length + 1),
6145a4
+        &tmp_wrapper, (uint) (direct_sql->tgt_wrapper_length + 1),
6145a4
+        &need_mon, (uint) (sizeof(int)),
6145a4
         NullS))
6145a4
     ) {
6145a4
       *error_num = HA_ERR_OUT_OF_MEM;
6145a4
@@ -1602,8 +1604,8 @@ long long spider_direct_sql_body(
6145a4
   SPIDER_BACKUP_DASTATUS;
6145a4
   if (!(direct_sql = (SPIDER_DIRECT_SQL *)
6145a4
     spider_bulk_malloc(spider_current_trx, 34, MYF(MY_WME | MY_ZEROFILL),
6145a4
-      &direct_sql, sizeof(SPIDER_DIRECT_SQL),
6145a4
-      &sql, sizeof(char) * args->lengths[0],
6145a4
+      &direct_sql, (uint) (sizeof(SPIDER_DIRECT_SQL)),
6145a4
+      &sql, (uint) (sizeof(char) * args->lengths[0]),
6145a4
       NullS))
6145a4
   ) {
6145a4
     error_num = HA_ERR_OUT_OF_MEM;
6145a4
diff --git a/storage/spider/spd_group_by_handler.cc b/storage/spider/spd_group_by_handler.cc
6145a4
index 3b57092c4ce..51cfca23106 100644
6145a4
--- a/storage/spider/spd_group_by_handler.cc
6145a4
+++ b/storage/spider/spd_group_by_handler.cc
6145a4
@@ -1,4 +1,5 @@
6145a4
-/* Copyright (C) 2008-2018 Kentoku Shiba
6145a4
+/* Copyright (C) 2008-2019 Kentoku Shiba
6145a4
+   Copyright (C) 2019 MariaDB corp
6145a4
 
6145a4
   This program is free software; you can redistribute it and/or modify
6145a4
   it under the terms of the GNU General Public License as published by
6145a4
@@ -637,9 +638,9 @@ SPIDER_CONN_HOLDER *spider_fields::create_conn_holder(
6145a4
   DBUG_PRINT("info",("spider this=%p", this));
6145a4
   return_conn_holder = (SPIDER_CONN_HOLDER *)
6145a4
     spider_bulk_malloc(spider_current_trx, 252, MYF(MY_WME | MY_ZEROFILL),
6145a4
-      &return_conn_holder, sizeof(SPIDER_CONN_HOLDER),
6145a4
+      &return_conn_holder, (uint) (sizeof(SPIDER_CONN_HOLDER)),
6145a4
       &table_link_idx_holder,
6145a4
-        table_count * sizeof(SPIDER_TABLE_LINK_IDX_HOLDER),
6145a4
+        (uint) (table_count * sizeof(SPIDER_TABLE_LINK_IDX_HOLDER)),
6145a4
       NullS
6145a4
     );
6145a4
   if (!return_conn_holder)
6145a4
diff --git a/storage/spider/spd_ping_table.cc b/storage/spider/spd_ping_table.cc
6145a4
index 431d46063c3..60e36fc24fb 100644
6145a4
--- a/storage/spider/spd_ping_table.cc
6145a4
+++ b/storage/spider/spd_ping_table.cc
6145a4
@@ -1,4 +1,5 @@
6145a4
-/* Copyright (C) 2009-2018 Kentoku Shiba
6145a4
+/* Copyright (C) 2009-2019 Kentoku Shiba
6145a4
+   Copyright (C) 2019 MariaDB corp
6145a4
 
6145a4
   This program is free software; you can redistribute it and/or modify
6145a4
   it under the terms of the GNU General Public License as published by
6145a4
@@ -367,12 +368,15 @@ int spider_get_ping_table_mon(
6145a4
   do {
6145a4
     if (!(table_mon = (SPIDER_TABLE_MON *)
6145a4
       spider_bulk_malloc(spider_current_trx, 35, MYF(MY_WME | MY_ZEROFILL),
6145a4
-        &table_mon, sizeof(SPIDER_TABLE_MON),
6145a4
-        &tmp_share, sizeof(SPIDER_SHARE),
6145a4
-        &tmp_connect_info, sizeof(char *) * SPIDER_TMP_SHARE_CHAR_PTR_COUNT,
6145a4
-        &tmp_connect_info_length, sizeof(uint) * SPIDER_TMP_SHARE_UINT_COUNT,
6145a4
-        &tmp_long, sizeof(long) * SPIDER_TMP_SHARE_LONG_COUNT,
6145a4
-        &tmp_longlong, sizeof(longlong) * SPIDER_TMP_SHARE_LONGLONG_COUNT,
6145a4
+        &table_mon, (uint) (sizeof(SPIDER_TABLE_MON)),
6145a4
+        &tmp_share, (uint) (sizeof(SPIDER_SHARE)),
6145a4
+        &tmp_connect_info,
6145a4
+          (uint) (sizeof(char *) * SPIDER_TMP_SHARE_CHAR_PTR_COUNT),
6145a4
+        &tmp_connect_info_length,
6145a4
+          (uint) (sizeof(uint) * SPIDER_TMP_SHARE_UINT_COUNT),
6145a4
+        &tmp_long, (uint) (sizeof(long) * SPIDER_TMP_SHARE_LONG_COUNT),
6145a4
+        &tmp_longlong,
6145a4
+          (uint) (sizeof(longlong) * SPIDER_TMP_SHARE_LONGLONG_COUNT),
6145a4
         NullS))
6145a4
     ) {
6145a4
       spider_sys_index_end(table_link_mon);
6145a4
@@ -491,13 +495,17 @@ SPIDER_TABLE_MON_LIST *spider_get_ping_table_tgt(
6145a4
   SPD_INIT_ALLOC_ROOT(&mem_root, 4096, 0, MYF(MY_WME));
6145a4
   if (!(table_mon_list = (SPIDER_TABLE_MON_LIST *)
6145a4
     spider_bulk_malloc(spider_current_trx, 36, MYF(MY_WME | MY_ZEROFILL),
6145a4
-      &table_mon_list, sizeof(SPIDER_TABLE_MON_LIST),
6145a4
-      &tmp_share, sizeof(SPIDER_SHARE),
6145a4
-      &tmp_connect_info, sizeof(char *) * SPIDER_TMP_SHARE_CHAR_PTR_COUNT,
6145a4
-      &tmp_connect_info_length, sizeof(uint) * SPIDER_TMP_SHARE_UINT_COUNT,
6145a4
-      &tmp_long, sizeof(long) * SPIDER_TMP_SHARE_LONG_COUNT,
6145a4
-      &tmp_longlong, sizeof(longlong) * SPIDER_TMP_SHARE_LONGLONG_COUNT,
6145a4
-      &key_str, str->length() + 1,
6145a4
+      &table_mon_list, (uint) (sizeof(SPIDER_TABLE_MON_LIST)),
6145a4
+      &tmp_share, (uint) (sizeof(SPIDER_SHARE)),
6145a4
+      &tmp_connect_info,
6145a4
+        (uint) (sizeof(char *) * SPIDER_TMP_SHARE_CHAR_PTR_COUNT),
6145a4
+      &tmp_connect_info_length,
6145a4
+        (uint) (sizeof(uint) * SPIDER_TMP_SHARE_UINT_COUNT),
6145a4
+      &tmp_long,
6145a4
+        (uint) (sizeof(long) * SPIDER_TMP_SHARE_LONG_COUNT),
6145a4
+      &tmp_longlong,
6145a4
+        (uint) (sizeof(longlong) * SPIDER_TMP_SHARE_LONGLONG_COUNT),
6145a4
+      &key_str, (uint) (str->length() + 1),
6145a4
       NullS))
6145a4
   ) {
6145a4
     my_error(HA_ERR_OUT_OF_MEM, MYF(0));
6145a4
diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc
6145a4
index 83c5a37555f..5bae895570d 100644
6145a4
--- a/storage/spider/spd_table.cc
6145a4
+++ b/storage/spider/spd_table.cc
6145a4
@@ -1209,8 +1209,8 @@ int spider_create_string_list(
6145a4
 
6145a4
   if (!(*string_list = (char**)
6145a4
     spider_bulk_malloc(spider_current_trx, 37, MYF(MY_WME | MY_ZEROFILL),
6145a4
-      string_list, sizeof(char*) * (*list_length),
6145a4
-      string_length_list, sizeof(int) * (*list_length),
6145a4
+      string_list, (uint) (sizeof(char*) * (*list_length)),
6145a4
+      string_length_list, (uint) (sizeof(int) * (*list_length)),
6145a4
       NullS))
6145a4
   ) {
6145a4
     my_error(ER_OUT_OF_RESOURCES, MYF(0), HA_ERR_OUT_OF_MEM);
6145a4
@@ -1328,7 +1328,7 @@ int spider_create_long_list(
6145a4
 
6145a4
   if (!(*long_list = (long*)
6145a4
     spider_bulk_malloc(spider_current_trx, 38, MYF(MY_WME | MY_ZEROFILL),
6145a4
-      long_list, sizeof(long) * (*list_length),
6145a4
+      long_list, (uint) (sizeof(long) * (*list_length)),
6145a4
       NullS))
6145a4
   ) {
6145a4
     my_error(ER_OUT_OF_RESOURCES, MYF(0), HA_ERR_OUT_OF_MEM);
6145a4
@@ -1412,7 +1412,7 @@ int spider_create_longlong_list(
6145a4
 
6145a4
   if (!(*longlong_list = (longlong *)
6145a4
     spider_bulk_malloc(spider_current_trx, 39, MYF(MY_WME | MY_ZEROFILL),
6145a4
-      longlong_list, sizeof(longlong) * (*list_length),
6145a4
+      longlong_list, (uint) (sizeof(longlong) * (*list_length)),
6145a4
       NullS))
6145a4
   ) {
6145a4
     my_error(ER_OUT_OF_RESOURCES, MYF(0), HA_ERR_OUT_OF_MEM);
6145a4
@@ -1483,8 +1483,8 @@ int spider_increase_string_list(
6145a4
 
6145a4
   if (!(tmp_str_list = (char**)
6145a4
     spider_bulk_malloc(spider_current_trx, 40, MYF(MY_WME | MY_ZEROFILL),
6145a4
-      &tmp_str_list, sizeof(char*) * link_count,
6145a4
-      &tmp_length_list, sizeof(uint) * link_count,
6145a4
+      &tmp_str_list, (uint) (sizeof(char*) * link_count),
6145a4
+      &tmp_length_list, (uint) (sizeof(uint) * link_count),
6145a4
       NullS))
6145a4
   ) {
6145a4
     my_error(ER_OUT_OF_RESOURCES, MYF(0), HA_ERR_OUT_OF_MEM);
6145a4
@@ -1546,8 +1546,8 @@ int spider_increase_null_string_list(
6145a4
 
6145a4
   if (!(tmp_str_list = (char**)
6145a4
     spider_bulk_malloc(spider_current_trx, 247, MYF(MY_WME | MY_ZEROFILL),
6145a4
-      &tmp_str_list, sizeof(char*) * link_count,
6145a4
-      &tmp_length_list, sizeof(uint) * link_count,
6145a4
+      &tmp_str_list, (uint) (sizeof(char*) * link_count),
6145a4
+      &tmp_length_list, (uint) (sizeof(uint) * link_count),
6145a4
       NullS))
6145a4
   ) {
6145a4
     my_error(ER_OUT_OF_RESOURCES, MYF(0), HA_ERR_OUT_OF_MEM);
6145a4
@@ -1604,7 +1604,7 @@ int spider_increase_long_list(
6145a4
 
6145a4
   if (!(tmp_long_list = (long*)
6145a4
     spider_bulk_malloc(spider_current_trx, 41, MYF(MY_WME | MY_ZEROFILL),
6145a4
-      &tmp_long_list, sizeof(long) * link_count,
6145a4
+      &tmp_long_list, (uint) (sizeof(long) * link_count),
6145a4
       NullS))
6145a4
   ) {
6145a4
     my_error(ER_OUT_OF_RESOURCES, MYF(0), HA_ERR_OUT_OF_MEM);
6145a4
@@ -1649,7 +1649,7 @@ int spider_increase_longlong_list(
6145a4
 
6145a4
   if (!(tmp_longlong_list = (longlong*)
6145a4
     spider_bulk_malloc(spider_current_trx, 42, MYF(MY_WME | MY_ZEROFILL),
6145a4
-      &tmp_longlong_list, sizeof(longlong) * link_count,
6145a4
+      &tmp_longlong_list, (uint) (sizeof(longlong) * link_count),
6145a4
       NullS))
6145a4
   ) {
6145a4
     my_error(ER_OUT_OF_RESOURCES, MYF(0), HA_ERR_OUT_OF_MEM);
6145a4
@@ -2972,17 +2972,17 @@ int spider_parse_connect_info(
6145a4
   if (!(share_alter->tmp_server_names = (char **)
6145a4
     spider_bulk_malloc(spider_current_trx, 43, MYF(MY_WME | MY_ZEROFILL),
6145a4
       &share_alter->tmp_server_names,
6145a4
-      sizeof(char *) * 16 * share->all_link_count,
6145a4
+      (uint) (sizeof(char *) * 16 * share->all_link_count),
6145a4
       &share_alter->tmp_server_names_lengths,
6145a4
-      sizeof(uint *) * 16 * share->all_link_count,
6145a4
+      (uint) (sizeof(uint *) * 16 * share->all_link_count),
6145a4
       &share_alter->tmp_tgt_ports,
6145a4
-      sizeof(long) * share->all_link_count,
6145a4
+      (uint) (sizeof(long) * share->all_link_count),
6145a4
       &share_alter->tmp_tgt_ssl_vscs,
6145a4
-      sizeof(long) * share->all_link_count,
6145a4
+      (uint) (sizeof(long) * share->all_link_count),
6145a4
       &share_alter->tmp_monitoring_binlog_pos_at_failing,
6145a4
-      sizeof(long) * share->all_link_count,
6145a4
+      (uint) (sizeof(long) * share->all_link_count),
6145a4
       &share_alter->tmp_link_statuses,
6145a4
-      sizeof(long) * share->all_link_count,
6145a4
+      (uint) (sizeof(long) * share->all_link_count),
6145a4
       NullS))
6145a4
   ) {
6145a4
     error_num = HA_ERR_OUT_OF_MEM;
6145a4
@@ -4383,13 +4383,17 @@ SPIDER_SHARE *spider_create_share(
6145a4
   bitmap_size = spider_bitmap_size(table_share->fields);
6145a4
   if (!(share = (SPIDER_SHARE *)
6145a4
     spider_bulk_malloc(spider_current_trx, 46, MYF(MY_WME | MY_ZEROFILL),
6145a4
-      &share, sizeof(*share),
6145a4
-      &tmp_name, length + 1,
6145a4
-      &tmp_static_key_cardinality, sizeof(*tmp_static_key_cardinality) * table_share->keys,
6145a4
-      &tmp_cardinality, sizeof(*tmp_cardinality) * table_share->fields,
6145a4
-      &tmp_cardinality_upd, sizeof(*tmp_cardinality_upd) * bitmap_size,
6145a4
-      &tmp_table_mon_mutex_bitmap, sizeof(*tmp_table_mon_mutex_bitmap) *
6145a4
-        ((spider_param_udf_table_mon_mutex_count() + 7) / 8),
6145a4
+      &share, (uint) (sizeof(*share)),
6145a4
+      &tmp_name, (uint) (length + 1),
6145a4
+      &tmp_static_key_cardinality,
6145a4
+        (uint) (sizeof(*tmp_static_key_cardinality) * table_share->keys),
6145a4
+      &tmp_cardinality,
6145a4
+        (uint) (sizeof(*tmp_cardinality) * table_share->fields),
6145a4
+      &tmp_cardinality_upd,
6145a4
+        (uint) (sizeof(*tmp_cardinality_upd) * bitmap_size),
6145a4
+      &tmp_table_mon_mutex_bitmap,
6145a4
+        (uint) (sizeof(*tmp_table_mon_mutex_bitmap) *
6145a4
+          ((spider_param_udf_table_mon_mutex_count() + 7) / 8)),
6145a4
       NullS))
6145a4
   ) {
6145a4
     *error_num = HA_ERR_OUT_OF_MEM;
6145a4
@@ -5907,8 +5911,8 @@ SPIDER_LGTM_TBLHND_SHARE *spider_get_lgtm_tblhnd_share(
6145a4
     DBUG_PRINT("info",("spider create new lgtm tblhnd share"));
6145a4
     if (!(lgtm_tblhnd_share = (SPIDER_LGTM_TBLHND_SHARE *)
6145a4
       spider_bulk_malloc(spider_current_trx, 244, MYF(MY_WME | MY_ZEROFILL),
6145a4
-        &lgtm_tblhnd_share, sizeof(*lgtm_tblhnd_share),
6145a4
-        &tmp_name, table_name_length + 1,
6145a4
+        &lgtm_tblhnd_share, (uint) (sizeof(*lgtm_tblhnd_share)),
6145a4
+        &tmp_name, (uint) (table_name_length + 1),
6145a4
         NullS))
6145a4
     ) {
6145a4
       *error_num = HA_ERR_OUT_OF_MEM;
6145a4
@@ -6017,9 +6021,10 @@ SPIDER_PARTITION_SHARE *spider_get_pt_share(
6145a4
     DBUG_PRINT("info",("spider create new pt share"));
6145a4
     if (!(partition_share = (SPIDER_PARTITION_SHARE *)
6145a4
       spider_bulk_malloc(spider_current_trx, 51, MYF(MY_WME | MY_ZEROFILL),
6145a4
-        &partition_share, sizeof(*partition_share),
6145a4
-        &tmp_name, table_share->path.length + 1,
6145a4
-        &tmp_cardinality, sizeof(*tmp_cardinality) * table_share->fields,
6145a4
+        &partition_share, (uint) (sizeof(*partition_share)),
6145a4
+        &tmp_name, (uint) (table_share->path.length + 1),
6145a4
+        &tmp_cardinality,
6145a4
+          (uint) (sizeof(*tmp_cardinality) * table_share->fields),
6145a4
         NullS))
6145a4
     ) {
6145a4
       *error_num = HA_ERR_OUT_OF_MEM;
6145a4
@@ -6395,15 +6400,18 @@ int spider_open_all_tables(
6145a4
 
6145a4
       if (!(share = (SPIDER_SHARE *)
6145a4
         spider_bulk_malloc(spider_current_trx, 52, MYF(MY_WME | MY_ZEROFILL),
6145a4
-          &share, sizeof(*share),
6145a4
-          &connect_info, sizeof(char *) * SPIDER_TMP_SHARE_CHAR_PTR_COUNT,
6145a4
-          &connect_info_length, sizeof(uint) * SPIDER_TMP_SHARE_UINT_COUNT,
6145a4
-          &long_info, sizeof(long) * SPIDER_TMP_SHARE_LONG_COUNT,
6145a4
-          &longlong_info, sizeof(longlong) * SPIDER_TMP_SHARE_LONGLONG_COUNT,
6145a4
-          &conns, sizeof(SPIDER_CONN *),
6145a4
-          &need_mon, sizeof(int),
6145a4
-          &spider->conn_link_idx, sizeof(uint),
6145a4
-          &spider->conn_can_fo, sizeof(uchar),
6145a4
+          &share, (uint) (sizeof(*share)),
6145a4
+          &connect_info,
6145a4
+            (uint) (sizeof(char *) * SPIDER_TMP_SHARE_CHAR_PTR_COUNT),
6145a4
+          &connect_info_length,
6145a4
+            (uint) (sizeof(uint) * SPIDER_TMP_SHARE_UINT_COUNT),
6145a4
+          &long_info, (uint) (sizeof(long) * SPIDER_TMP_SHARE_LONG_COUNT),
6145a4
+          &longlong_info,
6145a4
+            (uint) (sizeof(longlong) * SPIDER_TMP_SHARE_LONGLONG_COUNT),
6145a4
+          &conns, (uint) (sizeof(SPIDER_CONN *)),
6145a4
+          &need_mon, (uint) (sizeof(int)),
6145a4
+          &spider->conn_link_idx, (uint) (sizeof(uint)),
6145a4
+          &spider->conn_can_fo, (uint) (sizeof(uchar)),
6145a4
           NullS))
6145a4
       ) {
6145a4
         delete spider;
6145a4
@@ -7204,12 +7212,12 @@ int spider_db_init(
6145a4
 
6145a4
   if (!(spider_udf_table_mon_mutexes = (pthread_mutex_t *)
6145a4
     spider_bulk_malloc(NULL, 53, MYF(MY_WME | MY_ZEROFILL),
6145a4
-      &spider_udf_table_mon_mutexes, sizeof(pthread_mutex_t) *
6145a4
-        spider_param_udf_table_mon_mutex_count(),
6145a4
-      &spider_udf_table_mon_conds, sizeof(pthread_cond_t) *
6145a4
-        spider_param_udf_table_mon_mutex_count(),
6145a4
-      &spider_udf_table_mon_list_hash, sizeof(HASH) *
6145a4
-        spider_param_udf_table_mon_mutex_count(),
6145a4
+      &spider_udf_table_mon_mutexes, (uint) (sizeof(pthread_mutex_t) *
6145a4
+        spider_param_udf_table_mon_mutex_count()),
6145a4
+      &spider_udf_table_mon_conds, (uint) (sizeof(pthread_cond_t) *
6145a4
+        spider_param_udf_table_mon_mutex_count()),
6145a4
+      &spider_udf_table_mon_list_hash, (uint) (sizeof(HASH) *
6145a4
+        spider_param_udf_table_mon_mutex_count()),
6145a4
       NullS))
6145a4
   )
6145a4
     goto error_alloc_mon_mutxes;
6145a4
@@ -7258,10 +7266,10 @@ int spider_db_init(
6145a4
 #ifndef WITHOUT_SPIDER_BG_SEARCH
6145a4
   if (!(spider_table_sts_threads = (SPIDER_THREAD *)
6145a4
     spider_bulk_malloc(NULL, 256, MYF(MY_WME | MY_ZEROFILL),
6145a4
-      &spider_table_sts_threads, sizeof(SPIDER_THREAD) *
6145a4
-        spider_param_table_sts_thread_count(),
6145a4
-      &spider_table_crd_threads, sizeof(SPIDER_THREAD) *
6145a4
-        spider_param_table_crd_thread_count(),
6145a4
+      &spider_table_sts_threads, (uint) (sizeof(SPIDER_THREAD) *
6145a4
+        spider_param_table_sts_thread_count()),
6145a4
+      &spider_table_crd_threads, (uint) (sizeof(SPIDER_THREAD) *
6145a4
+        spider_param_table_crd_thread_count()),
6145a4
       NullS))
6145a4
   )
6145a4
     goto error_alloc_mon_mutxes;
6145a4
@@ -7968,8 +7976,8 @@ SPIDER_INIT_ERROR_TABLE *spider_get_init_error_table(
6145a4
     }
6145a4
     if (!(spider_init_error_table = (SPIDER_INIT_ERROR_TABLE *)
6145a4
       spider_bulk_malloc(spider_current_trx, 54, MYF(MY_WME | MY_ZEROFILL),
6145a4
-        &spider_init_error_table, sizeof(*spider_init_error_table),
6145a4
-        &tmp_name, share->table_name_length + 1,
6145a4
+        &spider_init_error_table, (uint) (sizeof(*spider_init_error_table)),
6145a4
+        &tmp_name, (uint) (share->table_name_length + 1),
6145a4
         NullS))
6145a4
     ) {
6145a4
       pthread_mutex_unlock(&spider_init_error_tbl_mutex);
6145a4
@@ -9551,25 +9559,25 @@ int spider_create_spider_object_for_share(
6145a4
 #if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
6145a4
   if (!(need_mons = (int *)
6145a4
     spider_bulk_malloc(spider_current_trx, 255, MYF(MY_WME | MY_ZEROFILL),
6145a4
-      &need_mons, (sizeof(int) * share->link_count),
6145a4
-      &conns, (sizeof(SPIDER_CONN *) * share->link_count),
6145a4
-      &conn_link_idx, (sizeof(uint) * share->link_count),
6145a4
-      &conn_can_fo, (sizeof(uchar) * share->link_bitmap_size),
6145a4
-      &conn_keys, (sizeof(char *) * share->link_count),
6145a4
-      &hs_r_conn_keys, (sizeof(char *) * share->link_count),
6145a4
-      &hs_w_conn_keys, (sizeof(char *) * share->link_count),
6145a4
-      &dbton_hdl, (sizeof(spider_db_handler *) * SPIDER_DBTON_SIZE),
6145a4
+      &need_mons, (uint) (sizeof(int) * share->link_count),
6145a4
+      &conns, (uint) (sizeof(SPIDER_CONN *) * share->link_count),
6145a4
+      &conn_link_idx, (uint) (sizeof(uint) * share->link_count),
6145a4
+      &conn_can_fo, (uint) (sizeof(uchar) * share->link_bitmap_size),
6145a4
+      &conn_keys, (uint) (sizeof(char *) * share->link_count),
6145a4
+      &hs_r_conn_keys, (uint) (sizeof(char *) * share->link_count),
6145a4
+      &hs_w_conn_keys, (uint) (sizeof(char *) * share->link_count),
6145a4
+      &dbton_hdl, (uint) (sizeof(spider_db_handler *) * SPIDER_DBTON_SIZE),
6145a4
       NullS))
6145a4
   )
6145a4
 #else
6145a4
   if (!(need_mons = (int *)
6145a4
     spider_bulk_malloc(spider_current_trx, 255, MYF(MY_WME | MY_ZEROFILL),
6145a4
-      &need_mons, (sizeof(int) * share->link_count),
6145a4
-      &conns, (sizeof(SPIDER_CONN *) * share->link_count),
6145a4
-      &conn_link_idx, (sizeof(uint) * share->link_count),
6145a4
-      &conn_can_fo, (sizeof(uchar) * share->link_bitmap_size),
6145a4
-      &conn_keys, (sizeof(char *) * share->link_count),
6145a4
-      &dbton_hdl, (sizeof(spider_db_handler *) * SPIDER_DBTON_SIZE),
6145a4
+      &need_mons, (uint) (sizeof(int) * share->link_count),
6145a4
+      &conns, (uint) (sizeof(SPIDER_CONN *) * share->link_count),
6145a4
+      &conn_link_idx, (uint) (sizeof(uint) * share->link_count),
6145a4
+      &conn_can_fo, (uint) (sizeof(uchar) * share->link_bitmap_size),
6145a4
+      &conn_keys, (uint) (sizeof(char *) * share->link_count),
6145a4
+      &dbton_hdl, (uint) (sizeof(spider_db_handler *) * SPIDER_DBTON_SIZE),
6145a4
       NullS))
6145a4
   )
6145a4
 #endif
6145a4
diff --git a/storage/spider/spd_trx.cc b/storage/spider/spd_trx.cc
6145a4
index bb9f11793cb..1638533eca1 100644
6145a4
--- a/storage/spider/spd_trx.cc
6145a4
+++ b/storage/spider/spd_trx.cc
6145a4
@@ -548,81 +548,90 @@ int spider_create_trx_alter_table(
6145a4
 
6145a4
   if (!(alter_table = (SPIDER_ALTER_TABLE *)
6145a4
     spider_bulk_malloc(spider_current_trx, 55, MYF(MY_WME | MY_ZEROFILL),
6145a4
-      &alter_table, sizeof(*alter_table),
6145a4
-      &tmp_name, sizeof(char) * (share->table_name_length + 1),
6145a4
-
6145a4
-      &tmp_server_names, sizeof(char *) * share->all_link_count,
6145a4
-      &tmp_tgt_table_names, sizeof(char *) * share->all_link_count,
6145a4
-      &tmp_tgt_dbs, sizeof(char *) * share->all_link_count,
6145a4
-      &tmp_tgt_hosts, sizeof(char *) * share->all_link_count,
6145a4
-      &tmp_tgt_usernames, sizeof(char *) * share->all_link_count,
6145a4
-      &tmp_tgt_passwords, sizeof(char *) * share->all_link_count,
6145a4
-      &tmp_tgt_sockets, sizeof(char *) * share->all_link_count,
6145a4
-      &tmp_tgt_wrappers, sizeof(char *) * share->all_link_count,
6145a4
-      &tmp_tgt_ssl_cas, sizeof(char *) * share->all_link_count,
6145a4
-      &tmp_tgt_ssl_capaths, sizeof(char *) * share->all_link_count,
6145a4
-      &tmp_tgt_ssl_certs, sizeof(char *) * share->all_link_count,
6145a4
-      &tmp_tgt_ssl_ciphers, sizeof(char *) * share->all_link_count,
6145a4
-      &tmp_tgt_ssl_keys, sizeof(char *) * share->all_link_count,
6145a4
-      &tmp_tgt_default_files, sizeof(char *) * share->all_link_count,
6145a4
-      &tmp_tgt_default_groups, sizeof(char *) * share->all_link_count,
6145a4
-      &tmp_static_link_ids, sizeof(char *) * share->all_link_count,
6145a4
-
6145a4
-      &tmp_server_names_lengths, sizeof(uint) * share->all_link_count,
6145a4
-      &tmp_tgt_table_names_lengths, sizeof(uint) * share->all_link_count,
6145a4
-      &tmp_tgt_dbs_lengths, sizeof(uint) * share->all_link_count,
6145a4
-      &tmp_tgt_hosts_lengths, sizeof(uint) * share->all_link_count,
6145a4
-      &tmp_tgt_usernames_lengths, sizeof(uint) * share->all_link_count,
6145a4
-      &tmp_tgt_passwords_lengths, sizeof(uint) * share->all_link_count,
6145a4
-      &tmp_tgt_sockets_lengths, sizeof(uint) * share->all_link_count,
6145a4
-      &tmp_tgt_wrappers_lengths, sizeof(uint) * share->all_link_count,
6145a4
-      &tmp_tgt_ssl_cas_lengths, sizeof(uint) * share->all_link_count,
6145a4
-      &tmp_tgt_ssl_capaths_lengths, sizeof(uint) * share->all_link_count,
6145a4
-      &tmp_tgt_ssl_certs_lengths, sizeof(uint) * share->all_link_count,
6145a4
-      &tmp_tgt_ssl_ciphers_lengths, sizeof(uint) * share->all_link_count,
6145a4
-      &tmp_tgt_ssl_keys_lengths, sizeof(uint) * share->all_link_count,
6145a4
-      &tmp_tgt_default_files_lengths, sizeof(uint) * share->all_link_count,
6145a4
-      &tmp_tgt_default_groups_lengths, sizeof(uint) * share->all_link_count,
6145a4
-      &tmp_static_link_ids_lengths, sizeof(uint) * share->all_link_count,
6145a4
-
6145a4
-      &tmp_tgt_ports, sizeof(long) * share->all_link_count,
6145a4
-      &tmp_tgt_ssl_vscs, sizeof(long) * share->all_link_count,
6145a4
+      &alter_table, (uint) (sizeof(*alter_table)),
6145a4
+      &tmp_name, (uint) (sizeof(char) * (share->table_name_length + 1)),
6145a4
+
6145a4
+      &tmp_server_names, (uint) (sizeof(char *) * share->all_link_count),
6145a4
+      &tmp_tgt_table_names, (uint) (sizeof(char *) * share->all_link_count),
6145a4
+      &tmp_tgt_dbs, (uint) (sizeof(char *) * share->all_link_count),
6145a4
+      &tmp_tgt_hosts, (uint) (sizeof(char *) * share->all_link_count),
6145a4
+      &tmp_tgt_usernames, (uint) (sizeof(char *) * share->all_link_count),
6145a4
+      &tmp_tgt_passwords, (uint) (sizeof(char *) * share->all_link_count),
6145a4
+      &tmp_tgt_sockets, (uint) (sizeof(char *) * share->all_link_count),
6145a4
+      &tmp_tgt_wrappers, (uint) (sizeof(char *) * share->all_link_count),
6145a4
+      &tmp_tgt_ssl_cas, (uint) (sizeof(char *) * share->all_link_count),
6145a4
+      &tmp_tgt_ssl_capaths, (uint) (sizeof(char *) * share->all_link_count),
6145a4
+      &tmp_tgt_ssl_certs, (uint) (sizeof(char *) * share->all_link_count),
6145a4
+      &tmp_tgt_ssl_ciphers, (uint) (sizeof(char *) * share->all_link_count),
6145a4
+      &tmp_tgt_ssl_keys, (uint) (sizeof(char *) * share->all_link_count),
6145a4
+      &tmp_tgt_default_files, (uint) (sizeof(char *) * share->all_link_count),
6145a4
+      &tmp_tgt_default_groups, (uint) (sizeof(char *) * share->all_link_count),
6145a4
+      &tmp_static_link_ids, (uint) (sizeof(char *) * share->all_link_count),
6145a4
+
6145a4
+      &tmp_server_names_lengths, (uint) (sizeof(uint) * share->all_link_count),
6145a4
+      &tmp_tgt_table_names_lengths,
6145a4
+        (uint) (sizeof(uint) * share->all_link_count),
6145a4
+      &tmp_tgt_dbs_lengths, (uint) (sizeof(uint) * share->all_link_count),
6145a4
+      &tmp_tgt_hosts_lengths, (uint) (sizeof(uint) * share->all_link_count),
6145a4
+      &tmp_tgt_usernames_lengths,
6145a4
+        (uint) (sizeof(uint) * share->all_link_count),
6145a4
+      &tmp_tgt_passwords_lengths,
6145a4
+        (uint) (sizeof(uint) * share->all_link_count),
6145a4
+      &tmp_tgt_sockets_lengths, (uint) (sizeof(uint) * share->all_link_count),
6145a4
+      &tmp_tgt_wrappers_lengths, (uint) (sizeof(uint) * share->all_link_count),
6145a4
+      &tmp_tgt_ssl_cas_lengths, (uint) (sizeof(uint) * share->all_link_count),
6145a4
+      &tmp_tgt_ssl_capaths_lengths,
6145a4
+        (uint) (sizeof(uint) * share->all_link_count),
6145a4
+      &tmp_tgt_ssl_certs_lengths,
6145a4
+        (uint) (sizeof(uint) * share->all_link_count),
6145a4
+      &tmp_tgt_ssl_ciphers_lengths,
6145a4
+        (uint) (sizeof(uint) * share->all_link_count),
6145a4
+      &tmp_tgt_ssl_keys_lengths, (uint) (sizeof(uint) * share->all_link_count),
6145a4
+      &tmp_tgt_default_files_lengths,
6145a4
+        (uint) (sizeof(uint) * share->all_link_count),
6145a4
+      &tmp_tgt_default_groups_lengths,
6145a4
+        (uint) (sizeof(uint) * share->all_link_count),
6145a4
+      &tmp_static_link_ids_lengths,
6145a4
+        (uint) (sizeof(uint) * share->all_link_count),
6145a4
+
6145a4
+      &tmp_tgt_ports, (uint) (sizeof(long) * share->all_link_count),
6145a4
+      &tmp_tgt_ssl_vscs, (uint) (sizeof(long) * share->all_link_count),
6145a4
       &tmp_monitoring_binlog_pos_at_failing,
6145a4
-        sizeof(long) * share->all_link_count,
6145a4
-      &tmp_link_statuses, sizeof(long) * share->all_link_count,
6145a4
-
6145a4
-      &tmp_server_names_char, sizeof(char) *
6145a4
-        (share_alter->tmp_server_names_charlen + 1),
6145a4
-      &tmp_tgt_table_names_char, sizeof(char) *
6145a4
-        (share_alter->tmp_tgt_table_names_charlen + 1),
6145a4
-      &tmp_tgt_dbs_char, sizeof(char) *
6145a4
-        (share_alter->tmp_tgt_dbs_charlen + 1),
6145a4
-      &tmp_tgt_hosts_char, sizeof(char) *
6145a4
-        (share_alter->tmp_tgt_hosts_charlen + 1),
6145a4
-      &tmp_tgt_usernames_char, sizeof(char) *
6145a4
-        (share_alter->tmp_tgt_usernames_charlen + 1),
6145a4
-      &tmp_tgt_passwords_char, sizeof(char) *
6145a4
-        (share_alter->tmp_tgt_passwords_charlen + 1),
6145a4
-      &tmp_tgt_sockets_char, sizeof(char) *
6145a4
-        (share_alter->tmp_tgt_sockets_charlen + 1),
6145a4
-      &tmp_tgt_wrappers_char, sizeof(char) *
6145a4
-        (share_alter->tmp_tgt_wrappers_charlen + 1),
6145a4
-      &tmp_tgt_ssl_cas_char, sizeof(char) *
6145a4
-        (share_alter->tmp_tgt_ssl_cas_charlen + 1),
6145a4
-      &tmp_tgt_ssl_capaths_char, sizeof(char) *
6145a4
-        (share_alter->tmp_tgt_ssl_capaths_charlen + 1),
6145a4
-      &tmp_tgt_ssl_certs_char, sizeof(char) *
6145a4
-        (share_alter->tmp_tgt_ssl_certs_charlen + 1),
6145a4
-      &tmp_tgt_ssl_ciphers_char, sizeof(char) *
6145a4
-        (share_alter->tmp_tgt_ssl_ciphers_charlen + 1),
6145a4
-      &tmp_tgt_ssl_keys_char, sizeof(char) *
6145a4
-        (share_alter->tmp_tgt_ssl_keys_charlen + 1),
6145a4
-      &tmp_tgt_default_files_char, sizeof(char) *
6145a4
-        (share_alter->tmp_tgt_default_files_charlen + 1),
6145a4
-      &tmp_tgt_default_groups_char, sizeof(char) *
6145a4
-        (share_alter->tmp_tgt_default_groups_charlen + 1),
6145a4
-      &tmp_static_link_ids_char, sizeof(char) *
6145a4
-        (share_alter->tmp_static_link_ids_charlen + 1),
6145a4
+        (uint) (sizeof(long) * share->all_link_count),
6145a4
+      &tmp_link_statuses, (uint) (sizeof(long) * share->all_link_count),
6145a4
+
6145a4
+      &tmp_server_names_char, (uint) (sizeof(char) *
6145a4
+        (share_alter->tmp_server_names_charlen + 1)),
6145a4
+      &tmp_tgt_table_names_char, (uint) (sizeof(char) *
6145a4
+        (share_alter->tmp_tgt_table_names_charlen + 1)),
6145a4
+      &tmp_tgt_dbs_char, (uint) (sizeof(char) *
6145a4
+        (share_alter->tmp_tgt_dbs_charlen + 1)),
6145a4
+      &tmp_tgt_hosts_char, (uint) (sizeof(char) *
6145a4
+        (share_alter->tmp_tgt_hosts_charlen + 1)),
6145a4
+      &tmp_tgt_usernames_char, (uint) (sizeof(char) *
6145a4
+        (share_alter->tmp_tgt_usernames_charlen + 1)),
6145a4
+      &tmp_tgt_passwords_char, (uint) (sizeof(char) *
6145a4
+        (share_alter->tmp_tgt_passwords_charlen + 1)),
6145a4
+      &tmp_tgt_sockets_char, (uint) (sizeof(char) *
6145a4
+        (share_alter->tmp_tgt_sockets_charlen + 1)),
6145a4
+      &tmp_tgt_wrappers_char, (uint) (sizeof(char) *
6145a4
+        (share_alter->tmp_tgt_wrappers_charlen + 1)),
6145a4
+      &tmp_tgt_ssl_cas_char, (uint) (sizeof(char) *
6145a4
+        (share_alter->tmp_tgt_ssl_cas_charlen + 1)),
6145a4
+      &tmp_tgt_ssl_capaths_char, (uint) (sizeof(char) *
6145a4
+        (share_alter->tmp_tgt_ssl_capaths_charlen + 1)),
6145a4
+      &tmp_tgt_ssl_certs_char, (uint) (sizeof(char) *
6145a4
+        (share_alter->tmp_tgt_ssl_certs_charlen + 1)),
6145a4
+      &tmp_tgt_ssl_ciphers_char, (uint) (sizeof(char) *
6145a4
+        (share_alter->tmp_tgt_ssl_ciphers_charlen + 1)),
6145a4
+      &tmp_tgt_ssl_keys_char, (uint) (sizeof(char) *
6145a4
+        (share_alter->tmp_tgt_ssl_keys_charlen + 1)),
6145a4
+      &tmp_tgt_default_files_char, (uint) (sizeof(char) *
6145a4
+        (share_alter->tmp_tgt_default_files_charlen + 1)),
6145a4
+      &tmp_tgt_default_groups_char, (uint) (sizeof(char) *
6145a4
+        (share_alter->tmp_tgt_default_groups_charlen + 1)),
6145a4
+      &tmp_static_link_ids_char, (uint) (sizeof(char) *
6145a4
+        (share_alter->tmp_static_link_ids_charlen + 1)),
6145a4
       NullS))
6145a4
   ) {
6145a4
     error_num = HA_ERR_OUT_OF_MEM;
6145a4
@@ -1200,10 +1209,10 @@ SPIDER_TRX *spider_get_trx(
6145a4
     DBUG_PRINT("info",("spider create new trx"));
6145a4
     if (!(trx = (SPIDER_TRX *)
6145a4
       spider_bulk_malloc(NULL, 56, MYF(MY_WME | MY_ZEROFILL),
6145a4
-        &trx, sizeof(*trx),
6145a4
-        &tmp_share, sizeof(SPIDER_SHARE),
6145a4
-        &udf_table_mutexes, sizeof(pthread_mutex_t) *
6145a4
-          spider_param_udf_table_lock_mutex_count(),
6145a4
+        &trx, (uint) (sizeof(*trx)),
6145a4
+        &tmp_share, (uint) (sizeof(SPIDER_SHARE)),
6145a4
+        &udf_table_mutexes, (uint) (sizeof(pthread_mutex_t) *
6145a4
+          spider_param_udf_table_lock_mutex_count()),
6145a4
         NullS))
6145a4
     )
6145a4
       goto error_alloc_trx;
6145a4
@@ -4191,10 +4200,10 @@ int spider_create_trx_ha(
6145a4
   {
6145a4
     if (!(trx_ha = (SPIDER_TRX_HA *)
6145a4
       spider_bulk_malloc(spider_current_trx, 58, MYF(MY_WME),
6145a4
-        &trx_ha, sizeof(SPIDER_TRX_HA),
6145a4
-        &tmp_name, sizeof(char *) * (share->table_name_length + 1),
6145a4
-        &conn_link_idx, sizeof(uint) * share->link_count,
6145a4
-        &conn_can_fo, sizeof(uchar) * share->link_bitmap_size,
6145a4
+        &trx_ha, (uint) (sizeof(SPIDER_TRX_HA)),
6145a4
+        &tmp_name, (uint) (sizeof(char *) * (share->table_name_length + 1)),
6145a4
+        &conn_link_idx, (uint) (sizeof(uint) * share->link_count),
6145a4
+        &conn_can_fo, (uint) (sizeof(uchar) * share->link_bitmap_size),
6145a4
         NullS))
6145a4
     ) {
6145a4
       DBUG_RETURN(HA_ERR_OUT_OF_MEM);
6145a4
-- 
6145a4
2.23.0
6145a4