Skip to content

Commit

Permalink
test(mtr): Add update_signed.test and delete_signed.test(stoneatom#497)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidshiz committed Oct 25, 2022
1 parent 0f42cb3 commit ca484c1
Show file tree
Hide file tree
Showing 4 changed files with 1,321 additions and 0 deletions.
380 changes: 380 additions & 0 deletions mysql-test/suite/tianmu/r/delete_signed.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,380 @@
#
# DELETE decimal and DElETE WHERE
#
DROP DATABASE IF EXISTS delete_signed_test;
CREATE DATABASE delete_signed_test;
USE delete_signed_test;
DROP PROCEDURE IF EXISTS signedinsertproc;
DROP PROCEDURE IF EXISTS signeddeleteproc;
CREATE PROCEDURE signedinsertproc ()
BEGIN
INSERT INTO cs1 VALUES (125, 125);
INSERT INTO cs1 VALUES (-125, -125);
INSERT INTO cs1 values (99998, 998);
INSERT INTO cs1 values (99999, 999);
INSERT INTO cs1 values (-99998, -998);
INSERT INTO cs1 values (-99999, -999);
INSERT INTO cs1 VALUES (0, 0);
INSERT INTO cs1 VALUES (NULL, NULL);
INSERT INTO cs2 VALUES (1.25, 1.25);
INSERT INTO cs2 VALUES (-1.25, -1.25);
INSERT INTO cs2 values (99999.998, 99999.998);
INSERT INTO cs2 values (99999.999, 99999.999);
INSERT INTO cs2 values (-99999.998, -99999.998);
INSERT INTO cs2 values (-99999.999, -99999.999);
INSERT INTO cs2 VALUES (1.1234567891, 1.1234567891);
INSERT INTO cs2 VALUES (1.999, 1.999);
INSERT INTO cs2 VALUES (-1.1234567891, -1.1234567891);
INSERT INTO cs2 VALUES (-1.999, -1.999);
INSERT INTO cs2 VALUES (1.0000000009, 1.0000000009);
INSERT INTO cs2 VALUES (-1.0000000009, -1.0000000009);
INSERT INTO cs2 VALUES (0, 0);
INSERT INTO cs2 VALUES (NULL, NULL);
INSERT INTO cs3 VALUES (0.125, 0.125);
INSERT INTO cs3 VALUES (-0.125, -0.125);
INSERT INTO cs3 values (0.99998, 0.998);
INSERT INTO cs3 values (0.99999, 0.999);
INSERT INTO cs3 values (-0.99998, -0.998);
INSERT INTO cs3 values (-0.99999, -0.999);
INSERT INTO cs3 VALUES (0.12345, 0.1234);
INSERT INTO cs3 VALUES (0.199999, 0.19999);
INSERT INTO cs3 VALUES (-0.12345, -0.1234);
INSERT INTO cs3 VALUES (-0.199999, -0.19999);
INSERT INTO cs3 VALUES (0.000009, 0.00009);
INSERT INTO cs3 VALUES (-0.000009, -0.00009);
INSERT INTO cs3 VALUES (0, 0);
INSERT INTO cs3 VALUES (NULL, NULL);
END//
CREATE PROCEDURE signeddeleteproc ()
BEGIN
DELETE FROM cs1;
DELETE FROM cs2;
DELETE FROM cs3;
END//
DROP TABLE IF EXISTS cs1;
DROP TABLE IF EXISTS cs2;
DROP TABLE IF EXISTS cs3;
CREATE TABLE cs1 (d1 DECIMAL(18), d2 DECIMAL(18)) ;
CREATE TABLE cs2 (d1 DECIMAL(18,10), d2 DECIMAL(18,10)) ;
CREATE TABLE cs3 (d1 DECIMAL(18,10), d2 DECIMAL(18,10)) ;
CALL signedinsertproc();
DELETE FROM cs1;
DELETE FROM cs2;
DELETE FROM cs3;
SELECT "signedtest1", d1, d2 FROM cs1;
signedtest1 d1 d2
SELECT "signedtest1", d1, d2 FROM cs2;
signedtest1 d1 d2
SELECT "signedtest1", d1, d2 FROM cs3;
signedtest1 d1 d2
CALL signedinsertproc();
DELETE FROM cs1 WHERE d1=-99998;
DELETE FROM cs1 WHERE d2=999;
DELETE FROM cs2 WHERE d1=-99999.998;
DELETE FROM cs2 WHERE d2=99999.999;
DELETE FROM cs3 WHERE d1=-0.99998;
DELETE FROM cs3 WHERE d2=0.999;
SELECT "signedtest2", d1, d2 FROM cs1;
signedtest2 d1 d2
signedtest2 125 125
signedtest2 -125 -125
signedtest2 99998 998
signedtest2 -99999 -999
signedtest2 0 0
signedtest2 NULL NULL
SELECT "signedtest2", d1, d2 FROM cs2;
signedtest2 d1 d2
signedtest2 1.2500000000 1.2500000000
signedtest2 -1.2500000000 -1.2500000000
signedtest2 99999.9980000000 99999.9980000000
signedtest2 -99999.9990000000 -99999.9990000000
signedtest2 1.1234567891 1.1234567891
signedtest2 1.9990000000 1.9990000000
signedtest2 -1.1234567891 -1.1234567891
signedtest2 -1.9990000000 -1.9990000000
signedtest2 1.0000000009 1.0000000009
signedtest2 -1.0000000009 -1.0000000009
signedtest2 0.0000000000 0.0000000000
signedtest2 NULL NULL
SELECT "signedtest2", d1, d2 FROM cs3;
signedtest2 d1 d2
signedtest2 0.1250000000 0.1250000000
signedtest2 -0.1250000000 -0.1250000000
signedtest2 0.9999800000 0.9980000000
signedtest2 -0.9999900000 -0.9990000000
signedtest2 0.1234500000 0.1234000000
signedtest2 0.1999990000 0.1999900000
signedtest2 -0.1234500000 -0.1234000000
signedtest2 -0.1999990000 -0.1999900000
signedtest2 0.0000090000 0.0000900000
signedtest2 -0.0000090000 -0.0000900000
signedtest2 0.0000000000 0.0000000000
signedtest2 NULL NULL
CALL signeddeleteproc();
CALL signedinsertproc();
DELETE FROM cs1 WHERE d1 <= -99998 OR d2 >= 998;
DELETE FROM cs2 WHERE d1 <= -99999.998 OR d2 >= 99999.998;
DELETE FROM cs3 WHERE d1 <= -0.99998 OR d2 >= 0.998;
SELECT "signedtest4a", d1, d2 FROM cs1;
signedtest4a d1 d2
signedtest4a 125 125
signedtest4a -125 -125
signedtest4a 0 0
signedtest4a NULL NULL
SELECT "signedtest4a", d1, d2 FROM cs2;
signedtest4a d1 d2
signedtest4a 1.2500000000 1.2500000000
signedtest4a -1.2500000000 -1.2500000000
signedtest4a 1.1234567891 1.1234567891
signedtest4a 1.9990000000 1.9990000000
signedtest4a -1.1234567891 -1.1234567891
signedtest4a -1.9990000000 -1.9990000000
signedtest4a 1.0000000009 1.0000000009
signedtest4a -1.0000000009 -1.0000000009
signedtest4a 0.0000000000 0.0000000000
signedtest4a NULL NULL
SELECT "signedtest4a", d1, d2 FROM cs3;
signedtest4a d1 d2
signedtest4a 0.1250000000 0.1250000000
signedtest4a -0.1250000000 -0.1250000000
signedtest4a 0.1234500000 0.1234000000
signedtest4a 0.1999990000 0.1999900000
signedtest4a -0.1234500000 -0.1234000000
signedtest4a -0.1999990000 -0.1999900000
signedtest4a 0.0000090000 0.0000900000
signedtest4a -0.0000090000 -0.0000900000
signedtest4a 0.0000000000 0.0000000000
signedtest4a NULL NULL
CALL signeddeleteproc();
CALL signedinsertproc();
DELETE FROM cs1 WHERE d1 < -99998 OR d2 > 998;
DELETE FROM cs2 WHERE d1 < -99999.998 OR d2 > 99999.998;
DELETE FROM cs3 WHERE d1 < -0.99998 OR d2 > 0.998;
SELECT "signedtest4", d1, d2 FROM cs1;
signedtest4 d1 d2
signedtest4 125 125
signedtest4 -125 -125
signedtest4 99998 998
signedtest4 -99998 -998
signedtest4 0 0
signedtest4 NULL NULL
SELECT "signedtest4", d1, d2 FROM cs2;
signedtest4 d1 d2
signedtest4 1.2500000000 1.2500000000
signedtest4 -1.2500000000 -1.2500000000
signedtest4 99999.9980000000 99999.9980000000
signedtest4 -99999.9980000000 -99999.9980000000
signedtest4 1.1234567891 1.1234567891
signedtest4 1.9990000000 1.9990000000
signedtest4 -1.1234567891 -1.1234567891
signedtest4 -1.9990000000 -1.9990000000
signedtest4 1.0000000009 1.0000000009
signedtest4 -1.0000000009 -1.0000000009
signedtest4 0.0000000000 0.0000000000
signedtest4 NULL NULL
SELECT "signedtest4", d1, d2 FROM cs3;
signedtest4 d1 d2
signedtest4 0.1250000000 0.1250000000
signedtest4 -0.1250000000 -0.1250000000
signedtest4 0.9999800000 0.9980000000
signedtest4 -0.9999800000 -0.9980000000
signedtest4 0.1234500000 0.1234000000
signedtest4 0.1999990000 0.1999900000
signedtest4 -0.1234500000 -0.1234000000
signedtest4 -0.1999990000 -0.1999900000
signedtest4 0.0000090000 0.0000900000
signedtest4 -0.0000090000 -0.0000900000
signedtest4 0.0000000000 0.0000000000
signedtest4 NULL NULL
DELETE FROM cs1 WHERE d1 is NULL;
DELETE FROM cs2 WHERE d1 is NULL;
DELETE FROM cs3 WHERE d1 is NULL;
SELECT "signedtest5", d1, d2 FROM cs1;
signedtest5 d1 d2
signedtest5 125 125
signedtest5 -125 -125
signedtest5 99998 998
signedtest5 -99998 -998
signedtest5 0 0
SELECT "signedtest5", d1, d2 FROM cs2;
signedtest5 d1 d2
signedtest5 1.2500000000 1.2500000000
signedtest5 -1.2500000000 -1.2500000000
signedtest5 99999.9980000000 99999.9980000000
signedtest5 -99999.9980000000 -99999.9980000000
signedtest5 1.1234567891 1.1234567891
signedtest5 1.9990000000 1.9990000000
signedtest5 -1.1234567891 -1.1234567891
signedtest5 -1.9990000000 -1.9990000000
signedtest5 1.0000000009 1.0000000009
signedtest5 -1.0000000009 -1.0000000009
signedtest5 0.0000000000 0.0000000000
SELECT "signedtest5", d1, d2 FROM cs3;
signedtest5 d1 d2
signedtest5 0.1250000000 0.1250000000
signedtest5 -0.1250000000 -0.1250000000
signedtest5 0.9999800000 0.9980000000
signedtest5 -0.9999800000 -0.9980000000
signedtest5 0.1234500000 0.1234000000
signedtest5 0.1999990000 0.1999900000
signedtest5 -0.1234500000 -0.1234000000
signedtest5 -0.1999990000 -0.1999900000
signedtest5 0.0000090000 0.0000900000
signedtest5 -0.0000090000 -0.0000900000
signedtest5 0.0000000000 0.0000000000
DELETE FROM cs1 WHERE d1 != 125;
DELETE FROM cs2 WHERE d1 != 1.25;
DELETE FROM cs3 WHERE d1 != 0.125;
SELECT "signedtest6", d1, d2 FROM cs1;
signedtest6 d1 d2
signedtest6 125 125
SELECT "signedtest6", d1, d2 FROM cs2;
signedtest6 d1 d2
signedtest6 1.2500000000 1.2500000000
SELECT "signedtest6", d1, d2 FROM cs3;
signedtest6 d1 d2
signedtest6 0.1250000000 0.1250000000
CALL signeddeleteproc();
CALL signedinsertproc();
DELETE FROM cs1 WHERE d1 = d2;
DELETE FROM cs2 WHERE d1 = d2;
DELETE FROM cs3 WHERE d1 = d2;
SELECT "signedtest7", d1, d2 FROM cs1;
signedtest7 d1 d2
signedtest7 99998 998
signedtest7 99999 999
signedtest7 -99998 -998
signedtest7 -99999 -999
signedtest7 NULL NULL
SELECT "signedtest7", d1, d2 FROM cs2;
signedtest7 d1 d2
signedtest7 NULL NULL
SELECT "signedtest7", d1, d2 FROM cs3;
signedtest7 d1 d2
signedtest7 0.9999800000 0.9980000000
signedtest7 0.9999900000 0.9990000000
signedtest7 -0.9999800000 -0.9980000000
signedtest7 -0.9999900000 -0.9990000000
signedtest7 0.1234500000 0.1234000000
signedtest7 0.1999990000 0.1999900000
signedtest7 -0.1234500000 -0.1234000000
signedtest7 -0.1999990000 -0.1999900000
signedtest7 0.0000090000 0.0000900000
signedtest7 -0.0000090000 -0.0000900000
signedtest7 NULL NULL
CALL signeddeleteproc();
CALL signedinsertproc();
DELETE FROM cs1 WHERE d1 != d2;
DELETE FROM cs2 WHERE d1 != d2;
DELETE FROM cs3 WHERE d1 != d2;
SELECT "signedtest8", d1, d2 FROM cs1;
signedtest8 d1 d2
signedtest8 125 125
signedtest8 -125 -125
signedtest8 0 0
signedtest8 NULL NULL
SELECT "signedtest8", d1, d2 FROM cs2;
signedtest8 d1 d2
signedtest8 1.2500000000 1.2500000000
signedtest8 -1.2500000000 -1.2500000000
signedtest8 99999.9980000000 99999.9980000000
signedtest8 99999.9990000000 99999.9990000000
signedtest8 -99999.9980000000 -99999.9980000000
signedtest8 -99999.9990000000 -99999.9990000000
signedtest8 1.1234567891 1.1234567891
signedtest8 1.9990000000 1.9990000000
signedtest8 -1.1234567891 -1.1234567891
signedtest8 -1.9990000000 -1.9990000000
signedtest8 1.0000000009 1.0000000009
signedtest8 -1.0000000009 -1.0000000009
signedtest8 0.0000000000 0.0000000000
signedtest8 NULL NULL
SELECT "signedtest8", d1, d2 FROM cs3;
signedtest8 d1 d2
signedtest8 0.1250000000 0.1250000000
signedtest8 -0.1250000000 -0.1250000000
signedtest8 0.0000000000 0.0000000000
signedtest8 NULL NULL
CALL signeddeleteproc();
CALL signedinsertproc();
DELETE FROM cs1 WHERE d1 < d2;
DELETE FROM cs2 WHERE d1 < d2;
DELETE FROM cs3 WHERE d1 < d2;
SELECT "signedtest9", d1, d2 FROM cs1;
signedtest9 d1 d2
signedtest9 125 125
signedtest9 -125 -125
signedtest9 99998 998
signedtest9 99999 999
signedtest9 0 0
signedtest9 NULL NULL
SELECT "signedtest9", d1, d2 FROM cs2;
signedtest9 d1 d2
signedtest9 1.2500000000 1.2500000000
signedtest9 -1.2500000000 -1.2500000000
signedtest9 99999.9980000000 99999.9980000000
signedtest9 99999.9990000000 99999.9990000000
signedtest9 -99999.9980000000 -99999.9980000000
signedtest9 -99999.9990000000 -99999.9990000000
signedtest9 1.1234567891 1.1234567891
signedtest9 1.9990000000 1.9990000000
signedtest9 -1.1234567891 -1.1234567891
signedtest9 -1.9990000000 -1.9990000000
signedtest9 1.0000000009 1.0000000009
signedtest9 -1.0000000009 -1.0000000009
signedtest9 0.0000000000 0.0000000000
signedtest9 NULL NULL
SELECT "signedtest9", d1, d2 FROM cs3;
signedtest9 d1 d2
signedtest9 0.1250000000 0.1250000000
signedtest9 -0.1250000000 -0.1250000000
signedtest9 0.9999800000 0.9980000000
signedtest9 0.9999900000 0.9990000000
signedtest9 0.1234500000 0.1234000000
signedtest9 0.1999990000 0.1999900000
signedtest9 -0.0000090000 -0.0000900000
signedtest9 0.0000000000 0.0000000000
signedtest9 NULL NULL
CALL signeddeleteproc();
CALL signedinsertproc();
DELETE FROM cs1 WHERE d1 > d2;
DELETE FROM cs2 WHERE d1 > d2;
DELETE FROM cs3 WHERE d1 > d2;
SELECT "signedtest10", d1, d2 FROM cs1;
signedtest10 d1 d2
signedtest10 125 125
signedtest10 -125 -125
signedtest10 -99998 -998
signedtest10 -99999 -999
signedtest10 0 0
signedtest10 NULL NULL
SELECT "signedtest10", d1, d2 FROM cs2;
signedtest10 d1 d2
signedtest10 1.2500000000 1.2500000000
signedtest10 -1.2500000000 -1.2500000000
signedtest10 99999.9980000000 99999.9980000000
signedtest10 99999.9990000000 99999.9990000000
signedtest10 -99999.9980000000 -99999.9980000000
signedtest10 -99999.9990000000 -99999.9990000000
signedtest10 1.1234567891 1.1234567891
signedtest10 1.9990000000 1.9990000000
signedtest10 -1.1234567891 -1.1234567891
signedtest10 -1.9990000000 -1.9990000000
signedtest10 1.0000000009 1.0000000009
signedtest10 -1.0000000009 -1.0000000009
signedtest10 0.0000000000 0.0000000000
signedtest10 NULL NULL
SELECT "signedtest10", d1, d2 FROM cs3;
signedtest10 d1 d2
signedtest10 0.1250000000 0.1250000000
signedtest10 -0.1250000000 -0.1250000000
signedtest10 -0.9999800000 -0.9980000000
signedtest10 -0.9999900000 -0.9990000000
signedtest10 -0.1234500000 -0.1234000000
signedtest10 -0.1999990000 -0.1999900000
signedtest10 0.0000090000 0.0000900000
signedtest10 0.0000000000 0.0000000000
signedtest10 NULL NULL
DROP PROCEDURE IF EXISTS signedinsertproc;
DROP PROCEDURE IF EXISTS signeddeleteproc;
DROP DATABASE delete_signed_test;
Loading

0 comments on commit ca484c1

Please sign in to comment.