Eason09053360 opened a new pull request, #73520:
URL: https://github.com/apache/airflow/pull/73520

   ## Why
   
   `*_prefix_pattern` filters turn a prefix into an index-friendly range scan. 
When bumping the last character would leave the alphanumeric range (`9`, `z`, 
`Z`), the upper bound is recomputed from a shorter prefix, so the range is far 
wider than what was asked for — `dag_9` also returns `dag_abc`, and `z` gets no 
upper bound at all. Every `*_prefix_pattern` parameter is affected.
   
   ## What
   
   - `airflow-core/src/airflow/api_fastapi/common/parameters/search.py`: both 
`_prefix_clause` implementations add `substr(column, 1, len(prefix)) = prefix` 
beside the bounds — an equality rather than `LIKE`, so it resolves under the 
same collation as `>=`/`<` (`LIKE` is case-insensitive on SQLite and on MySQL 
`_ci` columns).
   - The bounds are untouched and the documented trailing-punctuation strip 
(`test_` matches `test`) still holds; a new SQLite-backed test pins both down.
   - The collation premise behind the alnum restriction looks unverified — 
happy to drop the restriction instead of narrowing if a reviewer knows it does 
not hold.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Opus 5)
   
   Generated-by: Claude Code (Opus 5) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to