[vhffs-dev] [682] Added some die for error tracking.

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 682
Author:   beuss
Date:     2007-07-07 16:08:12 +0000 (Sat, 07 Jul 2007)

Log Message:
-----------
Added some die for error tracking.

Modified Paths:
--------------
    trunk/vhffs-backend/src/mirror/mydns-mirror.pl


Modified: trunk/vhffs-backend/src/mirror/mydns-mirror.pl
===================================================================
--- trunk/vhffs-backend/src/mirror/mydns-mirror.pl	2007-07-07 15:01:51 UTC (rev 681)
+++ trunk/vhffs-backend/src/mirror/mydns-mirror.pl	2007-07-07 16:08:12 UTC (rev 682)
@@ -62,21 +62,26 @@
 
 # Create temporary tables
 # mirror table containing SOA must be named vhffs_dns_soa
-$slave_dbh->do('CREATE TEMPORARY TABLE tmp_dns_soa(LIKE vhffs_dns_soa)') or die("Unable to create temporary DNS SOA table\n");
-$slave_dbh->do('CREATE TEMPORARY TABLE tmp_dns_rr(LIKE vhffs_dns_rr)') or die("Unable to create temporary DNS RR table\n");
+$slave_dbh->do('CREATE TEMPORARY TABLE tmp_dns_soa(LIKE vhffs_dns_soa)')
+    or die("Unable to create temporary DNS SOA table\n");
+$slave_dbh->do('CREATE TEMPORARY TABLE tmp_dns_rr(LIKE vhffs_dns_rr)')
+    or die("Unable to create temporary DNS RR table\n");
 
 $master_dbh->{AutoCommit} = 0;
 $slave_dbh->{AutoCommit} = 0;
 
 # We need to set transaction isolation level to serializable to avoid
 # foreign key issues
-$master_dbh->do('SET TRANSACTION ISOLATION LEVEL SERIALIZABLE') or die("Unable to set transaction level on master DB\n");
+$master_dbh->do('SET TRANSACTION ISOLATION LEVEL SERIALIZABLE')
+    or die("Unable to set transaction level on master DB\n");
 
 # Replicate vhffs_dns_soa table
-my $msth = $master_dbh->prepare(q{SELECT id, origin, ns, mbox, serial, refresh, retry, expire, minimum, ttl FROM vhffs_dns_soa});
+my $msth = $master_dbh->prepare(q{SELECT id, origin, ns, mbox, serial, refresh, retry, expire, minimum, ttl FROM vhffs_dns_soa})
+    or die("Unable to prepare SELECT query for master vhffs_dns_soa\n");
 my $ssth = $slave_dbh->prepare('INSERT INTO tmp_dns_soa(id, origin, ns, mbox, serial, refresh, retry, expire, minimum, ttl) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)') or die("Unable to prepare INSERT query for tmp_dns_soa\n");
 
-$msth->execute();
+$msth->execute()
+    or die("Unable to execute SELECT query for master vhffs_dns_soa\n");;
 
 while(my $row = $msth->fetchrow_hashref()) {
     $ssth->execute($row->{id}, $row->{origin}, $row->{ns}, $row->{mbox},
@@ -90,10 +95,13 @@
 
 # Replicate vhffs_dns_rr table
 
-$msth = $master_dbh->prepare(q{SELECT r.id, r.zone, r.name, r.type, r.data, r.aux, r.ttl FROM vhffs_dns_rr r INNER JOIN vhffs_dns_soa s ON r.zone = s.id}) or die("Unable to prepare resource records SELECT statement\n");
-$ssth = $slave_dbh->prepare(q{INSERT INTO tmp_dns_rr(id, zone, name, type, data, aux, ttl) VALUES(?, ?, ?, ?, ?, ?, ?)});
+$msth = $master_dbh->prepare(q{SELECT r.id, r.zone, r.name, r.type, r.data, r.aux, r.ttl FROM vhffs_dns_rr r INNER JOIN vhffs_dns_soa s ON r.zone = s.id})
+    or die("Unable to prepare resource records SELECT statement\n");
+$ssth = $slave_dbh->prepare(q{INSERT INTO tmp_dns_rr(id, zone, name, type, data, aux, ttl) VALUES(?, ?, ?, ?, ?, ?, ?)})
+    or die("Unable to prepare INSERT statement for tmp_dns_rr\n");
 
-$msth->execute();
+$msth->execute()
+    or die("Unable to execute SELECT query for master vhffs_dns_rr\n");
 
 while(my $row = $msth->fetchrow_hashref()) {
     $ssth->execute($row->{id}, $row->{zone}, $row->{name}, $row->{type},


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/