Skip to content

Conversation

@linrrzqqq
Copy link
Contributor

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

  1. wrong ans of PORT in BE && FE fold constant:
    Before:
mysql> SELECT PARSE_URL('http://user:pwd@example.com:8080/path/to/resource', 'PORT');
+------------------------------------------------------------------------+
| PARSE_URL('http://user:pwd@example.com:8080/path/to/resource', 'PORT') |
+------------------------------------------------------------------------+
| mple.com:8080                                                          |
+------------------------------------------------------------------------+

mysql> SELECT PARSE_URL('http://user:pwd@www.test.com/path?query=string#frag', 'PORT');
+--------------------------------------------------------------------------+
| PARSE_URL('http://user:pwd@www.test.com/path?query=string#frag', 'PORT') |
+--------------------------------------------------------------------------+
| -1                                                                       |
+--------------------------------------------------------------------------+

After:

mysql> SELECT PARSE_URL('http://user:pwd@example.com:8080/path/to/resource', 'PORT');
+------------------------------------------------------------------------+
| PARSE_URL('http://user:pwd@example.com:8080/path/to/resource', 'PORT') |
+------------------------------------------------------------------------+
| 8080                                                                   |
+------------------------------------------------------------------------+

mysql> SELECT PARSE_URL('http://user:pwd@www.test.com/path?query=string#frag', 'PORT');
+--------------------------------------------------------------------------+
| PARSE_URL('http://user:pwd@www.test.com/path?query=string#frag', 'PORT') |
+--------------------------------------------------------------------------+
| NULL                                                                     |
+--------------------------------------------------------------------------+

  1. wrong ans of PATH in FE fold constant

Before:

mysql> SELECT PARSE_URL('invalid-url', 'PATH');
+----------------------------------+
| PARSE_URL('invalid-url', 'PATH') |
+----------------------------------+
| invalid-url                      |
+----------------------------------+

After:

mysql> SELECT PARSE_URL('invalid-url', 'PATH');
+----------------------------------+
| PARSE_URL('invalid-url', 'PATH') |
+----------------------------------+
| NULL                             |
+----------------------------------+

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@linrrzqqq
Copy link
Contributor Author

run buildall

@linrrzqqq
Copy link
Contributor Author

run buildall

Copy link
Contributor

@zclllyybb zclllyybb left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Sep 25, 2025
@github-actions
Copy link
Contributor

PR approved by at least one committer and no changes requested.

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@doris-robot
Copy link

ClickBench: Total hot run time: 30.19 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit d5885c7fc9585d408f4e441c3f0c51a5d63b5db1, data reload: false

query1	0.06	0.04	0.04
query2	0.09	0.06	0.05
query3	0.25	0.08	0.08
query4	1.60	0.11	0.11
query5	0.28	0.26	0.25
query6	1.18	0.64	0.65
query7	0.03	0.02	0.02
query8	0.05	0.04	0.04
query9	0.64	0.52	0.51
query10	0.57	0.56	0.56
query11	0.17	0.12	0.11
query12	0.15	0.12	0.12
query13	0.62	0.62	0.62
query14	1.04	1.04	1.04
query15	0.89	0.87	0.86
query16	0.41	0.40	0.40
query17	1.05	1.06	1.05
query18	0.21	0.19	0.21
query19	1.94	1.83	1.87
query20	0.02	0.01	0.02
query21	15.43	0.90	0.57
query22	0.76	1.20	0.66
query23	14.92	1.41	0.68
query24	6.77	2.02	0.43
query25	0.34	0.31	0.12
query26	0.65	0.15	0.14
query27	0.07	0.06	0.05
query28	9.66	1.36	0.94
query29	12.68	3.88	3.22
query30	0.28	0.15	0.12
query31	2.85	0.63	0.39
query32	3.25	0.56	0.49
query33	3.15	3.15	3.21
query34	16.22	5.47	4.89
query35	4.93	4.92	4.97
query36	0.68	0.52	0.51
query37	0.11	0.08	0.08
query38	0.06	0.05	0.04
query39	0.04	0.04	0.03
query40	0.18	0.16	0.14
query41	0.09	0.04	0.03
query42	0.05	0.03	0.03
query43	0.04	0.03	0.04
Total cold run time: 104.46 s
Total hot run time: 30.19 s

@doris-robot
Copy link

BE UT Coverage Report

Increment line coverage 100.00% (1/1) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.40% (17611/33607)
Line Coverage 37.62% (160020/425318)
Region Coverage 32.19% (122101/379372)
Branch Coverage 33.52% (53534/159686)

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 0.00% (0/6) 🎉
Increment coverage report
Complete coverage report

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (1/1) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 71.13% (23339/32810)
Line Coverage 57.53% (244003/424162)
Region Coverage 52.93% (203453/384402)
Branch Coverage 54.54% (87441/160335)

@hello-stephen
Copy link
Contributor

FE Regression Coverage Report

Increment line coverage 100.00% (6/6) 🎉
Increment coverage report
Complete coverage report

Copy link
Contributor

@HappenLee HappenLee left a comment

Choose a reason for hiding this comment

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

LGTM

@zclllyybb zclllyybb merged commit 6707309 into apache:master Sep 25, 2025
29 of 30 checks passed
@linrrzqqq linrrzqqq deleted the parse_url_err_result_in_path_and_port branch September 25, 2025 10:11
github-actions bot pushed a commit that referenced this pull request Sep 27, 2025
1. wrong ans of `PORT` in BE && FE fold constant:
Before:
```text
mysql> SELECT PARSE_URL('http://user:pwd@example.com:8080/path/to/resource', 'PORT');
+------------------------------------------------------------------------+
| PARSE_URL('http://user:pwd@example.com:8080/path/to/resource', 'PORT') |
+------------------------------------------------------------------------+
| mple.com:8080                                                          |
+------------------------------------------------------------------------+

mysql> SELECT PARSE_URL('http://user:pwd@www.test.com/path?query=string#frag', 'PORT');
+--------------------------------------------------------------------------+
| PARSE_URL('http://user:pwd@www.test.com/path?query=string#frag', 'PORT') |
+--------------------------------------------------------------------------+
| -1                                                                       |
+--------------------------------------------------------------------------+
```

After:
```text
mysql> SELECT PARSE_URL('http://user:pwd@example.com:8080/path/to/resource', 'PORT');
+------------------------------------------------------------------------+
| PARSE_URL('http://user:pwd@example.com:8080/path/to/resource', 'PORT') |
+------------------------------------------------------------------------+
| 8080                                                                   |
+------------------------------------------------------------------------+

mysql> SELECT PARSE_URL('http://user:pwd@www.test.com/path?query=string#frag', 'PORT');
+--------------------------------------------------------------------------+
| PARSE_URL('http://user:pwd@www.test.com/path?query=string#frag', 'PORT') |
+--------------------------------------------------------------------------+
| NULL                                                                     |
+--------------------------------------------------------------------------+
```
---

2. wrong ans of `PATH` in FE fold constant

Before:
```text
mysql> SELECT PARSE_URL('invalid-url', 'PATH');
+----------------------------------+
| PARSE_URL('invalid-url', 'PATH') |
+----------------------------------+
| invalid-url                      |
+----------------------------------+
```
After:
```text
mysql> SELECT PARSE_URL('invalid-url', 'PATH');
+----------------------------------+
| PARSE_URL('invalid-url', 'PATH') |
+----------------------------------+
| NULL                             |
+----------------------------------+
```
yiguolei pushed a commit that referenced this pull request Sep 27, 2025
…56521)

Cherry-picked from #56429

Co-authored-by: linrrarity <linzhenqi@selectdb.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. dev/4.0.0-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants