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/fastpath/Fastpath.java
src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java

index 166949309a2eed400935ece5da0b915f3335d96a..31192fcf22a6cd35464784859c28264ceebcbdea 100644 (file)
@@ -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 19bd01aae59d9cd3aba417bb4233f8555812f638..c514d98b8df6bd6c5c1e0164e3a5ef8e705d6b7f 100644 (file)
@@ -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