github.com/matrixorigin/matrixone@v1.2.0/test/distributed/cases/function/func_sleep.sql (about) 1 select sleep(); 2 select sleep(1); 3 select sleep(1.5); 4 select sleep(null); 5 select sleep(-1); 6 select sleep(-1.5); 7 8 create table t1 (a int,b int); 9 insert into t1 values (1,1),(1,null); 10 select sleep(a) from t1; 11 select sleep(b) from t1; 12 13 -- @suit 14 -- @case 15 -- @desc:test for sleep() function 16 -- @label:bvt 17 18 SELECT sleep(0); 19 SELECT sleep(1); 20 SELECT sleep(0.33); 21 22 -- parameter error 23 SELECT sleep(-2); 24 SELECT sleep(-23.1); 25 26 -- @suite 27 -- @setup 28 DROP TABLE IF EXISTS sleep_01; 29 CREATE TABLE sleep_01 (id int); 30 31 -- Empty table 32 SELECT * ,sleep(0.2) from sleep_01; 33 34 -- One record 35 INSERT INTO sleep_01 VALUES(273); 36 SELECT *, sleep(1.2) FROM sleep_01; 37 SELECT *, sleep(0) FROM sleep_01; 38 39 -- two records 40 INSERT INTO sleep_01 VALUES(-32783); 41 42 SELECT *,sleep(0.2) FROM sleep_01; 43 SELECT *,sleep(0) FROM sleep_01; 44 45 -- three records 46 INSERT INTO sleep_01 VALUES(0); 47 48 SELECT * ,sleep(0.2) FROM sleep_01; 49 50 SELECT *, sleep(0) FROM sleep_01; 51 52 -- @suite 53 -- @setup 54 DROP TABLE IF EXISTS sleep_02; 55 CREATE TABLE sleep_02 (id int, name VARCHAR(10), province VARCHAR(100) NOT NULL, address VARCHAR(100)); 56 INSERT INTO sleep_02 VALUES(1, '张三', '陕西', '大头村二组'); 57 INSERT INTO sleep_02 VALUES(2, '李四', '北京', '快乐村三组'); 58 INSERT INTO sleep_02 VALUES(3, '王五', '陕西', '美丽村四组'); 59 60 61 SELECT province, address, sleep(2) FROM sleep_02 WHERE name = '张三'; 62 SELECT name, sleep(0.3) FROM sleep_02 WHERE address = '大头村二组' AND province = '陕西'; 63 SELECT *, sleep(0.2) FROM sleep_02 WHERE id = COS(0) + TAN(45); 64 65 SELECT name, province, sleep(0.2) FROM sleep_02; 66 67 68 -- @suite 69 -- @setup 70 DROP TABLE IF EXISTS sleep_03; 71 DROP TABLE IF EXISTS sleep_04; 72 CREATE TABLE sleep_03(d INT,d1 VARCHAR(20), d2 BIGINT,PRIMARY KEY (d)); 73 CREATE TABLE sleep_04( d INT,d1 CHAR(20),d2 DATE,PRIMARY KEY (d)); 74 INSERT INTO sleep_03 VALUES (1,'lijklnfdsalj',19290988); 75 INSERT INTO sleep_03 VALUES (2,'xlziblkfdi',1949100132); 76 INSERT INTO sleep_03 VALUES (3,'ixioklakmaria',69456486); 77 INSERT INTO sleep_03 VALUES (4,'brzilaiusd',6448781575); 78 79 INSERT INTO sleep_04 VALUES (1,'usaisagoodnat','1970-01-02'); 80 INSERT INTO sleep_04 VALUES (2,'chanialfakbjap','1971-11-12'); 81 INSERT INTO sleep_04 VALUES (3,'indiaisashit','1972-09-09'); 82 INSERT INTO sleep_04 VALUES (4,'xingoporelka','1973-12-07'); 83 84 SELECT sleep_03.d, sleep(0) FROM sleep_03,sleep_04 WHERE sleep_03.d = sleep_04.d; 85 86 SELECT sleep_03.d, sleep(0.1) FROM sleep_03; 87 SELECT sleep_03.d, sleep_03.d1, sleep(0.4) FROM sleep_03 JOIN sleep_04 ON sleep_03.d = sleep_04.d; 88 SELECT sleep_03.d, sleep(1) FROM sleep_03 join sleep_04 on sleep_03.d=sleep_04.d; 89 SELECT sleep_03.d, sleep(0.432)FROM sleep_03 right join sleep_04 on sleep_03.d=sleep_04.d; 90 SELECT d, sleep(0.5) FROM sleep_03 ORDER BY d2 desc; 91 92 93 94 select sleep(); 95 select sleep(1); 96 select sleep(1.5); 97 select sleep(null); 98 select sleep(-1); 99 select sleep(-1.5); 100 101 create table t1 (a int,b int); 102 insert into t1 values (1,1),(1,null); 103 select sleep(a) from t1; 104 select sleep(b) from t1;