@@ -665,11 +665,11 @@ The body is a 3-item map:
665
665
IPROTO_OPTIONS: :samp: `{ {MP_ARRAY array } } `
666
666
})
667
667
668
- Use IPROTO_STMT_ID (0x43) + statement-id (MP_INT) if executing a prepared statement,
668
+ Use IPROTO_STMT_ID (0x43) and statement-id (MP_INT) if executing a prepared statement,
669
669
or use
670
- IPROTO_SQL_TEXT (0x40) + statement-text (MP_STR) if executing an SQL string, then
671
- IPROTO_SQL_BIND (0x41) + array of parameter values to match ? placeholders or
672
- :name placeholders, IPROTO_OPTIONS (0x2b) + array of options (usually empty).
670
+ IPROTO_SQL_TEXT (0x40) and statement-text (MP_STR) if executing an SQL string, then
671
+ IPROTO_SQL_BIND (0x41) and array of parameter values to match ? placeholders or
672
+ :name placeholders, IPROTO_OPTIONS (0x2b) and array of options (usually empty).
673
673
674
674
For example, suppose we prepare a statement
675
675
with two ? placeholders, and execute with two parameters, thus: |br |
@@ -731,9 +731,9 @@ The body is a 1-item map:
731
731
IPROTO_STMT_ID: :samp: `{ {MP_INT integer } } ` or IPROTO_SQL_TEXT: :samp: `{ {MP_STR string } } `
732
732
})
733
733
734
- IPROTO_STMT_ID (0x43) + statement-id (MP_INT) if executing a prepared statement
734
+ IPROTO_STMT_ID (0x43) and statement-id (MP_INT) if executing a prepared statement
735
735
or
736
- IPROTO_SQL_TEXT (0x40) + statement-text (string) if executing an SQL string.
736
+ IPROTO_SQL_TEXT (0x40) and statement-text (string) if executing an SQL string.
737
737
Thus the IPROTO_PREPARE map item is the same as the first item of the
738
738
:ref: `IPROTO_EXECUTE <box_protocol-execute >` body.
739
739
@@ -1052,7 +1052,7 @@ If the SQL statement is SELECT or VALUES or PRAGMA, the response contains:
1052
1052
})
1053
1053
1054
1054
* :samp: `IPROTO_METADATA: { array of column maps } ` = array of column maps, with each column map containing
1055
- at least IPROTO_FIELD_NAME (0x00) + MP_STR, and IPROTO_FIELD_TYPE (0x01) + MP_STR.
1055
+ at least IPROTO_FIELD_NAME (0x00) and MP_STR, and IPROTO_FIELD_TYPE (0x01) and MP_STR.
1056
1056
Additionally, if ``sql_full_metadata `` in the
1057
1057
:ref: `_session_settings <box_space-session_settings >` system space
1058
1058
is TRUE, then the array will have these additional column maps
@@ -1061,10 +1061,10 @@ If the SQL statement is SELECT or VALUES or PRAGMA, the response contains:
1061
1061
1062
1062
.. code-block :: none
1063
1063
1064
- IPROTO_FIELD_COLL (0x02) + MP_STR
1065
- IPROTO_FIELD_IS_NULLABLE (0x03) + MP_BOOL
1066
- IPROTO_FIELD_IS_AUTOINCREMENT (0x04) + MP_BOOL
1067
- IPROTO_FIELD_SPAN (0x05) + MP_STR or MP_NIL
1064
+ IPROTO_FIELD_COLL (0x02) and MP_STR
1065
+ IPROTO_FIELD_IS_NULLABLE (0x03) and MP_BOOL
1066
+ IPROTO_FIELD_IS_AUTOINCREMENT (0x04) and MP_BOOL
1067
+ IPROTO_FIELD_SPAN (0x05) and MP_STR or MP_NIL
1068
1068
1069
1069
* :samp: `IPROTO_DATA:{ array of tuples } ` = the result set "rows".
1070
1070
@@ -1085,7 +1085,6 @@ we could get this response, in the body:
1085
1085
IPROTO_FIELD_IS_NULLABLE: false,
1086
1086
IPROTO_FIELD_IS_AUTOINCREMENT: true,
1087
1087
IPROTO_FIELD_SPAN: nil,
1088
- ,
1089
1088
IPROTO_FIELD_NAME: 'Д',
1090
1089
IPROTO_FIELD_TYPE: 'string',
1091
1090
IPROTO_FIELD_COLL: 'unicode',
@@ -1102,8 +1101,8 @@ If instead we said |br|
1102
1101
:code: `conn:prepare([[SELECT dd, дд AS д FROM t1;]]) ` |br |
1103
1102
then we could get almost the same response, but there would
1104
1103
be no IPROTO_DATA and there would be two additional items: |br |
1105
- ``34 00 = IPROTO_BIND_COUNT + MP_UINT = 0 `` (there are no parameters to bind), |br |
1106
- ``33 90 = IPROTO_BIND_METADATA + MP_ARRAY, size 0 `` (there are no parameters to bind).
1104
+ ``34 00 = IPROTO_BIND_COUNT and MP_UINT = 0 `` (there are no parameters to bind), |br |
1105
+ ``33 90 = IPROTO_BIND_METADATA and MP_ARRAY, size 0 `` (there are no parameters to bind).
1107
1106
1108
1107
.. cssclass :: highlight
1109
1108
.. parsed-literal ::
@@ -1119,7 +1118,6 @@ be no IPROTO_DATA and there would be two additional items: |br|
1119
1118
IPROTO_FIELD_IS_NULLABLE: false
1120
1119
IPROTO_FIELD_IS_AUTOINCREMENT: true
1121
1120
IPROTO_FIELD_SPAN: nil,
1122
- ,
1123
1121
IPROTO_FIELD_NAME: 'Д',
1124
1122
IPROTO_FIELD_TYPE: 'string',
1125
1123
IPROTO_FIELD_COLL: 'unicode',
@@ -1273,7 +1271,7 @@ IPROTO_BEGIN, the transaction data-change and query requests,
1273
1271
IPROTO_COMMIT or IPROTO_ROLLBACK.
1274
1272
Each request must contain the same IPROTO_STREAM_ID value.
1275
1273
With streaming there is no need to add
1276
- :ref: `IPROTO_FLAGS <box_protocol-flags >` + IPROTO_FLAG_COMMIT
1274
+ :ref: `IPROTO_FLAGS <box_protocol-flags >` and IPROTO_FLAG_COMMIT
1277
1275
in the header of the last request of a transaction.
1278
1276
Rollback will be automatic if disconnect occurs before commit is possible.
1279
1277
@@ -1390,12 +1388,12 @@ The fields within IPROTO_BALLOT are map items:
1390
1388
1391
1389
.. code-block :: none
1392
1390
1393
- IPROTO_BALLOT_IS_RO_CFG (0x01) + MP_BOOL
1394
- IPROTO_BALLOT_VCLOCK (0x02) + vclock
1395
- IPROTO_BALLOT_GC_VCLOCK (0x03) + vclock
1396
- IPROTO_BALLOT_IS_RO (0x04) + MP_BOOL
1397
- IPROTO_BALLOT_IS_ANON = 0x05 + MP_BOOL
1398
- IPROTO_BALLOT_IS_BOOTED = 0x06 + MP_BOOL
1391
+ IPROTO_BALLOT_IS_RO_CFG (0x01) and MP_BOOL
1392
+ IPROTO_BALLOT_VCLOCK (0x02) and vclock
1393
+ IPROTO_BALLOT_GC_VCLOCK (0x03) and vclock
1394
+ IPROTO_BALLOT_IS_RO (0x04) and MP_BOOL
1395
+ IPROTO_BALLOT_IS_ANON = 0x05 and MP_BOOL
1396
+ IPROTO_BALLOT_IS_BOOTED = 0x06 and MP_BOOL
1399
1397
1400
1398
IPROTO_BALLOT_IS_RO_CFG and IPRO_BALLOT_VCLOCK and IPROTO_BALLOT_GC_VCLOCK and IPROTO_BALLOT_IS_RO
1401
1399
were added in version :doc: `2.6.1 </release/2.6.1 >`.
@@ -1571,7 +1569,7 @@ example:
1571
1569
1572
1570
.. code-block :: none
1573
1571
1574
- ce 00 00 00 20 MP_UINT = HEADER + BODY SIZE
1572
+ ce 00 00 00 20 MP_UINT = HEADER AND BODY SIZE
1575
1573
83 MP_MAP, size 3
1576
1574
00 Response-Code-Indicator
1577
1575
ce 00 00 00 00 MP_UINT = IPROTO_OK
@@ -1590,7 +1588,7 @@ example:
1590
1588
1591
1589
.. code-block :: none
1592
1590
1593
- ce 00 00 00 3b MP_UINT = HEADER + BODY SIZE
1591
+ ce 00 00 00 3b MP_UINT = HEADER AND BODY SIZE
1594
1592
83 MP_MAP, size 3 (i.e. 3 items in header)
1595
1593
00 Response-Code-Indicator
1596
1594
ce 00 00 80 0a MP_UINT = hexadecimal 800a
@@ -1638,17 +1636,17 @@ then tcpdump will show this response, after the header:
1638
1636
32 IPROTO_METADATA
1639
1637
92 MP_ARRAY, size 2 (i.e. 2 columns)
1640
1638
85 MP_MAP, size 5 (i.e. 5 items for column#1)
1641
- 00 a2 44 44 IPROTO_FIELD_NAME + 'DD'
1642
- 01 a7 69 6e 74 65 67 65 72 IPROTO_FIELD_TYPE + 'integer'
1643
- 03 c2 IPROTO_FIELD_IS_NULLABLE + false
1644
- 04 c3 IPROTO_FIELD_IS_AUTOINCREMENT + true
1645
- 05 c0 PROTO_FIELD_SPAN + nil
1639
+ 00 a2 44 44 IPROTO_FIELD_NAME and 'DD'
1640
+ 01 a7 69 6e 74 65 67 65 72 IPROTO_FIELD_TYPE and 'integer'
1641
+ 03 c2 IPROTO_FIELD_IS_NULLABLE and false
1642
+ 04 c3 IPROTO_FIELD_IS_AUTOINCREMENT and true
1643
+ 05 c0 PROTO_FIELD_SPAN and nil
1646
1644
85 MP_MAP, size 5 (i.e. 5 items for column#2)
1647
- 00 a2 d0 94 IPROTO_FIELD_NAME + 'Д' upper case
1648
- 01 a6 73 74 72 69 6e 67 IPROTO_FIELD_TYPE + 'string'
1649
- 02 a7 75 6e 69 63 6f 64 65 IPROTO_FIELD_COLL + 'unicode'
1650
- 03 c3 IPROTO_FIELD_IS_NULLABLE + true
1651
- 05 a4 d0 b4 d0 b4 IPROTO_FIELD_SPAN + 'дд' lower case
1645
+ 00 a2 d0 94 IPROTO_FIELD_NAME and 'Д' upper case
1646
+ 01 a6 73 74 72 69 6e 67 IPROTO_FIELD_TYPE and 'string'
1647
+ 02 a7 75 6e 69 63 6f 64 65 IPROTO_FIELD_COLL and 'unicode'
1648
+ 03 c3 IPROTO_FIELD_IS_NULLABLE and true
1649
+ 05 a4 d0 b4 d0 b4 IPROTO_FIELD_SPAN and 'дд' lower case
1652
1650
30 IPROTO_DATA
1653
1651
92 MP_ARRAY, size 2
1654
1652
92 MP_ARRAY, size 2
@@ -1662,8 +1660,8 @@ Byte code for the SQL PREPARE example. If we said |br|
1662
1660
:code: `conn:prepare([[SELECT dd, дд AS д FROM t1;]]) ` |br |
1663
1661
then tcpdump would should show almost the same response, but there would
1664
1662
be no IPROTO_DATA and there would be two additional items: |br |
1665
- :code: `34 00 = IPROTO_BIND_COUNT + MP_UINT = 0 ` (there are no parameters to bind), |br |
1666
- :code: `33 90 = IPROTO_BIND_METADATA + MP_ARRAY `, size 0 (there are no parameters to bind).
1663
+ :code: `34 00 = IPROTO_BIND_COUNT and MP_UINT = 0 ` (there are no parameters to bind), |br |
1664
+ :code: `33 90 = IPROTO_BIND_METADATA and MP_ARRAY `, size 0 (there are no parameters to bind).
1667
1665
1668
1666
.. code-block :: none
1669
1667
@@ -1677,17 +1675,17 @@ be no IPROTO_DATA and there would be two additional items: |br|
1677
1675
32 IPROTO_METADATA
1678
1676
92 MP_ARRAY, size 2 (i.e. 2 columns)
1679
1677
85 MP_MAP, size 5 (i.e. 5 items for column#1)
1680
- 00 a2 44 44 IPROTO_FIELD_NAME + 'DD'
1681
- 01 a7 69 6e 74 65 67 65 72 IPROTO_FIELD_TYPE + 'integer'
1682
- 03 c2 IPROTO_FIELD_IS_NULLABLE + false
1683
- 04 c3 IPROTO_FIELD_IS_AUTOINCREMENT + true
1684
- 05 c0 PROTO_FIELD_SPAN + nil
1678
+ 00 a2 44 44 IPROTO_FIELD_NAME and 'DD'
1679
+ 01 a7 69 6e 74 65 67 65 72 IPROTO_FIELD_TYPE and 'integer'
1680
+ 03 c2 IPROTO_FIELD_IS_NULLABLE and false
1681
+ 04 c3 IPROTO_FIELD_IS_AUTOINCREMENT and true
1682
+ 05 c0 PROTO_FIELD_SPAN and nil
1685
1683
85 MP_MAP, size 5 (i.e. 5 items for column#2)
1686
- 00 a2 d0 94 IPROTO_FIELD_NAME + 'Д' upper case
1687
- 01 a6 73 74 72 69 6e 67 IPROTO_FIELD_TYPE + 'string'
1688
- 02 a7 75 6e 69 63 6f 64 65 IPROTO_FIELD_COLL + 'unicode'
1689
- 03 c3 IPROTO_FIELD_IS_NULLABLE + true
1690
- 05 a4 d0 b4 d0 b4 IPROTO_FIELD_SPAN + 'дд' lower case
1684
+ 00 a2 d0 94 IPROTO_FIELD_NAME and 'Д' upper case
1685
+ 01 a6 73 74 72 69 6e 67 IPROTO_FIELD_TYPE and 'string'
1686
+ 02 a7 75 6e 69 63 6f 64 65 IPROTO_FIELD_COLL and 'unicode'
1687
+ 03 c3 IPROTO_FIELD_IS_NULLABLE and true
1688
+ 05 a4 d0 b4 d0 b4 IPROTO_FIELD_SPAN and 'дд' lower case
1691
1689
1692
1690
Byte code for the heartbeat example. The master might send this body:
1693
1691
0 commit comments