Commit 0edf928f authored by Peter Eisentraut's avatar Peter Eisentraut

Fix for bitsubstr when third argument is missing (i.e., -1).

From Adriaan Joubert <a.joubert@albourne.com>
parent cf4ad01d
......@@ -9,7 +9,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varbit.c,v 1.13 2000/11/18 16:18:41 petere Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varbit.c,v 1.14 2000/11/22 13:35:35 petere Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -764,6 +764,9 @@ bitsubstr(PG_FUNCTION_ARGS)
*ps;
bitlen = VARBITLEN(arg);
/* If we do not have an upper bound, set bitlen */
if (l==-1)
l = bitlen;
e = s + l;
s1 = Max(s, 1);
e1 = Min(e, bitlen + 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment