patch for Oracle initcap compatibility
This makes the initcap function compatible with Oracle 9i, it has been
tested on both redhat 8 and FreebSD.
--
Mike Nolan
RCS file: /projects/cvsroot/pgsql-server/src/backend/utils/adt/oracle_compat.c,v
retrieving revision 1.44
diff -c -r1.44 oracle_compat.c
*** oracle_compat.c 23 May 2003 22:33:20 -0000 1.44
--- oracle_compat.c 17 Jul 2003 08:03:41 -0000
***************
*** 132,138 ****
while (m-- > 0)
{
! if (isspace((unsigned char) ptr[-1]))
*ptr = toupper((unsigned char) *ptr);
else
*ptr = tolower((unsigned char) *ptr);
--- 132,139 ----
while (m-- > 0)
{
! /* Oracle capitalizes after all non-alphanumeric */
! if (!isalnum((unsigned char) ptr[-1]))
*ptr = toupper((unsigned char) *ptr);
else
*ptr = tolower((unsigned char) *ptr);
Your patch has been added to the PostgreSQL unapplied patches list at:
http://momjian.postgresql.org/cgi-bin/pgpatches
I will try to apply it within the next 48 hours.
---------------------------------------------------------------------------
nolan@celery.tssi.com wrote:
This makes the initcap function compatible with Oracle 9i, it has been
tested on both redhat 8 and FreebSD.
--
Mike NolanRCS file: /projects/cvsroot/pgsql-server/src/backend/utils/adt/oracle_compat.c,v retrieving revision 1.44 diff -c -r1.44 oracle_compat.c *** oracle_compat.c 23 May 2003 22:33:20 -0000 1.44 --- oracle_compat.c 17 Jul 2003 08:03:41 -0000 *************** *** 132,138 ****while (m-- > 0) { ! if (isspace((unsigned char) ptr[-1])) *ptr = toupper((unsigned char) *ptr); else *ptr = tolower((unsigned char) *ptr); --- 132,139 ----while (m-- > 0)
{
! /* Oracle capitalizes after all non-alphanumeric */
! if (!isalnum((unsigned char) ptr[-1]))
*ptr = toupper((unsigned char) *ptr);
else
*ptr = tolower((unsigned char) *ptr);---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
Patch applied. Thanks.
---------------------------------------------------------------------------
nolan@celery.tssi.com wrote:
This makes the initcap function compatible with Oracle 9i, it has been
tested on both redhat 8 and FreebSD.
--
Mike NolanRCS file: /projects/cvsroot/pgsql-server/src/backend/utils/adt/oracle_compat.c,v retrieving revision 1.44 diff -c -r1.44 oracle_compat.c *** oracle_compat.c 23 May 2003 22:33:20 -0000 1.44 --- oracle_compat.c 17 Jul 2003 08:03:41 -0000 *************** *** 132,138 ****while (m-- > 0) { ! if (isspace((unsigned char) ptr[-1])) *ptr = toupper((unsigned char) *ptr); else *ptr = tolower((unsigned char) *ptr); --- 132,139 ----while (m-- > 0)
{
! /* Oracle capitalizes after all non-alphanumeric */
! if (!isalnum((unsigned char) ptr[-1]))
*ptr = toupper((unsigned char) *ptr);
else
*ptr = tolower((unsigned char) *ptr);---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073