From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Vladislav Shpilevoy Subject: [PATCH 2/4] Revert "box: store sql text and length in sql_request" Date: Tue, 11 Dec 2018 00:40:39 +0300 Message-Id: <13e5e88c89884ff4e444e4f27ab87fa45317927b.1544477760.git.v.shpilevoy@tarantool.org> In-Reply-To: References: In-Reply-To: References: To: tarantool-patches@freelists.org Cc: vdavydov.dev@gmail.com List-ID: This reverts commit bc9e41e9b5d06e70330964d94abbab2fabf3ced1. This is one step forward to make sql_request store raw MessagePack. Part of #3828 --- src/box/execute.c | 6 +++--- src/box/execute.h | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/box/execute.c b/src/box/execute.c index 894625c71..3c4898216 100644 --- a/src/box/execute.c +++ b/src/box/execute.c @@ -283,8 +283,7 @@ error: if (sql_bind_list_decode(request, value, region) != 0) return -1; } else { - request->sql_text = - mp_decode_str(&value, &request->sql_text_len); + request->sql_text = value; } } if (request->sql_text == NULL) { @@ -600,7 +599,8 @@ sql_prepare_and_execute(const struct sql_request *request, struct sql_response *response, struct region *region) { const char *sql = request->sql_text; - uint32_t len = request->sql_text_len; + uint32_t len; + sql = mp_decode_str(&sql, &len); struct sqlite3_stmt *stmt; sqlite3 *db = sql_get(); if (db == NULL) { diff --git a/src/box/execute.h b/src/box/execute.h index fa7820b0b..266566260 100644 --- a/src/box/execute.h +++ b/src/box/execute.h @@ -57,8 +57,6 @@ struct xrow_header; struct sql_request { /** SQL statement text. */ const char *sql_text; - /** Length of the SQL statement text. */ - uint32_t sql_text_len; /** Array of parameters. */ struct sql_bind *bind; /** Length of the @bind. */ -- 2.17.2 (Apple Git-113)