github.com/matrixorigin/matrixone@v1.2.0/test/distributed/cases/function/func_datetime_now.result (about) 1 select now()=now(); 2 now() = now() 3 true 4 create table t1(a timestamp,b int auto_increment); 5 prepare s1 from 'insert into t1(a) select now()'; 6 execute s1; 7 execute s1; 8 select t1.a=t2.a from t1,(select a from t1 where b=2)as t2 where b=1; 9 t1.a = t2.a 10 false 11 delete from t1; 12 deallocate prepare s1; 13 prepare s1 from 'insert into t1(a,b) values(now(),?)'; 14 set @b=1; 15 execute s1 using @b; 16 set @b=2; 17 execute s1 using @b; 18 select t1.a=t2.a from t1,(select a from t1 where b=2)as t2 where b=1; 19 t1.a = t2.a 20 false 21 select a=b,c from (select now(6) as a, sleep(1) as c, now(6) as b) t1; 22 a = b c 23 true 0 24 set @ts=now(); 25 select sleep(1); 26 sleep(1) 27 0 28 set @ts_after=now(); 29 select timestampdiff(microsecond, @ts, @ts_after) > 1000000 checked; 30 checked 31 true 32 drop table if exists t1; 33 create table t1(a timestamp,b int auto_increment); 34 insert into t1(a) select current_timestamp () from mo_catalog.mo_sessions limit 1; 35 select sleep(1); 36 sleep(1) 37 0 38 insert into t1(a) select current_timestamp () from mo_catalog.mo_sessions limit 1; 39 select t1.a=t2.a from t1,(select a from t1 where b=2)as t2 where b=1; 40 t1.a = t2.a 41 false 42 drop table t1; 43 select timestampdiff(second, t1, t2), a from (select sysdate() as t1, sleep(2) as a, sysdate() as t2); 44 timestampdiff(second, t1, t2) a 45 2 0