Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

DPY-3021: OSON version 2 is not supported when selecting a JSON column after an in-place update (23.26)

オープン
#622 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
backend, databases

調査の方向性

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 の本文から書いたものです。

説明

  1. 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-faststart image)
  • Python 3.13.6, macOS arm64
  1. Is it an error or a hang or a crash?

An error.

  1. 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.

  1. Does your application call init_oracle_client()?

No, thin mode.

  1. 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 はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

oracle/python-oracledb のほかの issue

oracle/python-oracledb の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。