Skip to content

formatDateTime: Treat %W unconditionally as a variable-length formatter - #101847

Merged
alexey-milovidov merged 2 commits into
masterfrom
bug101844
Apr 8, 2026
Merged

alexey-milovidov merged 2 commits into
masterfrom
bug101844

Conversation

@rschu1ze

@rschu1ze rschu1ze commented Apr 6, 2026 •

Copy link
Copy Markdown
Member

Resolves #101844

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Fixed incorrect output in function formatDateTime with formatter%W with certain (non-default) formatting settings.

Version info

  • Merged into: 26.4.1.619
  • Backported to: 26.3.5.9, 26.2.9.6, 26.1.8.24, 25.8.22.17

@clickhouse-gh

clickhouse-gh Bot commented Apr 6, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [a90ad53]

Summary: ✅


AI Review

Summary

This PR fixes formatDateTime fixed-width detection so %W is always treated as variable-length, independent of MySQL-format compatibility settings. The code change is small and targeted, and the added stateless test covers the reported setting combinations where behavior previously diverged. I did not find correctness, safety, or compatibility regressions in the modified code.

Missing context
  • ⚠️ No CI logs or Praktika report links were provided in this review context, so I could not independently verify runtime results beyond code inspection.
ClickHouse Rules
Item Status Notes
Deletion logging ➖
Serialization versioning ➖
Core-area scrutiny ✅
No test removal ✅
Experimental gate ➖
No magic constants ✅
Backward compatibility ✅
SettingsChangesHistory.cpp ➖
PR metadata quality ✅
Safe rollout ✅
Compilation time ✅
Final Verdict
  • Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-bugfix Pull request with bugfix, not backported by default label Apr 6, 2026
@alexey-milovidov

Copy link
Copy Markdown
Member

The Stress test (arm_msan) failure is fixed by #101239, which should be merged first. After it is merged, please update the branch to include the fix.

@clickhouse-gh

clickhouse-gh Bot commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 84.00% 84.00% +0.00%
Functions 90.90% 90.90% +0.00%
Branches 76.60% 76.50% -0.10%

Changed lines: 100.00% (21/21) | lost baseline coverage: 5 line(s) · Uncovered code

Full report · Diff report

@alexey-milovidov alexey-milovidov self-assigned this Apr 8, 2026
@alexey-milovidov

Copy link
Copy Markdown
Member

Thanks for the PR! LGTM, and it is entirely green!

@alexey-milovidov
alexey-milovidov merged commit 61a96e7 into master Apr 8, 2026
315 of 318 checks passed
@alexey-milovidov
alexey-milovidov deleted the bug101844 branch April 8, 2026 00:32
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Apr 8, 2026
@rschu1ze rschu1ze added the pr-must-backport Pull request should be backported intentionally. Use this label with great care! label Apr 8, 2026
@robot-ch-test-poll1 robot-ch-test-poll1 added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Apr 8, 2026
robot-clickhouse added a commit that referenced this pull request Apr 8, 2026
robot-clickhouse added a commit that referenced this pull request Apr 8, 2026
robot-clickhouse added a commit that referenced this pull request Apr 8, 2026
robot-clickhouse added a commit that referenced this pull request Apr 8, 2026
@robot-clickhouse robot-clickhouse added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Apr 8, 2026
rschu1ze added a commit that referenced this pull request Apr 8, 2026
Backport #101847 to 25.8: `formatDateTime`: Treat `%W` unconditionally as a variable-length formatter
rschu1ze added a commit that referenced this pull request Apr 8, 2026
Backport #101847 to 26.1: `formatDateTime`: Treat `%W` unconditionally as a variable-length formatter
rschu1ze added a commit that referenced this pull request Apr 8, 2026
Backport #101847 to 26.2: `formatDateTime`: Treat `%W` unconditionally as a variable-length formatter
rschu1ze added a commit that referenced this pull request Apr 8, 2026
Backport #101847 to 26.3: `formatDateTime`: Treat `%W` unconditionally as a variable-length formatter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-bugfix Pull request with bugfix, not backported by default pr-must-backport Pull request should be backported intentionally. Use this label with great care! pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

containsOnlyFixedWidthMySQLFormatters skips %W variable-width check when mysql_e_with_space_padding=false

5 participants