Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitff2f9b6

Browse files
author
Dave Cramer
committed
fixed cancel query bug introduced by patch
1 parentb7cc409 commitff2f9b6

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

‎src/interfaces/jdbc/org/postgresql/Connection.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
importorg.postgresql.core.*;
1212

1313
/*
14-
* $Id: Connection.java,v 1.41 2002/02/26 02:15:54 davec Exp $
14+
* $Id: Connection.java,v 1.42 2002/03/05 18:00:36 davec Exp $
1515
*
1616
* This abstract class is used by org.postgresql.Driver to open either the JDBC1 or
1717
* JDBC2 versions of the Connection class.
@@ -315,16 +315,6 @@ protected void openConnection(String host, int port, Properties info, String dat
315315
switch (beresp)
316316
{
317317
case'Z':
318-
319-
try
320-
{
321-
pg_stream.SendChar('Q');
322-
pg_stream.SendChar(' ');
323-
pg_stream.SendChar(0);
324-
pg_stream.flush();
325-
}catch (IOExceptione) {
326-
thrownewPSQLException("postgresql.con.ioerror",e);
327-
}
328318
break;
329319
case'E':
330320
case'N':

‎src/interfaces/jdbc/org/postgresql/core/QueryExecutor.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* <p>The lifetime of a QueryExecutor object is from sending the query
1414
* until the response has been received from the backend.
1515
*
16-
* $Id: QueryExecutor.java,v 1.6 2001/11/25 23:26:56 barry Exp $
16+
* $Id: QueryExecutor.java,v 1.7 2002/03/05 18:01:27 davec Exp $
1717
*/
1818

1919
publicclassQueryExecutor
@@ -57,6 +57,7 @@ public java.sql.ResultSet execute() throws SQLException
5757

5858
intfqp =0;
5959
booleanhfr =false;
60+
intlastMessage =0;
6061

6162
synchronized (pg_stream)
6263
{
@@ -112,11 +113,26 @@ public java.sql.ResultSet execute() throws SQLException
112113
receiveFields();
113114
break;
114115
case'Z':// backend ready for query, ignore for now :-)
116+
if (lastMessage =='Z' )
117+
{
118+
try
119+
{
120+
pg_stream.SendChar('Q');
121+
pg_stream.SendChar(' ');
122+
pg_stream.SendChar(0);
123+
pg_stream.flush();
124+
}catch (IOExceptione) {
125+
thrownewPSQLException("postgresql.con.ioerror",e);
126+
}
127+
fqp++;
128+
}
129+
115130
break;
116131
default:
117132
thrownewPSQLException("postgresql.con.type",
118133
newCharacter((char)c));
119134
}
135+
lastMessage =c;
120136
}
121137
returnconnection.getResultSet(connection,statement,fields,tuples,status,update_count,insert_oid,binaryCursor);
122138
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp