[tarantool-patches] [PATCH v2 11/15] sql: support -2^63 .. 2^64-1 integer type

Stanislav Zudin szudin at tarantool.org
Mon Apr 1 23:44:49 MSK 2019


Removes unused code.

Part of #3810
---
 src/box/sql/main.c    | 11 -----------
 src/box/sql/os_unix.c |  5 -----
 src/box/sql/sqlInt.h  |  9 ---------
 src/box/sql/util.c    | 35 -----------------------------------
 4 files changed, 60 deletions(-)

diff --git a/src/box/sql/main.c b/src/box/sql/main.c
index a3c59b126..03dbaf842 100644
--- a/src/box/sql/main.c
+++ b/src/box/sql/main.c
@@ -1899,17 +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;
-}
-
 #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 c43d8c193..df051a32b 100644
--- a/src/box/sql/sqlInt.h
+++ b/src/box/sql/sqlInt.h
@@ -847,10 +847,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;
 
@@ -4407,11 +4403,6 @@ enum arithmetic_result sqlDivInt64(i64 *, bool, i64, bool);
 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 1f3f92a04..62c43c555 100644
--- a/src/box/sql/util.c
+++ b/src/box/sql/util.c
@@ -1467,41 +1467,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





More information about the Tarantool-patches mailing list