Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbe850f1

Browse files
committed
Copy a Param's location field when replacing it with a Const.
This allows Param substitution to produce just the same resultas writing a constant value literally would have done. Whileit hardly matters so far as the current core code is concerned,extensions might take more interest in node location fields.Julien RouhaudDiscussion:https://postgr.es/m/20170311220932.GJ15188@nol.local
1 parentc203dcd commitbe850f1

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

‎src/backend/optimizer/util/clauses.c

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2329,20 +2329,23 @@ eval_const_expressions_mutator(Node *node,
23292329
int16typLen;
23302330
booltypByVal;
23312331
Datumpval;
2332+
Const*con;
23322333

23332334
get_typlenbyval(param->paramtype,
23342335
&typLen,&typByVal);
23352336
if (prm->isnull||typByVal)
23362337
pval=prm->value;
23372338
else
23382339
pval=datumCopy(prm->value,typByVal,typLen);
2339-
return (Node*)makeConst(param->paramtype,
2340-
param->paramtypmod,
2341-
param->paramcollid,
2342-
(int)typLen,
2343-
pval,
2344-
prm->isnull,
2345-
typByVal);
2340+
con=makeConst(param->paramtype,
2341+
param->paramtypmod,
2342+
param->paramcollid,
2343+
(int)typLen,
2344+
pval,
2345+
prm->isnull,
2346+
typByVal);
2347+
con->location=param->location;
2348+
return (Node*)con;
23462349
}
23472350
}
23482351
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp