Bug 257546

Summary: bugs.webkit.org internal server error when limiting search by 1 month
Product: WebKit Reporter: Alexey Proskuryakov <ap>
Component: WebKit WebsiteAssignee: lingho <lingho>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, jond, lingho, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 257577    
Bug Blocks:    

Description Alexey Proskuryakov 2023-05-31 09:41:44 PDT
When I search for bugs changed in the last month, I get an internal server error.

Steps to reproduce:
1. Open https://bugs.webkit.org/query.cgi
2. Show advanced fields.
3. Enter anything for the search string.
4. In "Search By Change History" below, set the search from "1m" to "Now".
5. Hit Enter.

Results: 
-------------------
Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at admin@webkit.org to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.
-------------------


This isn't happening when searching within 2 months from now, but happens again with 3 months from now. So I suspect that this is a date arithmetic bug that happens on 31st of each month, and won't reproduce tomorrow. But despite this, I suspect that this is a regression (perhaps from upgrading something underlying), because I search like this all the time, and would likely have run into this earlier if it always happened.
Comment 1 lingho@apple.com 2023-05-31 12:01:53 PDT
It appears that the SqlifyDate function in Bugzilla/Search.pm takes today's date and substracts month without changing the day.

For example, giving 1m to the function returns 2023-04-31 11:06:09;
giving 3m to the function returns 2023-02-31 11:07:38 . The error most likely cause by database query with invalid date.
Comment 2 Radar WebKit Bug Importer 2023-05-31 12:32:48 PDT
<rdar://problem/110075621>
Comment 3 lingho@apple.com 2023-05-31 12:33:51 PDT
Pull request: https://github.com/WebKit/WebKit/pull/14546
Comment 4 EWS 2023-05-31 15:09:25 PDT
Committed 264758@main (a9b9e3661656): <https://commits.webkit.org/264758@main>

Reviewed commits have been landed. Closing PR #14546 and removing active labels.
Comment 5 WebKit Commit Bot 2023-05-31 18:13:44 PDT
Re-opened since this is blocked by bug 257577
Comment 6 lingho@apple.com 2023-05-31 20:28:23 PDT
Pull request https://github.com/WebKit/WebKit/pull/14569
Comment 7 EWS 2023-06-01 18:10:48 PDT
Committed 264820@main (48759ded673b): <https://commits.webkit.org/264820@main>

Reviewed commits have been landed. Closing PR #14569 and removing active labels.