Tarantool development patches archive
 help / color / mirror / Atom feed
From: Nikita Pettik <korablev@tarantool.org>
To: tarantool-patches@freelists.org
Cc: v.shpilevoy@tarantool.org, Nikita Pettik <korablev@tarantool.org>
Subject: [tarantool-patches] [PATCH v2 3/4] sql: remove total_changes() function
Date: Tue, 13 Nov 2018 19:11:22 +0300	[thread overview]
Message-ID: <ac042c7409576aafe009c7414c21dee976ecaeb9.1542124689.git.korablev@tarantool.org> (raw)
In-Reply-To: <cover.1542124689.git.korablev@tarantool.org>
In-Reply-To: <cover.1542124689.git.korablev@tarantool.org>

Part of #2181
---
 src/box/sql/func.c      | 17 -----------------
 src/box/sql/main.c      | 15 ---------------
 src/box/sql/sqliteInt.h |  4 ----
 src/box/sql/vdbeaux.c   |  1 -
 4 files changed, 37 deletions(-)

diff --git a/src/box/sql/func.c b/src/box/sql/func.c
index 8c34cbb3d..5ab64821b 100644
--- a/src/box/sql/func.c
+++ b/src/box/sql/func.c
@@ -600,21 +600,6 @@ changes(sqlite3_context * context, int NotUsed, sqlite3_value ** NotUsed2)
 	sqlite3_result_int(context, sqlite3_changes(db));
 }
 
-/*
- * Implementation of the total_changes() SQL function.  The return value is
- * the same as the sqlite3_total_changes() API function.
- */
-static void
-total_changes(sqlite3_context * context, int NotUsed, sqlite3_value ** NotUsed2)
-{
-	sqlite3 *db = sqlite3_context_db_handle(context);
-	UNUSED_PARAMETER2(NotUsed, NotUsed2);
-	/* IMP: R-52756-41993 This function is a wrapper around the
-	 * sqlite3_total_changes() C/C++ interface.
-	 */
-	sqlite3_result_int(context, sqlite3_total_changes(db));
-}
-
 /*
  * A structure defining how to do GLOB-style comparisons.
  */
@@ -1869,8 +1854,6 @@ sqlite3RegisterBuiltinFunctions(void)
 		FUNCTION(version, 0, 0, 0, sql_func_version, AFFINITY_TEXT),
 		FUNCTION(quote, 1, 0, 0, quoteFunc, AFFINITY_TEXT),
 		VFUNCTION(changes, 0, 0, 0, changes, AFFINITY_INTEGER),
-		VFUNCTION(total_changes, 0, 0, 0, total_changes,
-			  AFFINITY_INTEGER),
 		FUNCTION(replace, 3, 0, 0, replaceFunc, AFFINITY_TEXT),
 		FUNCTION(zeroblob, 1, 0, 0, zeroblobFunc, AFFINITY_BLOB),
 		FUNCTION(substr, 2, 0, 0, substrFunc, AFFINITY_TEXT),
diff --git a/src/box/sql/main.c b/src/box/sql/main.c
index e1d61621f..76c152c68 100644
--- a/src/box/sql/main.c
+++ b/src/box/sql/main.c
@@ -498,21 +498,6 @@ sqlite3_changes(sqlite3 * db)
 	return db->nChange;
 }
 
-/*
- * Return the number of changes since the database handle was opened.
- */
-int
-sqlite3_total_changes(sqlite3 * db)
-{
-#ifdef SQLITE_ENABLE_API_ARMOR
-	if (!sqlite3SafetyCheckOk(db)) {
-		(void)SQLITE_MISUSE_BKPT;
-		return 0;
-	}
-#endif
-	return db->nTotalChange;
-}
-
 /*
  * Close all open savepoints.
  * This procedure is trivial as savepoints are allocated on the "region" and
diff --git a/src/box/sql/sqliteInt.h b/src/box/sql/sqliteInt.h
index 1999ff568..73ca35c11 100644
--- a/src/box/sql/sqliteInt.h
+++ b/src/box/sql/sqliteInt.h
@@ -657,9 +657,6 @@ sqlite3_randomness(int N, void *P);
 int
 sqlite3_changes(sqlite3 *);
 
-int
-sqlite3_total_changes(sqlite3 *);
-
 void *
 sqlite3_user_data(sqlite3_context *);
 
@@ -1516,7 +1513,6 @@ struct sqlite3 {
 	u8 mTrace;		/* zero or more SQLITE_TRACE flags */
 	u32 magic;		/* Magic number for detect library misuse */
 	int nChange;		/* Value returned by sqlite3_changes() */
-	int nTotalChange;	/* Value returned by sqlite3_total_changes() */
 	int aLimit[SQLITE_N_LIMIT];	/* Limits */
 	int nMaxSorterMmap;	/* Maximum size of regions mapped by sorter */
 	struct sqlite3InitInfo {	/* Information used during initialization */
diff --git a/src/box/sql/vdbeaux.c b/src/box/sql/vdbeaux.c
index e0bf92acf..c0945d36d 100644
--- a/src/box/sql/vdbeaux.c
+++ b/src/box/sql/vdbeaux.c
@@ -3453,7 +3453,6 @@ void
 sqlite3VdbeSetChanges(sqlite3 * db, int nChange)
 {
 	db->nChange = nChange;
-	db->nTotalChange += nChange;
 }
 
 /*
-- 
2.15.1

  parent reply	other threads:[~2018-11-13 16:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-13 16:11 [tarantool-patches] [PATCH v2 0/4] Introduce row_count() function Nikita Pettik
2018-11-13 16:11 ` [tarantool-patches] [PATCH v2 1/4] sql: don't increment row count on FK creation within CREATE TABLE Nikita Pettik
2018-11-14 12:32   ` [tarantool-patches] " Vladislav Shpilevoy
2018-11-14 16:20     ` n.pettik
2018-11-13 16:11 ` [tarantool-patches] [PATCH v2 2/4] sql: account REPLACE as two row changes Nikita Pettik
2018-11-14 12:32   ` [tarantool-patches] " Vladislav Shpilevoy
2018-11-14 16:20     ` n.pettik
2018-11-13 16:11 ` Nikita Pettik [this message]
2018-11-13 16:11 ` [tarantool-patches] [PATCH v2 4/4] sql: rename changes() to row_count() Nikita Pettik
2018-11-14 12:32   ` [tarantool-patches] " Vladislav Shpilevoy
2018-11-14 16:20     ` n.pettik
2018-11-14 16:43       ` Vladislav Shpilevoy
2018-11-15  5:06 ` [tarantool-patches] Re: [PATCH v2 0/4] Introduce row_count() function 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=ac042c7409576aafe009c7414c21dee976ecaeb9.1542124689.git.korablev@tarantool.org \
    --to=korablev@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [tarantool-patches] [PATCH v2 3/4] sql: remove total_changes() function' \
    /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