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

Fix date marshal, unmarshall functions #374

Merged
merged 2 commits into from
Dec 13, 2024

Conversation

illia-li
Copy link

@illia-li illia-li commented Dec 11, 2024

Changes:

  1. Marshallig are string with max 5881580-07-11 or min values -5877641-06-23 return an error before, now returns value.
  2. Marshallig into custom int64 and custom string, was unsupported before, now is supported.
  3. Marshallig and Unmarshalling are int32, uint32, custom int32 and , custom uint32, was unsupported before, now is supported. These are the basic representations of date.
  4. Unmarshalling zero data into string and time.Time led to non-zero values before, now is led to zero values.
  5. Unmarshalling into int64, custom int64 and custom string, was unsupported before, now is supported.
  6. Marshallig int64, time.Time values which out of the cql type range, does not return an error before, now returns an error.
  7. Unmarshallig corrupted data into string, time.Time, does not return an error before, now returns an error.
  8. Marshalling the 0001-1-1 value of the time.Time return zero data before, now returns a data that is equivalent to the difference between 0001-1-1 and 1970-1-1

dkropachev
dkropachev previously approved these changes Dec 12, 2024
serialization/date/unmarshal_utils.go Outdated Show resolved Hide resolved
serialization/date/unmarshal_utils.go Outdated Show resolved Hide resolved
serialization/date/marshal_utils.go Outdated Show resolved Hide resolved
@illia-li illia-li force-pushed the il/fix/marshal/date branch from 98ddb63 to a0d8dd9 Compare December 12, 2024 18:48
@illia-li illia-li requested a review from dkropachev December 12, 2024 20:36
@illia-li illia-li force-pushed the il/fix/marshal/date branch 2 times, most recently from fd99977 to 34a3f90 Compare December 13, 2024 16:24
Changes:
1. Marshallig are `string` with max `5881580-07-11`  or min values `-5877641-06-23` return an error before, now returns value.
2. Marshallig into `custom int64` and `custom string`, was unsupported before, now is supported.
3. Marshallig and Unmarshalling are `int32`, `uint32`, `custom int32` and , `custom uint32`, was unsupported before, now is supported. These are the basic representations of `date`.
4. Unmarshalling `zero data` into `string` and `time.Time` led to non-zero values before, now is led to zero values.
5. Unmarshalling into `int64`, `custom int64` and `custom string`, was unsupported before, now is supported.
6. Marshallig `int64`, `time.Time` values which out of the `cql type` range, does not return an error before, now returns an error.
7. Unmarshallig `corrupted data` into `string`, `time.Time`, does not return an error before, now returns an error.
8. Marshalling the `0001-1-1` value of the `time.Time` return `zero data` before, now returns a data that is equivalent to the difference between `0001-1-1` and `1970-1-1`
@illia-li illia-li force-pushed the il/fix/marshal/date branch from 34a3f90 to 8a691c0 Compare December 13, 2024 16:29
@dkropachev dkropachev merged commit 7f20235 into scylladb:master Dec 13, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants