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
e0eb5e0a
Commit
e0eb5e0a
authored
Mar 28, 2017
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve Node vs Expr use a bit
Author: Mark Dilger <hornschnorter@gmail.com>
parent
4cb82469
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
+16
-16
src/backend/catalog/partition.c
src/backend/catalog/partition.c
+16
-16
No files found.
src/backend/catalog/partition.c
View file @
e0eb5e0a
...
...
@@ -1159,7 +1159,7 @@ get_qual_for_list(PartitionKey key, PartitionBoundSpec *spec)
ListCell
*
cell
,
*
prev
,
*
next
;
Node
*
keyCol
;
Expr
*
keyCol
;
Oid
operoid
;
bool
need_relabel
,
list_has_null
=
false
;
...
...
@@ -1168,14 +1168,14 @@ get_qual_for_list(PartitionKey key, PartitionBoundSpec *spec)
/* Left operand is either a simple Var or arbitrary expression */
if
(
key
->
partattrs
[
0
]
!=
0
)
keyCol
=
(
Node
*
)
makeVar
(
1
,
keyCol
=
(
Expr
*
)
makeVar
(
1
,
key
->
partattrs
[
0
],
key
->
parttypid
[
0
],
key
->
parttypmod
[
0
],
key
->
parttypcoll
[
0
],
0
);
else
keyCol
=
(
Node
*
)
copyObject
(
linitial
(
key
->
partexprs
));
keyCol
=
(
Expr
*
)
copyObject
(
linitial
(
key
->
partexprs
));
/*
* We must remove any NULL value in the list; we handle it separately
...
...
@@ -1205,7 +1205,7 @@ get_qual_for_list(PartitionKey key, PartitionBoundSpec *spec)
* expressions
*/
nulltest1
=
makeNode
(
NullTest
);
nulltest1
->
arg
=
(
Expr
*
)
keyCol
;
nulltest1
->
arg
=
keyCol
;
nulltest1
->
nulltesttype
=
IS_NOT_NULL
;
nulltest1
->
argisrow
=
false
;
nulltest1
->
location
=
-
1
;
...
...
@@ -1216,7 +1216,7 @@ get_qual_for_list(PartitionKey key, PartitionBoundSpec *spec)
* Gin up a col IS NULL test that will be OR'd with other expressions
*/
nulltest2
=
makeNode
(
NullTest
);
nulltest2
->
arg
=
(
Expr
*
)
keyCol
;
nulltest2
->
arg
=
keyCol
;
nulltest2
->
nulltesttype
=
IS_NULL
;
nulltest2
->
argisrow
=
false
;
nulltest2
->
location
=
-
1
;
...
...
@@ -1237,7 +1237,7 @@ get_qual_for_list(PartitionKey key, PartitionBoundSpec *spec)
operoid
=
get_partition_operator
(
key
,
0
,
BTEqualStrategyNumber
,
&
need_relabel
);
if
(
need_relabel
||
key
->
partcollation
[
0
]
!=
key
->
parttypcoll
[
0
])
keyCol
=
(
Node
*
)
makeRelabelType
((
Expr
*
)
keyCol
,
keyCol
=
(
Expr
*
)
makeRelabelType
(
keyCol
,
key
->
partopcintype
[
0
],
-
1
,
key
->
partcollation
[
0
],
...
...
@@ -1291,7 +1291,7 @@ get_qual_for_range(PartitionKey key, PartitionBoundSpec *spec)
{
PartitionRangeDatum
*
ldatum
=
lfirst
(
cell1
),
*
udatum
=
lfirst
(
cell2
);
Node
*
keyCol
;
Expr
*
keyCol
;
Const
*
lower_val
=
NULL
,
*
upper_val
=
NULL
;
EState
*
estate
;
...
...
@@ -1307,7 +1307,7 @@ get_qual_for_range(PartitionKey key, PartitionBoundSpec *spec)
/* Left operand */
if
(
key
->
partattrs
[
i
]
!=
0
)
{
keyCol
=
(
Node
*
)
makeVar
(
1
,
keyCol
=
(
Expr
*
)
makeVar
(
1
,
key
->
partattrs
[
i
],
key
->
parttypid
[
i
],
key
->
parttypmod
[
i
],
...
...
@@ -1316,7 +1316,7 @@ get_qual_for_range(PartitionKey key, PartitionBoundSpec *spec)
}
else
{
keyCol
=
(
Node
*
)
copyObject
(
lfirst
(
partexprs_item
));
keyCol
=
copyObject
(
lfirst
(
partexprs_item
));
partexprs_item
=
lnext
(
partexprs_item
);
}
...
...
@@ -1329,7 +1329,7 @@ get_qual_for_range(PartitionKey key, PartitionBoundSpec *spec)
if
(
!
IsA
(
keyCol
,
Var
))
{
nulltest
=
makeNode
(
NullTest
);
nulltest
->
arg
=
(
Expr
*
)
keyCol
;
nulltest
->
arg
=
keyCol
;
nulltest
->
nulltesttype
=
IS_NOT_NULL
;
nulltest
->
argisrow
=
false
;
nulltest
->
location
=
-
1
;
...
...
@@ -1384,7 +1384,7 @@ get_qual_for_range(PartitionKey key, PartitionBoundSpec *spec)
elog
(
ERROR
,
"invalid range bound specification"
);
if
(
need_relabel
||
key
->
partcollation
[
i
]
!=
key
->
parttypcoll
[
i
])
keyCol
=
(
Node
*
)
makeRelabelType
((
Expr
*
)
keyCol
,
keyCol
=
(
Expr
*
)
makeRelabelType
(
keyCol
,
key
->
partopcintype
[
i
],
-
1
,
key
->
partcollation
[
i
],
...
...
@@ -1393,7 +1393,7 @@ get_qual_for_range(PartitionKey key, PartitionBoundSpec *spec)
make_opclause
(
operoid
,
BOOLOID
,
false
,
(
Expr
*
)
keyCol
,
keyCol
,
(
Expr
*
)
lower_val
,
InvalidOid
,
key
->
partcollation
[
i
]));
...
...
@@ -1415,7 +1415,7 @@ get_qual_for_range(PartitionKey key, PartitionBoundSpec *spec)
&
need_relabel
);
if
(
need_relabel
||
key
->
partcollation
[
i
]
!=
key
->
parttypcoll
[
i
])
keyCol
=
(
Node
*
)
makeRelabelType
((
Expr
*
)
keyCol
,
keyCol
=
(
Expr
*
)
makeRelabelType
(
keyCol
,
key
->
partopcintype
[
i
],
-
1
,
key
->
partcollation
[
i
],
...
...
@@ -1424,7 +1424,7 @@ get_qual_for_range(PartitionKey key, PartitionBoundSpec *spec)
make_opclause
(
operoid
,
BOOLOID
,
false
,
(
Expr
*
)
keyCol
,
keyCol
,
(
Expr
*
)
lower_val
,
InvalidOid
,
key
->
partcollation
[
i
]));
...
...
@@ -1437,7 +1437,7 @@ get_qual_for_range(PartitionKey key, PartitionBoundSpec *spec)
&
need_relabel
);
if
(
need_relabel
||
key
->
partcollation
[
i
]
!=
key
->
parttypcoll
[
i
])
keyCol
=
(
Node
*
)
makeRelabelType
((
Expr
*
)
keyCol
,
keyCol
=
(
Expr
*
)
makeRelabelType
(
keyCol
,
key
->
partopcintype
[
i
],
-
1
,
key
->
partcollation
[
i
],
...
...
@@ -1447,7 +1447,7 @@ get_qual_for_range(PartitionKey key, PartitionBoundSpec *spec)
make_opclause
(
operoid
,
BOOLOID
,
false
,
(
Expr
*
)
keyCol
,
keyCol
,
(
Expr
*
)
upper_val
,
InvalidOid
,
key
->
partcollation
[
i
]));
...
...
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