]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Decode V3 notice messages instead of leaving them in raw form.
authorKris Jurka <books@ejurka.com>
Wed, 11 Aug 2004 06:56:00 +0000 (06:56 +0000)
committerKris Jurka <books@ejurka.com>
Wed, 11 Aug 2004 06:56:00 +0000 (06:56 +0000)
From Donald Fraser.

src/interfaces/jdbc/org/postgresql/core/QueryExecutor.java
src/interfaces/jdbc/org/postgresql/fastpath/Fastpath.java
src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java

index 00f0211a7414530120bd922f28d889ccdeda592e..f5964d1caf21bc4c914fdc5899ee331c9321ad0b 100644 (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());
index dd0dd7f9f0beeed14f030507d4ab2d2ab92080c8..5a30422e6faef068396527bd50b675c24238a6d3 100644 (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':
index 42e893ba2ffb76097a3b63ccfa1831ade3c0a643..94ec4e6d2e9fd651b62948ace8c761eb1f54ae83 100644 (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