# 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.a1 mysql> create table test.a1(id int(11) NOT NULL AUTO_INCREMENT, name enum('A','B','C') DEFAULT NULL, PRIMARY KEY (id)); mysql> insert into test.a1 values (1,'A'),(2,'B'),(3,'C'); mysql> alter table test.a1 set tiflash replica 1; func> wait_table test a1 mysql> set session tidb_isolation_read_engines='tiflash'; select * from test.a1 order by id; +----+------+ | id | name | +----+------+ | 1 | A | | 2 | B | | 3 | C | +----+------+ mysql> alter table test.a1 change name name enum('A','B','C', 'D'); mysql> insert into test.a1 values (4,'D'); mysql> set session tidb_isolation_read_engines='tiflash'; select * from test.a1 order by id; +----+------+ | id | name | +----+------+ | 1 | A | | 2 | B | | 3 | C | | 4 | D | +----+------+ mysql> SET SESSION SQL_MODE = ''; insert into test.a1 values (5,''); mysql> set session tidb_isolation_read_engines='tiflash'; select * from test.a1 order by id; +----+------+ | id | name | +----+------+ | 1 | A | | 2 | B | | 3 | C | | 4 | D | | 5 | | +----+------+ mysql> set session tidb_isolation_read_engines='tiflash'; select name+0 from test.a1 order by id; +--------+ | name+0 | +--------+ | 1 | | 2 | | 3 | | 4 | | 0 | +--------+ mysql> drop table if exists test.a1