You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
err := db.QueryRowx("select group_concat(distinct concat(coalesce(st.host,s.host ),':',coalesce(st.port,s.port))) as value from mysql.spider_tables st left join mysql.servers s on st.server=s.server_name").Scan(&value)
506
-
if err != nil {
507
-
log.Println("ERROR: Could not get spider shards", err)
508
-
}
509
-
return value, err
511
+
var value string
512
+
err := db.QueryRowx("select coalesce(group_concat(distinct concat(coalesce(st.host,s.host ),':',coalesce(st.port,s.port))),'') as value from mysql.spider_tables st left join mysql.servers s on st.server=s.server_name").Scan(&value)
513
+
if err != nil {
514
+
log.Println("ERROR: Could not get spider shards", err)
err := db.QueryRowx("select coalesce(group_concat(distinct concat(coalesce(st.host,s.host ),':',coalesce(st.port,s.port))),'') as value from mysql.spider_link_mon_servers st left join mysql.servers s on st.server=s.server_name").Scan(&value)
522
+
if err != nil {
523
+
log.Println("ERROR: Could not get spider shards", err)
select group_concat( distinct concat(db_name, '.',substring_index(table_name,'#P#', 1))) as tbl_src , group_concat( distinct concat(db_name, '.', table_name)) as tbl_src_link,concat( coalesce(st.tgt_db_name,s.db) ,'.', tgt_table_name ) as tbl_dest, concat(coalesce(st.host,s.host ),':',coalesce(st.port,s.port)) as srv_desync from (select * from mysql.spider_tables where link_status=3) st left join mysql.servers s on st.server=s.server_name group by tbl_dest, srv_desync
533
+
) usync inner join (
534
+
select group_concat( distinct concat(db_name, '.',table_name)) as tbl_src ,concat( coalesce(st.tgt_db_name,s.db) ,'.', tgt_table_name ) as tbl_dest, concat(coalesce(st.host,s.host ),':',coalesce(st.port,s.port)) as srv_sync from (select * from mysql.spider_tables where link_status=1) st left join mysql.servers s on st.server=s.server_name group by tbl_dest, srv_sync
535
+
) sync ON usync.tbl_src_link= sync.tbl_src and usync.tbl_dest=sync.tbl_dest
0 commit comments