Tarantool development patches archive
 help / color / mirror / Atom feed
From: Nikita Pettik <korablev@tarantool.org>
To: tarantool-patches@dev.tarantool.org
Subject: [Tarantool-patches] [PATCH v3 05/20] sql: rename sql_finalize() to sql_stmt_finalize()
Date: Fri, 20 Dec 2019 15:47:10 +0300	[thread overview]
Message-ID: <2039b04c88e015e25367a1bf8e4244f853de1a20.1576844632.git.korablev@tarantool.org> (raw)
In-Reply-To: <cover.1576844631.git.korablev@tarantool.org>
In-Reply-To: <cover.1576844631.git.korablev@tarantool.org>

Let's follow unified naming rules for SQL high level API which
manipulates on statements objects. To be more precise, let's use
'sql_stmt_' prefix for interface functions operating on statement
handles.
---
 src/box/bind.c          | 2 +-
 src/box/ck_constraint.c | 4 ++--
 src/box/execute.c       | 2 +-
 src/box/lua/execute.c   | 2 +-
 src/box/sql/analyze.c   | 6 +++---
 src/box/sql/sqlInt.h    | 2 +-
 src/box/sql/vdbe.c      | 4 ++--
 src/box/sql/vdbeapi.c   | 2 +-
 8 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/box/bind.c b/src/box/bind.c
