Current Path : /home/usr.opt/mysql57/mysql-test/suite/engines/rr_trx/t/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //home/usr.opt/mysql57/mysql-test/suite/engines/rr_trx/t/rr_sc_sum_total.test |
SELECT @sum:=SUM(`int1` + `int1_key` + `int1_unique` + `int2` + `int2_key` + `int2_unique`) AS TotalSum FROM t1; # Get some diagnostics if sum is non-zero if (`SELECT @sum`) { # Get sum of consistent rows (should be 0) SELECT SUM(`int1` + `int1_key` + `int1_unique` + `int2` + `int2_key` + `int2_unique`) FROM t1 where `is_consistent` = 1; # Get sum of inconsistent rows (should be non-0 if the total sum is to be non-0) SELECT SUM(`int1` + `int1_key` + `int1_unique` + `int2` + `int2_key` + `int2_unique`) FROM t1 where `is_consistent` = 0; # Get number of inconsistent rows SELECT COUNT(*) FROM t1 WHERE `is_consistent` = 0; # See if there is a single row which is the culprit SELECT * FROM t1 WHERE `int1` + `int1_key` + `int1_unique` + `int2` + `int2_key` + `int2_unique` = @sum; SELECT * FROM t1 WHERE `int1` + `int1_key` + `int1_unique` + `int2` + `int2_key` + `int2_unique` = -@sum; }