-
Notifications
You must be signed in to change notification settings - Fork 98
Open
Labels
bugSomething isn't workingSomething isn't working
Description
- What versions are you using?
Oracle Database version: 19.14.0.0.0
platform.platform: macOS-15.7.3-arm64-arm-64bit
sys.maxsize > 2**32: True
platform.python_version: 3.12.11
oracledb.version: 3.4.2
- Is it an error or a hang or a crash?
Silent data corruption. No error is raised.
- What error(s) or behavior you are seeing?
In thin mode (async), both callfunc and callproc silently send False for boolean IN parameters regardless of the actual value. OUT parameters set by plsql directly decode correctly. Related, but for OUT: https://github.com/oracle/python-oracledb/issues/565
# callfunc
callfunc(bool_echo, bool, [True]) => False (expected True) # wrong
callfunc(bool_echo, bool, [False]) => False (expected False)
callfunc(bool_always_true, bool) => True (expected True) # hardcoded return works
# callproc
callproc(bool_echo_proc, in=True) => out=False (expected True) # wrong
callproc(bool_echo_proc, in=False) => out=False (expected False)
callproc(bool_always_true_proc) => out=True (expected True) # hardcoded OUT works
- Does your application call init_oracle_client()?
No. Thin mode only (async).
- Include a runnable Python script that shows the problem.
import asyncio
import oracledb
async def main():
pool = oracledb.create_pool_async(
user="YOUR_USER", password="YOUR_PASS", dsn="YOUR_DSN",
min=1, max=2,
)
async with pool.acquire() as conn:
with conn.cursor() as cur:
# -- callfunc bug --
await cur.execute("""
create or replace function bool_echo(v_flag boolean) return boolean as
begin
return v_flag;
end;
""")
result = await cur.callfunc("bool_echo", bool, [True])
print(f"callfunc bool_echo(True) => {result}") # False -- BUG
assert result is True, f"Expected True, got {result}"
# -- callproc bug --
await cur.execute("""
create or replace procedure bool_echo_proc(v_in boolean, v_out out boolean) as
begin
v_out := v_in;
end;
""")
in_var = cur.var(bool)
in_var.setvalue(0, True)
out_var = cur.var(bool)
await cur.callproc("bool_echo_proc", [in_var, out_var])
print(f"callproc bool_echo_proc(True) => {out_var.getvalue(0)}") # False -- BUG
assert out_var.getvalue(0) is True, f"Expected True, got {out_var.getvalue(0)}"
await pool.close()
asyncio.run(main())
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working