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
d0a6042f
Commit
d0a6042f
authored
Dec 17, 2004
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make array_cat more paranoid about checking datatypes in empty arrays.
parent
bd3bc407
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
src/backend/utils/adt/array_userfuncs.c
src/backend/utils/adt/array_userfuncs.c
+17
-17
No files found.
src/backend/utils/adt/array_userfuncs.c
View file @
d0a6042f
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Copyright (c) 2003, PostgreSQL Global Development Group
* Copyright (c) 2003, PostgreSQL Global Development Group
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/adt/array_userfuncs.c,v 1.1
3 2004/08/29 05:06:49 momjian
Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/array_userfuncs.c,v 1.1
4 2004/12/17 20:59:58 tgl
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -165,6 +165,22 @@ array_cat(PG_FUNCTION_ARGS)
...
@@ -165,6 +165,22 @@ array_cat(PG_FUNCTION_ARGS)
v1
=
PG_GETARG_ARRAYTYPE_P
(
0
);
v1
=
PG_GETARG_ARRAYTYPE_P
(
0
);
v2
=
PG_GETARG_ARRAYTYPE_P
(
1
);
v2
=
PG_GETARG_ARRAYTYPE_P
(
1
);
element_type1
=
ARR_ELEMTYPE
(
v1
);
element_type2
=
ARR_ELEMTYPE
(
v2
);
/* Check we have matching element types */
if
(
element_type1
!=
element_type2
)
ereport
(
ERROR
,
(
errcode
(
ERRCODE_DATATYPE_MISMATCH
),
errmsg
(
"cannot concatenate incompatible arrays"
),
errdetail
(
"Arrays with element types %s and %s are not "
"compatible for concatenation."
,
format_type_be
(
element_type1
),
format_type_be
(
element_type2
))));
/* OK, use it */
element_type
=
element_type1
;
/*----------
/*----------
* We must have one of the following combinations of inputs:
* We must have one of the following combinations of inputs:
* 1) one empty array, and one non-empty array
* 1) one empty array, and one non-empty array
...
@@ -200,22 +216,6 @@ array_cat(PG_FUNCTION_ARGS)
...
@@ -200,22 +216,6 @@ array_cat(PG_FUNCTION_ARGS)
"compatible for concatenation."
,
"compatible for concatenation."
,
ndims1
,
ndims2
)));
ndims1
,
ndims2
)));
element_type1
=
ARR_ELEMTYPE
(
v1
);
element_type2
=
ARR_ELEMTYPE
(
v2
);
/* Check we have matching element types */
if
(
element_type1
!=
element_type2
)
ereport
(
ERROR
,
(
errcode
(
ERRCODE_DATATYPE_MISMATCH
),
errmsg
(
"cannot concatenate incompatible arrays"
),
errdetail
(
"Arrays with element types %s and %s are not "
"compatible for concatenation."
,
format_type_be
(
element_type1
),
format_type_be
(
element_type2
))));
/* OK, use it */
element_type
=
element_type1
;
/* get argument array details */
/* get argument array details */
lbs1
=
ARR_LBOUND
(
v1
);
lbs1
=
ARR_LBOUND
(
v1
);
lbs2
=
ARR_LBOUND
(
v2
);
lbs2
=
ARR_LBOUND
(
v2
);
...
...
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