Skip to content

Commit

Permalink
Revert "Try a different approach"
Browse files Browse the repository at this point in the history
This reverts commit 89fd0fe.
  • Loading branch information
rowleya committed Oct 19, 2023
1 parent 89fd0fe commit 0edd0b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -328,12 +328,7 @@ private class ChangeStatus {

ChangeStatus(Row row) {
nChanges = row.getInt("n_changes");
Integer errors = row.getInteger("n_errors");
if (errors == null) {
nErrors = 0;
} else {
nErrors = errors;
}
nErrors = row.getInt("n_errors");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -809,8 +809,7 @@ public abstract class SQLQueries {
*/
@Parameter("change_id")
protected static final String ERROR_PENDING =
"UPDATE pending_changes SET is_error=1 "
+ "WHERE change_id = :change_id";
"UPDATE pending_changes SET is_error=1 WHERE change_id = :change_id";

/**
* Get descriptions of how to move from a board to its neighbours.
Expand Down Expand Up @@ -863,7 +862,7 @@ public abstract class SQLQueries {
@ResultColumn("n_errors")
protected static final String COUNT_CHANGES_FOR_JOB =
"SELECT COUNT(change_id) as n_changes, "
+ "SUM(is_error) as n_errors "
+ "COALESCE(SUM(is_error), 0) as n_errors "
+ "FROM pending_changes "
+ "WHERE job_id = :job_id AND from_state = :from_state "
+ "AND to_state = :to_state";
Expand Down

0 comments on commit 0edd0b0

Please sign in to comment.