yifanwu-sys commented on PR #64645:
URL: https://github.com/apache/doris/pull/64645#issuecomment-4749345478
Thanks for the reminder. I have clarified the PR description below.
### What problem was fixed?
This PR does not change the implementation behavior of `url_decode`. It adds
missing regression test coverage for malformed percent-encoding inputs.
The existing `url_decode` regression test mainly covered valid URL decoding
cases, but it did not explicitly cover malformed inputs such as:
* truncated percent sequences;
* a bare percent sign;
* invalid hex characters;
* mixed valid and invalid percent-encoded strings.
Without these regression tests, the existing error behavior of `url_decode`
could be changed accidentally in future updates.
### How was it fixed?
I added 6 error-case tests to:
```text
regression-test/suites/query_p0/sql_functions/string_functions/test_url_decode.groovy
```
The added cases include:
```sql
select url_decode('%2');
select url_decode('%');
select url_decode('hello%');
select url_decode('%GG');
select url_decode('%20%GG%41');
select url_decode('%%20');
```
Each case verifies that malformed percent-encoding raises the expected error:
```text
Decode url failed
```
### Which behaviors were modified?
No Doris runtime behavior was modified.
Before this PR:
* `url_decode` already returned an error for malformed percent-encoding
inputs.
* However, these error cases were not covered by regression tests.
After this PR:
* The same existing behavior is now covered by regression tests.
* Future changes to `url_decode` can detect regressions in malformed input
handling.
### Why was it modified?
Malformed URL percent-encoding is a common edge case for URL decoding
functions. Adding regression tests helps document and protect the expected
error behavior.
### Possible impact
This is a test-only change.
It does not affect:
* Doris build behavior;
* runtime behavior;
* SQL execution logic;
* storage behavior;
* query execution;
* compatibility.
### New features
No new feature was added.
### Refactoring
No code was refactored.
### Optimization
No function was optimized. This PR only adds regression test coverage for
existing `url_decode` error behavior.
### Verification
This PR only adds constant SQL error assertion cases.
The added cases verify that malformed percent-encoding inputs raise:
```text
Decode url failed
```
No core code was modified, and no `.out` file update is required because
these are exception assertion cases.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]