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 E5BAB2B4C5 for ; Wed, 3 Apr 2019 07:47:13 -0400 (EDT) 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 I6EV1cwjYbY8 for ; Wed, 3 Apr 2019 07:47:13 -0400 (EDT) Received: from smtp63.i.mail.ru (smtp63.i.mail.ru [217.69.128.43]) (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 930542ADB5 for ; Wed, 3 Apr 2019 07:47:13 -0400 (EDT) From: Stanislav Zudin Subject: [tarantool-patches] [PATCH v3 2/2] sql: removes unused function. Date: Wed, 3 Apr 2019 14:47:07 +0300 Message-Id: <282ba59a6c21182e4437dbafe0f9d4b9d798dafc.1554291531.git.szudin@tarantool.org> 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, korablev@tarantool.org Cc: Stanislav Zudin Closes #3810 --- src/box/sql/main.c | 27 --------------------------- src/box/sql/os_unix.c | 5 ----- src/box/sql/sqlInt.h | 9 --------- src/box/sql/util.c | 35 ----------------------------------- 4 files changed, 76 deletions(-) diff --git a/src/box/sql/main.c b/src/box/sql/main.c index 9fe2e2c9d..03dbaf842 100644 --- a/src/box/sql/main.c +++ b/src/box/sql/main.c @@ -1899,33 +1899,6 @@ sql_uri_parameter(const char *zFilename, const char *zParam) return 0; } -/* - * Return a boolean value for a query parameter. - */ -int -sql_uri_boolean(const char *zFilename, const char *zParam, int bDflt) -{ - const char *z = sql_uri_parameter(zFilename, zParam); - bDflt = bDflt != 0; - return z ? sqlGetBoolean(z, bDflt) : bDflt; -} - -/* - * Return a 64-bit integer value for a query parameter. - */ -sql_int64 -sql_uri_int64(const char *zFilename, /* Filename as passed to xOpen */ - const char *zParam, /* URI parameter sought */ - sql_int64 bDflt) /* return if parameter is missing */ -{ - const char *z = sql_uri_parameter(zFilename, zParam); - int64_t v; - if (z != NULL && sql_dec_or_hex_to_i64(z, false, &v) == 0) - bDflt = v; - return bDflt; -} - - #ifdef SQL_ENABLE_SNAPSHOT /* * Obtain a snapshot handle for the snapshot of database zDb currently diff --git a/src/box/sql/os_unix.c b/src/box/sql/os_unix.c index b6599852a..615d539b5 100644 --- a/src/box/sql/os_unix.c +++ b/src/box/sql/os_unix.c @@ -1693,11 +1693,6 @@ getFileMode(const char *zFile, /* File name */ * corresponding database file and sets *pMode to this value. Whenever * possible, journal files are created using the same permissions * as the associated database file. - * - * If the SQL_ENABLE_8_3_NAMES option is enabled, then the - * original filename is unavailable. But 8_3_NAMES is only used for - * FAT filesystems and permissions do not matter there, so just use - * the default permissions. */ static int findCreateFileMode(const char *zPath, /* Path of file (possibly) being created */ diff --git a/src/box/sql/sqlInt.h b/src/box/sql/sqlInt.h index 8942addd3..509879cf7 100644 --- a/src/box/sql/sqlInt.h +++ b/src/box/sql/sqlInt.h @@ -853,10 +853,6 @@ sql_limit(sql *, int id, int newVal); #define SQL_SYNC_FULL 0x00003 #define SQL_SYNC_DATAONLY 0x00010 -int -sql_uri_boolean(const char *zFile, - const char *zParam, int bDefault); - extern char * sql_temp_directory; @@ -4399,11 +4395,6 @@ enum arithmetic_result sqlRemInt64(i64 *, bool, i64, bool); int sqlAbsInt32(int); -#ifdef SQL_ENABLE_8_3_NAMES -void sqlFileSuffix3(const char *, char *); -#else -#define sqlFileSuffix3(X,Y) -#endif u8 sqlGetBoolean(const char *z, u8); const void *sqlValueText(sql_value *); diff --git a/src/box/sql/util.c b/src/box/sql/util.c index d1b159770..e56ae6e05 100644 --- a/src/box/sql/util.c +++ b/src/box/sql/util.c @@ -1460,41 +1460,6 @@ sqlAbsInt32(int x) return -x; } -#ifdef SQL_ENABLE_8_3_NAMES -/* - * If SQL_ENABLE_8_3_NAMES is set at compile-time and if the database - * filename in zBaseFilename is a URI with the "8_3_names=1" parameter and - * if filename in z[] has a suffix (a.k.a. "extension") that is longer than - * three characters, then shorten the suffix on z[] to be the last three - * characters of the original suffix. - * - * If SQL_ENABLE_8_3_NAMES is set to 2 at compile-time, then always - * do the suffix shortening regardless of URI parameter. - * - * Examples: - * - * test.db-journal => test.nal - * test.db-wal => test.wal - * test.db-shm => test.shm - * test.db-mj7f3319fa => test.9fa - */ -void -sqlFileSuffix3(const char *zBaseFilename, char *z) -{ -#if SQL_ENABLE_8_3_NAMES<2 - if (sql_uri_boolean(zBaseFilename, "8_3_names", 0)) -#endif - { - int i, sz; - sz = sqlStrlen30(z); - for (i = sz - 1; i > 0 && z[i] != '/' && z[i] != '.'; i--) { - } - if (z[i] == '.' && ALWAYS(sz > i + 4)) - memmove(&z[i + 1], &z[sz - 3], 4); - } -} -#endif - /* * Find (an approximate) sum of two LogEst values. This computation is * not a simple "+" operator because LogEst is stored as a logarithmic -- 2.17.1