public DbComparator.ChangeType detectChange(ResultSet srs, ResultSet drs) throws Exception {
        // Verify we're on the same row
        Key srcPk = getPk(srs);
        Key dstPk = getPk(drs);
        int eq = Key.compare(srcPk, dstPk);

/*
Left		Right
ACD			BDE

A			B			Left < right, insert A into right
C			B			Left > right, delete B from right
D			D			Left = right, update D in right
null		E			Left > right, delete E from right
*/
        if (eq < 0) {
            // Left < right, insert
            return DbComparator.ChangeType.INSERT;
        }
        if (eq > 0) {
            // Left > right, delete
            return DbComparator.ChangeType.DELETE;
        }

        // Keys match, check hashes
        byte[] shash = getHash(srs);
        byte[] dhash = getHash(drs);
        if (shash == null && dhash == null) {
            throw new RuntimeException("Both rows are null!");
        }
        if (shash == null) {
            return DbComparator.ChangeType.DELETE;
        }
        if (dhash == null) {
            return DbComparator.ChangeType.INSERT;
        }
        if (Arrays.equals(shash, dhash)) {
            return DbComparator.ChangeType.NONE;
        }
        return DbComparator.ChangeType.UPDATE;
    }