[6.0b1] Decimal parameter edge case. · Issue #22 · oracle/python-cx_Oracle · GitHub
Skip to content

[6.0b1] Decimal parameter edge case. #22

Description

@felixxm

I think that there is regression in cx_Oracle==6.0b1. Passing Decimal('0.000') as a parameter to the cursor doesn't return correct result, moreover passing Decimal('0'), '0', '0.000' works. Please find below regression test that fails in cx_Oracle==6.0b1 and works in cx_Oracle==5.3:

import cx_Oracle
connection = cx_Oracle.connect("user", "password", "TNS")
cursor = connection.cursor()
cursor.execute('CREATE TABLE "TEST"("DATA" NUMBER(5,3) PRIMARY KEY)')
cursor.execute('INSERT INTO "TEST"("DATA") VALUES (0)')
cursor.execute(
    'SELECT 1 FROM "TEST" WHERE "TEST"."DATA" = :arg0',
    {':arg0': Decimal('0.000')},
)
row = cursor.fetchone()
assert row is not None
assert row[0] == 1
  • Python 3.4.3 (64-bit)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions