Skip to content

Commit

Permalink
Revert "try to read any notifies or errors that come in asynchronousl…
Browse files Browse the repository at this point in the history
…y" (#2276)

* Revert "fix: try to read any notifies or errors that come in asynchronously (#2143)"

This reverts commit b3d5fba.

* fix spacing on GSS_ENC_MODE (#2280)
  • Loading branch information
davecramer committed Oct 7, 2021
1 parent ab228ed commit c4c35d1
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 96 deletions.
26 changes: 2 additions & 24 deletions pgjdbc/src/main/java/org/postgresql/core/v3/QueryExecutorImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -305,19 +305,7 @@ public synchronized void execute(Query query, @Nullable ParameterList parameters
LOGGER.log(Level.FINEST, " simple execute, handler={0}, maxRows={1}, fetchSize={2}, flags={3}",
new Object[]{handler, maxRows, fetchSize, flags});
}
try {
if (pgStream.hasMessagePending()) {
if (pgStream.peekChar() == 'N') {
pgStream.receiveChar();
handler.handleWarning(receiveNoticeResponse());
} else if (pgStream.peekChar() == 'E') {
pgStream.receiveChar();
throw receiveErrorResponse();
}
}
} catch ( IOException ex ) {
throw new SQLException(ex);
}

if (parameters == null) {
parameters = SimpleQuery.NO_PARAMETERS;
}
Expand Down Expand Up @@ -2386,7 +2374,6 @@ protected void processResults(ResultHandler handler, int flags, boolean adaptive
}

case 'N': // Notice Response
LOGGER.log(Level.FINEST, " <=BE Notice");
SQLWarning warning = receiveNoticeResponse();
handler.handleWarning(warning);
break;
Expand Down Expand Up @@ -2444,16 +2431,7 @@ && castNonNull(pendingExecuteQueue.peekFirst()).asSimple) {
}
}
endQuery = true;
if (pgStream.hasMessagePending()) {
if (pgStream.peekChar() == 'N') {
pgStream.receiveChar();
handler.handleWarning(receiveNoticeResponse());
}
if (pgStream.peekChar() == 'E') {
pgStream.receiveChar();
handler.handleError(receiveErrorResponse());
}
}

// Reset the statement name of Parses that failed.
while (!pendingParseQueue.isEmpty()) {
SimpleQuery failedQuery = pendingParseQueue.removeFirst();
Expand Down
2 changes: 0 additions & 2 deletions pgjdbc/src/main/java/org/postgresql/util/PSQLState.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ public enum PSQLState {
SYSTEM_ERROR("60000"),
IO_ERROR("58030"),

ERROR_CODE_CRASH_SHUTDOWN("57P02"),

UNEXPECTED_ERROR("99999");

private final String state;
Expand Down
3 changes: 1 addition & 2 deletions pgjdbc/src/test/java/org/postgresql/test/jdbc2/CopyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,7 @@ public void testLockReleaseOnCancelFailure() throws SQLException, InterruptedExc
if (rollbackException == null) {
fail("rollback should have thrown an exception");
}

assertTrue( rollbackException instanceof SQLException);
acceptIOCause(rollbackException);
}

private static class Rollback extends Thread {
Expand Down
68 changes: 0 additions & 68 deletions pgjdbc/src/test/java/org/postgresql/test/jdbc4/TestTerminate.java

This file was deleted.

0 comments on commit c4c35d1

Please sign in to comment.