[tarantool-patches] Re: [PATCH v1 04/28] sql: remove sqlError() and remove sqlErrorWithMsg()
Vladislav Shpilevoy
v.shpilevoy at tarantool.org
Fri Jun 14 01:25:06 MSK 2019
Thanks for the patch!
Consider my review fixes below and on the branch
in a separate commit.
======================================================
diff --git a/src/box/sql/os.c b/src/box/sql/os.c
index eb7450b23..a06067583 100644
--- a/src/box/sql/os.c
+++ b/src/box/sql/os.c
@@ -128,12 +128,6 @@ sqlOsRandomness(sql_vfs * pVfs, int nByte, char *zBufOut)
return pVfs->xRandomness(pVfs, nByte, zBufOut);
}
-int
-sqlOsGetLastError(sql_vfs * pVfs)
-{
- return pVfs->xGetLastError ? pVfs->xGetLastError(pVfs, 0, 0) : 0;
-}
-
int
sqlOsCurrentTimeInt64(sql_vfs * pVfs, sql_int64 * pTimeOut)
{
diff --git a/src/box/sql/os.h b/src/box/sql/os.h
index 1514f0d8a..9122e9cb7 100644
--- a/src/box/sql/os.h
+++ b/src/box/sql/os.h
@@ -146,7 +146,6 @@ int sqlOsUnfetch(sql_file *, i64, void *);
*/
int sqlOsOpen(sql_vfs *, const char *, sql_file *, int, int *);
int sqlOsRandomness(sql_vfs *, int, char *);
-int sqlOsGetLastError(sql_vfs *);
int sqlOsCurrentTimeInt64(sql_vfs *, sql_int64 *);
/*
diff --git a/src/box/sql/os_unix.c b/src/box/sql/os_unix.c
index 615d539b5..486f9ce7c 100644
--- a/src/box/sql/os_unix.c
+++ b/src/box/sql/os_unix.c
@@ -2018,21 +2018,6 @@ unixCurrentTimeInt64(sql_vfs * NotUsed, sql_int64 * piNow)
return rc;
}
-/*
- * The xGetLastError() method is designed to return a better
- * low-level error message when operating-system problems come up
- * during sql operation. Only the integer return code is currently
- * used.
- */
-static int
-unixGetLastError(sql_vfs * NotUsed, int NotUsed2, char *NotUsed3)
-{
- UNUSED_PARAMETER(NotUsed);
- UNUSED_PARAMETER(NotUsed2);
- UNUSED_PARAMETER(NotUsed3);
- return errno;
-}
-
/*
*********************** End of sql_vfs methods ***************************
*****************************************************************************/
@@ -2057,7 +2042,6 @@ unixGetLastError(sql_vfs * NotUsed, int NotUsed2, char *NotUsed3)
unixDelete, /* xDelete */ \
unixRandomness, /* xRandomness */ \
NULL, /* xCurrentTime */ \
- unixGetLastError, /* xGetLastError */ \
unixCurrentTimeInt64, /* xCurrentTimeInt64 */ \
}
diff --git a/src/box/sql/sqlInt.h b/src/box/sql/sqlInt.h
index 2b7aa8bc8..a87c5748d 100644
--- a/src/box/sql/sqlInt.h
+++ b/src/box/sql/sqlInt.h
@@ -330,7 +330,6 @@ struct sql_vfs {
int (*xDelete) (sql_vfs *, const char *zName, int syncDir);
int (*xRandomness) (sql_vfs *, int nByte, char *zOut);
int (*xCurrentTime) (sql_vfs *, double *);
- int (*xGetLastError) (sql_vfs *, int, char *);
/*
** The methods above are in version 1 of the sql_vfs object
** definition. Those that follow are added in version 2 or later
More information about the Tarantool-patches
mailing list