From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id AB06A2F2B1 for ; Tue, 13 Nov 2018 11:11:28 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vZ_maRq3MeGQ for ; Tue, 13 Nov 2018 11:11:28 -0500 (EST) 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 turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 5935F2F2C1 for ; Tue, 13 Nov 2018 11:11:28 -0500 (EST) From: Nikita Pettik Subject: [tarantool-patches] [PATCH v2 3/4] sql: remove total_changes() function Date: Tue, 13 Nov 2018 19:11:22 +0300 Message-Id: In-Reply-To: References: In-Reply-To: References: Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: tarantool-patches@freelists.org Cc: v.shpilevoy@tarantool.org, Nikita Pettik 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