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

Commit54cc549

Browse files
author
Dave Cramer
committed
modifications to the way the protocol is handled to be consistent with
QueryExecutor. This includes:1) only exit after we receive a 'Z' packet2) append error messages to a buffer and throw the exception at the end
1 parent0092322 commit54cc549

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

‎src/interfaces/jdbc/org/postgresql/fastpath/Fastpath.java

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ public Object fastpath(int fnid, boolean resulttype, FastpathArg[] args) throws
9898

9999
// Now loop, reading the results
100100
Objectresult =null;// our result
101-
while (true)
101+
StringBuffererrorMessage =null;
102+
booleanloop =true;
103+
while (loop)
102104
{
103105
intin =stream.ReceiveChar();
104106
//DriverManager.println("ReceiveChar() = "+in+" '"+((char)in)+"'");
@@ -128,8 +130,10 @@ public Object fastpath(int fnid, boolean resulttype, FastpathArg[] args) throws
128130
//------------------------------
129131
// Error message returned
130132
case'E':
131-
thrownewPSQLException("postgresql.fp.error",stream.ReceiveString(conn.getEncoding()));
132-
133+
if (errorMessage ==null )
134+
errorMessage =newStringBuffer();
135+
errorMessage.append(stream.ReceiveString(conn.getEncoding()));
136+
break;
133137
//------------------------------
134138
// Notice from backend
135139
case'N':
@@ -143,15 +147,22 @@ public Object fastpath(int fnid, boolean resulttype, FastpathArg[] args) throws
143147
// processed earlier. If no result, this already contains null
144148
case'0':
145149
//DriverManager.println("returning "+result);
146-
returnresult;
147-
150+
//return result;
151+
break;
148152
case'Z':
153+
// cause the loop to exit
154+
loop =false;
149155
break;
150156

151157
default:
152158
thrownewPSQLException("postgresql.fp.protocol",newCharacter((char)in));
153159
}
154160
}
161+
162+
if (errorMessage !=null )
163+
thrownewPSQLException("postgresql.fp.error",errorMessage.toString());
164+
165+
returnresult;
155166
}
156167
}
157168

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp