Decode V3 notice messages instead of leaving them in raw form.

From Donald Fraser.
This commit is contained in:
Kris Jurka 2004-08-11 06:56:00 +00:00
parent af8e9a44fe
commit 8120dc536a
3 changed files with 9 additions and 6 deletions

View File

@ -6,7 +6,7 @@
* Copyright (c) 2003, PostgreSQL Global Development Group
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/core/Attic/QueryExecutor.java,v 1.27.2.2 2004/03/29 17:47:47 barry Exp $
* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/core/Attic/QueryExecutor.java,v 1.27.2.3 2004/08/11 06:56:00 jurka Exp $
*
*-------------------------------------------------------------------------
*/
@ -164,7 +164,8 @@ public class QueryExecutor
break;
case 'N': // Error Notification
int l_nlen = pgStream.ReceiveIntegerR(4);
statement.addWarning(connection.getEncoding().decode(pgStream.Receive(l_nlen-4)));
PSQLException notify = PSQLException.parseServerError(connection.getEncoding().decode(pgStream.Receive(l_nlen-4)));
statement.addWarning(notify.getMessage());
break;
case 'P': // Portal Name
String pname = pgStream.ReceiveString(connection.getEncoding());

View File

@ -6,7 +6,7 @@
* Copyright (c) 2003, PostgreSQL Global Development Group
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/fastpath/Attic/Fastpath.java,v 1.16.2.3 2004/02/03 05:43:22 jurka Exp $
* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/fastpath/Attic/Fastpath.java,v 1.16.2.4 2004/08/11 06:56:00 jurka Exp $
*
*-------------------------------------------------------------------------
*/
@ -142,7 +142,8 @@ public class Fastpath
// Notice from backend
case 'N':
int l_nlen = stream.ReceiveIntegerR(4);
conn.addWarning(conn.getEncoding().decode(stream.Receive(l_nlen-4)));
PSQLException notify = PSQLException.parseServerError(conn.getEncoding().decode(stream.Receive(l_nlen-4)));
conn.addWarning(notify.getMessage());
break;
case 'V':

View File

@ -9,7 +9,7 @@
* Copyright (c) 2003, PostgreSQL Global Development Group
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1Connection.java,v 1.27.2.3 2004/06/22 09:37:03 jurka Exp $
* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1Connection.java,v 1.27.2.4 2004/08/11 06:56:00 jurka Exp $
*
*-------------------------------------------------------------------------
*/
@ -460,7 +460,8 @@ public abstract class AbstractJdbc1Connection implements BaseConnection
throw new PSQLException("postgresql.con.backend", PSQLState.CONNECTION_UNABLE_TO_CONNECT, PSQLException.parseServerError(encoding.decode(pgStream.Receive(l_elen-4))));
case 'N':
int l_nlen = pgStream.ReceiveIntegerR(4);
addWarning(encoding.decode(pgStream.Receive(l_nlen-4)));
PSQLException notify = PSQLException.parseServerError(encoding.decode(pgStream.Receive(l_nlen-4)));
addWarning(notify.getMessage());
break;
case 'S':
//TODO: handle parameter status messages