Tarantool development patches archive
 help / color / mirror / Atom feed
From: Stanislav Zudin <szudin@tarantool.org>
To: tarantool-patches@freelists.org, korablev@tarantool.org
Cc: Stanislav Zudin <szudin@tarantool.org>
Subject: [tarantool-patches] [PATCH v3 2/2] sql: removes unused function.
Date: Wed,  3 Apr 2019 14:47:07 +0300	[thread overview]
Message-ID: <282ba59a6c21182e4437dbafe0f9d4b9d798dafc.1554291531.git.szudin@tarantool.org> (raw)
In-Reply-To: <cover.1554291531.git.szudin@tarantool.org>
In-Reply-To: <cover.1554291531.git.szudin@tarantool.org>

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

      parent reply	other threads:[~2019-04-03 11:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-03 11:47 [tarantool-patches] [PATCH v3 0/2] sql: support -2^63 .. 2^64-1 integer type *** Stanislav Zudin
2019-04-03 11:47 ` [tarantool-patches] [PATCH v3 1/2] sql: support -2^63 .. 2^64-1 integer type Stanislav Zudin
2019-04-04  0:49   ` [tarantool-patches] " n.pettik
2019-04-03 11:47 ` Stanislav Zudin [this message]

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=282ba59a6c21182e4437dbafe0f9d4b9d798dafc.1554291531.git.szudin@tarantool.org \
    --to=szudin@tarantool.org \
    --cc=korablev@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [tarantool-patches] [PATCH v3 2/2] sql: removes unused 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