[patches] [PATCH 4/4] iproto: rename IPROTO_SQL_OPTIONS to IPROTO_OPTIONS
Vladislav Shpilevoy
v.shpilevoy at tarantool.org
Wed Mar 14 00:49:27 MSK 2018
IPROTO_OPTIONS can be used in the future for request types,
different from IPROTO_EXECUTE.
Signed-off-by: Vladislav Shpilevoy <v.shpilevoy at tarantool.org>
---
src/box/execute.c | 6 +++---
src/box/iproto_constants.c | 7 +++----
src/box/iproto_constants.h | 4 ++--
src/box/lua/net_box.c | 2 +-
src/box/lua/net_box.lua | 2 +-
5 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/src/box/execute.c b/src/box/execute.c
index 91e253beb..b28984bd9 100644
--- a/src/box/execute.c
+++ b/src/box/execute.c
@@ -251,7 +251,7 @@ sql_bind_list_decode(struct sql_request *request, const char *data,
}
/**
- * Decode IPROTO_SQL_OPTIONS.
+ * Decode SQL IPROTO_OPTIONS.
* @param[out] sql_request Request to decode to.
* @param data MessagePack encoded options.
*
@@ -316,7 +316,7 @@ mp_error:
for (uint32_t i = 0; i < map_size; ++i) {
uint8_t key = *data;
if (key != IPROTO_SQL_BIND && key != IPROTO_SQL_TEXT &&
- key != IPROTO_SQL_OPTIONS) {
+ key != IPROTO_OPTIONS) {
mp_check(&data, end); /* skip the key */
mp_check(&data, end); /* skip the value */
continue;
@@ -337,7 +337,7 @@ mp_error:
}
request->sql_text = value;
break;
- case IPROTO_SQL_OPTIONS:
+ case IPROTO_OPTIONS:
if (sql_options_decode(request, value) != 0)
return -1;
break;
diff --git a/src/box/iproto_constants.c b/src/box/iproto_constants.c
index 203c85a52..9a41ff196 100644
--- a/src/box/iproto_constants.c
+++ b/src/box/iproto_constants.c
@@ -64,7 +64,7 @@ const unsigned char iproto_key_type[IPROTO_KEY_MAX] =
/* }}} */
/* {{{ unused */
- /* 0x16 */ MP_UINT,
+ /* 0x16 */ MP_MAP,
/* 0x17 */ MP_UINT,
/* 0x18 */ MP_UINT,
/* 0x19 */ MP_UINT,
@@ -148,7 +148,7 @@ const char *iproto_key_strs[IPROTO_KEY_MAX] = {
"offset", /* 0x13 */
"iterator", /* 0x14 */
"index base", /* 0x15 */
- NULL, /* 0x16 */
+ "options", /* 0x16 */
NULL, /* 0x17 */
NULL, /* 0x18 */
NULL, /* 0x19 */
@@ -192,8 +192,7 @@ const char *iproto_key_strs[IPROTO_KEY_MAX] = {
NULL, /* 0x3f */
"SQL text", /* 0x40 */
"SQL bind", /* 0x41 */
- "SQL options", /* 0x42 */
- "SQL info", /* 0x43 */
+ "SQL info", /* 0x42 */
};
const char *vy_page_info_key_strs[VY_PAGE_INFO_KEY_MAX] = {
diff --git a/src/box/iproto_constants.h b/src/box/iproto_constants.h
index ee79681b2..607401ae1 100644
--- a/src/box/iproto_constants.h
+++ b/src/box/iproto_constants.h
@@ -66,6 +66,7 @@ enum iproto_key {
IPROTO_OFFSET = 0x13,
IPROTO_ITERATOR = 0x14,
IPROTO_INDEX_BASE = 0x15,
+ IPROTO_OPTIONS = 0x16,
/* Leave a gap between integer values and other keys */
IPROTO_KEY = 0x20,
@@ -104,13 +105,12 @@ enum iproto_key {
/* Leave a gap between response keys and SQL keys. */
IPROTO_SQL_TEXT = 0x40,
IPROTO_SQL_BIND = 0x41,
- IPROTO_SQL_OPTIONS = 0x42,
/**
* IPROTO_SQL_INFO: {
* SQL_INFO_ROW_COUNT: number
* }
*/
- IPROTO_SQL_INFO = 0x43,
+ IPROTO_SQL_INFO = 0x42,
IPROTO_KEY_MAX
};
diff --git a/src/box/lua/net_box.c b/src/box/lua/net_box.c
index 40e585cfb..1440dcd44 100644
--- a/src/box/lua/net_box.c
+++ b/src/box/lua/net_box.c
@@ -596,7 +596,7 @@ usage_error:
luamp_encode_uint(cfg, &stream, IPROTO_SQL_BIND);
luamp_encode_tuple(L, cfg, &stream, 5);
- luamp_encode_uint(cfg, &stream, IPROTO_SQL_OPTIONS);
+ luamp_encode_uint(cfg, &stream, IPROTO_OPTIONS);
luamp_encode_map(cfg, &stream, 1);
luamp_encode_uint(cfg, &stream, SQL_OPTION_RETURN_TUPLE);
luamp_encode_bool(cfg, &stream, opt_return_tuple);
diff --git a/src/box/lua/net_box.lua b/src/box/lua/net_box.lua
index b258ecbdf..da1b02e04 100644
--- a/src/box/lua/net_box.lua
+++ b/src/box/lua/net_box.lua
@@ -37,7 +37,7 @@ local IPROTO_ERRNO_MASK = 0x7FFF
local IPROTO_SYNC_KEY = 0x01
local IPROTO_SCHEMA_VERSION_KEY = 0x05
local IPROTO_METADATA_KEY = 0x32
-local IPROTO_SQL_INFO_KEY = 0x43
+local IPROTO_SQL_INFO_KEY = 0x42
local SQL_INFO_ROW_COUNT_KEY = 0
local IPROTO_FIELD_NAME_KEY = 0x29
local IPROTO_DATA_KEY = 0x30
--
2.14.3 (Apple Git-98)
More information about the Tarantool-patches
mailing list