4paradigm / 4paradigm/OpenMLDB
SQL: Add Identifier Length Limits
- Dominant language
- C++
- Stars
- 1.7k
- Forks
- 331
- Avg merge
- 12d 12h
- Merged PRs (30d)
- 1
Description
**Is your feature request related to a problem? Please describe.**
Certain objects within OpenMLDB, including database, table, index, column, etc are known as identifiers.
Now the identifiers in OpenMLDB do not have specific string limits which might introduce risks into our system.
In this issue, we are going to apply restrictions on the maximum length of each type of identifier.
#### reference
https://dev.mysql.com/doc/refman/8.0/en/identifier-length.html
**Describe the solution you'd like**
- Assert identifier length size in ASTNodeConverter.
- Identifier size should be <= 64
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
Contributor guide
Research direction
The issue mentions adding length checks in ASTNodeConverter. Start by locating this converter in the codebase, likely in the SQL parser or compiler module. Examine how identifiers are currently handled and where validation can be added. Refer to the MySQL documentation link for length limits. Write tests to verify that identifiers longer than 64 characters are rejected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sql
- Domain
- backend, database
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100