[tarantool-patches] [PATCH v3 2/2] sql: removes unused function.
Stanislav Zudin
szudin at tarantool.org
Wed Apr 3 14:47:07 MSK 2019
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
More information about the Tarantool-patches
mailing list