Add support for named time zones in thin mode
まだ誰も着手していません。
評価
調査の方向性
issue にある実行可能な Python スクリプトから始め、指定された Oracle 11g とドライバーのセットアップで、失敗する名前付きタイムゾーンのクエリと成功する timestamp クエリを比較します。完了条件は、名前付きタイムゾーンを使用して timestamp を取得すると、タイムゾーン情報を保持した datetime 値が返されることです。TIMESTAMP WITH TIME ZONE のテーブル例も対象にします。
索引モデルが issue の本文から書いたものです。
説明
Fetching timestamp with time zone raises error ORA-01805: possible error in date/time operation instead of returning datetime with time zone information.
-
What versions are you using?
- database version: Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
- platform.python_version: 3.9.9
- oracledb.__version__: 1.0.1
-
Is it an error or a hang or a crash? Error
-
What error(s) or behavior you are seeing?
Error oracledb.exceptions.DatabaseError: ORA-01805: possible error in date/time operation is raised when trying to use at time zone in SQL . Below is a sample code to reproduce the problem.
-
Does your application call init_oracle_client()? Yes, uses Thick mode.
-
Include a runnable Python script that shows the problem.
import oracledb
from oracledb.thick_impl import init_oracle_client
def f(sql):
with oracledb.connect(user='hr', password='password', dsn='127.0.0.1:1511/xe') as connection:
with connection.cursor() as cursor:
query = cursor.execute(sql)
row = query.fetchone()
print(row[0].time())
init_oracle_client()
# this works because returns datetime without time zone
f("select systimestamp from dual")
# this raises error ORA-01805
f("select systimestamp at time zone 'America/Montreal' as d from dual")
# this is manual walkaround but datetime is still missing time zone information
f("select cast(systimestamp at time zone 'America/Montreal' as timestamp) as d from dual")
The above is an example using systimestamp but similar error can be achieved by crating table with column type timestamp with time zone
create table tz_table
(
tz_timestamp TIMESTAMP(6) WITH TIME ZONE not null
);
insert into tz_table values ( TIMESTAMP '2022-06-16 08:00:00 US/Central');
- 主要言語
- Python
- スター
- 451
- フォーク
- 118
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
oracle/python-oracledb のほかの issue
-
fetch_df_batches() segfaults with fetch_decimals=True and repeated NUMBER values across batches オープンbug
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
oracle/python-oracledb#608 · コメント 1 件 ·
-
bug
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
oracle/python-oracledb#607 · コメント 1 件 ·
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
oracle/python-oracledb#592 · コメント 6 件 · リアクション 1 件 ·
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
oracle/python-oracledb#564 ·
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
oracle/python-oracledb#502 · コメント 5 件 ·
oracle/python-oracledb の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
stephrobert/dsoxlab#238 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
sublimehq/package_control#1780 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
nwg-piotr/nwg-displays#145 ·