set tidb_cost_model_version=1; drop table if exists t; set @@tidb_init_chunk_size = 1; set @@tidb_max_chunk_size = 32; create table t(a bigint); insert into t values(1), (2), (3), (4), (5), (6), (7), (8), (9), (10); select * from t; a 1 2 3 4 5 6 7 8 9 10 select @v1 from t where (@v1 := a) > 3 && a < 9; @v1 4 5 6 7 8 select @v2, a, @v2 := a from t where a > 3 && a < 9; @v2 a @v2 := a NULL 4 4 4 5 5 5 6 6 6 7 7 7 8 8 select a from t where (@v3 := a) > 3 && @v3 = a; a 4 5 6 7 8 9 10 drop table if exists t; create table t(a decimal(10, 2), b bigint); insert into t values(1.3, 1); select * from t where a/1 > 1; a b 1.30 1