Skip site navigation (1) Skip section navigation (2)

Re: bug in array contrib

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: Massimo Dal Zotto <dz(at)wizard(dot)net>
Cc: PostgreSQL Hackers <hackers(at)postgreSQL(dot)org>, Pgsql Patches <pgsql-patches(at)postgreSQL(dot)org>
Subject: Re: bug in array contrib
Date: 1999-09-27 20:39:40
Message-ID: 199909272039.QAA16543@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
This shows as already applied.


> Hi,
> 
> there is a bug in my array contrib. The varchar and bpchar function don't
> work correctly. The following patch (for 6.5.1) fixes the problem.
> 
> *** contrib/array/array_iterator.c.orig	Sat Jun  5 21:09:35 1999
> --- contrib/array/array_iterator.c	Tue Aug 31 11:22:44 1999
> ***************
> *** 6,14 ****
>    * elements of the array and the value and compute a result as
>    * the logical OR or AND of the iteration results.
>    *
> !  * Copyright (c) 1997, Massimo Dal Zotto <dz(at)cs(dot)unitn(dot)it>
>    * ported to postgreSQL 6.3.2,added oid_functions, 18.1.1999,
>    * Tobias Gabele <gabele(at)wiz(dot)uni-kassel(dot)de>
>    */
>   
>   #include <ctype.h>
> --- 6,17 ----
>    * elements of the array and the value and compute a result as
>    * the logical OR or AND of the iteration results.
>    *
> !  * Copyright (C) 1999, Massimo Dal Zotto <dz(at)cs(dot)unitn(dot)it>
>    * ported to postgreSQL 6.3.2,added oid_functions, 18.1.1999,
>    * Tobias Gabele <gabele(at)wiz(dot)uni-kassel(dot)de>
> +  *
> +  * This software is distributed under the GNU General Public License
> +  * either version 2, or (at your option) any later version.
>    */
>   
>   #include <ctype.h>
> ***************
> *** 180,186 ****
>   int32
>   array_varchareq(ArrayType *array, char *value)
>   {
> ! 	return array_iterator((Oid) 20,		/* varchar */
>   						  (Oid) 1070,	/* varchareq */
>   						  0,			/* logical or */
>   						  array, (Datum) value);
> --- 183,189 ----
>   int32
>   array_varchareq(ArrayType *array, char *value)
>   {
> ! 	return array_iterator((Oid) 1043,	/* varchar */
>   						  (Oid) 1070,	/* varchareq */
>   						  0,			/* logical or */
>   						  array, (Datum) value);
> ***************
> *** 189,195 ****
>   int32
>   array_all_varchareq(ArrayType *array, char *value)
>   {
> ! 	return array_iterator((Oid) 20,		/* varchar */
>   						  (Oid) 1070,	/* varchareq */
>   						  1,			/* logical and */
>   						  array, (Datum) value);
> --- 192,198 ----
>   int32
>   array_all_varchareq(ArrayType *array, char *value)
>   {
> ! 	return array_iterator((Oid) 1043,	/* varchar */
>   						  (Oid) 1070,	/* varchareq */
>   						  1,			/* logical and */
>   						  array, (Datum) value);
> ***************
> *** 198,204 ****
>   int32
>   array_varcharregexeq(ArrayType *array, char *value)
>   {
> ! 	return array_iterator((Oid) 20,		/* varchar */
>   						  (Oid) 1254,	/* textregexeq */
>   						  0,			/* logical or */
>   						  array, (Datum) value);
> --- 201,207 ----
>   int32
>   array_varcharregexeq(ArrayType *array, char *value)
>   {
> ! 	return array_iterator((Oid) 1043,	/* varchar */
>   						  (Oid) 1254,	/* textregexeq */
>   						  0,			/* logical or */
>   						  array, (Datum) value);
> ***************
> *** 207,213 ****
>   int32
>   array_all_varcharregexeq(ArrayType *array, char *value)
>   {
> ! 	return array_iterator((Oid) 20,		/* varchar */
>   						  (Oid) 1254,	/* textregexeq */
>   						  1,			/* logical and */
>   						  array, (Datum) value);
> --- 210,216 ----
>   int32
>   array_all_varcharregexeq(ArrayType *array, char *value)
>   {
> ! 	return array_iterator((Oid) 1043,	/* varchar */
>   						  (Oid) 1254,	/* textregexeq */
>   						  1,			/* logical and */
>   						  array, (Datum) value);
> ***************
> *** 221,227 ****
>   int32
>   array_bpchareq(ArrayType *array, char *value)
>   {
> ! 	return array_iterator((Oid) 20,		/* bpchar */
>   						  (Oid) 1048,	/* bpchareq */
>   						  0,			/* logical or */
>   						  array, (Datum) value);
> --- 224,230 ----
>   int32
>   array_bpchareq(ArrayType *array, char *value)
>   {
> ! 	return array_iterator((Oid) 1042,	/* bpchar */
>   						  (Oid) 1048,	/* bpchareq */
>   						  0,			/* logical or */
>   						  array, (Datum) value);
> ***************
> *** 230,236 ****
>   int32
>   array_all_bpchareq(ArrayType *array, char *value)
>   {
> ! 	return array_iterator((Oid) 20,		/* bpchar */
>   						  (Oid) 1048,	/* bpchareq */
>   						  1,			/* logical and */
>   						  array, (Datum) value);
> --- 233,239 ----
>   int32
>   array_all_bpchareq(ArrayType *array, char *value)
>   {
> ! 	return array_iterator((Oid) 1042,	/* bpchar */
>   						  (Oid) 1048,	/* bpchareq */
>   						  1,			/* logical and */
>   						  array, (Datum) value);
> ***************
> *** 239,245 ****
>   int32
>   array_bpcharregexeq(ArrayType *array, char *value)
>   {
> ! 	return array_iterator((Oid) 20,		/* bpchar */
>   						  (Oid) 1254,	/* textregexeq */
>   						  0,			/* logical or */
>   						  array, (Datum) value);
> --- 242,248 ----
>   int32
>   array_bpcharregexeq(ArrayType *array, char *value)
>   {
> ! 	return array_iterator((Oid) 1042,	/* bpchar */
>   						  (Oid) 1254,	/* textregexeq */
>   						  0,			/* logical or */
>   						  array, (Datum) value);
> ***************
> *** 248,254 ****
>   int32
>   array_all_bpcharregexeq(ArrayType *array, char *value)
>   {
> ! 	return array_iterator((Oid) 20,		/* bpchar */
>   						  (Oid) 1254,	/* textregexeq */
>   						  1,			/* logical and */
>   						  array, (Datum) value);
> --- 251,257 ----
>   int32
>   array_all_bpcharregexeq(ArrayType *array, char *value)
>   {
> ! 	return array_iterator((Oid) 1042,	/* bpchar */
>   						  (Oid) 1254,	/* textregexeq */
>   						  1,			/* logical and */
>   						  array, (Datum) value);
> 
> -- 
> Massimo Dal Zotto
> 
> +----------------------------------------------------------------------+
> |  Massimo Dal Zotto               email: dz(at)cs(dot)unitn(dot)it               |
> |  Via Marconi, 141                phone: ++39-0461534251              |
> |  38057 Pergine Valsugana (TN)      www: http://www.cs.unitn.it/~dz/  |
> |  Italy                             pgp: finger dz(at)tango(dot)cs(dot)unitn(dot)it  |
> +----------------------------------------------------------------------+
> 


-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist(at)candle(dot)pha(dot)pa(dot)us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

In response to

pgsql-hackers by date

Next:From: Bruce MomjianDate: 1999-09-27 20:41:08
Subject: Re: [HACKERS] PostgreSQL 6.5.2
Previous:From: Bruce MomjianDate: 1999-09-27 20:36:05
Subject: Re: [HACKERS] PostgreSQL 6.5.2

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group