index 7eea9fcc8..bbc1f56df 100644
--- a/src/box/bind.c
+++ b/src/box/bind.c
@@ -180,7 +180,7 @@ sql_bind_column(struct sql_stmt *stmt, const struct sql_bind *p,
 		 * Parameters are allocated within message pack,
 		 * received from the iproto thread. IProto thread
 		 * now is waiting for the response and it will not
-		 * free the packet until sql_finalize. So
+		 * free the packet until sql_stmt_finalize. So
 		 * there is no need to copy the packet and we can
 		 * use SQL_STATIC.
 		 */
diff --git a/src/box/ck_constraint.c b/src/box/ck_constraint.c
index a2c66ce00..551bdd397 100644
--- a/src/box/ck_constraint.c
+++ b/src/box/ck_constraint.c
@@ -141,7 +141,7 @@ ck_constraint_program_compile(struct ck_constraint_def *ck_constraint_def,
 		diag_set(ClientError, ER_CREATE_CK_CONSTRAINT,
 			 ck_constraint_def->name,
 			 box_error_message(box_error_last()));
-		sql_finalize((struct sql_stmt *) v);
+		sql_stmt_finalize((struct sql_stmt *) v);
 		return NULL;
 	}
 	return (struct sql_stmt *) v;
@@ -254,7 +254,7 @@ error:
 void
 ck_constraint_delete(struct ck_constraint *ck_constraint)
 {
-	sql_finalize(ck_constraint->stmt);
+	sql_stmt_finalize(ck_constraint->stmt);
 	ck_constraint_def_delete(ck_constraint->def);
 	TRASH(ck_constraint);
 	free(ck_constraint);
diff --git a/src/box/execute.c b/src/box/execute.c
index af66447b5..fb83e1194 100644
--- a/src/box/execute.c
+++ b/src/box/execute.c
@@ -100,7 +100,7 @@ static void
 port_sql_destroy(struct port *base)
 {
 	port_tuple_vtab.destroy(base);
-	sql_finalize(((struct port_sql *)base)->stmt);
+	sql_stmt_finalize(((struct port_sql *)base)->stmt);
 }
 
 const struct port_vtab port_sql_vtab = {
diff --git a/src/box/lua/execute.c b/src/box/lua/execute.c
index ffa3d4d2e..68adacf72 100644
--- a/src/box/lua/execute.c
+++ b/src/box/lua/execute.c
@@ -217,7 +217,7 @@ lua_sql_bind_list_decode(struct lua_State *L, struct sql_bind **out_bind,
 	size_t size = sizeof(struct sql_bind) * bind_count;
 	/*
 	 * Memory allocated here will be freed in
-	 * sql_finalize() or in txn_commit()/txn_rollback() if
+	 * sql_stmt_finalize() or in txn_commit()/txn_rollback() if
 	 * there is an active transaction.
 	 */
 	struct sql_bind *bind = (struct sql_bind *) region_alloc(region, size);
diff --git a/src/box/sql/analyze.c b/src/box/sql/analyze.c
index 42e2a1a2f..f74f9b358 100644
--- a/src/box/sql/analyze.c
+++ b/src/box/sql/analyze.c
@@ -1424,7 +1424,7 @@ load_stat_from_space(const char *sql_select_prepare,
 		current_idx_count++;
 
 	}
-	rc = sql_finalize(stmt);
+	rc = sql_stmt_finalize(stmt);
 	if (rc)
 		goto finalize;
 	rc = sql_stmt_compile(sql_select_load, -1, NULL, &stmt, 0);
@@ -1475,7 +1475,7 @@ load_stat_from_space(const char *sql_select_prepare,
 		sample->sample_key = region_alloc(&fiber()->gc,
 						  sample->key_size);
 		if (sample->sample_key == NULL) {
-			sql_finalize(stmt);
+			sql_stmt_finalize(stmt);
 			rc = -1;
 			diag_set(OutOfMemory, sample->key_size,
 				 "region", "sample_key");
@@ -1488,7 +1488,7 @@ load_stat_from_space(const char *sql_select_prepare,
 		}
 		stats[current_idx_count].sample_count++;
 	}
-	rc = sql_finalize(stmt);
+	rc = sql_stmt_finalize(stmt);
 	if (rc == 0 && prev_index != NULL)
 		init_avg_eq(prev_index, &stats[current_idx_count]);
 	assert(current_idx_count <= index_count);
diff --git a/src/box/sql/sqlInt.h b/src/box/sql/sqlInt.h
index 03deb733c..cf0b946f1 100644
--- a/src/box/sql/sqlInt.h
+++ b/src/box/sql/sqlInt.h
@@ -521,7 +521,7 @@ sql_column_value(sql_stmt *,
 		     int iCol);
 
 int
-sql_finalize(sql_stmt * pStmt);
+sql_stmt_finalize(sql_stmt * pStmt);
 
 /*
  * Terminate the current execution of an SQL statement and reset
diff --git a/src/box/sql/vdbe.c b/src/box/sql/vdbe.c
index ab86be9a9..336fd4a52 100644
--- a/src/box/sql/vdbe.c
+++ b/src/box/sql/vdbe.c
@@ -1084,7 +1084,7 @@ case OP_Yield: {            /* in1, jump */
  * automatically.
  *
  * P1 is the result code returned by sql_exec(),
- * sql_reset(), or sql_finalize().  For a normal halt,
+ * sql_reset(), or sql_stmt_finalize().  For a normal halt,
  * this should be 0.
  * For errors, it can be some other value.  If P1!=0 then P2 will
  * determine whether or not to rollback the current transaction.
@@ -2887,7 +2887,7 @@ case OP_MakeRecord: {
 	 * memory shouldn't be reused until it is written into WAL.
 	 *
 	 * However, if memory for ephemeral space is allocated
-	 * on region, it will be freed only in sql_finalize()
+	 * on region, it will be freed only in sql_stmt_finalize()
 	 * routine.
 	 */
 	if (bIsEphemeral) {
diff --git a/src/box/sql/vdbeapi.c b/src/box/sql/vdbeapi.c
index ab8441bc5..7463fb9d7 100644
--- a/src/box/sql/vdbeapi.c
+++ b/src/box/sql/vdbeapi.c
@@ -76,7 +76,7 @@ invokeProfileCallback(sql * db, Vdbe * p)
  * machine.
  */
 int
-sql_finalize(sql_stmt * pStmt)
+sql_stmt_finalize(sql_stmt * pStmt)
 {
 	if (pStmt == NULL)
 		return 0;
-- 
2.15.1

  parent reply	other threads:[~2019-12-20 12:47 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-20 12:47 [Tarantool-patches] [PATCH v3 00/20] sql: prepared statements Nikita Pettik
2019-12-20 12:47 ` [Tarantool-patches] [PATCH v3 01/20] sql: remove sql_prepare_v2() Nikita Pettik
2019-12-23 14:03   ` Sergey Ostanevich
2019-12-24  0:51     ` Nikita Pettik
2019-12-27 19:18       ` Sergey Ostanevich
2019-12-20 12:47 ` [Tarantool-patches] [PATCH v3 02/20] sql: refactor sql_prepare() and sqlPrepare() Nikita Pettik
2019-12-24 11:35   ` Sergey Ostanevich
2019-12-20 12:47 ` [Tarantool-patches] [PATCH v3 03/20] sql: move sql_prepare() declaration to box/execute.h Nikita Pettik
2019-12-24 11:40   ` Sergey Ostanevich
2019-12-20 12:47 ` [Tarantool-patches] [PATCH v3 04/20] sql: rename sqlPrepare() to sql_stmt_compile() Nikita Pettik
2019-12-24 12:01   ` Sergey Ostanevich
2019-12-20 12:47 ` Nikita Pettik [this message]
2019-12-24 12:08   ` [Tarantool-patches] [PATCH v3 05/20] sql: rename sql_finalize() to sql_stmt_finalize() Sergey Ostanevich
2019-12-20 12:47 ` [Tarantool-patches] [PATCH v3 06/20] sql: rename sql_reset() to sql_stmt_reset() Nikita Pettik
2019-12-24 12:09   ` Sergey Ostanevich
2019-12-20 12:47 ` [Tarantool-patches] [PATCH v3 07/20] sql: move sql_stmt_finalize() to execute.h Nikita Pettik
2019-12-24 12:11   ` Sergey Ostanevich
2019-12-20 12:47 ` [Tarantool-patches] [PATCH v3 08/20] port: increase padding of struct port Nikita Pettik
2019-12-24 12:34   ` Sergey Ostanevich
2019-12-20 12:47 ` [Tarantool-patches] [PATCH v3 09/20] port: add result set format and request type to port_sql Nikita Pettik
2019-12-25 13:37   ` Sergey Ostanevich
2019-12-20 12:47 ` [Tarantool-patches] [PATCH v3 10/20] sql: resurrect sql_bind_parameter_count() function Nikita Pettik
2019-12-24 20:23   ` Sergey Ostanevich
2019-12-20 12:47 ` [Tarantool-patches] [PATCH v3 11/20] sql: resurrect sql_bind_parameter_name() Nikita Pettik
2019-12-24 20:26   ` Sergey Ostanevich
2019-12-20 12:47 ` [Tarantool-patches] [PATCH v3 12/20] sql: add sql_stmt_schema_version() Nikita Pettik
2019-12-25 13:37   ` Sergey Ostanevich
2019-12-20 12:47 ` [Tarantool-patches] [PATCH v3 13/20] sql: introduce sql_stmt_sizeof() function Nikita Pettik
2019-12-25 13:44   ` Sergey Ostanevich
2019-12-20 12:47 ` [Tarantool-patches] [PATCH v3 14/20] box: increment schema_version on ddl operations Nikita Pettik
2019-12-25 14:33   ` Sergey Ostanevich
2019-12-20 12:47 ` [Tarantool-patches] [PATCH v3 15/20] sql: introduce sql_stmt_query_str() method Nikita Pettik
2019-12-25 14:36   ` Sergey Ostanevich
2019-12-20 12:47 ` [Tarantool-patches] [PATCH v3 16/20] sql: move sql_stmt_busy() declaration to box/execute.h Nikita Pettik
2019-12-25 14:54   ` Sergey Ostanevich
2019-12-20 12:47 ` [Tarantool-patches] [PATCH v3 17/20] sql: introduce holder for prepared statemets Nikita Pettik
2019-12-23 20:54   ` Sergey Ostanevich
2019-12-20 12:47 ` [Tarantool-patches] [PATCH v3 18/20] box: introduce prepared statements Nikita Pettik
2019-12-25 15:23   ` Sergey Ostanevich
2019-12-30 10:27     ` Nikita Pettik
2019-12-30 14:15       ` Sergey Ostanevich
2019-12-20 12:47 ` [Tarantool-patches] [PATCH v3 19/20] netbox: " Nikita Pettik
2019-12-25 20:41   ` Sergey Ostanevich
2019-12-30  9:58     ` Nikita Pettik
2019-12-30 14:16       ` Sergey Ostanevich
2019-12-20 12:47 ` [Tarantool-patches] [PATCH v3 20/20] sql: add cache statistics to box.info Nikita Pettik
2019-12-25 20:53   ` Sergey Ostanevich
2019-12-30  9:46     ` Nikita Pettik
2019-12-30 14:23       ` Sergey Ostanevich
2019-12-30  1:13 ` [Tarantool-patches] [PATCH v3 00/20] sql: prepared statements Nikita Pettik
2019-12-31  8:39 ` Kirill Yukhin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2039b04c88e015e25367a1bf8e4244f853de1a20.1576844632.git.korablev@tarantool.org \
    --to=korablev@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v3 05/20] sql: rename sql_finalize() to sql_stmt_finalize()' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox