DPY-3021: OSON version 2 is not supported when selecting a JSON column after an in-place update (23.26)
还没有人认领这个 Issue。
评估
调研方向
Start by locating the thin mode OSON decoder and its version checks; the report identifies the accepted versions but gives no source file or test path. Reproduce with an in-place JSON_MERGEPATCH update, then read the decoder tests and add coverage for selecting the updated JSON column. Done means the read succeeds and the async statement can be executed again without ORA-01002.
由索引模型根据 Issue 内容生成。
描述
- What versions are you using?
- python-oracledb 26.0.1, thin mode
- Oracle AI Database 26ai Free 23.26.3.0.0 (the
gvenzl/oracle-free:23-faststartimage) - Python 3.13.6, macOS arm64
- Is it an error or a hang or a crash?
An error.
- What error(s) or behavior you are seeing?
Once a row's JSON column has been updated in place, for example with JSON_MERGEPATCH or JSON_TRANSFORM in an UPDATE, selecting that column fails:
oracledb.exceptions.NotSupportedError: DPY-3021: OSON version 2 is not supported
The OSON decoder accepts only versions 1 and 3 (TNS_JSON_VERSION_MAX_FNAME_255 and TNS_JSON_VERSION_MAX_FNAME_65535), and the database sends version 2 for a document updated in place. JSON_SERIALIZE(doc) and JSON_TRANSFORM(doc, KEEP '$') read the same row without error.
With the async API there is a second symptom. If the same statement is executed again on that connection, it fails with ORA-01002: fetch out of sequence. Other statements still work, so the failed cursor seems to stay in the statement cache.
node-oracledb 7.0.1 fails on the same read with NJS-126: OSON version 2 is not supported. I'm reporting it there separately.
- Does your application call init_oracle_client()?
No, thin mode.
- Include a runnable Python script that shows the problem.
import asyncio
import oracledb
DSN = dict(user="drivine", password="...", dsn="localhost:1521/FREEPDB1")
c = oracledb.connect(**DSN)
cur = c.cursor()
cur.execute("DROP TABLE IF EXISTS oson_v2")
cur.execute("CREATE TABLE oson_v2 (id NUMBER PRIMARY KEY, doc JSON)")
cur.execute("""INSERT INTO oson_v2 VALUES (1, JSON('{"name":"Ada","bio":"b0"}'))""")
cur.execute("""UPDATE oson_v2 SET doc = JSON_MERGEPATCH(doc, JSON('{"bio":"b1"}')) WHERE id = 1""")
c.commit()
cur.execute("SELECT JSON_SERIALIZE(doc) FROM oson_v2")
print(cur.fetchall()) # [('{"name":"Ada","bio":"b1"}',)]
cur.execute("SELECT doc FROM oson_v2") # DPY-3021: OSON version 2 is not supported
async def main():
a = await oracledb.connect_async(**DSN)
for sql in ["SELECT doc FROM oson_v2", "SELECT 1 FROM dual", "SELECT doc FROM oson_v2"]:
try:
cursor = a.cursor()
await cursor.execute(sql)
print(await cursor.fetchall())
except Exception as e:
print(e)
# DPY-3021: OSON version 2 is not supported
# [(1,)]
# ORA-01002: fetch out of sequence
asyncio.run(main())
- 主要语言
- Python
- 星标
- 455
- 派生
- 119
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
oracle/python-oracledb 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 48/100
oracle/python-oracledb#623 ·
-
bug
难度 4/5 3-5 天 新手友好度 32/100
oracle/python-oracledb#621 · 3 条评论 ·
-
Client Library or Database
难度 4/5 3-5 天 新手友好度 25/100
oracle/python-oracledb#620 · 4 条评论 ·
-
难度 4/5 3-5 天 新手友好度 42/100
oracle/python-oracledb#619 ·
-
asyncio: DPY-4011 on connect_async() when the listener closes the original socket after a redirect可能已有人在做 @AlexGracas 于 17 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 35/100
oracle/python-oracledb#616 ·
查看 oracle/python-oracledb 的全部 Issue
相似的 Issue
-
bug
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
documentation
难度 2/5 1-3 小时 新手友好度 84/100
sergey-miryanov/gcmon#230 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
Azure-Samples/azure-search-openai-demo#3249 ·
维护者通常 1 天内回复
-
[BUG] Failed archive extraction deletes the dataset cache可能已有人在做 @dajiaohuang 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
alibaba/GraphScope#4674 ·