Skip to content

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

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
Tracked by #2646
TarantoolBot opened this issue Nov 13, 2021 · 0 comments
Closed
Tracked by #2646
Labels
factual error Factual error in functionality description reference [location] Tarantool manual, Reference part server [area] Task relates to Tarantool's server (core) functionality

Comments

@TarantoolBot
Copy link
Collaborator

TarantoolBot commented Nov 13, 2021

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.

@patiencedaur patiencedaur added this to the Estimate [@patiencedaur] milestone Nov 16, 2021
@patiencedaur patiencedaur added the server [area] Task relates to Tarantool's server (core) functionality label Nov 16, 2021
@patiencedaur patiencedaur changed the title feedback: Binary protocol | Tarantool [1pt?] feedback: Binary protocol: incorrect request type specified Nov 16, 2021
@patiencedaur patiencedaur added factual error Factual error in functionality description reference [location] Tarantool manual, Reference part labels Nov 16, 2021
@patiencedaur patiencedaur changed the title [1pt?] feedback: Binary protocol: incorrect request type specified [2pt] feedback: Binary protocol: incorrect request type specified Nov 18, 2021
@patiencedaur patiencedaur removed this from the Estimate [@patiencedaur] milestone Nov 23, 2021
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 reference [location] Tarantool manual, Reference part server [area] Task relates to Tarantool's server (core) functionality
Projects
None yet
Development

No branches or pull requests

2 participants