Make sure before_check_rows code is only enabled for pushdelta (e.g. not fullcopy)
authorGreg Sabino Mullane <greg@endpoint.com>
Fri, 20 Mar 2015 22:39:04 +0000 (18:39 -0400)
committerGreg Sabino Mullane <greg@endpoint.com>
Fri, 20 Mar 2015 22:39:04 +0000 (18:39 -0400)
Bucardo.pm

index bd08aa2f723ee0b74beefc275517cdf8e6cc4434..795608c673ab74b13a8d82a5fa6b041713327795 100644 (file)
@@ -3264,21 +3264,21 @@ sub start_kid {
         ## We may have a request to lock all the tables
         $self->lock_all_tables({ sync => $sync, databases => \@dbs_write, tables => $goatlist});
 
-        ## Run all 'before_check_rows' code
-        if (exists $sync->{code_before_check_rows}) {
-            $sth{kid_syncrun_update_status}->execute("Code before_check_rows (KID $$)", $syncname);
-            $maindbh->commit();
-            for my $code (@{$sync->{code_before_check_rows}}) {
-                ## Check if the code has asked us to skip other before_check_rows codes
-                last if 'last' eq $self->run_kid_custom_code($sync, $code);
-            }
-        }
-
         ## Do all the delta (non-fullcopy) targets
         if (@dbs_delta) {
 
             ## We will never reach this while in onetimecopy mode as @dbs_delta is emptied
 
+            ## Run all 'before_check_rows' code
+            if (exists $sync->{code_before_check_rows}) {
+                $sth{kid_syncrun_update_status}->execute("Code before_check_rows (KID $$)", $syncname);
+                $maindbh->commit();
+                for my $code (@{$sync->{code_before_check_rows}}) {
+                    ## Check if the code has asked us to skip other before_check_rows codes
+                    last if 'last' eq $self->run_kid_custom_code($sync, $code);
+                }
+            }
+
             ## Check if any tables were truncated on all source databases
             ## If so, set $self->{has_truncation}; store results in $self->{truncateinfo}
             ## First level keys are schema then table name