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

Commite9ef11a

Browse files
committed
Infer functional dependency past RelabelType
Vars hidden within a RelabelType would not be detected as compatiblewith some functional dependency. Repair by properly ignoring theRelabelType.Author: David RowleyReviewed-by: Tomas VondraDiscussion:https://postgr.es/m/CAKJS1f-y-UEy=rsBXynBOgiW1fKMr_LVoYSGL9QOc36mLEC-ww@mail.gmail.com
1 parent360fd1a commite9ef11a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

‎src/backend/statistics/dependencies.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,14 @@ dependency_is_compatible_clause(Node *clause, Index relid, AttrNumber *attnum)
792792

793793
var= (varonleft) ?linitial(expr->args) :lsecond(expr->args);
794794

795+
/*
796+
* We may ignore any RelabelType node above the operand. (There won't
797+
* be more than one, since eval_const_expressions() has been applied
798+
* already.)
799+
*/
800+
if (IsA(var,RelabelType))
801+
var= (Var*) ((RelabelType*)var)->arg;
802+
795803
/* We only support plain Vars for now */
796804
if (!IsA(var,Var))
797805
return false;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp