@@global.default_week_format was not immediately loaded on new session, causing week() to use the wrong mode #21510
Labels
component/session
severity/moderate
sig/sql-infra
SIG: SQL Infra
type/bug
The issue is confirmed as a bug.
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
First, change the global default_week_format
mysql -u root -h 127.0.0.1 -P 4000 -e "set global default_week_format = 4"
Then execute week() in a new connection.
mysql -u root -h 127.0.0.1 -P 4000 -E -e "select week('2020-02-02'), @@default_week_format, week('2020-02-02')"
2. What did you expect to see? (Required)
3. What did you see instead (Required)
The first execution of
week('2020-02-02')
used mode 0 instead of 4.4. What is your TiDB version? (Required)
Repro with both v4.0.8 and nightly 62fd2b7
The text was updated successfully, but these errors were encountered: