[PATCH] Comments in PGbytea byte[] to pgstring conversion - Mailing list pgsql-jdbc

From Michael Paesold
Subject [PATCH] Comments in PGbytea byte[] to pgstring conversion
Date
Msg-id 454E577E.3040904@gmx.at
Whole thread Raw
Responses Re: [PATCH] Comments in PGbytea byte[] to pgstring conversion
List pgsql-jdbc
Change the comments in org.postgresql.util.PGbytea to clarify that the
backslashes are given twice as often as required by the backend because
of how Java processes string literals (and not because of the backend's
parser).

Best Regards
Michael Paesold
diff -crN pgjdbc.bb8feffc6a34/org/postgresql/util/PGbytea.java pgjdbc/org/postgresql/util/PGbytea.java
*** pgjdbc.bb8feffc6a34/org/postgresql/util/PGbytea.java    2006-11-05 22:23:38.000000000 +0100
--- pgjdbc/org/postgresql/util/PGbytea.java    2006-11-05 22:23:38.000000000 +0100
***************
*** 116,122 ****
              if (l_int < 040 || l_int > 0176)
              {
                  //escape charcter with the form \000, but need two \\ because of
!                 //the parser
                  l_strbuf.append("\\");
                  l_strbuf.append((char)(((l_int >> 6) & 0x3) + 48));
                  l_strbuf.append((char)(((l_int >> 3) & 0x7) + 48));
--- 116,122 ----
              if (l_int < 040 || l_int > 0176)
              {
                  //escape charcter with the form \000, but need two \\ because of
!                 //the Java parser
                  l_strbuf.append("\\");
                  l_strbuf.append((char)(((l_int >> 6) & 0x3) + 48));
                  l_strbuf.append((char)(((l_int >> 3) & 0x7) + 48));
***************
*** 125,131 ****
              else if (p_buf[i] == (byte)'\\')
              {
                  //escape the backslash character as \\, but need four \\\\ because
!                 //of the parser
                  l_strbuf.append("\\\\");
              }
              else
--- 125,131 ----
              else if (p_buf[i] == (byte)'\\')
              {
                  //escape the backslash character as \\, but need four \\\\ because
!                 //of the Java parser
                  l_strbuf.append("\\\\");
              }
              else

pgsql-jdbc by date:

Previous
From: Michael Paesold
Date:
Subject: [PATCH] Escaping of SAVEPOINT names
Next
From: Kris Jurka
Date:
Subject: Re: [PATCH] Escaping of SAVEPOINT names