Index: trunk/ippTools/src/difftool.c
===================================================================
--- trunk/ippTools/src/difftool.c	(revision 32593)
+++ trunk/ippTools/src/difftool.c	(revision 32609)
@@ -1936,19 +1936,70 @@
             return false;
         }
+        psS64 numSkycells = psDBAffectedRows(config->dbh);
+        if (numSkycells > 0) {
+            if (!setdiffRunState(config, run->diff_id, "new", false)) {
+                psError(PS_ERR_UNKNOWN, false, "Failed to change diffRun.state for diff_id: %" PRId64,
+                        run->diff_id);
+                psFree(input);
+                psFree(diff);
+                psFree(run);
+                psFree(list);
+                psFree(insert);
+                psFree(results);
+                if (!psDBRollback(config->dbh)) {
+                    psError(PS_ERR_UNKNOWN, false, "database error");
+                }
+                return false;
+            }
+            run->state = psStringCopy("new");
+        } else {
+            // No overlap between the warps. Insert a dummy skycell which will complete this pair of warps
+            // XXX: we'd like to use diffInputSkyfileRowAlloc and diffInputSkyfileInsert but there doesn't
+            // seem to be a way to pass in NULL for skycell_id, stack1 and stack2
+            psString dummyQuery = NULL;
+            psStringAppend(&dummyQuery, 
+              "INSERT INTO diffInputSkyfile VALUES(%" PRId64 ", NULL, %s, NULL, %s, NULL, '%s', 0)",
+                    run->diff_id, 
+                    input,                      // warp1
+                    template,                   // warp2
+                    tess_id);
+            if (!p_psDBRunQuery(config->dbh, dummyQuery)) {
+                psError(PS_ERR_UNKNOWN, false, "database error");
+                psFree(dummyQuery);
+                psFree(input);
+                psFree(diff);
+                psFree(run);
+                psFree(list);
+                psFree(insert);
+                psFree(results);
+                if (!psDBRollback(config->dbh)) {
+                    psError(PS_ERR_UNKNOWN, false, "database error");
+                }
+                return false;
+            }
+            psFree(dummyQuery);
+            psString finishQuery = NULL;
+            psStringAppend( &finishQuery, 
+                "UPDATE diffRun set state ='full', note = 'dummy run - no overlap' WHERE diff_id = %" PRId64,
+                run->diff_id);
+            if (!p_psDBRunQuery(config->dbh, finishQuery)) {
+                psError(PS_ERR_UNKNOWN, false, "database error");
+                psFree(finishQuery);
+                psFree(input);
+                psFree(diff);
+                psFree(run);
+                psFree(list);
+                psFree(insert);
+                psFree(results);
+                if (!psDBRollback(config->dbh)) {
+                    psError(PS_ERR_UNKNOWN, false, "database error");
+                }
+                return false;
+            }
+            psFree(finishQuery);
+            run->state = psStringCopy("full");
+        }
         psFree(input);
         psFree(diff);
-
-        if (!setdiffRunState(config, run->diff_id, "new", false)) {
-            psError(PS_ERR_UNKNOWN, false, "Failed to change diffRun.state for diff_id: %" PRId64,
-                    run->diff_id);
-            psFree(run);
-            psFree(list);
-            psFree(insert);
-            psFree(results);
-            if (!psDBRollback(config->dbh)) {
-                psError(PS_ERR_UNKNOWN, false, "database error");
-            }
-            return false;
-        }
 
         psArrayAdd(list, list->n, run);
