0001-Fix-usage-of-is_not_null-in-xmltable.patch

text/x-patch

Filename: 0001-Fix-usage-of-is_not_null-in-xmltable.patch
Type: text/x-patch
Part: 0
Message: Assert failure in base_yyparse

Patch

Format: format-patch
Series: patch 0001
Subject: Fix usage of is_not_null in xmltable
File+
src/backend/parser/gram.y 5 0
From e54dbe190a0e5a0bbbadd07af8aa6b24433ad02a Mon Sep 17 00:00:00 2001
From: Evgeniy Gorbanev <gorbanyoves@basealt.ru>
Date: Fri, 28 Mar 2025 13:07:07 +0600
Subject: [PATCH] Fix usage of is_not_null in xmltable

is_not_null is considered as a valid keyword in xmltable, but it gets the type T_A_Expr
---
 src/backend/parser/gram.y | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index 0fc502a3a40..e3f22cb8b77 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -14232,6 +14232,11 @@ xmltable_column_el:
 										(errcode(ERRCODE_SYNTAX_ERROR),
 										 errmsg("conflicting or redundant NULL / NOT NULL declarations for column \"%s\"", fc->colname),
 										 parser_errposition(defel->location)));
+							if (defel->arg->type != T_Boolean)
+								ereport(ERROR,
+										(errcode(ERRCODE_SYNTAX_ERROR),
+										 errmsg("syntax error at or near \"%s\"", defel->defname),
+										 parser_errposition(defel->location)));
 							fc->is_not_null = boolVal(defel->arg);
 							nullability_seen = true;
 						}
-- 
2.42.2