1 --source include/big_test.inc
4 drop procedure if exists sp1;
8 #-- 2. Adding (one millionth) one million times should be the same as
9 #-- adding 1. So a stored procedure with many iterations will show if
10 #-- small errors accumulate.
15 CREATE PROCEDURE sp1()
17 DECLARE v1, v2, v3, v4 DECIMAL(28,12);
18 DECLARE v3_2, v4_2 DECIMAL(28, 12);
23 SET v3 = 1000000000000;
24 SET v4 = 2000000000000;
27 WHILE counter < 100000 DO
28 SET v1 = v1 + 0.000000000001;
29 SET v2 = v2 - 0.000000000001;
32 SET counter = counter + 1;
35 SET v3_2 = v3 * 0.000000000001;
36 SET v4_2 = v4 * 0.000000000001;
38 SELECT v1, v2, v3, v3_2, v4, v4_2;
44 # -- v2=1.999999900000
46 # -- v4=1.999999900000