Patch queue
Patch queue
От:
Bruce Momjian <pgman@candle.pha.pa.us>
Дата:
I have loaded the patch queue with all patches that were in my main mailbox: http://momjian.postgresql.org/cgi-bin/pgpatches I still have to go through the saved patches in: http:/momjian.postgresql.org/cgi-bin/pgpatches2 -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073
Re: Patch queue
От:
Joe Conway <mail@joeconway.com>
Дата:
Bruce Momjian wrote:
> I have loaded the patch queue with all patches that were in my main
> mailbox:
>
> http://momjian.postgresql.org/cgi-bin/pgpatches
I posted an alternative to this one
http://candle.pha.pa.us/mhonarc/patches/msg00004.html
for comment last night (however I can't find it in the archives -- I'll
paste it below). I was going to commit it tomorrow if I don't hear any
objections.
Joe
8<---------------------------------------------------------------------
Tom Lane wrote:> I was actually thinking it'd be best to hexify everything outside the> range 0x20 to 0x7e.>
Here's a proposed fix. Any objections?
I'm thinking this applies to 7.4 and 7.3 stable branches as well as cvs
head -- correct?
Joe
Index: doc/src/sgml/datatype.sgml
===================================================================
RCS file: /cvsroot/pgsql-server/doc/src/sgml/datatype.sgml,v
retrieving revision 1.131
diff -c -r1.131 datatype.sgml
*** doc/src/sgml/datatype.sgml 16 Nov 2003 20:29:16 -0000 1.131
--- doc/src/sgml/datatype.sgml 29 Nov 2003 05:28:38 -0000
***************
*** 1076,1084 **** strings are distinguished from characters strings by two characteristics: First, binary strings specifically allow storing octets of value zero and other non-printable
! octets. Second, operations on binary strings process the actual
! bytes, whereas the encoding and processing of character strings
! depends on locale settings.
--- 1076,1085 ---- strings are distinguished from characters strings by two characteristics: First, binary strings specifically allow storing octets of value zero and other non-printable
! octets (defined as octets outside the range 32 to 126).
! Second, operations on binary strings process the actual bytes,
! whereas the encoding and processing of character strings depends
! on locale settings.
***************
*** 1131,1144 **** \\
! Note that the result in each of the examples in was exactly one
! octet in length, even though the output representation of the zero
! octet and backslash are more than one character.
--- 1132,1156 ---- \\
+
+ 0 to 31 and 127 to 255
+ non-printable octets
+ '\\xxx'</> (octal
value)
+ SELECT '\\001'::bytea;
+ \001
+
+
! The requirement to escape non-printable octets actually
! varies depending on locale settings. In some instances you can get
away
! with leaving them unescaped. Note that the result in each of the
examples
! in was exactly one octet in
! length, even though the output representation of the zero octet and
! backslash are more than one character.
***************
*** 1206,1212 **** 32 to 126 printable octets
! ASCII representation SELECT '\\176'::bytea; ~
--- 1218,1224 ---- 32 to 126 printable octets
! client character set representation SELECT '\\176'::bytea; ~
Index: src/backend/utils/adt/varlena.c
===================================================================
RCS file: /cvsroot/pgsql-server/src/backend/utils/adt/varlena.c,v
retrieving revision 1.106
diff -c -r1.106 varlena.c
*** src/backend/utils/adt/varlena.c 25 Sep 2003 06:58:05 -0000 1.106
--- src/backend/utils/adt/varlena.c 29 Nov 2003 05:28:40 -0000
***************
*** 186,195 **** { if (*vp == '\\') len += 2;
! else if (isprint((unsigned char) *vp))
! len++;
! else len += 4; } rp = result = (char *) palloc(len); vp = VARDATA(vlena);
--- 186,195 ---- { if (*vp == '\\') len += 2;
! else if ((unsigned char) *vp < 0x20 || (unsigned char) *vp > 0x7e) len += 4;
+ else
+ len++; } rp = result = (char *) palloc(len); vp = VARDATA(vlena);
***************
*** 200,208 **** *rp++ = '\\'; *rp++ = '\\'; }
! else if (isprint((unsigned char) *vp))
! *rp++ = *vp;
! else { val = *vp; rp[0] = '\\';
--- 200,206 ---- *rp++ = '\\'; *rp++ = '\\'; }
! else if ((unsigned char) *vp < 0x20 || (unsigned char) *vp > 0x7e) { val = *vp; rp[0] = '\\';
***************
*** 213,218 ****
--- 211,218 ---- rp[1] = DIG(val & 03); rp += 4; }
+ else
+ *rp++ = *vp; } *rp = '\0'; PG_RETURN_CSTRING(result);
Index: src/interfaces/libpq/fe-exec.c
===================================================================
RCS file: /cvsroot/pgsql-server/src/interfaces/libpq/fe-exec.c,v
retrieving revision 1.153
diff -c -r1.153 fe-exec.c
*** src/interfaces/libpq/fe-exec.c 31 Oct 2003 17:43:10 -0000 1.153
--- src/interfaces/libpq/fe-exec.c 29 Nov 2003 05:28:45 -0000
***************
*** 2261,2267 **** * '\0' == ASCII 0 == \\000 * '\'' == ASCII 39 == \' * '\\' == ASCII 92 == \\\\
! * anything >= 0x80 ---> \\ooo (where ooo is an octal expression) */ unsigned char * PQescapeBytea(const unsigned char *bintext, size_t binlen, size_t
*bytealen)
--- 2261,2268 ---- * '\0' == ASCII 0 == \\000 * '\'' == ASCII 39 == \' * '\\' == ASCII 92 == \\\\
! * anything < 0x20, or > 0x7e ---> \\ooo
! * (where ooo is an octal expression) */ unsigned char * PQescapeBytea(const unsigned char *bintext, size_t binlen, size_t
*bytealen)
***************
*** 2280,2286 **** vp = bintext; for (i = binlen; i > 0; i--, vp++) {
! if (*vp == 0 || *vp >= 0x80) len += 5; /* '5' is for '\\ooo' */ else if (*vp == '\'') len += 2;
--- 2281,2287 ---- vp = bintext; for (i = binlen; i > 0; i--, vp++) {
! if (*vp < 0x20 || *vp > 0x7e) len += 5; /* '5' is for '\\ooo' */ else if (*vp == '\'') len += 2;
***************
*** 2299,2305 ****
for (i = binlen; i > 0; i--, vp++) {
! if (*vp == 0 || *vp >= 0x80) { (void) sprintf(rp, "\\\\%03o", *vp); rp += 5;
--- 2300,2306 ----
for (i = binlen; i > 0; i--, vp++) {
! if (*vp < 0x20 || *vp > 0x7e) { (void) sprintf(rp, "\\\\%03o", *vp); rp += 5;
Re: Patch queue
От:
Bruce Momjian <pgman@candle.pha.pa.us>
Дата:
Strange --- I have not seen it either.
---------------------------------------------------------------------------
Joe Conway wrote:
> Bruce Momjian wrote:
>
> > I have loaded the patch queue with all patches that were in my main
> > mailbox:
> >
> > http://momjian.postgresql.org/cgi-bin/pgpatches
>
> I posted an alternative to this one
> http://candle.pha.pa.us/mhonarc/patches/msg00004.html
> for comment last night (however I can't find it in the archives -- I'll
> paste it below). I was going to commit it tomorrow if I don't hear any
> objections.
>
> Joe
>
>
> 8<---------------------------------------------------------------------
> Tom Lane wrote:
> > I was actually thinking it'd be best to hexify everything outside the
> > range 0x20 to 0x7e.
> >
>
> Here's a proposed fix. Any objections?
>
> I'm thinking this applies to 7.4 and 7.3 stable branches as well as cvs
> head -- correct?
>
> Joe
>
>
>
> Index: doc/src/sgml/datatype.sgml
> ===================================================================
> RCS file: /cvsroot/pgsql-server/doc/src/sgml/datatype.sgml,v
> retrieving revision 1.131
> diff -c -r1.131 datatype.sgml
> *** doc/src/sgml/datatype.sgml 16 Nov 2003 20:29:16 -0000 1.131
> --- doc/src/sgml/datatype.sgml 29 Nov 2003 05:28:38 -0000
> ***************
> *** 1076,1084 ****
> strings are distinguished from characters strings by two
> characteristics: First, binary strings specifically allow storing
> octets of value zero and other non-printable
> ! octets. Second, operations on binary strings process the actual
> ! bytes, whereas the encoding and processing of character strings
> ! depends on locale settings.
>
>
>
> --- 1076,1085 ----
> strings are distinguished from characters strings by two
> characteristics: First, binary strings specifically allow storing
> octets of value zero and other non-printable
> ! octets (defined as octets outside the range 32 to 126).
> ! Second, operations on binary strings process the actual bytes,
> ! whereas the encoding and processing of character strings depends
> ! on locale settings.
>
>
>
> ***************
> *** 1131,1144 ****
> \\
>
>
>
>
>
>
>
> ! Note that the result in each of the examples in linkend="datatype-binary-sqlesc"> was exactly one
> ! octet in length, even though the output representation of the zero
> ! octet and backslash are more than one character.
>
>
>
> --- 1132,1156 ----
> \\
>
>
> +
> + 0 to 31 and 127 to 255
> + non-printable octets
> + '\\xxx'</> (octal
> value)
> + SELECT '\\001'::bytea;
> + \001
> +
> +
>
>
>
>
>
> ! The requirement to escape non-printable octets actually
> ! varies depending on locale settings. In some instances you can get
> away
> ! with leaving them unescaped. Note that the result in each of the
> examples
> ! in was exactly one octet in
> ! length, even though the output representation of the zero octet and
> ! backslash are more than one character.
>
>
>
> ***************
> *** 1206,1212 ****
>
> 32 to 126
> printable octets
> ! ASCII representation
> SELECT '\\176'::bytea;
> ~
>
> --- 1218,1224 ----
>
> 32 to 126
> printable octets
> ! client character set representation
> SELECT '\\176'::bytea;
> ~
>
> Index: src/backend/utils/adt/varlena.c
> ===================================================================
> RCS file: /cvsroot/pgsql-server/src/backend/utils/adt/varlena.c,v
> retrieving revision 1.106
> diff -c -r1.106 varlena.c
> *** src/backend/utils/adt/varlena.c 25 Sep 2003 06:58:05 -0000 1.106
> --- src/backend/utils/adt/varlena.c 29 Nov 2003 05:28:40 -0000
> ***************
> *** 186,195 ****
> {
> if (*vp == '\\')
> len += 2;
> ! else if (isprint((unsigned char) *vp))
> ! len++;
> ! else
> len += 4;
> }
> rp = result = (char *) palloc(len);
> vp = VARDATA(vlena);
> --- 186,195 ----
> {
> if (*vp == '\\')
> len += 2;
> ! else if ((unsigned char) *vp < 0x20 || (unsigned char) *vp > 0x7e)
> len += 4;
> + else
> + len++;
> }
> rp = result = (char *) palloc(len);
> vp = VARDATA(vlena);
> ***************
> *** 200,208 ****
> *rp++ = '\\';
> *rp++ = '\\';
> }
> ! else if (isprint((unsigned char) *vp))
> ! *rp++ = *vp;
> ! else
> {
> val = *vp;
> rp[0] = '\\';
> --- 200,206 ----
> *rp++ = '\\';
> *rp++ = '\\';
> }
> ! else if ((unsigned char) *vp < 0x20 || (unsigned char) *vp > 0x7e)
> {
> val = *vp;
> rp[0] = '\\';
> ***************
> *** 213,218 ****
> --- 211,218 ----
> rp[1] = DIG(val & 03);
> rp += 4;
> }
> + else
> + *rp++ = *vp;
> }
> *rp = '\0';
> PG_RETURN_CSTRING(result);
> Index: src/interfaces/libpq/fe-exec.c
> ===================================================================
> RCS file: /cvsroot/pgsql-server/src/interfaces/libpq/fe-exec.c,v
> retrieving revision 1.153
> diff -c -r1.153 fe-exec.c
> *** src/interfaces/libpq/fe-exec.c 31 Oct 2003 17:43:10 -0000 1.153
> --- src/interfaces/libpq/fe-exec.c 29 Nov 2003 05:28:45 -0000
> ***************
> *** 2261,2267 ****
> * '\0' == ASCII 0 == \\000
> * '\'' == ASCII 39 == \'
> * '\\' == ASCII 92 == \\\\
> ! * anything >= 0x80 ---> \\ooo (where ooo is an octal expression)
> */
> unsigned char *
> PQescapeBytea(const unsigned char *bintext, size_t binlen, size_t
> *bytealen)
> --- 2261,2268 ----
> * '\0' == ASCII 0 == \\000
> * '\'' == ASCII 39 == \'
> * '\\' == ASCII 92 == \\\\
> ! * anything < 0x20, or > 0x7e ---> \\ooo
> ! * (where ooo is an octal expression)
> */
> unsigned char *
> PQescapeBytea(const unsigned char *bintext, size_t binlen, size_t
> *bytealen)
> ***************
> *** 2280,2286 ****
> vp = bintext;
> for (i = binlen; i > 0; i--, vp++)
> {
> ! if (*vp == 0 || *vp >= 0x80)
> len += 5; /* '5' is for '\\ooo' */
> else if (*vp == '\'')
> len += 2;
> --- 2281,2287 ----
> vp = bintext;
> for (i = binlen; i > 0; i--, vp++)
> {
> ! if (*vp < 0x20 || *vp > 0x7e)
> len += 5; /* '5' is for '\\ooo' */
> else if (*vp == '\'')
> len += 2;
> ***************
> *** 2299,2305 ****
>
> for (i = binlen; i > 0; i--, vp++)
> {
> ! if (*vp == 0 || *vp >= 0x80)
> {
> (void) sprintf(rp, "\\\\%03o", *vp);
> rp += 5;
> --- 2300,2306 ----
>
> for (i = binlen; i > 0; i--, vp++)
> {
> ! if (*vp < 0x20 || *vp > 0x7e)
> {
> (void) sprintf(rp, "\\\\%03o", *vp);
> rp += 5;
>
>
-- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073
Re: Patch queue
От:
Bruce Momjian <pgman@candle.pha.pa.us>
Дата:
OK, I emailed him telling him you had a newer version and would email
him back once it is applied.
Basic patch application is:
notify reviewers patch will be applied shortlymake sure patch is easily retrievable by reviewersapply patchrun tools/pgtest (checks compile, warnings, and regression)notify author that patch was applied, and thank him
---------------------------------------------------------------------------
Joe Conway wrote:
> Bruce Momjian wrote:
>
> > I have loaded the patch queue with all patches that were in my main
> > mailbox:
> >
> > http://momjian.postgresql.org/cgi-bin/pgpatches
>
> I posted an alternative to this one
> http://candle.pha.pa.us/mhonarc/patches/msg00004.html
> for comment last night (however I can't find it in the archives -- I'll
> paste it below). I was going to commit it tomorrow if I don't hear any
> objections.
>
> Joe
>
>
> 8<---------------------------------------------------------------------
> Tom Lane wrote:
> > I was actually thinking it'd be best to hexify everything outside the
> > range 0x20 to 0x7e.
> >
>
> Here's a proposed fix. Any objections?
>
> I'm thinking this applies to 7.4 and 7.3 stable branches as well as cvs
> head -- correct?
>
> Joe
>
>
>
> Index: doc/src/sgml/datatype.sgml
> ===================================================================
> RCS file: /cvsroot/pgsql-server/doc/src/sgml/datatype.sgml,v
> retrieving revision 1.131
> diff -c -r1.131 datatype.sgml
> *** doc/src/sgml/datatype.sgml 16 Nov 2003 20:29:16 -0000 1.131
> --- doc/src/sgml/datatype.sgml 29 Nov 2003 05:28:38 -0000
> ***************
> *** 1076,1084 ****
> strings are distinguished from characters strings by two
> characteristics: First, binary strings specifically allow storing
> octets of value zero and other non-printable
> ! octets. Second, operations on binary strings process the actual
> ! bytes, whereas the encoding and processing of character strings
> ! depends on locale settings.
>
>
>
> --- 1076,1085 ----
> strings are distinguished from characters strings by two
> characteristics: First, binary strings specifically allow storing
> octets of value zero and other non-printable
> ! octets (defined as octets outside the range 32 to 126).
> ! Second, operations on binary strings process the actual bytes,
> ! whereas the encoding and processing of character strings depends
> ! on locale settings.
>
>
>
> ***************
> *** 1131,1144 ****
> \\
>
>
>
>
>
>
>
> ! Note that the result in each of the examples in linkend="datatype-binary-sqlesc"> was exactly one
> ! octet in length, even though the output representation of the zero
> ! octet and backslash are more than one character.
>
>
>
> --- 1132,1156 ----
> \\
>
>
> +
> + 0 to 31 and 127 to 255
> + non-printable octets
> + '\\xxx'</> (octal
> value)
> + SELECT '\\001'::bytea;
> + \001
> +
> +
>
>
>
>
>
> ! The requirement to escape non-printable octets actually
> ! varies depending on locale settings. In some instances you can get
> away
> ! with leaving them unescaped. Note that the result in each of the
> examples
> ! in was exactly one octet in
> ! length, even though the output representation of the zero octet and
> ! backslash are more than one character.
>
>
>
> ***************
> *** 1206,1212 ****
>
> 32 to 126
> printable octets
> ! ASCII representation
> SELECT '\\176'::bytea;
> ~
>
> --- 1218,1224 ----
>
> 32 to 126
> printable octets
> ! client character set representation
> SELECT '\\176'::bytea;
> ~
>
> Index: src/backend/utils/adt/varlena.c
> ===================================================================
> RCS file: /cvsroot/pgsql-server/src/backend/utils/adt/varlena.c,v
> retrieving revision 1.106
> diff -c -r1.106 varlena.c
> *** src/backend/utils/adt/varlena.c 25 Sep 2003 06:58:05 -0000 1.106
> --- src/backend/utils/adt/varlena.c 29 Nov 2003 05:28:40 -0000
> ***************
> *** 186,195 ****
> {
> if (*vp == '\\')
> len += 2;
> ! else if (isprint((unsigned char) *vp))
> ! len++;
> ! else
> len += 4;
> }
> rp = result = (char *) palloc(len);
> vp = VARDATA(vlena);
> --- 186,195 ----
> {
> if (*vp == '\\')
> len += 2;
> ! else if ((unsigned char) *vp < 0x20 || (unsigned char) *vp > 0x7e)
> len += 4;
> + else
> + len++;
> }
> rp = result = (char *) palloc(len);
> vp = VARDATA(vlena);
> ***************
> *** 200,208 ****
> *rp++ = '\\';
> *rp++ = '\\';
> }
> ! else if (isprint((unsigned char) *vp))
> ! *rp++ = *vp;
> ! else
> {
> val = *vp;
> rp[0] = '\\';
> --- 200,206 ----
> *rp++ = '\\';
> *rp++ = '\\';
> }
> ! else if ((unsigned char) *vp < 0x20 || (unsigned char) *vp > 0x7e)
> {
> val = *vp;
> rp[0] = '\\';
> ***************
> *** 213,218 ****
> --- 211,218 ----
> rp[1] = DIG(val & 03);
> rp += 4;
> }
> + else
> + *rp++ = *vp;
> }
> *rp = '\0';
> PG_RETURN_CSTRING(result);
> Index: src/interfaces/libpq/fe-exec.c
> ===================================================================
> RCS file: /cvsroot/pgsql-server/src/interfaces/libpq/fe-exec.c,v
> retrieving revision 1.153
> diff -c -r1.153 fe-exec.c
> *** src/interfaces/libpq/fe-exec.c 31 Oct 2003 17:43:10 -0000 1.153
> --- src/interfaces/libpq/fe-exec.c 29 Nov 2003 05:28:45 -0000
> ***************
> *** 2261,2267 ****
> * '\0' == ASCII 0 == \\000
> * '\'' == ASCII 39 == \'
> * '\\' == ASCII 92 == \\\\
> ! * anything >= 0x80 ---> \\ooo (where ooo is an octal expression)
> */
> unsigned char *
> PQescapeBytea(const unsigned char *bintext, size_t binlen, size_t
> *bytealen)
> --- 2261,2268 ----
> * '\0' == ASCII 0 == \\000
> * '\'' == ASCII 39 == \'
> * '\\' == ASCII 92 == \\\\
> ! * anything < 0x20, or > 0x7e ---> \\ooo
> ! * (where ooo is an octal expression)
> */
> unsigned char *
> PQescapeBytea(const unsigned char *bintext, size_t binlen, size_t
> *bytealen)
> ***************
> *** 2280,2286 ****
> vp = bintext;
> for (i = binlen; i > 0; i--, vp++)
> {
> ! if (*vp == 0 || *vp >= 0x80)
> len += 5; /* '5' is for '\\ooo' */
> else if (*vp == '\'')
> len += 2;
> --- 2281,2287 ----
> vp = bintext;
> for (i = binlen; i > 0; i--, vp++)
> {
> ! if (*vp < 0x20 || *vp > 0x7e)
> len += 5; /* '5' is for '\\ooo' */
> else if (*vp == '\'')
> len += 2;
> ***************
> *** 2299,2305 ****
>
> for (i = binlen; i > 0; i--, vp++)
> {
> ! if (*vp == 0 || *vp >= 0x80)
> {
> (void) sprintf(rp, "\\\\%03o", *vp);
> rp += 5;
> --- 2300,2306 ----
>
> for (i = binlen; i > 0; i--, vp++)
> {
> ! if (*vp < 0x20 || *vp > 0x7e)
> {
> (void) sprintf(rp, "\\\\%03o", *vp);
> rp += 5;
>
>
-- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073
Re: Patch queue
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Joe Conway writes: > I posted an alternative to this one > http://candle.pha.pa.us/mhonarc/patches/msg00004.html > for comment last night (however I can't find it in the archives -- I'll > paste it below). I was going to commit it tomorrow if I don't hear any > objections. Looks all right to me. > I'm thinking this applies to 7.4 and 7.3 stable branches as well as cvs > head -- correct? Yes. Please commit to 7.3 branch before Tuesday noon so it gets into 7.3.5 (or if you can't make that, let me know and we'll work something out). regards, tom lane