Skip to content

datetime: supported parse of h's or m's frac part#3

Merged
sergepetrenko merged 1 commit into
tarantool:tarantool-master-v1from
tmr-g:i12082
Mar 2, 2026
Merged

datetime: supported parse of h's or m's frac part#3
sergepetrenko merged 1 commit into
tarantool:tarantool-master-v1from
tmr-g:i12082

Conversation

@tmr-g

@tmr-g tmr-g commented Dec 3, 2025

Copy link
Copy Markdown

hh.hh & hhmm.mm parsing in dt_iso_parse.c implemented.

Such formats are defined in ISO 8601-1:2019 (5.3.1.4).
They are used in tarantool datetime tests.

Needed for tarantool/tarantool#12082
Needed for tarantool/tarantool#12083

@tmr-g tmr-g marked this pull request as ready for review December 3, 2025 22:16
tmr-g added a commit to tmr-g/tarantool that referenced this pull request Dec 4, 2025
- `datetime.c` `parse_tz_suffix` & it's clients refactored
  for better error detection & to simplify code:
  - offset value post condition check is moved to `parse_tz_suffix`.
  - this check uses tzoffset valid range instead of int16_t min/max.
  - offset arg type of `parse_tz_suffix` to valid for TZoffset int16_t.
- The better error detection lead to assertion fails of datetime tests
  with decimal fraction of hours and minutes. So we need
  tarantool/c-dt#3. It's the first way to fix the problem which
  is mentioned in tarantool#12082.
- datetime.c unit tests refactored. The number of tap test checks
  is being calculated using the lenght of test data tables.

FIXME: need to update c-dt submodule hash.

Requires tarantool/c-dt#3
Closes tarantool#12082

NO_DOC=FIXME, must have
NO_CHANGELOG=FIXME, must have
tmr-g added a commit to tmr-g/tarantool that referenced this pull request Dec 4, 2025
- `datetime.c` `parse_tz_suffix` & it's clients refactored
  for better error detection & to simplify code:
  - offset value post condition check is moved to `parse_tz_suffix`.
  - this check uses tzoffset valid range instead of int16_t min/max.
  - offset arg type of `parse_tz_suffix` fixed
    to valid for TZoffset int16_t.
- The better error detection lead to assertion fails of datetime tests
  with decimal fraction of hours and minutes. So we need
  tarantool/c-dt#3. It's the first way to fix the problem which
  is mentioned in tarantool#12082.
- datetime.c unit tests refactored. The number of tap test checks
  is being calculated using the lenght of test data tables.

FIXME: need to update c-dt submodule hash.

Requires tarantool/c-dt#3
Closes tarantool#12082

NO_DOC=FIXME, must have
NO_CHANGELOG=FIXME, must have
tmr-g added a commit to tmr-g/tarantool that referenced this pull request Dec 10, 2025
- `datetime.c` `parse_tz_suffix` & it's clients refactored
  for better error detection & to simplify code:
  - offset value post condition check is moved to `parse_tz_suffix`.
  - this check uses tzoffset valid range instead of int16_t min/max.
  - offset arg type of `parse_tz_suffix` fixed
    to valid for TZoffset int16_t.
- The better error detection lead to assertion fails of datetime tests
  with decimal fraction of hours and minutes. So we need
  tarantool/c-dt#3. It's the first way to fix the problem which
  is mentioned in tarantool#12082.
- datetime.c unit tests refactored to simpilfy it's support.
  The number of tap test checks is being calculated
  using the lenght of test data tables.

FIXME: need to update c-dt submodule hash.

Requires tarantool/c-dt#3
Closes tarantool#12082

NO_DOC=FIXME, must have
NO_CHANGELOG=FIXME, must have
tmr-g added a commit to tmr-g/tarantool that referenced this pull request Dec 10, 2025
- `datetime.c` `parse_tz_suffix` & it's clients refactored
  for better error detection & to simplify code:
  - offset value post condition check is moved to `parse_tz_suffix`.
  - this check uses tzoffset valid range instead of int16_t min/max.
  - offset arg type of `parse_tz_suffix` fixed
    to valid for TZoffset int16_t.
- The better error detection lead to assertion fails of datetime tests
  with decimal fraction of hours and minutes. So we need
  tarantool/c-dt#3. It's the first way to fix the problem which
  is mentioned in tarantool#12082.
- datetime.c unit tests refactored to simpilfy it's support.
  The number of tap test checks is being calculated
  using the lenght of test data tables.

FIXME: need to update c-dt submodule hash.

Requires tarantool/c-dt#3
Closes tarantool#12082

NO_DOC=FIXME, must have
NO_CHANGELOG=FIXME, must have
tmr-g added a commit to tmr-g/tarantool that referenced this pull request Dec 10, 2025
- `datetime.c` `parse_tz_suffix` & it's clients refactored
  for better error detection & to simplify code:
  - offset value post condition check is moved to `parse_tz_suffix`.
  - this check uses tzoffset valid range instead of int16_t min/max.
  - offset arg type of `parse_tz_suffix` fixed
    to valid for TZoffset int16_t.
