Index: branches/cname-collision/DNSDB.pm
===================================================================
--- branches/cname-collision/DNSDB.pm	(revision 989)
+++ branches/cname-collision/DNSDB.pm	(revision 990)
@@ -641,5 +641,4 @@
   foreach my $tcompare ('<>', '=') {
     next if $tcompare eq '<>' && ${$args{rectype}} != 5;
-    # First, check for non-CNAME collisions.
     my $sql = "SELECT count(*) FROM "._rectable($args{defrec}, $args{revrec}).
 	" WHERE "._recparent($args{defrec}, $args{revrec})." = ? AND type $tcompare 5 AND $hfield = ?";
@@ -664,5 +663,5 @@
     }
 
-    # Check timestamps of pending active-after records.  Coerce expires-at fields to soonest match if found.
+    # Check timestamps of pending active-after records.  Coerce expires-at timestamp down to soonest match if overlapping.
     if ($args{defrec} eq 'n') {
       $sql = "SELECT extract(epoch from stamp),stamp < now() FROM "._rectable($args{defrec}, $args{revrec}).
@@ -690,5 +689,5 @@
           } else {
             # coerce the expiry timestamp
-            ${$args{stamp}} = strftime('Y-%m-%d %H:%M:%S', localtime($t[0]));
+            ${$args{stamp}} = strftime('%Y-%m-%d %H:%M:%S', localtime($t[0]));
             return ('WARN', "CNAME added with modified expiry time;  conflicting valid-after record found");
           }
@@ -1772,5 +1771,5 @@
 
   return ('WARN', join("\n", $errstr, $warnmsg) ) if $warnmsg;
-  
+
   return ('OK','OK');
 } # done ALIAS record
Index: branches/cname-collision/t/cname.t
===================================================================
--- branches/cname-collision/t/cname.t	(revision 989)
+++ branches/cname-collision/t/cname.t	(revision 990)
@@ -214,5 +214,5 @@
       }
     };
-# this test arguably overkill, subsumed by earlier test for substantially the same thing
+# this test arguably overkill, subsumed by earlier test for nonexpiring collision
     subtest '  - collision with soon to expire record' => sub {
       $newname = 'expired2.expiry1.test';
@@ -288,7 +288,7 @@
         ok( $rcount == 2, " ... [$rcount] correct number of records for $newname" );
         my ($newstamp) = $dbh->selectrow_array("SELECT extract(epoch from stamp) FROM records WHERE domain_id = 5 AND host = '$newname' ".
-               "AND stampactive = 't' AND expires = 't'");
+		"AND stampactive = 't' AND expires = 't'");
         my ($oldstamp) = $dbh->selectrow_array("SELECT extract(epoch from stamp) FROM records WHERE domain_id = 5 AND host = '$newname' ".
-               "AND stampactive = 't' AND expires = 'f'");
+		"AND stampactive = 't' AND expires = 'f'");
         ok( $newstamp <= $oldstamp, " ... added record expires before existing active-after record goes active" );
       } else {
