970f87a4f35875cfbda2179aa9b1f890def4757f max Mon Jan 20 05:34:48 2014 -0800 handling the show table status command with failover connections diff --git src/hg/lib/jksql.c src/hg/lib/jksql.c index d3d1fb1..ee17d37 100644 --- src/hg/lib/jksql.c +++ src/hg/lib/jksql.c @@ -2595,30 +2595,35 @@ } } } return updateFieldIndex; } char *sqlTableUpdate(struct sqlConnection *conn, char *table) /* Get last update time for table as an SQL string * Note: does NOT work on innoDB! */ { char query[512], **row; struct sqlResult *sr; int updateIx; char *ret; sqlSafef(query, sizeof(query), "show table status like '%s'", table); +if (conn->slowConn) + // the failover strategy does not work for this command, + // as it never returns an error. So default to slowConn instead. + sr = sqlGetResult(conn->slowConn, query); +else sr = sqlGetResult(conn, query); updateIx = getUpdateFieldIndex(sr); row = sqlNextRow(sr); if (row == NULL) errAbort("Database table %s doesn't exist", table); ret = cloneString(row[updateIx]); sqlFreeResult(&sr); return ret; } time_t sqlTableUpdateTime(struct sqlConnection *conn, char *table) /* Get last update time for table. * Note: does NOT work on innoDB! */ { char *date = sqlTableUpdate(conn, table);