--- ./sql/sql_insert.cc.orig	2020-11-09 01:44:40 +0000
+++ ./sql/sql_insert.cc	2020-11-09 01:45:52 +0000
@@ -2702,7 +2702,7 @@
   delayed_row *row= 0;
   Delayed_insert *di=thd->di;
   const Discrete_interval *forced_auto_inc;
-  size_t user_len, host_len, ip_len;
+  size_t user_len, host_len, ip_len_AIX;
   DBUG_ENTER("write_delayed");
   DBUG_PRINT("enter", ("query = '%s' length %lu", query.str,
                        (ulong) query.length));
@@ -2736,7 +2736,7 @@
     goto err;
   }
 
-  user_len= host_len= ip_len= 0;
+  user_len= host_len= ip_len_AIX= 0;
   row->user= row->host= row->ip= NULL;
   if (thd->security_ctx)
   {
@@ -2745,11 +2745,11 @@
     if (thd->security_ctx->host)
       host_len= strlen(thd->security_ctx->host) + 1;
     if (thd->security_ctx->ip)
-      ip_len= strlen(thd->security_ctx->ip) + 1;
+      ip_len_AIX= strlen(thd->security_ctx->ip) + 1;
   }
   /* This can't be THREAD_SPECIFIC as it's freed in delayed thread */
   if (!(row->record= (char*) my_malloc(table->s->reclength +
-                                       user_len + host_len + ip_len,
+                                       user_len + host_len + ip_len_AIX,
                                        MYF(MY_WME))))
     goto err;
   memcpy(row->record, table->record[0], table->s->reclength);
@@ -2769,7 +2769,7 @@
     if (thd->security_ctx->ip)
     {
       row->ip= row->record + table->s->reclength + user_len + host_len;
-      memcpy(row->ip, thd->security_ctx->ip, ip_len);
+      memcpy(row->ip, thd->security_ctx->ip, ip_len_AIX);
     }
   }
   row->query_id= thd->query_id;
