Skip to content

Conversation

@fairyfar
Copy link
Contributor

@fairyfar fairyfar commented Feb 9, 2026

Fix the regex matching bug of the GUC gp_resource_group_cgroup_parent

What does this PR do?

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.

Type of Change

  • Bug fix (non-breaking change)
  • New feature (non-breaking change)
  • Breaking change (fix or feature with breaking changes)
  • Documentation update

Breaking Changes

Test Plan

  • Unit tests added/updated
  • Integration tests added/updated
  • Passed make installcheck
  • Passed make -C src/test installcheck-cbdb-parallel

Impact

Performance:

User-facing changes:

Dependencies:

Checklist

Additional Context

CI Skip Instructions


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.
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @fairyfar welcome!🎊 Thanks for taking the effort to make our project better! 🙌 Keep making such awesome contributions!

@leborchuk
Copy link
Contributor

The same issue is in archived gp7 repo. It looks like we always copy first 4 bytes of data, which could leads not only to wrong name but also to buffer overflow in a case of empty string

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.

2 participants