pgsql: Make bit/varbit substring() treat any negative length as meaning - Mailing list pgsql-committers

From [email protected] (Tom Lane)
Subject pgsql: Make bit/varbit substring() treat any negative length as meaning
Date
Msg-id [email protected]
Whole thread Raw
List pgsql-committers
Log Message:
-----------
Make bit/varbit substring() treat any negative length as meaning "all the rest
of the string".  The previous coding treated only -1 that way, and would
produce an invalid result value for other negative values.

We ought to fix it so that 2-parameter bit substring() is a different C
function and the 3-parameter form throws error for negative length, but
that takes a pg_proc change which is impractical in the back branches;
and in any case somebody might be relying on -1 working this way.
So just do this as a back-patchable fix.

Tags:
----
REL8_0_STABLE

Modified Files:
--------------
    pgsql/src/backend/utils/adt:
        varbit.c (r1.44.4.2 -> r1.44.4.3)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/varbit.c?r1=1.44.4.2&r2=1.44.4.3)

pgsql-committers by date:

Previous
From: [email protected] (Tom Lane)
Date:
Subject: pgsql: Make bit/varbit substring() treat any negative length as meaning
Next
From: [email protected] (Tom Lane)
Date:
Subject: pgsql: Make bit/varbit substring() treat any negative length as meaning