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
a0d6e29e
Commit
a0d6e29e
authored
Jun 01, 2004
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some more de-FastList-ification.
parent
80c6847c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
50 deletions
+38
-50
src/backend/executor/execQual.c
src/backend/executor/execQual.c
+16
-21
src/backend/parser/gram.y
src/backend/parser/gram.y
+3
-8
src/backend/parser/parse_target.c
src/backend/parser/parse_target.c
+19
-21
No files found.
src/backend/executor/execQual.c
View file @
a0d6e29e
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.16
1 2004/05/30 23:40:26 neilc
Exp $
* $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.16
2 2004/06/01 03:28:41 tgl
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -2826,12 +2826,11 @@ ExecInitExpr(Expr *node, PlanState *parent)
...
@@ -2826,12 +2826,11 @@ ExecInitExpr(Expr *node, PlanState *parent)
{
{
CaseExpr
*
caseexpr
=
(
CaseExpr
*
)
node
;
CaseExpr
*
caseexpr
=
(
CaseExpr
*
)
node
;
CaseExprState
*
cstate
=
makeNode
(
CaseExprState
);
CaseExprState
*
cstate
=
makeNode
(
CaseExprState
);
FastList
outlist
;
List
*
outlist
=
NIL
;
ListCell
*
l
;
ListCell
*
l
;
cstate
->
xprstate
.
evalfunc
=
(
ExprStateEvalFunc
)
ExecEvalCase
;
cstate
->
xprstate
.
evalfunc
=
(
ExprStateEvalFunc
)
ExecEvalCase
;
cstate
->
arg
=
ExecInitExpr
(
caseexpr
->
arg
,
parent
);
cstate
->
arg
=
ExecInitExpr
(
caseexpr
->
arg
,
parent
);
FastListInit
(
&
outlist
);
foreach
(
l
,
caseexpr
->
args
)
foreach
(
l
,
caseexpr
->
args
)
{
{
CaseWhen
*
when
=
(
CaseWhen
*
)
lfirst
(
l
);
CaseWhen
*
when
=
(
CaseWhen
*
)
lfirst
(
l
);
...
@@ -2842,9 +2841,9 @@ ExecInitExpr(Expr *node, PlanState *parent)
...
@@ -2842,9 +2841,9 @@ ExecInitExpr(Expr *node, PlanState *parent)
wstate
->
xprstate
.
expr
=
(
Expr
*
)
when
;
wstate
->
xprstate
.
expr
=
(
Expr
*
)
when
;
wstate
->
expr
=
ExecInitExpr
(
when
->
expr
,
parent
);
wstate
->
expr
=
ExecInitExpr
(
when
->
expr
,
parent
);
wstate
->
result
=
ExecInitExpr
(
when
->
result
,
parent
);
wstate
->
result
=
ExecInitExpr
(
when
->
result
,
parent
);
FastAppend
(
&
outlist
,
wstate
);
outlist
=
lappend
(
outlist
,
wstate
);
}
}
cstate
->
args
=
FastListValue
(
&
outlist
)
;
cstate
->
args
=
outlist
;
cstate
->
defresult
=
ExecInitExpr
(
caseexpr
->
defresult
,
parent
);
cstate
->
defresult
=
ExecInitExpr
(
caseexpr
->
defresult
,
parent
);
state
=
(
ExprState
*
)
cstate
;
state
=
(
ExprState
*
)
cstate
;
}
}
...
@@ -2853,20 +2852,19 @@ ExecInitExpr(Expr *node, PlanState *parent)
...
@@ -2853,20 +2852,19 @@ ExecInitExpr(Expr *node, PlanState *parent)
{
{
ArrayExpr
*
arrayexpr
=
(
ArrayExpr
*
)
node
;
ArrayExpr
*
arrayexpr
=
(
ArrayExpr
*
)
node
;
ArrayExprState
*
astate
=
makeNode
(
ArrayExprState
);
ArrayExprState
*
astate
=
makeNode
(
ArrayExprState
);
FastList
outlist
;
List
*
outlist
=
NIL
;
ListCell
*
l
;
ListCell
*
l
;
astate
->
xprstate
.
evalfunc
=
(
ExprStateEvalFunc
)
ExecEvalArray
;
astate
->
xprstate
.
evalfunc
=
(
ExprStateEvalFunc
)
ExecEvalArray
;
FastListInit
(
&
outlist
);
foreach
(
l
,
arrayexpr
->
elements
)
foreach
(
l
,
arrayexpr
->
elements
)
{
{
Expr
*
e
=
(
Expr
*
)
lfirst
(
l
);
Expr
*
e
=
(
Expr
*
)
lfirst
(
l
);
ExprState
*
estate
;
ExprState
*
estate
;
estate
=
ExecInitExpr
(
e
,
parent
);
estate
=
ExecInitExpr
(
e
,
parent
);
FastAppend
(
&
outlist
,
estate
);
outlist
=
lappend
(
outlist
,
estate
);
}
}
astate
->
elements
=
FastListValue
(
&
outlist
)
;
astate
->
elements
=
outlist
;
/* do one-time catalog lookup for type info */
/* do one-time catalog lookup for type info */
get_typlenbyvalalign
(
arrayexpr
->
element_typeid
,
get_typlenbyvalalign
(
arrayexpr
->
element_typeid
,
&
astate
->
elemlength
,
&
astate
->
elemlength
,
...
@@ -2879,11 +2877,10 @@ ExecInitExpr(Expr *node, PlanState *parent)
...
@@ -2879,11 +2877,10 @@ ExecInitExpr(Expr *node, PlanState *parent)
{
{
RowExpr
*
rowexpr
=
(
RowExpr
*
)
node
;
RowExpr
*
rowexpr
=
(
RowExpr
*
)
node
;
RowExprState
*
rstate
=
makeNode
(
RowExprState
);
RowExprState
*
rstate
=
makeNode
(
RowExprState
);
List
*
outlist
;
List
*
outlist
=
NIL
;
ListCell
*
l
;
ListCell
*
l
;
rstate
->
xprstate
.
evalfunc
=
(
ExprStateEvalFunc
)
ExecEvalRow
;
rstate
->
xprstate
.
evalfunc
=
(
ExprStateEvalFunc
)
ExecEvalRow
;
outlist
=
NIL
;
foreach
(
l
,
rowexpr
->
args
)
foreach
(
l
,
rowexpr
->
args
)
{
{
Expr
*
e
=
(
Expr
*
)
lfirst
(
l
);
Expr
*
e
=
(
Expr
*
)
lfirst
(
l
);
...
@@ -2912,20 +2909,19 @@ ExecInitExpr(Expr *node, PlanState *parent)
...
@@ -2912,20 +2909,19 @@ ExecInitExpr(Expr *node, PlanState *parent)
{
{
CoalesceExpr
*
coalesceexpr
=
(
CoalesceExpr
*
)
node
;
CoalesceExpr
*
coalesceexpr
=
(
CoalesceExpr
*
)
node
;
CoalesceExprState
*
cstate
=
makeNode
(
CoalesceExprState
);
CoalesceExprState
*
cstate
=
makeNode
(
CoalesceExprState
);
FastList
outlist
;
List
*
outlist
=
NIL
;
ListCell
*
l
;
ListCell
*
l
;
cstate
->
xprstate
.
evalfunc
=
(
ExprStateEvalFunc
)
ExecEvalCoalesce
;
cstate
->
xprstate
.
evalfunc
=
(
ExprStateEvalFunc
)
ExecEvalCoalesce
;
FastListInit
(
&
outlist
);
foreach
(
l
,
coalesceexpr
->
args
)
foreach
(
l
,
coalesceexpr
->
args
)
{
{
Expr
*
e
=
(
Expr
*
)
lfirst
(
l
);
Expr
*
e
=
(
Expr
*
)
lfirst
(
l
);
ExprState
*
estate
;
ExprState
*
estate
;
estate
=
ExecInitExpr
(
e
,
parent
);
estate
=
ExecInitExpr
(
e
,
parent
);
FastAppend
(
&
outlist
,
estate
);
outlist
=
lappend
(
outlist
,
estate
);
}
}
cstate
->
args
=
FastListValue
(
&
outlist
)
;
cstate
->
args
=
outlist
;
state
=
(
ExprState
*
)
cstate
;
state
=
(
ExprState
*
)
cstate
;
}
}
break
;
break
;
...
@@ -2984,18 +2980,17 @@ ExecInitExpr(Expr *node, PlanState *parent)
...
@@ -2984,18 +2980,17 @@ ExecInitExpr(Expr *node, PlanState *parent)
break
;
break
;
case
T_List
:
case
T_List
:
{
{
FastList
outlist
;
List
*
outlist
=
NIL
;
ListCell
*
l
;
ListCell
*
l
;
FastListInit
(
&
outlist
);
foreach
(
l
,
(
List
*
)
node
)
foreach
(
l
,
(
List
*
)
node
)
{
{
FastAppend
(
&
outlist
,
outlist
=
lappend
(
outlist
,
ExecInitExpr
((
Expr
*
)
lfirst
(
l
),
ExecInitExpr
((
Expr
*
)
lfirst
(
l
),
parent
));
parent
));
}
}
/* Don't fall through to the "common" code below */
/* Don't fall through to the "common" code below */
return
(
ExprState
*
)
FastListValue
(
&
outlist
)
;
return
(
ExprState
*
)
outlist
;
}
}
default:
default:
elog
(
ERROR
,
"unrecognized node type: %d"
,
elog
(
ERROR
,
"unrecognized node type: %d"
,
...
...
src/backend/parser/gram.y
View file @
a0d6e29e
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.45
8 2004/05/30 23:40:34 neilc
Exp $
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.45
9 2004/06/01 03:28:48 tgl
Exp $
*
*
* HISTORY
* HISTORY
* AUTHOR DATE MAJOR EVENT
* AUTHOR DATE MAJOR EVENT
...
@@ -108,7 +108,6 @@ static void doNegateFloat(Value *v);
...
@@ -108,7 +108,6 @@ static void doNegateFloat(Value *v);
OnCommitAction oncommit;
OnCommitAction oncommit;
ContainsOids withoids;
ContainsOids withoids;
List *list;
List *list;
FastList fastlist;
Node *node;
Node *node;
Value *value;
Value *value;
ColumnRef *columnref;
ColumnRef *columnref;
...
@@ -6820,15 +6819,11 @@ opt_indirection:
...
@@ -6820,15 +6819,11 @@ opt_indirection:
expr_list: a_expr
expr_list: a_expr
{
{
FastList *dst = (FastList *) &$$;
$$ = list_make1($1);
makeFastList1(dst, $1);
}
}
| expr_list ',' a_expr
| expr_list ',' a_expr
{
{
FastList *dst = (FastList *) &$$;
$$ = lappend($1, $3);
FastList *src = (FastList *) &$1;
*dst = *src;
FastAppend(dst, $3);
}
}
;
;
...
...
src/backend/parser/parse_target.c
View file @
a0d6e29e
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/parse_target.c,v 1.1
19 2004/05/30 23:40:35 neilc
Exp $
* $PostgreSQL: pgsql/src/backend/parser/parse_target.c,v 1.1
20 2004/06/01 03:28:48 tgl
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -92,11 +92,9 @@ transformTargetEntry(ParseState *pstate,
...
@@ -92,11 +92,9 @@ transformTargetEntry(ParseState *pstate,
List
*
List
*
transformTargetList
(
ParseState
*
pstate
,
List
*
targetlist
)
transformTargetList
(
ParseState
*
pstate
,
List
*
targetlist
)
{
{
FastList
p_target
;
List
*
p_target
=
NIL
;
ListCell
*
o_target
;
ListCell
*
o_target
;
FastListInit
(
&
p_target
);
foreach
(
o_target
,
targetlist
)
foreach
(
o_target
,
targetlist
)
{
{
ResTarget
*
res
=
(
ResTarget
*
)
lfirst
(
o_target
);
ResTarget
*
res
=
(
ResTarget
*
)
lfirst
(
o_target
);
...
@@ -116,8 +114,8 @@ transformTargetList(ParseState *pstate, List *targetlist)
...
@@ -116,8 +114,8 @@ transformTargetList(ParseState *pstate, List *targetlist)
* Target item is a single '*', expand all tables
* Target item is a single '*', expand all tables
* (e.g., SELECT * FROM emp)
* (e.g., SELECT * FROM emp)
*/
*/
FastConc
(
&
p_target
,
p_target
=
list_concat
(
p_target
,
ExpandAllTables
(
pstate
));
ExpandAllTables
(
pstate
));
}
}
else
else
{
{
...
@@ -173,34 +171,34 @@ transformTargetList(ParseState *pstate, List *targetlist)
...
@@ -173,34 +171,34 @@ transformTargetList(ParseState *pstate, List *targetlist)
rte
=
addImplicitRTE
(
pstate
,
makeRangeVar
(
schemaname
,
rte
=
addImplicitRTE
(
pstate
,
makeRangeVar
(
schemaname
,
relname
));
relname
));
FastConc
(
&
p_target
,
p_target
=
list_concat
(
p_target
,
expandRelAttrs
(
pstate
,
rte
));
expandRelAttrs
(
pstate
,
rte
));
}
}
}
}
else
else
{
{
/* Plain ColumnRef node, treat it as an expression */
/* Plain ColumnRef node, treat it as an expression */
FastAppend
(
&
p_target
,
p_target
=
lappend
(
p_target
,
transformTargetEntry
(
pstate
,
transformTargetEntry
(
pstate
,
res
->
val
,
res
->
val
,
NULL
,
NULL
,
res
->
name
,
res
->
name
,
false
));
false
));
}
}
}
}
else
else
{
{
/* Everything else but ColumnRef */
/* Everything else but ColumnRef */
FastAppend
(
&
p_target
,
p_target
=
lappend
(
p_target
,
transformTargetEntry
(
pstate
,
transformTargetEntry
(
pstate
,
res
->
val
,
res
->
val
,
NULL
,
NULL
,
res
->
name
,
res
->
name
,
false
));
false
));
}
}
}
}
return
FastListValue
(
&
p_target
)
;
return
p_target
;
}
}
...
...
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