tarantool / tarantool/tarantool

scalar-field format rejects datetime.interval type

Open
#12,246 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug datetime
Dominant language
Lua
Stars
3.7k
Forks
419
Avg merge
1d 23h
Merged PRs (30d)
88

Description

Bug description

Version: Tarantool 3.7.0-entrypoint-55-ga755e0ed38

Actual behavior

  1. datetime as scalar is accepted, but interval as scalar is rejected
dt = require('datetime')

s = box.schema.space.create('s', {format = {{'id', 'unsigned'}, {'d', 'scalar'}}, temporary = true})
---
...

s:create_index('ii')
...

s:insert({1, dt.new()})
---
- [1, '1970-01-01T00:00:00Z']
...

s:insert({2, dt.interval.new()})
---
- error: 'Tuple field 2 (d) type does not match one required by operation: expected
    scalar, got extension'
...
  1. datetime and interval is missed in the docu in enumerations of scalar and any types: https://www.tarantool.io/en/doc/latest/platform/ddl_dml/value_store/#scalar

  2. It seems box.schema.space.create() and similar format tests missed datetime and interval types.

Expected behavior

  1. interval type must be accepted as scalar.

  2. docu fixed.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the scalar format behavior with box.schema.space.create() and the datetime interval example from the report, then inspect the related format tests. Confirm that interval is accepted as scalar, add coverage for datetime and interval where the report says tests are missing, and update the scalar and any documentation page to list both types.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
databases, documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.