Skip to content
Snippets Groups Projects
Commit b64a7549 authored by Marc G. Fournier's avatar Marc G. Fournier
Browse files

From: "Thomas G. Lockhart" <lockhart@alumni.caltech.edu>

For substr() and substring() on the text data type, the relevant code is in
varlena.c. You are right, there is a problem. I have a patch which I will
apply to the source tree soon. The copy enclosed below probably does not
preserve tabs correctly so cannot be applied directly; the relevant change
is simply changing the ">=" to ">"...
parent 6ac25286
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.31 1998/02/26 04:37:24 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.32 1998/03/15 08:07:01 scrappy Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -291,7 +291,7 @@ text_substr(text *string, int32 m, int32 n) ...@@ -291,7 +291,7 @@ text_substr(text *string, int32 m, int32 n)
len = VARSIZE(string) - VARHDRSZ; len = VARSIZE(string) - VARHDRSZ;
/* m will now become a zero-based starting position */ /* m will now become a zero-based starting position */
if (m >= len) if (m > len)
{ {
m = 0; m = 0;
n = 0; n = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment