Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DateTime64 values less than 1970-01-01 cannot be read #62

Closed
MaceWindu opened this issue Jul 2, 2022 · 3 comments
Closed

DateTime64 values less than 1970-01-01 cannot be read #62

MaceWindu opened this issue Jul 2, 2022 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@MaceWindu
Copy link
Contributor

From error it looks like values read as UInt64 instead of Int64

System.OverflowException
  Message=The value 0xFFCD8C88F2850000 is greater than the maximal value of the type "System.DateTime". It is only possible to read this value as "System.UInt64".
  StackTrace:
   at Octonica.ClickHouseClient.Types.DateTime64TableColumn.GetValue(Int32 index)
   at Octonica.ClickHouseClient.Types.ReinterpretedTableColumn`2.GetValue(Int32 index)
   at Octonica.ClickHouseClient.ClickHouseDataReader.GetFieldValue[T](Int32 ordinal)

Originally posted by @MaceWindu in #60 (comment)

@MrDoe
Copy link
Contributor

MrDoe commented Mar 5, 2024

I have the same problem. I think this project isn't maintained anymore. I'll try to fix that in my fork.

Edit:
I submitted a pull request for this issue. If you still can use it and can't wait for the pull request to be merged, you can use my fork: https://github.com/MrDoe/ClickHouseClient

@victor-sushko victor-sushko self-assigned this Mar 10, 2024
@victor-sushko victor-sushko added the bug Something isn't working label Mar 10, 2024
victor-sushko referenced this issue Mar 10, 2024
Both types has the range [1900-01-01 00:00:00, 2299-12-31 23:59:59.99999999]
@victor-sushko
Copy link
Contributor

I changed ranges of supported values to [1900-01-01 00:00:00, 2299-12-31 23:59:59.99999999] for DateTime64 and to [1900-01-01, 2299-12-31] for Date32. Also, the client doesn't return default(DateTime) for 1970-01-01 anymore.

@victor-sushko
Copy link
Contributor

The bug was fixed in the version 3.1.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants