38. 38
パッチレビュー(4)
• レビューしたいけど環境がない!
–レビューワーはVMが無料で借りられます!
As part of an ongoing effort to encourage patch review for the
PostgreSQL project, we will be funding cloud servers for patch
reviewers
and testers who need them for CommitFests. That is, if you want to
help
with reviewing or testing a patch for a CommitFest, and don't have your
own test server to use, the PostgreSQL project (via our funds at
Software In the Public Interest) will pay for you to use a cloud server
for the duration of your review/testing.
So, if "I don't have anywhere to test it" was your excuse for not
reviewing in the past, time to stop making excuses and start reviewing!
Since these are cloud servers, they won't work well for performance
testing. However, they will be excellent for testing replication.
If you need one of these, please contact me to allocate a VM for you.
2013-07-13 Josh Berkus氏のメールより
52. 52
改造してみましょう(2)
• デバッグ時のTips
– elog()でのprintfデバッグ
• プロトタイプ:elog(level, fmt, ...)
• 例:
int
func(int param)
{
int foo;
elog(WARNING, "%s() called with %d", __FUNCTION__, param);
...
elog(WARNING, "foo = %d before xxx", foo);
exec_xxx(...);
elog(WARNING, "foo = %d after xxx", foo);
...
}
53. 53
改造してみましょう(3)
• デバッグ時のTips
– NodeTag
• NodeTagオブジェクト種別識別子
• 構造体の先頭にNodeTagを置き、その値でオブ
ジェクト種別を識別
/*
* The first field of a node of any type is guaranteed to be the NodeTag.
* Hence the type of any node can be gotten by casting it to Node. Declaring
* a variable to be of Node * (instead of void *) can also facilitate
* debugging.
*/
typedef struct Node
{
NodeTag type;
} Node;
54. 54
改造してみましょう(4)
– NodeTag(続き)
typedef struct JoinExpr
{
NodeTag type;
JoinType jointype; /* type of join */
bool isNatural; /* Natural join? Will need to shape table */
Node *larg; /* left subtree */
Node *rarg; /* right subtree */
List *usingClause; /* USING clause, if any (list of String) */
Node *quals; /* qualifiers on join, if any */
Alias *alias; /* user-written alias clause, if any */
int rtindex; /* RT index assigned for join, or 0 */
} JoinExpr;