- The better error detection lead to assertion fails of datetime tests
  with decimal fraction of hours and minutes. So we need
  tarantool/c-dt#3. It's the first way to fix the problem which
  is mentioned in tarantool#12082.

FIXME: need to update c-dt submodule hash.

Requires tarantool/c-dt#3
Closes tarantool#12082

NO_DOC=FIXME, must have
NO_CHANGELOG=FIXME, must have
@tmr-g tmr-g force-pushed the i12082 branch 2 times, most recently from 4a3058f to 91c68e5 Compare December 10, 2025 23:58
@sergos sergos requested a review from sergepetrenko December 11, 2025 08:42
@sergos sergos requested a review from ligurio December 11, 2025 08:46
Comment thread dt_parse_iso.c

@sergepetrenko sergepetrenko left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch!
LGTM.

@sergepetrenko sergepetrenko assigned ligurio and tmr-g and unassigned sergepetrenko and ligurio Dec 12, 2025
tmr-g added a commit to tmr-g/tarantool that referenced this pull request Dec 16, 2025
- `datetime.c` `parse_tz_suffix` & it's clients refactored
  for better error detection & to simplify code:
  - offset value post condition check is moved to `parse_tz_suffix`.
  - this check uses tzoffset valid range instead of int16_t min/max.
  - offset arg type of `parse_tz_suffix` fixed
    to valid for TZoffset int16_t.
- The better error detection lead to assertion fails of datetime tests
  with decimal fraction of hours and minutes. So we need
  tarantool/c-dt#3. It's the first way to fix the problem which
  is mentioned in tarantool#12082.

FIXME: need to update c-dt submodule hash.

Requires tarantool/c-dt#3
Closes tarantool#12082

NO_DOC=FIXME, must have
NO_CHANGELOG=FIXME, must have
tmr-g added a commit to tmr-g/tarantool that referenced this pull request Dec 16, 2025
- `datetime.c` `parse_tz_suffix` & it's clients refactored
  for better error detection & to simplify code:
  - offset value post condition check is moved to `parse_tz_suffix`.
  - this check uses tzoffset valid range instead of int16_t min/max.
  - offset arg type of `parse_tz_suffix` fixed
    to valid for TZoffset int16_t.
- The better error detection lead to assertion fails of datetime tests
  with decimal fraction of hours and minutes. So we need
  tarantool/c-dt#3. It's the first way to fix the problem which
  is mentioned in tarantool#12082.

FIXME: need to update c-dt submodule hash.

Requires tarantool/c-dt#3
Closes tarantool#12082

NO_DOC=FIXME, must have
NO_CHANGELOG=FIXME, must have
tmr-g added a commit to tmr-g/tarantool that referenced this pull request Dec 16, 2025
- `datetime.c` `parse_tz_suffix` & it's clients refactored
  for better error detection & to simplify code:
  - offset value post condition check is moved to `parse_tz_suffix`.
  - this check uses tzoffset valid range instead of int16_t min/max.
  - offset arg type of `parse_tz_suffix` fixed
    to valid for TZoffset int16_t.
- The better error detection lead to assertion fails of datetime tests
  with decimal fraction of hours and minutes. So we need
  tarantool/c-dt#3. It's the first way to fix the problem which
  is mentioned in tarantool#12082.

FIXME: need to update c-dt submodule hash.

Requires tarantool/c-dt#3
Closes tarantool#12082

NO_DOC=FIXME, must have
NO_CHANGELOG=FIXME, must have
tmr-g added a commit to tmr-g/tarantool that referenced this pull request Dec 16, 2025
- `datetime.c` `parse_tz_suffix` & it's clients refactored
  for better error detection & to simplify code:
  - offset value post condition check is moved to `parse_tz_suffix`.
  - this check uses tzoffset valid range instead of int16_t min/max.
  - offset arg type of `parse_tz_suffix` fixed
    to valid for TZoffset int16_t.
- The better error detection lead to assertion fails of datetime tests
  with decimal fraction of hours and minutes. So we need
  tarantool/c-dt#3. It's the first way to fix the problem which
  is mentioned in tarantool#12082.

FIXME: need to update c-dt submodule hash.

Requires tarantool/c-dt#3
Closes tarantool#12082

NO_DOC=FIXME, must have
NO_CHANGELOG=FIXME, must have
tmr-g added a commit to tmr-g/tarantool that referenced this pull request Dec 16, 2025
- `datetime.c` `parse_tz_suffix` & it's clients refactored
  for better error detection & to simplify code:
  - offset value post condition check is moved to `parse_tz_suffix`.
  - this check uses tzoffset valid range instead of int16_t min/max.
  - offset arg type of `parse_tz_suffix` fixed
    to valid for TZoffset int16_t.
- The better error detection lead to assertion fails of datetime tests
  with decimal fraction of hours and minutes. So we need
  tarantool/c-dt#3. It's the first way to fix the problem which
  is mentioned in tarantool#12082.

FIXME: need to update c-dt submodule hash.

