From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 999A74696CA for ; Fri, 20 Dec 2019 15:47:37 +0300 (MSK) From: Nikita Pettik Date: Fri, 20 Dec 2019 15:47:15 +0300 Message-Id: In-Reply-To: References: In-Reply-To: References: Subject: [Tarantool-patches] [PATCH v3 10/20] sql: resurrect sql_bind_parameter_count() function List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org This function is present in sql/vdbeapi.c source file, its prototype is missing in any header file. It makes impossible to use it. Let's add prototype declaration to sql/sqlInt.h (as other parameter setters/getters) and refactor a bit in accordance with our codestyle. Need for #2592 --- src/box/sql/sqlInt.h | 6 ++++++ src/box/sql/vdbeapi.c | 10 +++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/box/sql/sqlInt.h b/src/box/sql/sqlInt.h index 24da3ca11..a9faaa6e7 100644 --- a/src/box/sql/sqlInt.h +++ b/src/box/sql/sqlInt.h @@ -689,6 +689,12 @@ int sql_bind_zeroblob64(sql_stmt *, int, sql_uint64); +/** + * Return the number of wildcards that should be bound to. + */ +int +sql_bind_parameter_count(const struct sql_stmt *stmt); + /** * Perform pointer parameter binding for the prepared sql * statement. diff --git a/src/box/sql/vdbeapi.c b/src/box/sql/vdbeapi.c index b6bf9aa81..7fda525ce 100644 --- a/src/box/sql/vdbeapi.c +++ b/src/box/sql/vdbeapi.c @@ -1051,15 +1051,11 @@ sql_bind_zeroblob64(sql_stmt * pStmt, int i, sql_uint64 n) return sql_bind_zeroblob(pStmt, i, n); } -/* - * Return the number of wildcards that can be potentially bound to. - * This routine is added to support DBD::sql. - */ int -sql_bind_parameter_count(sql_stmt * pStmt) +sql_bind_parameter_count(const struct sql_stmt *stmt) { - Vdbe *p = (Vdbe *) pStmt; - return p ? p->nVar : 0; + struct Vdbe *p = (struct Vdbe *) stmt; + return p->nVar; } /* -- 2.15.1