把target_list 中的这一段改变一下:| a_expr IDENT { $$ = makeNode(ResTarget); $$->name = $2; $$->indirection = NIL; $$->val = (Node *)$1; $$->location = @1; } 变...
转载 2012-09-05 16:43:00
88阅读
2评论
对于 gram.y 中, target_list 进一步理解:其中有如下一段:| a_expr IDENT { $$ = makeNode(ResTarget); $$->name = $2; $$->indirection = NIL; $$->val = (Node *)$1; $$->location = @1; } ...
转载 2012-09-05 16:12:00
103阅读
2评论
struct ListCellstruct ListCell{ union { void *ptr_value; int int_value; Oid oid_value; } data; ListCell *next;}由于在 target_list 相关部分,其 ptr_value 指向 ResTargettypedef struct ResTarget{ NodeTag type; char *name; List *indi...
转载 2012-09-10 15:23:00
47阅读
2评论
根据 <PostgreSQL 数据库内核分析>200和201页的说法,ResTarget 应该指向 ColumnRef 。这是如何实现的呢?target_list: target_el { $$ = list_make1($1); } | target_list ',' target_el { $$ = lappend($1, $3); } ; ...
转载 2012-09-10 16:09:00
89阅读
2评论
在gram.y 中, 有如下一段:target_el: a_expr AS ColLabel{ $$=makeNode(Restarget); $$->name =$3; $$->indirection=NIL; ...}...那么,makeNode到底是什么呢?nodes.h 里有这样的宏:#define makeNode(_type_) ((_type_ *) newNode(sizeof(_type_),T_##_type_))
转载 2012-09-10 09:41:00
80阅读
2评论