mirror of
https://github.com/postgres/postgres.git
synced 2025-11-22 12:22:45 +03:00
Make SQL arrays support null elements. This commit fixes the core array
functionality, but I still need to make another pass looking at places that incidentally use arrays (such as ACL manipulation) to make sure they are null-safe. Contrib needs work too. I have not changed the behaviors that are still under discussion about array comparison and what to do with lower bounds.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/catalog/pg_proc.c,v 1.135 2005/10/29 00:31:50 petere Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/catalog/pg_proc.c,v 1.136 2005/11/17 22:14:51 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -119,12 +119,15 @@ ProcedureCreate(const char *procedureName,
|
||||
* need to use deconstruct_array() since the array data is just going
|
||||
* to look like a C array of OID values.
|
||||
*/
|
||||
allParamCount = ARR_DIMS(DatumGetPointer(allParameterTypes))[0];
|
||||
if (ARR_NDIM(DatumGetPointer(allParameterTypes)) != 1 ||
|
||||
ArrayType *allParamArray = (ArrayType *) DatumGetPointer(allParameterTypes);
|
||||
|
||||
allParamCount = ARR_DIMS(allParamArray)[0];
|
||||
if (ARR_NDIM(allParamArray) != 1 ||
|
||||
allParamCount <= 0 ||
|
||||
ARR_ELEMTYPE(DatumGetPointer(allParameterTypes)) != OIDOID)
|
||||
ARR_HASNULL(allParamArray) ||
|
||||
ARR_ELEMTYPE(allParamArray) != OIDOID)
|
||||
elog(ERROR, "allParameterTypes is not a 1-D Oid array");
|
||||
allParams = (Oid *) ARR_DATA_PTR(DatumGetPointer(allParameterTypes));
|
||||
allParams = (Oid *) ARR_DATA_PTR(allParamArray);
|
||||
Assert(allParamCount >= parameterCount);
|
||||
/* we assume caller got the contents right */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user