This is an automated email from the ASF dual-hosted git repository.
djwang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git
The following commit(s) were added to refs/heads/main by this push:
new 045dc52ecb2 Fix the regex matching bug of the GUC
gp_resource_group_cgroup_parent
045dc52ecb2 is described below
commit 045dc52ecb234ddeb20e835bbf277b787264c1b6
Author: fairyfar <[email protected]>
AuthorDate: Mon Feb 9 15:15:12 2026 +0800
Fix the regex matching bug of the GUC gp_resource_group_cgroup_parent
This is a code defect of a original GPDB on resource group enabled.
There is a bug to calculate length of pg_wchar in
`gpvars_check_gp_resource_group_cgroup_parent` function.
For example, the value "greenplum database" was originally supposed to be
judged as an illegal name, and report error:
"gp_resource_group_cgroup_parent can only contains alphabet, number and
non-leading . _ -".
But it was wrongly judged as legal.
---
src/backend/cdb/cdbvars.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backend/cdb/cdbvars.c b/src/backend/cdb/cdbvars.c
index c6540a8a8d5..733bc40e470 100644
--- a/src/backend/cdb/cdbvars.c
+++ b/src/backend/cdb/cdbvars.c
@@ -580,7 +580,7 @@ bool gpvars_check_gp_resource_group_cgroup_parent(char
**newval, void **extra, G
pg_wchar *wpattern = palloc((strlen(pattern) + 1) * sizeof(pg_wchar));
int wlen = pg_mb2wchar_with_len(pattern, wpattern,
strlen(pattern));
pg_wchar *data = palloc((strlen(*newval) + 1) * sizeof(pg_wchar));
- int data_len = pg_mb2wchar_with_len(*newval, data,
sizeof(*newval));
+ int data_len = pg_mb2wchar_with_len(*newval, data,
strlen(*newval));
bool match = true;
regres = pg_regcomp(&re, wpattern, wlen, REG_ADVANCED,
DEFAULT_COLLATION_OID);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]