Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
bd3bc407
Commit
bd3bc407
authored
Dec 17, 2004
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
array_map failed to insert correct result type in an empty array.
Per example from Florian Pflug.
parent
92c001bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
src/backend/utils/adt/arrayfuncs.c
src/backend/utils/adt/arrayfuncs.c
+10
-9
No files found.
src/backend/utils/adt/arrayfuncs.c
View file @
bd3bc407
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.11
3 2004/09/27 01:39:02
tgl Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.11
4 2004/12/17 20:58:26
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -2241,7 +2241,13 @@ array_map(FunctionCallInfo fcinfo, Oid inpType, Oid retType)
/* Check for empty array */
if
(
nitems
<=
0
)
PG_RETURN_ARRAYTYPE_P
(
v
);
{
/* Return empty array */
result
=
(
ArrayType
*
)
palloc0
(
sizeof
(
ArrayType
));
result
->
size
=
sizeof
(
ArrayType
);
result
->
elemtype
=
retType
;
PG_RETURN_ARRAYTYPE_P
(
result
);
}
/*
* We arrange to look up info about input and return element types
...
...
@@ -2425,14 +2431,9 @@ construct_md_array(Datum *elems,
if
(
ndims
==
0
)
{
/* Allocate and initialize 0-D result array */
nbytes
=
ARR_OVERHEAD
(
ndims
);
result
=
(
ArrayType
*
)
palloc
(
nbytes
);
result
->
size
=
nbytes
;
result
->
ndim
=
ndims
;
result
->
flags
=
0
;
result
=
(
ArrayType
*
)
palloc0
(
sizeof
(
ArrayType
));
result
->
size
=
sizeof
(
ArrayType
);
result
->
elemtype
=
elmtype
;
return
result
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment