From 27d96a102e894c51ce25b92a638d6ea66693c1b6 Mon Sep 17 00:00:00 2001 From: mattf Date: Thu, 14 Feb 2019 23:07:28 +0000 Subject: [PATCH] Fix for cid_recent_ table optimization issue git-svn-id: svn://192.168.202.10@3064 3d104415-ff17-0410-8863-d5cf3c621b8a --- bin/AST_flush_DBqueue.pl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bin/AST_flush_DBqueue.pl b/bin/AST_flush_DBqueue.pl index 89d2e0e8..44483eef 100644 --- a/bin/AST_flush_DBqueue.pl +++ b/bin/AST_flush_DBqueue.pl @@ -9,7 +9,7 @@ # !!!!!!!! IMPORTANT !!!!!!!!!!!!!!!!!! # THIS SCRIPT SHOULD ONLY BE RUN ON ONE SERVER ON YOUR CLUSTER # -# Copyright (C) 2018 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2019 Matt Florell LICENSE: AGPLv2 # # CHANGES # 60717-1214 - changed to DBI by Marin Blu @@ -26,6 +26,7 @@ # 180511-1223 - Added flush for server-specific cid_channels_recent_ tables # 180519-1431 - Added vicidial_inbound_groups optimization # 181003-2115 - Added optimize of cid_channels_recent_ tables +# 190214-1758 - Fix for cid_recent_ table optimization issue # ### begin parsing run-time options ### @@ -379,9 +380,9 @@ if (!$Q) {print " - OPTIMIZE vicidial_inbound_groups \n";} $stmtA = "SELECT server_ip,server_id FROM servers where active='Y' and active_asterisk_server='Y';"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; -$sthArows=$sthA->rows; +$sthArowsSERVERS=$sthA->rows; $aas=0; -while ($sthArows > $aas) +while ($sthArowsSERVERS > $aas) { @aryA = $sthA->fetchrow_array; $dialer_ip[$aas] = $aryA[0]; @@ -394,7 +395,7 @@ while ($sthArows > $aas) $sthA->finish(); $aas=0; -while ($sthArows > $aas) +while ($sthArowsSERVERS > $aas) { $CCRrec=0; $stmtA = "SHOW TABLES LIKE \"cid_channels_recent_$PADserver_ip[$aas]\";";