Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
weird numeric issue, not sure which side its on but did not occur in cx_oracle 5.x #77
the test program below works without issue on all the 5.x cx_Oracle series, like 5.3, etc. When I run it on 6.0.2, I get random behavior, all seemingly related to the value "5748E+15". With outconverter set, I get just failures like:
AssertionError: set([Decimal('400000000'), Decimal('5749300000000000000'), Decimal('1521000000000000'), Decimal('100000000000')]) != set([Decimal('4E+8'), Decimal('5.748E+18'), Decimal('1E+11'), Decimal('1.521E+15')])
noting above, the exponent display is different, but that part is normal, the issue is the 5.748E value isn't coming back correctly - in my own test suites, sometimes it comes back as None also as though the outputtypehandler is getting skipped.
however more weirdly, if I use cursor.var(decimal.Decimal, ...) as cx_Oracle 6.0.x supports, then I get different errors each time, of the form:
decimal.InvalidOperation: Invalid literal for Decimal: '574A900000000000000'
if I remove the "5748E+15" value, then everything works without failing.
this is Oracle 11.2 express. I'm not sure if this is some weird known Oracle thing but if I use cx_Oracle 5.x, it goes away. This may well be within the realm of, "this won't work anymore on Oracle express on a laptop" but looking to see if you have some idea of what changed and what could cause this.