Requires tarantool/c-dt#3
Closes tarantool#12082

NO_DOC=FIXME, must have
NO_CHANGELOG=FIXME, must have
tmr-g added a commit to tmr-g/tarantool that referenced this pull request Dec 16, 2025
- `datetime.c` `parse_tz_suffix` & it's clients refactored
  for better error detection & to simplify code:
  - offset value post condition check is moved to `parse_tz_suffix`.
  - this check uses tzoffset valid range instead of int16_t min/max.
  - offset arg type of `parse_tz_suffix` fixed
    to valid for TZoffset int16_t.
- The better error detection lead to assertion fails of datetime tests
  with decimal fraction of hours and minutes. So we need
  tarantool/c-dt#3. It's the first way to fix the problem which
  is mentioned in tarantool#12082.

FIXME: UPDATE c-dt submodule hash TO COMMIT FROM tarantool/c-dt

Requires tarantool/c-dt#3
Closes tarantool#12082

NO_DOC=FIXME, must have
NO_CHANGELOG=FIXME, must have
tmr-g added a commit to tmr-g/tarantool that referenced this pull request Dec 16, 2025
- `datetime.c` `parse_tz_suffix` & it's clients refactored
  for better error detection & to simplify code:
  - offset value post condition check is moved to `parse_tz_suffix`.
  - this check uses tzoffset valid range instead of int16_t min/max.
  - offset arg type of `parse_tz_suffix` fixed
    to valid for TZoffset (int16_t).
- The better error detection lead to assertion fails of datetime tests
  with decimal fraction of hours and minutes. So we need
  tarantool/c-dt#3. It's the first way to fix the problem which
  is mentioned in tarantool#12082.

Requires tarantool/c-dt#3
Closes tarantool#12082

NO_DOC=bugfix

FIXME: UPDATE c-dt submodule hash TO COMMIT FROM tarantool/c-dt
tmr-g added a commit to tmr-g/tarantool that referenced this pull request Dec 16, 2025
- `datetime.c` `parse_tz_suffix` & it's clients refactored
  for better error detection & to simplify code:
  - offset value post condition check is moved to `parse_tz_suffix`.
  - this check uses tzoffset valid range instead of int16_t min/max.
  - offset arg type of `parse_tz_suffix` fixed
    to valid for TZoffset (int16_t).
- The better error detection lead to assertion fails of datetime tests
  with decimal fraction of hours and minutes. So we need
  tarantool/c-dt#3. It's the first way to fix the problem which
  is mentioned in tarantool#12082.

Requires tarantool/c-dt#3
Closes tarantool#12082

NO_DOC=bugfix

FIXME: UPDATE c-dt submodule hash TO COMMIT FROM tarantool/c-dt
@tmr-g tmr-g requested a review from ligurio December 16, 2025 19:41
tmr-g added a commit to tmr-g/tarantool that referenced this pull request Dec 16, 2025
- `datetime.c` `parse_tz_suffix` & it's clients refactored
  for better error detection & to simplify code:
  - offset value post condition check is moved to `parse_tz_suffix`.
  - this check uses tzoffset valid range instead of int16_t min/max.
  - offset arg type of `parse_tz_suffix` fixed
    to valid for TZoffset (int16_t).
- The better error detection lead to assertion fails of datetime tests
  with decimal fraction of hours and minutes. So we need
  tarantool/c-dt#3. It's the first way to fix the problem which
  is mentioned in tarantool#12082.

Requires tarantool/c-dt#3
Closes tarantool#12082

NO_DOC=bugfix

FIXME: UPDATE c-dt submodule hash TO COMMIT FROM tarantool/c-dt

@ligurio ligurio left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch! Please see my comments.

Comment thread dt_parse_iso.c Outdated
Comment thread dt_parse_iso.c Outdated
Comment thread t/parse_iso_time.c Outdated
Comment thread t/parse_iso_time.c Outdated
Comment thread dt_parse_iso.c
Comment thread t/parse_iso_time.c Outdated

@ligurio ligurio left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Evgeniy, thanks for your patience, and sorry for a huge delay with review!
LGTM

with a minor comment inline and nit below:
usually we add tags for tickets in commit message one per line, like below:

Needed for tarantool/tarantool#12082
Needed for tarantool/tarantool#12083

I propose to update the commit message. Feel free to ignore.

Comment thread dt_parse_iso.c Outdated
Comment thread t/parse_iso_time.c Outdated
hh.hh & hhmm.mm parsing in dt_iso_parse.c implemented.

Such formats are defined in ISO 8601-1:2019 (5.3.1.4).
They are used in tarantool datetime tests.

Needed for tarantool/tarantool#12082
Needed for tarantool/tarantool#12083
@sergepetrenko sergepetrenko merged commit 5bd1b4e into tarantool:tarantool-master-v1 Mar 2, 2026
2 checks passed
@tmr-g tmr-g deleted the i12082 branch March 2, 2026 17:04
@tmr-g tmr-g removed their assignment Apr 16, 2026
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.

3 participants