Changeset: 09da452b2f51 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=09da452b2f51 Added Files: sql/test/BugTracker-2014/Tests/number_4_4.Bug-3543.sql Modified Files: sql/test/BugTracker-2014/Tests/All Branch: Oct2014 Log Message:
added test for bug 3543 diffs (43 lines): diff --git a/sql/test/BugTracker-2014/Tests/All b/sql/test/BugTracker-2014/Tests/All --- a/sql/test/BugTracker-2014/Tests/All +++ b/sql/test/BugTracker-2014/Tests/All @@ -33,4 +33,5 @@ orderby_count.Bug-3526 outer_join_using_diff_types_using.Bug-3536 select-distinct-order-limit.Bug-3527 round.Bug-3542 +number_4_4.Bug-3543 ifthenelse.Bug-3546 diff --git a/sql/test/BugTracker-2014/Tests/number_4_4.Bug-3543.sql b/sql/test/BugTracker-2014/Tests/number_4_4.Bug-3543.sql new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2014/Tests/number_4_4.Bug-3543.sql @@ -0,0 +1,29 @@ +CREATE TABLE fract_only (id int, val numeric(4,4)); +--Note that the precision is equal to the scale, so the allowed number of significant digits before the decimal dot should not exceed 0 (4 - 4 = 0). + +--the following SQL are NOT accepted but should be accepted: +INSERT INTO fract_only VALUES (1, '-0.9999'); +INSERT INTO fract_only VALUES (2, '+0.9999'); + +--the following SQL are accepted but incorrect data is stored: +INSERT INTO fract_only VALUES (3, '+.9999'); +SELECT * FROM fract_only; +-- returns value 2.5535 !! + +--the following SQL are accepted but should error: +INSERT INTO fract_only VALUES (4, '0.99995'); -- should fail but is invalidly accepted +INSERT INTO fract_only VALUES (5, '0.99999'); -- should fail but is invalidly accepted +SELECT * FROM fract_only; +-- both show 1.0000 which out of the allowed value range of numeric(4,4) + +INSERT INTO fract_only VALUES (6, '+0.99995'); -- correctly fails +INSERT INTO fract_only VALUES (6, '+.99995'); -- should fail but is invalidly accepted +SELECT * FROM fract_only; +-- returns value 2.5536 for id 6 !! + +INSERT INTO fract_only VALUES (7, '-0.99995'); -- correctly fails +INSERT INTO fract_only VALUES (7, '-.999998'); -- should fail but is invalidly accepted +SELECT * FROM fract_only; +-- returns value -0.9999 for id 7 !! + +drop table fract_only; _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list