Skip to content

[2pt] feedback: Binary protocol: incorrect request type specified #2442

Closed
@TarantoolBot

Description

@TarantoolBot

Product: Tarantool
Audience/target: developers
Root document: https://www.tarantool.io/en/doc/latest/dev_guide/internals/box_protocol/
SME: @ Gerold103

Details

The examples on the page suggest that IPROTO_SQL_BIND is an array. Looks like there is an error in the description (integer instead of array).

@ Gerold103 also considers it crucial to indicate the formats of the values in the array:

IPROTO_SQL_BIND - это массив значений, где каждое из них имеет любой тип. Если это что угодно кроме MP_MAP, то они подставятся вместо '?'. Если встречается значение MP_MAP, то оно должно иметь формат вида {[name] = value}, где name - это имя именованного параметра из запроса. Пример:

tarantool> conn:execute('SELECT ?, ?, :name1, ?, :name2, :name1', {1, 2, {[':name1'] = 5}, 'str', {[':name2'] = true}})
---
- metadata:
  - name: COLUMN_1
    type: integer
  - name: COLUMN_2
    type: integer
  - name: COLUMN_3
    type: integer
  - name: COLUMN_4
    type: text
  - name: COLUMN_5
    type: boolean
  - name: COLUMN_6
    type: boolean
  rows:
  - [1, 2, 5, 'str', true, 5]

<…>_STMT_ID: {MP_INT integer} or IPROTO_SQL_TEXT: {MP_STR string},
| IPROTO_SQL_BIND: {MP_INT integer},
| IPROTO_OPTIONS:
{MP_ARRAY array}
})

Use IPROTO_STMT_ID (0x4<…>

https://www.tarantool.io/en/doc/latest/dev_guide/internals/box_protocol/#box-protocol-execute

According to description, IPROTO_SQL_BIN is an array, not int.

Metadata

Metadata

Assignees

No one assigned

    Labels

    factual errorFactual error in functionality descriptionreference[location] Tarantool manual, Reference partserver[area] Task relates to Tarantool's server (core) functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions