Skip to content

Cannot bind negative time zone minute offset such as -03:30. #38

@kubo

Description

@kubo

When a timestamp with negative time zone minute offset such as -03:30 is fetched, dpiTimestamp.tzMinuteOffset is negative. However when the fetched timestamp is set to dpiData_setTimestamp, dpiStmt_execute fails with ORA-01875: time zone minute must be between -59 and 59.

I made a test program.
https://gist.github.com/kubo/3d8cfb06a71454d137e3014475e62674

It printed:

Timestamp value:
  year: 2017
  month: 1
  day: 1
  hour: 0
  minute: 0
  second: 0
  fsecond 0
  tzHourOffset: -3
  tzMinuteOffset: -30

ERROR at line 84
  dpiStmt_execute(stmt, 0, &numQueryColumns)
  ORA-01875: time zone minute must be between -59 and 59

This issue is fixed if ts.tzMinuteOffset in this line is replaced with abs(ts.tzMinuteOffset). However this is strange workaround.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions