Bug #115554 Using util.copy to copy between different hosts encountered an error.
Submitted: 10 Jul 10:20 Modified: 10 Jul 12:22
Reporter: shu William Email Updates:
Status: Closed Impact on me:
None 
Category:Shell Dump & Load Severity:S3 (Non-critical)
Version:8.4.0/8.4.1 OS:Red Hat (Rocky linux 9.4)
Assigned to: MySQL Verification Team CPU Architecture:x86 (2678)

[10 Jul 10:20] shu William
Description:
When I used copy, I encountered an error. My host has different IP, different MAC address, uuid and server_id.

[root@mydb ~]# mysqlsh --js
MySQL Shell 8.4.1

Copyright (c) 2016, 2024, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.

Type '\help' or '\?' for help; '\quit' to exit.
Creating a Classic session to 'root@localhost'
Fetching schema names for auto-completion... Press ^C to stop.
Your MySQL connection id is 11
Server version: 8.4.1 MySQL Community Server - GPL
No default schema selected; type \use <schema> to set one.
 MySQL  localhost  JS > util.copySchemas(['world'], 'root@192.168.5.140:3306',{schema: "mySakilaSchema"})
Util.copySchemas: The target instance is the same as the source instance (ArgumentError)
 MySQL  localhost  JS >
 MySQL  localhost  JS >
 MySQL  localhost  JS >
 MySQL  localhost  JS > \system ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:0c:29:26:56:4c brd ff:ff:ff:ff:ff:ff
    altname enp3s0
    inet 192.168.5.130/24 brd 192.168.5.255 scope global noprefixroute ens160
       valid_lft forever preferred_lft forever
 MySQL  localhost  JS > util.copyTables('world', ['city'], 'root@192.168.5.140:3306',{schema: "db01",threads:"8",deferTableIndexes:"all",skipBinlog:"true"})
Util.copyTables: The target instance is the same as the source instance (ArgumentError)
 MySQL  localhost  JS >

How to repeat:
host 1 ip :192.168.5.130
host 1 ip :192.168.5.140

on host 1
 MySQL  localhost  JS > util.copySchemas(['world'], 'root@192.168.5.140:3306',{schema: "mySakilaSchema"})
[10 Jul 12:22] shu William
check report_host is null