oracle / python-oracledb

Python driver for Oracle Database conforming to the Python DB API 2.0 specification. This is the renamed, new major release of cx_Oracle
https://oracle.github.io/python-oracledb
Other
308 stars 61 forks source link

Windows: Access Violation when calling executemany() #217

Closed deymundson closed 10 months ago

deymundson commented 10 months ago
  1. What versions are you using? Database Version: 19.14.0.0.0

platform.platform: Windows-10-10.0.19045-SP0 sys.maxsize > 2**32: True platform.python_version: 3.11.4 oracledb.version: 1.4.0

  1. Is it an error or a hang or a crash? Crash

  2. What error(s) or behavior you are seeing? The python program immediately exits. The last exit code is -1073741819, which seems to indicate some form of access violation.

    > .\python.exe
    Python 3.11.4 (tags/v3.11.4:d2340ef, Jun  7 2023, 05:45:37) [MSC v.1934 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import oracledb
    >>> oracledb.init_oracle_client()
    >>> connection = oracledb.connect([REDACTED] ;P)
    >>> cursor = connection.cursor()
    >>> cursor.setinputsizes(None, int)
    [None, <oracledb.Var of type DB_TYPE_NUMBER with value None>]
    >>> cursor.executemany("select :1, :2 from dual", [])
    [[Program immediately exits]]
    > $LASTEXITCODE
    -1073741819
  3. Does your application call init_oracle_client()? Yes

  4. Include a runnable Python script that shows the problem.

    import oracledb
    oracledb.init_oracle_client()
    connection = oracledb.connect(...)
    cursor = connection.cursor()
    cursor.setinputsizes(None, int)
    cursor.executemany("select :1, :2 from dual", [])
cjbj commented 10 months ago

Thanks for the report.

anthony-tuininga commented 10 months ago

I have pushed a patch that should correct this issue. If you are able to build from source you can verify that it corrects your issue as well.

anthony-tuininga commented 10 months ago

This was included in version 1.4.1 which was just released.