Changeset: 696a36980c8e for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=696a36980c8e Modified Files: sql/test/BugTracker-2012/Tests/large-number-operation-strange-results.Bug-2929.py Branch: default Log Message:
I didn't convert this test well diffs (52 lines): diff --git a/sql/test/BugTracker-2012/Tests/large-number-operation-strange-results.Bug-2929.py b/sql/test/BugTracker-2012/Tests/large-number-operation-strange-results.Bug-2929.py --- a/sql/test/BugTracker-2012/Tests/large-number-operation-strange-results.Bug-2929.py +++ b/sql/test/BugTracker-2012/Tests/large-number-operation-strange-results.Bug-2929.py @@ -11,17 +11,8 @@ try: except pymonetdb.DatabaseError as e: has_huge = False -cur1.execute('select 10000000 * 100000 * 11.51 + 51.097 * 100000;') -if cur1.fetchall() != [(11510005109700,)]: - sys.stderr.write('[(11510005109700,)] expected') try: - cur1.execute('select convert(1000000000000000000 , decimal(20)) * 100000000000000 * 11.51 + 51.097 * 100000000000000;') - sys.stderr.write("Exception expected") -except pymonetdb.DatabaseError as e: - if "overflow in calculation" not in str(e): - sys.stderr.write('Wrong error %s, expected overflow in calculation' % (str(e))) -try: - cur1.execute('select convert ( 10000000 * 100000 * 11.51 , decimal(15)) + convert (51.097 * 100000 , decimal(15));') + cur1.execute('select 10000000 * 100000 * 11.51 + 51.097 * 100000;') if has_huge: if cur1.fetchall() != [(11510005109700,)]: sys.stderr.write('[(11510005109700,)] expected') @@ -29,10 +20,27 @@ try: sys.stderr.write("Exception expected") except pymonetdb.DatabaseError as e: if not has_huge: + if "overflow in calculation" not in str(e): + sys.stderr.write('Wrong error %s, expected overflow in calculation' % (str(e))) + else: + raise e +try: + cur1.execute('select convert(1000000000000000000 , decimal(20)) * 100000000000000 * 11.51 + 51.097 * 100000000000000;') + if has_huge: + if cur1.fetchall() != [(11510005109700,)]: + sys.stderr.write('[(11510005109700,)] expected') + else: + sys.stderr.write("Exception expected") +except pymonetdb.DatabaseError as e: + if has_huge: + if "overflow in calculation" not in str(e): + sys.stderr.write('Wrong error %s, expected overflow in calculation' % (str(e))) + else: if "Decimal of 20 digits are not supported in" not in str(e): sys.stderr.write('Wrong error %s, expected Decimal of 20 digits are not supported in' % (str(e))) - else: - raise e +cur1.execute('select convert ( 10000000 * 100000 * 11.51 , decimal(15)) + convert (51.097 * 100000 , decimal(15));') +if cur1.fetchall() != [(11510005109700,)]: + sys.stderr.write('[(11510005109700,)] expected') try: cur1.execute('select convert (convert(1000000000000000000 , decimal(20)) * 100000000000000 * 11.51 , decimal(35)) + convert (51.097 * 100000000000000 , decimal(35));') if has_huge: _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list