Skip to content

Fetching DF shows up as memory corruption #489

Open
@mauropagano

Description

@mauropagano
  1. What versions are you using?
    3.1.0 on python 3.9.6 and 3.12.7

  2. Is it an error or a hang or a crash?
    Looks like memory corruption, running the code over and over at some point you see the same Arrow object printing junk (I don't think it goes back to db to re-run)
    This fails CONSISTENTLY if the same connection is used twice (I'm not sure that's expected or not), but it also fails (if you try enough) with a new connection

  3. What error(s) or behavior you are seeing?
    Incorrect result, need to run a few times

  4. Does your application call init_oracle_client()?
    Reproduces in both thin and thick, thick seems easier to trigger

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

import oracledb
import pyarrow

                                                                                                                                                                                                                                                      
def f() -> pyarrow.Table:
    c = oracledb.connect("...")
    oracle_df = c.fetch_df_all(
        statement="select dbms_random.value from dual", arraysize=5000
    ) 
    pyarrow_table = pyarrow.Table.from_arrays(
        arrays=oracle_df.column_arrays(), names=oracle_df.column_names()
    ) 
    return pyarrow_table


df = f()
print(f"df: {df}")


df2 = f() # <-- no use of df2
print(f"df: {df}") 
print(f"df: {df}")

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions