Skip to content

Fix small issues #3069

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

Merged
merged 6 commits into from
Aug 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 24 additions & 13 deletions doc/book/box/data_model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ Lua versus MsgPack
- ext (for Tarantool ``uuid``)
- `cdata`_
- ``12a34b5c-de67-8f90-123g-h4567ab8901``
* - scalar
- msgpack.NULL
- `cdata`_
- :ref:`box.NULL <box-null>`
* - compound
- map
- `table`_ (with string keys)
Expand Down Expand Up @@ -1207,21 +1211,28 @@ in the YAML format in a declarative way.

The schema would look something like this:

.. code:: yaml
.. code-block:: yaml

spaces:
users:
engine: memtx
is_local: false
temporary: false
format:
- {name: user_id, type: uuid, is_nullable: false}
- {name: fullname, type: string, is_nullable: false}
indexes:
- name: user_id
unique: true
parts: [{path: user_id, type: uuid, is_nullable: false}]
type: HASH
users:
engine: memtx
is_local: false
temporary: false
format:
- {name: user_id, type: uuid, is_nullable: false}
- {name: fullname, type: string, is_nullable: false}
- {name: bucket_id, type: unsigned, is_nullable: false}
indexes:
- name: user_id
unique: true
parts: [{path: user_id, type: uuid, is_nullable: false}]
type: HASH
- name: bucket_id
unique: false
parts: [{path: bucket_id, type: unsigned, is_nullable: false}]
type: TREE
sharding_key: [user_id]
sharding_func: test_module.sharding_func

This alternative is simpler to use, and you do not have to dive deep into Lua.

Expand Down
3 changes: 2 additions & 1 deletion doc/reference/configuration/cfg_basic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@
A replica also binds to this port, and accepts connections, but these
connections can only serve reads until the replica becomes a master.

Starting from version 2.10.0, you can specify :ref:`several URIs <index-uri-several>`.
Starting from version 2.10.0, you can specify :ref:`several URIs <index-uri-several>`,
and the port number is always stored as an integer value.

| Type: integer or string
| Default: null
Expand Down
6 changes: 4 additions & 2 deletions doc/reference/reference_lua/box_null.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

There are some major problems with using Lua **nil** values in tables.
For example: you can't correctly assess the length of a table that is not a sequence.
(Learn more about data types in `Lua <https://www.lua.org/manual/5.1/manual.html#2.2>`__
and `LuaJIT <http://luajit.org/ext_ffi_semantics.html>`__.)

**Example:**

Expand Down Expand Up @@ -35,7 +37,7 @@ the end of the table differently. This is due to undefined behavior.

Trying to find the length for sparse arrays in LuaJIT leads to another
scenario of
`undefined behavior <https://www.lua.org/manual/5.2/manual.html#3.4.6>`_.
`undefined behavior <https://www.lua.org/manual/5.1/manual.html#2.5.5>`_.

To avoid this problem, use Tarantool's ``box.NULL`` constant instead of **nil**.
``box.NULL`` is a placeholder for a **nil** value in tables to preserve a key
Expand All @@ -45,7 +47,7 @@ without a value.
Using box.NULL
~~~~~~~~~~~~~~

``box.NULL`` is a value of the cdata type representing a NULL pointer.
``box.NULL`` is a value of the `cdata <http://luajit.org/ext_ffi_semantics.html>`__ type representing a NULL pointer.
It is similar to ``msgpack.NULL``, ``json.NULL`` and ``yaml.NULL``. So it is
some not **nil** value, even if it is a pointer to NULL.

Expand Down
2 changes: 1 addition & 1 deletion doc/reference/reference_lua/table.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
.. module:: table

The :code:`table` module has everything in the
`standard Lua table library <https://www.lua.org/pil/19.html>`_,
`standard Lua table library <https://www.lua.org/manual/5.1/manual.html#5.5>`_,
and some Tarantool extensions.

You can see this by saying "table": you will see this list of functions:
Expand Down
11 changes: 7 additions & 4 deletions locale/ru/LC_MESSAGES/reference/reference_lua/box_null.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ msgstr "Константа `box.NULL`"
msgid ""
"There are some major problems with using Lua **nil** values in tables. For "
"example: you can't correctly assess the length of a table that is not a "
"sequence."
"sequence. (Learn more about data types in `Lua <https://www.lua.org/manual/5.1/manual.html#2.2>`__ "
"and `LuaJIT <http://luajit.org/ext_ffi_semantics.html>`__.)"
msgstr ""
"Имеется целый ряд серьезных проблем при использовании значения **nil** из "
"Lua в таблицах. Например: вы не можете корректно оценить длину таблицы, не "
"являющейся последовательностью."
"являющейся последовательностью. (Узнайте больше о типах данных в `Lua "
"<https://www.lua.org/manual/5.1/manual.html#2.2>`__ "
"и `LuaJIT <http://luajit.org/ext_ffi_semantics.html>`__.)"

msgid "**Example:**"
msgstr "**Пример:**"
Expand Down Expand Up @@ -43,7 +46,7 @@ msgstr ""
msgid ""
"Trying to find the length for sparse arrays in LuaJIT leads to another "
"scenario of `undefined behavior "
"<https://www.lua.org/manual/5.2/manual.html#3.4.6>`_."
"<https://www.lua.org/manual/5.1/manual.html#2.5.5>`_."
msgstr ""
"Попытка найти длину для разреженного массива в LuaJIT приводит к другому "
"случаю `неопределённого поведения "
Expand All @@ -63,7 +66,7 @@ msgid "Using box.NULL"
msgstr "Использование box.NULL"

msgid ""
"``box.NULL`` is a value of the cdata type representing a NULL pointer. It is"
"``box.NULL`` is a value of the `cdata <http://luajit.org/ext_ffi_semantics.html>`__ type representing a NULL pointer. It is"
" similar to ``msgpack.NULL``, ``json.NULL`` and ``yaml.NULL``. So it is some"
" not **nil** value, even if it is a pointer to NULL."
msgstr ""
Expand Down
4 changes: 2 additions & 2 deletions locale/ru/LC_MESSAGES/reference/reference_lua/table.po
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ msgstr "Модуль `table`"

msgid ""
"The :code:`table` module has everything in the `standard Lua table library "
"<https://www.lua.org/pil/19.html>`_, and some Tarantool extensions."
"<https://www.lua.org/manual/5.1/manual.html#5.5>`_, and some Tarantool extensions."
msgstr ""
"Модуль :code:`table` включает в себя всё из `стандартной библиотеки для "
"работы с таблицами в Lua <https://www.lua.org/pil/19.html>`_, а также "
"работы с таблицами в Lua <https://www.lua.org/manual/5.1/manual.html#5.5>`_, а также "
"некоторые расширения специально для Tarantool."

msgid ""
Expand Down