diff options
author | Marc G. Fournier <scrappy@hub.org> | 1998-03-15 08:07:01 +0000 |
---|---|---|
committer | Marc G. Fournier <scrappy@hub.org> | 1998-03-15 08:07:01 +0000 |
commit | b64a7549b4c2e459e1d64b1d5cc94f4f5998f503 (patch) | |
tree | fe6a9b2bcf39ddc3dc53895fd0daabf2d652d9b2 | |
parent | 6ac2528616697eb2d155ff693874e37c7273b797 (diff) | |
download | postgresql-b64a7549b4c2e459e1d64b1d5cc94f4f5998f503.tar.gz postgresql-b64a7549b4c2e459e1d64b1d5cc94f4f5998f503.zip |
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 ">"...
-rw-r--r-- | src/backend/utils/adt/varlena.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/utils/adt/varlena.c b/src/backend/utils/adt/varlena.c index a6b45d20938..c45a5d9a2e3 100644 --- a/src/backend/utils/adt/varlena.c +++ b/src/backend/utils/adt/varlena.c @@ -7,7 +7,7 @@ * * * 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) len = VARSIZE(string) - VARHDRSZ; /* m will now become a zero-based starting position */ - if (m >= len) + if (m > len) { m = 0; n = 0; |