-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
Problem Description
Users frequently make a configuration error by including the module prefix (, , ) when defining variables in the corresponding sections of the ProxySQL configuration file.
For example, in section:
This causes the variable to be stored in the database as (double prefix) instead of . Later lookups via fail because they search for without the prefix.
The same issue occurs with ( prefix) and ( prefix).
Root Cause
The issue is in :
- The function reads key-value pairs from section
- Inserts them into table with format
- When users write , the key becomes
- Later searches without prefix
Proposed Solution
Add automatic prefix detection and stripping in :
0 ""
0 ""
0 ""
1 "/usr/include/stdc-predef.h" 1 3 4
0 "" 2
1 ""
Impact
- Files Modified: (~5 lines added)
- Sections Affected: , ,
- Backward Compatibility: Fully maintained - both prefixed and unprefixed forms will work
- Testing Required: Verify all three sections work correctly with and without prefixes
Testing Considerations
- Test mysql_variables with both and
- Test pgsql_variables with both and
- Test admin_variables with both and
- Ensure no regression for variables that legitimately shouldn't have prefixes stripped
Alternative Approaches Considered
- Validate and reject: Reject configs with prefixed variables, but breaks backward compatibility
- Documentation-only: Better docs/warnings, but users keep making the same mistake
- Database-level fix: Strip prefix when loading from database, but double prefix still stored
The proposed solution is most user-friendly as it automatically corrects the common mistake while maintaining compatibility.
Related Issue
This issue was identified while investigating issue #5242 where a user reported not working in the section.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels