Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit f0445dc

Browse files
committed
> It seems there is a mistake in substr function:
> then you try get substr, which consists only of last char in string > you get all string > > For example: > userbase=> select substr('123456', 6,1) ; > substr > ------ > 123456 > (1 row) > From Edmund Mergl <E.Mergl@bawue.de>
1 parent fc79509 commit f0445dc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/utils/adt/oracle_compat.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* Edmund Mergl <E.Mergl@bawue.de>
33
*
4-
* $Id: oracle_compat.c,v 1.10 1997/09/08 21:48:39 momjian Exp $
4+
* $Id: oracle_compat.c,v 1.11 1998/01/13 03:49:51 scrappy Exp $
55
*
66
*/
77

@@ -512,7 +512,7 @@ substr(text *string, int4 m, int4 n)
512512

513513
if ((string == (text *) NULL) ||
514514
(m <= 0) || (n <= 0) ||
515-
((len = VARSIZE(string) - VARHDRSZ - m) <= 0))
515+
((len = VARSIZE(string) - VARHDRSZ - m + 1) <= 0))
516516
return string;
517517

518518
len = len + 1 < n ? len + 1 : n;

0 commit comments

Comments
 (0)