Closed zzzeek closed 7 years ago
Interesting! I'll take a look.
Thanks for catching that. It was an intermittent issue due to the use of uninitialised data (only relevant with some numbers and only in some circumstances). I have corrected this in both ODPI-C and cx_Oracle.
awesome!! only some numbers as I observed :). great
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' decimal.InvalidOperation: Invalid literal for Decimal: '574?700000000000000' decimal.InvalidOperation: Invalid literal for Decimal: '574:200000000000000' decimal.InvalidOperation: Invalid literal for Decimal: '574:900000000000000'
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.