fd34cc77cd53fe8a6ff27d2be6d4d58bcd7adce3
hiram
  Thu Nov 1 13:06:42 2018 -0700
can also ouput dropLimit warning even when not dropping refs #22355

diff --git src/hg/dbTrash/dbTrash.c src/hg/dbTrash/dbTrash.c
index ac23d86..ab56a29 100644
--- src/hg/dbTrash/dbTrash.c
+++ src/hg/dbTrash/dbTrash.c
@@ -345,31 +345,31 @@
 	ctTouchLastUse(conn, el->name, FALSE); /* removes metaInfo row */
     }
 
 if (drop)
     {
     char comment[256];
     if (expiredTableNames)
 	{
 	struct slName *el;
 	int toBeDropped = slCount(expiredTableNames);
 	if (dropLimit > 0)
 	    {
 		if (toBeDropped > dropLimit)
 		    {
             errAbort("ERROR: expected drop table count: %d\n\tis larger"
-		" than the dropLimit: %d\n\twill not proceed with this drop.",
+		" than the dropLimit: %d\n\twill not proceed with this drop.\n",
 		toBeDropped, dropLimit);
 		    }
 	    }
 
 	int droppedCount = 0;
 	/* customTrash DB user permissions do not have permissions to
  	 * drop tables.  Must use standard special user that has all
  	 * permissions.  If we are not using the standard user at this
  	 * point, then switch to it.
 	 */
 	if (sameWord(db,CUSTOM_TRASH))
 	    {
 	    sqlDisconnect(&conn);
 	    conn = sqlConnect(db);
 	    }
@@ -394,30 +394,38 @@
 	}
     else
 	{
 	safef(comment, sizeof(comment),
 	    "Dropped no tables, none expired, %llu lost tables",
 		lostTableCount);
 	verbose(2,"# %s\n", comment);
 	}
     }
 else
     {
     char comment[256];
     if (expiredTableNames)
 	{
 	int droppedCount = slCount(expiredTableNames);
+	if (dropLimit > 0)
+	    {
+		if (droppedCount > dropLimit)
+		    {
+            warn("WARNING: expected drop table count: %d\n\tis larger"
+		" than the dropLimit: %d\n", droppedCount, dropLimit);
+		    }
+	    }
 	if (tableStatus)
 	    safef(comment, sizeof(comment), "Would have dropped %d tables with "
 		"total size %llu, %llu lost tables",
 		    droppedCount, totalSize, lostTableCount);
 	else
 	    safef(comment, sizeof(comment),
 		"Would have dropped %d tables, no size info, %llu lost tables",
 		    droppedCount, lostTableCount);
 	verbose(2,"# %s\n", comment);
 	}
     else
 	{
 	safef(comment, sizeof(comment),
 	    "Would have dropped no tables, none expired, %llu lost tables",
 		lostTableCount);