Skip to content

feedback: Data model | msgpack.nil and box.NULL #2765

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

Closed
TarantoolBot opened this issue Mar 18, 2022 · 2 comments · Fixed by #3087
Closed

feedback: Data model | msgpack.nil and box.NULL #2765

TarantoolBot opened this issue Mar 18, 2022 · 2 comments · Fixed by #3087
Assignees
Labels
factual error Factual error in functionality description need feedback [special status] On hold, awaiting feedback null See https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_null/ server [area] Task relates to Tarantool's server (core) functionality

Comments

@TarantoolBot
Copy link
Collaborator

TarantoolBot commented Mar 18, 2022

Product: Tarantool
Audience/target: developers
Root document:
https://www.tarantool.io/en/doc/latest/book/box/data_model/
SME: @ alyapunov

Details

<…>

Scalar / compound
MsgPack   type
Lua type
Example value

|scalar
nil
“nil”
nil|

scalar
boolean
“boolean”
true

scalar
string
“string”
'A B C'
<…>

https://www.tarantool.io/en/doc/latest/book/box/data_model/

По-моему тут ошибка. msgpack nil это box.null, а не nil. Проверьте, пожалуйста.

@Totktonada
Copy link
Member

nil is how the msgpack type named (if we're about the 'MsgPack type' column).

However as result of decoding of the nil msgpack value we receive box.NULL in Lua:

tarantool> type(msgpack.decode('\xc0'))
---
- cdata
...

tarantool> msgpack.decode('\xc0') == nil
---
- true
...

So it would be correct to write box.NULL instead of nil in the 'Lua type' column (and change the 'Example value' column acccordingly).

I guess there may be tricky cases with nullable fields, when a tuple does not contain the field 'physically', so we'll receive nil (not box.NULL), when access it. I don't know, whether I'm fully right here and whether we should reflect it there. I think it is better to consult with @alyapunov here.

@patiencedaur patiencedaur added the server [area] Task relates to Tarantool's server (core) functionality label Mar 18, 2022
@patiencedaur patiencedaur changed the title feedback: Data model | Tarantool feedback: Data model | msgpack.nil and box.NULL Mar 18, 2022
@patiencedaur patiencedaur added factual error Factual error in functionality description need feedback [special status] On hold, awaiting feedback null See https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_null/ labels Mar 21, 2022
@patiencedaur
Copy link
Contributor

Related issue: #927.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
factual error Factual error in functionality description need feedback [special status] On hold, awaiting feedback null See https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_null/ server [area] Task relates to Tarantool's server (core) functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants