Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
19c4e862
Commit
19c4e862
authored
May 17, 1999
by
Bruce Momjian
Browse files
Options
Downloads
Patches
Plain Diff
Skip junk nodes when comparing UNION target list lengths.
parent
585c9677
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/backend/parser/parse_clause.c
+11
-2
11 additions, 2 deletions
src/backend/parser/parse_clause.c
src/backend/rewrite/rewriteHandler.c
+14
-5
14 additions, 5 deletions
src/backend/rewrite/rewriteHandler.c
with
25 additions
and
7 deletions
src/backend/parser/parse_clause.c
+
11
−
2
View file @
19c4e862
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.3
3
1999/05/17 1
7:03:32
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.3
4
1999/05/17 1
8:22:18
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -767,8 +767,17 @@ transformUnionClause(List *unionClause, List *targetlist)
...
@@ -767,8 +767,17 @@ transformUnionClause(List *unionClause, List *targetlist)
Query
*
query
=
(
Query
*
)
lfirst
(
qlist_item
);
Query
*
query
=
(
Query
*
)
lfirst
(
qlist_item
);
List
*
prev_target
=
targetlist
;
List
*
prev_target
=
targetlist
;
List
*
next_target
;
List
*
next_target
;
int
prev_len
=
0
,
next_len
=
0
;
if
(
length
(
targetlist
)
!=
length
(
query
->
targetList
))
foreach
(
prev_target
,
targetlist
)
if
(
!
((
TargetEntry
*
)
lfirst
(
prev_target
))
->
resdom
->
resjunk
)
prev_len
++
;
foreach
(
next_target
,
query
->
targetList
)
if
(
!
((
TargetEntry
*
)
lfirst
(
next_target
))
->
resdom
->
resjunk
)
next_len
++
;
if
(
prev_len
!=
next_len
)
elog
(
ERROR
,
"Each UNION clause must have the same number of columns"
);
elog
(
ERROR
,
"Each UNION clause must have the same number of columns"
);
foreach
(
next_target
,
query
->
targetList
)
foreach
(
next_target
,
query
->
targetList
)
...
...
...
...
This diff is collapsed.
Click to expand it.
src/backend/rewrite/rewriteHandler.c
+
14
−
5
View file @
19c4e862
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteHandler.c,v 1.4
2
1999/05/17 1
7:03:38
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteHandler.c,v 1.4
3
1999/05/17 1
8:22:19
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -2762,11 +2762,20 @@ QueryRewrite(Query *parsetree)
...
@@ -2762,11 +2762,20 @@ QueryRewrite(Query *parsetree)
* attributes and the types are compatible */
* attributes and the types are compatible */
void
check_targetlists_are_compatible
(
List
*
prev_target
,
List
*
current_target
)
void
check_targetlists_are_compatible
(
List
*
prev_target
,
List
*
current_target
)
{
{
List
*
next_target
;
List
*
tl
,
*
next_target
;
int
prev_len
=
0
,
next_len
=
0
;
if
(
length
(
prev_target
)
!=
foreach
(
tl
,
prev_target
)
length
(
current_target
))
if
(
!
((
TargetEntry
*
)
lfirst
(
tl
))
->
resdom
->
resjunk
)
prev_len
++
;
foreach
(
next_target
,
current_target
)
if
(
!
((
TargetEntry
*
)
lfirst
(
next_target
))
->
resdom
->
resjunk
)
next_len
++
;
if
(
prev_len
!=
next_len
)
elog
(
ERROR
,
"Each UNION | EXCEPT | INTERSECT query must have the same number of columns."
);
elog
(
ERROR
,
"Each UNION | EXCEPT | INTERSECT query must have the same number of columns."
);
foreach
(
next_target
,
current_target
)
foreach
(
next_target
,
current_target
)
{
{
Oid
itype
;
Oid
itype
;
...
...
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment