# Copyright 2023 PingCAP, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. mysql> drop table if exists test.t; mysql> create table test.t(a char(20), b datetime, c date); mysql> insert into test.t values('', '1970-1-1 12:12:12', '1970-1-1'); mysql> insert into test.t values('123', '1989-6-6 12:12:12', '1989-6-6'); mysql> insert into test.t values('2022-3-10', '2000-3-4 12:12:12', '2000-3-4'); mysql> alter table test.t set tiflash replica 1; func> wait_table test t mysql> set @@tidb_isolation_read_engines='tiflash'; set @@tidb_enforce_mpp = 1; select dayofweek(a), dayofweek(b), dayofweek(c) from test.t; +--------------+--------------+--------------+ | dayofweek(a) | dayofweek(b) | dayofweek(c) | +--------------+--------------+--------------+ | NULL | 5 | 5 | | NULL | 3 | 3 | | 5 | 7 | 7 | +--------------+--------------+--------------+ mysql> set @@tidb_isolation_read_engines='tiflash'; set @@tidb_enforce_mpp = 1; select dayofyear(a), dayofyear(b), dayofyear(c) from test.t; +--------------+--------------+--------------+ | dayofyear(a) | dayofyear(b) | dayofyear(c) | +--------------+--------------+--------------+ | NULL | 1 | 1 | | NULL | 157 | 157 | | 69 | 64 | 64 | +--------------+--------------+--------------+ mysql> drop table if exists test.t;