mirror of
				https://github.com/postgres/postgres.git
				synced 2025-10-31 10:30:33 +03:00 
			
		
		
		
	Creates the SubLink structure, and the Query->hasSubLink field,
with supporting code. Creates SubLink node in gram.y. psql.c patch for newatttypmod field.
This commit is contained in:
		| @@ -7,7 +7,7 @@ | ||||
|  * | ||||
|  * | ||||
|  * IDENTIFICATION | ||||
|  *	  $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.22 1998/01/16 23:19:59 momjian Exp $ | ||||
|  *	  $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.23 1998/01/17 04:53:09 momjian Exp $ | ||||
|  * | ||||
|  * NOTES | ||||
|  *	  Every (plan) node in POSTGRES has an associated "out" routine which | ||||
| @@ -230,6 +230,8 @@ _outQuery(StringInfo str, Query *node) | ||||
|  	_outNode(str, node->havingQual); | ||||
| 	appendStringInfo(str, " :hasAggs "); | ||||
| 	appendStringInfo(str, (node->hasAggs ? "true" : "false")); | ||||
| 	appendStringInfo(str, " :hasSubLinks "); | ||||
| 	appendStringInfo(str, (node->hasSubLinks ? "true" : "false")); | ||||
| 	appendStringInfo(str, " :unionClause "); | ||||
|  	_outNode(str, node->unionClause); | ||||
| } | ||||
| @@ -753,6 +755,27 @@ _outAggreg(StringInfo str, Aggreg *node) | ||||
| 	appendStringInfo(str, node->usenulls ? "true" : "false"); | ||||
| } | ||||
|  | ||||
| /* | ||||
|  *	SubLink | ||||
|  */ | ||||
| static void | ||||
| _outSubLink(StringInfo str, SubLink *node) | ||||
| { | ||||
| 	char		buf[500]; | ||||
|  | ||||
| 	appendStringInfo(str, "SUBLINK"); | ||||
| 	sprintf(buf, " :subLinkType %d ", node->subLinkType); | ||||
| 	appendStringInfo(str, buf); | ||||
| 	appendStringInfo(str, " :useor "); | ||||
| 	appendStringInfo(str, node->useor ? "true" : "false"); | ||||
| 	appendStringInfo(str, " :lefthand "); | ||||
| 	_outNode(str, node->lefthand); | ||||
| 	appendStringInfo(str, " :oper "); | ||||
| 	_outNode(str, node->oper); | ||||
| 	appendStringInfo(str, " :subselect "); | ||||
| 	_outNode(str, node->subselect); | ||||
| } | ||||
|  | ||||
| /* | ||||
|  *	Array is a subclass of Expr | ||||
|  */ | ||||
| @@ -1648,6 +1671,9 @@ _outNode(StringInfo str, void *obj) | ||||
| 			case T_Aggreg: | ||||
| 				_outAggreg(str, obj); | ||||
| 				break; | ||||
| 			case T_SubLink: | ||||
| 				_outSubLink(str, obj); | ||||
| 				break; | ||||
| 			case T_Array: | ||||
| 				_outArray(str, obj); | ||||
| 				break; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user