jsquery_extract.c
static void
debugRecursive(StringInfo buf, ExtractedNode *node, int shift)
{
	int i;

	appendStringInfoSpaces(buf, shift * 2);

	if (isLogicalNodeType(node->type))
	{
		appendStringInfo(buf, (node->type == eAnd) ? "AND\n" : "OR\n");
		for (i = 0; i < node->args.count; i++)
			debugRecursive(buf, node->args.items[i], shift + 1);
		return;
	}

	debugPath(buf, node->path);
	switch(node->type)
	{
		case eExactValue:
			appendStringInfo(buf, " = ");
			debugValue(buf, node->exactValue);
			appendStringInfo(buf, " ,");
			break;
		case eAny:
			appendStringInfo(buf, " = * ,");
			break;
		case eEmptyArray:
			appendStringInfo(buf, " = [] ,");
			break;
		case eIs:
			appendStringInfo(buf, " IS %s ,", getTypeString(node->isType));
			break;
		case eInequality:
			if (node->bounds.leftBound)
			{
				if (node->bounds.leftInclusive)
					appendStringInfo(buf, " >= ");
				else
					appendStringInfo(buf, " > ");
				debugValue(buf, node->bounds.leftBound);
				appendStringInfo(buf, " ,");
			}
			if (node->bounds.rightBound)
			{
				if (node->bounds.rightInclusive)
					appendStringInfo(buf, " <= ");
				else
					appendStringInfo(buf, " < ");
				debugValue(buf, node->bounds.rightBound);
				appendStringInfo(buf, " ,");
			}
			break;
		default:
			elog(ERROR,"Wrong type");
			break;
	}
	appendStringInfo(buf, " entry %d \n", node->entryNum);
}
/*
 * Recursive worker of debug print of query processing.
 */
Recursive worker of debug print of query processing.
Recursive worker of debug print of query processing .
static void
debugRecursive(StringInfo buf, ExtractedNode *node, int shift)
{
	int i;
	appendStringInfoSpaces(buf, shift * 2);
	if (isLogicalNodeType(node->type))
	{
		appendStringInfo(buf, (node->type == eAnd) ? "AND\n" : "OR\n");
		for (i = 0; i < node->args.count; i++)
			debugRecursive(buf, node->args.items[i], shift + 1);
		return;
	}
	debugPath(buf, node->path);
	switch(node->type)
	{
		case eExactValue:
			appendStringInfo(buf, " = ");
			debugValue(buf, node->exactValue);
			appendStringInfo(buf, " ,");
			break;
		case eAny:
			appendStringInfo(buf, " = * ,");
			break;
		case eEmptyArray:
			appendStringInfo(buf, " = [] ,");
			break;
		case eIs:
			appendStringInfo(buf, " IS %s ,", getTypeString(node->isType));
			break;
		case eInequality:
			if (node->bounds.leftBound)
			{
				if (node->bounds.leftInclusive)
					appendStringInfo(buf, " >= ");
				else
					appendStringInfo(buf, " > ");
				debugValue(buf, node->bounds.leftBound);
				appendStringInfo(buf, " ,");
			}
			if (node->bounds.rightBound)
			{
				if (node->bounds.rightInclusive)
					appendStringInfo(buf, " <= ");
				else
					appendStringInfo(buf, " < ");
				debugValue(buf, node->bounds.rightBound);
				appendStringInfo(buf, " ,");
			}
			break;
		default:
			elog(ERROR,"Wrong type");
			break;
	}
	appendStringInfo(buf, " entry %d \n", node->entryNum);
}
static void debugRecursive ( StringInfo buf , ExtractedNode * node , int shift ) { int i ; appendStringInfoSpaces ( buf , shift * 2 ) ; if ( isLogicalNodeType ( node -> type ) ) { appendStringInfo ( buf , ( node -> type == eAnd ) ? " \n " : " \n " ) ; for ( i = 0 ; i < node -> args . count ; i ++ ) debugRecursive ( buf , node -> args . items [ i ] , shift + 1 ) ; return ; } debugPath ( buf , node -> path ) ; switch ( node -> type ) { case eExactValue : appendStringInfo ( buf , " " ) ; debugValue ( buf , node -> exactValue ) ; appendStringInfo ( buf , " " ) ; break ; case eAny : appendStringInfo ( buf , " " ) ; break ; case eEmptyArray : appendStringInfo ( buf , " " ) ; break ; case eIs : appendStringInfo ( buf , " " , getTypeString ( node -> isType ) ) ; break ; case eInequality : if ( node -> bounds . leftBound ) { if ( node -> bounds . leftInclusive ) appendStringInfo ( buf , " " ) ; else appendStringInfo ( buf , " " ) ; debugValue ( buf , node -> bounds . leftBound ) ; appendStringInfo ( buf , " " ) ; } if ( node -> bounds . rightBound ) { if ( node -> bounds . rightInclusive ) appendStringInfo ( buf , " " ) ; else appendStringInfo ( buf , " " ) ; debugValue ( buf , node -> bounds . rightBound ) ; appendStringInfo ( buf , " " ) ; } break ; default : elog ( ERROR , " " ) ; break ; } appendStringInfo ( buf , " \n " , node -> entryNum ) ; }
Recursive worker of debug print of query processing.
Recursive worker of debug print of query processing .