Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge conflict in 7c0eb3c622eb0882f460805109f244679b340964 Tighten up parsing logic in gen_node_support.pl. #62

Merged
merged 1 commit into from
Nov 29, 2023

Conversation

Sairakan
Copy link

@Sairakan Sairakan commented Nov 29, 2023

Merge conflict in src/include/nodes/parsenodes.h

/*
 * A_Const - a literal constant
 *
 * Value nodes are inline for performance.  You can treat 'val' as a node,
 * as in IsA(&val, Integer).  'val' is not valid if isnull is true.
 */
union ValUnion
{
	Node		node;
	Integer		ival;
	Float		fval;
	Boolean		boolval;
	String		sval;
	BitString	bsval;
};

typedef struct A_Const
{
	pg_node_attr(custom_copy_equal, custom_read_write, no_read)

	NodeTag		type;
<<<<<<< ours

	/*
	 * Value nodes are inline for performance.  You can treat 'val' as a node,
	 * as in IsA(&val, Integer).  'val' is not valid if isnull is true.
	 */
	union ValUnion
	{
		Node		node;
		Integer		ival;
		Float		fval;
		Boolean		boolval;
		String		sval;
		BitString	bsval;
		TSQL_HexString hsval; -- Babelfish added
	}			val;
=======
	union ValUnion val;
>>>>>>> theirs
	bool		isnull;			/* SQL NULL constant */
	int			location;		/* token location, or -1 if unknown */
} A_Const;

This conflict moved the union declaration in A_Const to outside of the struct definition, so just make sure that TSQL_HexString hsval also gets put in the new union declaration before taking in the new changes.

BABELFISH-CONFLICT: see Postgres community repo for original commit

Teach this script to handle function pointer fields honestly.
Previously they were just silently ignored, but that's not likely to
be a behavior we can accept indefinitely.  This mostly entails fixing
it so that a field declaration spanning multiple lines can be parsed,
because we have a bunch of such fields that're laid out that way.
But that's a good improvement in its own right.

With that change and a minor regex adjustment, the only struct it
fails to parse in the node-defining headers is A_Const, because
of the embedded union.  The path of least resistance is to move
that union declaration outside the struct.

Having done those things, we can make it error out if it finds
any within-struct syntax it doesn't understand, which seems like
a pretty important property for robustness.

This commit doesn't change the output files at all; it's just in
the way of future-proofing.

Discussion: https://postgr.es/m/[email protected]
(cherry picked from commit 7c0eb3c622eb0882f460805109f244679b340964)
Sairakan pushed a commit to amazon-aurora/babelfish_extensions that referenced this pull request Nov 29, 2023
@Sairakan Sairakan marked this pull request as ready for review November 29, 2023 21:47
@2jungkook 2jungkook merged commit af894ff into BABEL_main Nov 29, 2023
4 checks passed
@Sairakan Sairakan deleted the pg16-cherry-pick-bff-1 branch November 29, 2023 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants