提交 74fdbc5d 编写于 作者: H Heikki Linnakangas

Cosmetic fixes, to reduce diff vs upstream.

Most notably, move the definition of XmlExpr and friends to where they are
in the upstream.
上级 e94a339a
......@@ -858,14 +858,13 @@ typedef struct GroupingFuncExprState
*/
typedef struct WindowRefExprState
{
ExprState xprstate;
ExprState xprstate;
struct WindowState *windowstate; /* reflect parent window state */
List *args; /* states of argument expressions */
bool *argtypbyval; /* pg_type.typbyval for each argument */
int16 *argtyplen; /* pg_type.typlen of each argument */
int funcno; /* index in window state's func_state array */
// bool isAgg; /* aggregate-derived? */
char winkind; /* pg_window.winkind */
List *args; /* states of argument expressions */
bool *argtypbyval; /* pg_type.typbyval for each argument */
int16 *argtyplen; /* pg_type.typlen of each argument */
int funcno; /* index in window state's func_state array */
char winkind; /* pg_window.winkind */
} WindowRefExprState;
/* ----------------
......@@ -1554,7 +1553,7 @@ typedef struct BitmapOrState
} BitmapOrState;
/* ----------------------------------------------------------------
* Scan State Information
* Scan State Information
* ----------------------------------------------------------------
*/
......@@ -2429,9 +2428,9 @@ typedef struct AggState
} AggState;
/* ---------------------
* WindowState information
* -------------------------
/* ----------------
* WindowState information
* ----------------
*/
typedef struct WindowStatePerLevelData *WindowStatePerLevel;
typedef struct WindowStatePerFunctionData *WindowStatePerFunction;
......@@ -2450,11 +2449,11 @@ typedef struct WindowState
bool cur_slot_is_new; /* is this a slot from a buffer or outer plan */
bool cur_slot_part_break; /* slot breaks the partition key */
int cur_slot_key_break; /* break level of the key in the slot */
/* Array of working states per distinct window function */
int numfuncs;
WindowStatePerFunction func_state;
/* Per row state */
int64 row_index;
......
......@@ -534,7 +534,6 @@ typedef struct DefElem
DefElemAction defaction; /* unspecified action, or SET/ADD/DROP */
} DefElem;
/*
* LockingClause - raw representation of FOR UPDATE/SHARE options
*
......@@ -1014,7 +1013,6 @@ typedef struct WindowSpec
* nodes replaced by SetOperationStmt nodes.
* ----------------------
*/
typedef struct SetOperationStmt
{
NodeTag type;
......
......@@ -426,7 +426,6 @@ typedef struct FuncExpr
bool is_tablefunc; /* Is a TableFunction reference */
} FuncExpr;
/*
* OpExpr - expression node for an operator invocation
*
......@@ -965,6 +964,50 @@ typedef struct MinMaxExpr
int location; /* token location, or -1 if unknown */
} MinMaxExpr;
/*
* XmlExpr - various SQL/XML functions requiring special grammar productions
*
* 'name' carries the "NAME foo" argument (already XML-escaped).
* 'named_args' and 'arg_names' represent an xml_attribute list.
* 'args' carries all other arguments.
*
* Note: result type/typmod/collation are not stored, but can be deduced
* from the XmlExprOp. The type/typmod fields are just used for display
* purposes, and are NOT necessarily the true result type of the node.
* (We also use type == InvalidOid to mark a not-yet-parse-analyzed XmlExpr.)
*/
typedef enum XmlExprOp
{
IS_XMLCONCAT, /* XMLCONCAT(args) */
IS_XMLELEMENT, /* XMLELEMENT(name, xml_attributes, args) */
IS_XMLFOREST, /* XMLFOREST(xml_attributes) */
IS_XMLPARSE, /* XMLPARSE(text, is_doc, preserve_ws) */
IS_XMLPI, /* XMLPI(name [, args]) */
IS_XMLROOT, /* XMLROOT(xml, version, standalone) */
IS_XMLSERIALIZE, /* XMLSERIALIZE(is_document, xmlval) */
IS_DOCUMENT /* xmlval IS DOCUMENT */
} XmlExprOp;
typedef enum
{
XMLOPTION_DOCUMENT,
XMLOPTION_CONTENT
} XmlOptionType;
typedef struct XmlExpr
{
Expr xpr;
XmlExprOp op; /* xml function ID */
char *name; /* name in xml(NAME foo ...) syntaxes */
List *named_args; /* non-XML expressions for xml_attributes */
List *arg_names; /* parallel list of Value strings */
List *args; /* list of expressions */
XmlOptionType xmloption; /* DOCUMENT or CONTENT */
Oid type; /* target type/typmod for XMLSERIALIZE */
int32 typmod;
int location; /* token location, or -1 if unknown */
} XmlExpr;
/*
* NullIfExpr - a NULLIF expression
*
......@@ -1019,50 +1062,6 @@ typedef struct BooleanTest
BoolTestType booltesttype; /* test type */
} BooleanTest;
/*
* XmlExpr - various SQL/XML functions requiring special grammar productions
*
* 'name' carries the "NAME foo" argument (already XML-escaped).
* 'named_args' and 'arg_names' represent an xml_attribute list.
* 'args' carries all other arguments.
*
* Note: result type/typmod/collation are not stored, but can be deduced
* from the XmlExprOp. The type/typmod fields are just used for display
* purposes, and are NOT necessarily the true result type of the node.
* (We also use type == InvalidOid to mark a not-yet-parse-analyzed XmlExpr.)
*/
typedef enum XmlExprOp
{
IS_XMLCONCAT, /* XMLCONCAT(args) */
IS_XMLELEMENT, /* XMLELEMENT(name, xml_attributes, args) */
IS_XMLFOREST, /* XMLFOREST(xml_attributes) */
IS_XMLPARSE, /* XMLPARSE(text, is_doc, preserve_ws) */
IS_XMLPI, /* XMLPI(name [, args]) */
IS_XMLROOT, /* XMLROOT(xml, version, standalone) */
IS_XMLSERIALIZE, /* XMLSERIALIZE(is_document, xmlval) */
IS_DOCUMENT /* xmlval IS DOCUMENT */
} XmlExprOp;
typedef enum
{
XMLOPTION_DOCUMENT,
XMLOPTION_CONTENT
} XmlOptionType;
typedef struct XmlExpr
{
Expr xpr;
XmlExprOp op; /* xml function ID */
char *name; /* name in xml(NAME foo ...) syntaxes */
List *named_args; /* non-XML expressions for xml_attributes */
List *arg_names; /* parallel list of Value strings */
List *args; /* list of expressions */
XmlOptionType xmloption; /* DOCUMENT or CONTENT */
Oid type; /* target type/typmod for XMLSERIALIZE */
int32 typmod;
int location; /* token location, or -1 if unknown */
} XmlExpr;
/*
* CoerceToDomain
*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册