Skip to content

Commit b20764b

Browse files
authored
Fix small issues (#3069)
* Provide links to Lua and LuaJIT data types Resolves #1318 * Replace wrong link to Lua 5.2 with correct to Lua 5.1 Resolves #1321 * Provide a more relevant link to Lua table manual Resolves #1785 * Add msgpack.NULL to data types table Resolves #927 * Add a sharded space example Resolves #2474 * Clarify box.cfg.listen value type Resolves #2855
1 parent 288018e commit b20764b

File tree

6 files changed

+40
-23
lines changed

6 files changed

+40
-23
lines changed

doc/book/box/data_model.rst

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,10 @@ Lua versus MsgPack
182182
- ext (for Tarantool ``uuid``)
183183
- `cdata`_
184184
- ``12a34b5c-de67-8f90-123g-h4567ab8901``
185+
* - scalar
186+
- msgpack.NULL
187+
- `cdata`_
188+
- :ref:`box.NULL <box-null>`
185189
* - compound
186190
- map
187191
- `table`_ (with string keys)
@@ -1207,21 +1211,28 @@ in the YAML format in a declarative way.
12071211

12081212
The schema would look something like this:
12091213

1210-
.. code:: yaml
1214+
.. code-block:: yaml
12111215
12121216
spaces:
1213-
users:
1214-
engine: memtx
1215-
is_local: false
1216-
temporary: false
1217-
format:
1218-
- {name: user_id, type: uuid, is_nullable: false}
1219-
- {name: fullname, type: string, is_nullable: false}
1220-
indexes:
1221-
- name: user_id
1222-
unique: true
1223-
parts: [{path: user_id, type: uuid, is_nullable: false}]
1224-
type: HASH
1217+
users:
1218+
engine: memtx
1219+
is_local: false
1220+
temporary: false
1221+
format:
1222+
- {name: user_id, type: uuid, is_nullable: false}
1223+
- {name: fullname, type: string, is_nullable: false}
1224+
- {name: bucket_id, type: unsigned, is_nullable: false}
1225+
indexes:
1226+
- name: user_id
1227+
unique: true
1228+
parts: [{path: user_id, type: uuid, is_nullable: false}]
1229+
type: HASH
1230+
- name: bucket_id
1231+
unique: false
1232+
parts: [{path: bucket_id, type: unsigned, is_nullable: false}]
1233+
type: TREE
1234+
sharding_key: [user_id]
1235+
sharding_func: test_module.sharding_func
12251236
12261237
This alternative is simpler to use, and you do not have to dive deep into Lua.
12271238

doc/reference/configuration/cfg_basic.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@
8484
A replica also binds to this port, and accepts connections, but these
8585
connections can only serve reads until the replica becomes a master.
8686

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

8990
| Type: integer or string
9091
| Default: null

doc/reference/reference_lua/box_null.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

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

1012
**Example:**
1113

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

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

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

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

doc/reference/reference_lua/table.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
.. module:: table
88

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

1313
You can see this by saying "table": you will see this list of functions:

locale/ru/LC_MESSAGES/reference/reference_lua/box_null.po

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@ msgstr "Константа `box.NULL`"
55
msgid ""
66
"There are some major problems with using Lua **nil** values in tables. For "
77
"example: you can't correctly assess the length of a table that is not a "
8-
"sequence."
8+
"sequence. (Learn more about data types in `Lua <https://www.lua.org/manual/5.1/manual.html#2.2>`__ "
9+
"and `LuaJIT <http://luajit.org/ext_ffi_semantics.html>`__.)"
910
msgstr ""
1011
"Имеется целый ряд серьезных проблем при использовании значения **nil** из "
1112
"Lua в таблицах. Например: вы не можете корректно оценить длину таблицы, не "
12-
"являющейся последовательностью."
13+
"являющейся последовательностью. (Узнайте больше о типах данных в `Lua "
14+
"<https://www.lua.org/manual/5.1/manual.html#2.2>`__ "
15+
"и `LuaJIT <http://luajit.org/ext_ffi_semantics.html>`__.)"
1316

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

6568
msgid ""
66-
"``box.NULL`` is a value of the cdata type representing a NULL pointer. It is"
69+
"``box.NULL`` is a value of the `cdata <http://luajit.org/ext_ffi_semantics.html>`__ type representing a NULL pointer. It is"
6770
" similar to ``msgpack.NULL``, ``json.NULL`` and ``yaml.NULL``. So it is some"
6871
" not **nil** value, even if it is a pointer to NULL."
6972
msgstr ""

locale/ru/LC_MESSAGES/reference/reference_lua/table.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ msgstr "Модуль `table`"
44

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

1313
msgid ""

0 commit comments

Comments
 (0)