[tarantool-patches] [PATCH v1 02/28] sql: remove field pErr from struct sql
imeevma at tarantool.org
imeevma at tarantool.org
Mon Jun 10 16:56:28 MSK 2019
This field has become unused and should be removed.
---
src/box/sql/malloc.c | 3 +--
src/box/sql/sqlInt.h | 1 -
src/box/sql/util.c | 14 ++------------
src/box/sql/vdbeapi.c | 3 ---
4 files changed, 3 insertions(+), 18 deletions(-)
diff --git a/src/box/sql/malloc.c b/src/box/sql/malloc.c
index dbc6846..72a1fb9 100644
--- a/src/box/sql/malloc.c
+++ b/src/box/sql/malloc.c
@@ -939,8 +939,7 @@ apiOomError(sql * db)
* function. However, if a malloc() failure has occurred since the previous
* invocation SQL_NOMEM is returned instead.
*
- * If an OOM as occurred, then the connection error-code (the value
- * returned by sql_errcode()) is set to SQL_NOMEM.
+ * If an OOM as occurred, SQL_NOMEM is returned.
*/
int
sqlApiExit(sql * db, int rc)
diff --git a/src/box/sql/sqlInt.h b/src/box/sql/sqlInt.h
index a7487c7..fe5e64c 100644
--- a/src/box/sql/sqlInt.h
+++ b/src/box/sql/sqlInt.h
@@ -1471,7 +1471,6 @@ struct sql {
void *pUpdateArg;
void (*xUpdateCallback) (void *, int, const char *, const char *,
sql_int64);
- sql_value *pErr; /* Most recent error message */
Lookaside lookaside; /* Lookaside malloc configuration */
Hash aFunc; /* Hash table of connection functions */
int *pnBytesFreed; /* If not NULL, increment this in DbFree() */
diff --git a/src/box/sql/util.c b/src/box/sql/util.c
index d5c93f8..62c29ce 100644
--- a/src/box/sql/util.c
+++ b/src/box/sql/util.c
@@ -138,8 +138,6 @@ sqlStrlen30(const char *z)
static SQL_NOINLINE void
sqlErrorFinish(sql * db, int err_code)
{
- if (db->pErr)
- sqlValueSetNull(db->pErr);
sqlSystemError(db, err_code);
}
@@ -153,7 +151,7 @@ sqlError(sql * db, int err_code)
{
assert(db != 0);
db->errCode = err_code;
- if (err_code || db->pErr)
+ if (err_code)
sqlErrorFinish(db, err_code);
}
@@ -199,16 +197,8 @@ sqlErrorWithMsg(sql * db, int err_code, const char *zFormat, ...)
assert(db != 0);
db->errCode = err_code;
sqlSystemError(db, err_code);
- if (zFormat == 0) {
+ if (zFormat == 0)
sqlError(db, err_code);
- } else if (db->pErr || (db->pErr = sqlValueNew(db)) != 0) {
- char *z;
- va_list ap;
- va_start(ap, zFormat);
- z = sqlVMPrintf(db, zFormat, ap);
- va_end(ap);
- sqlValueSetStr(db->pErr, -1, z, SQL_DYNAMIC);
- }
}
/*
diff --git a/src/box/sql/vdbeapi.c b/src/box/sql/vdbeapi.c
index 85059ed..81ee36b 100644
--- a/src/box/sql/vdbeapi.c
+++ b/src/box/sql/vdbeapi.c
@@ -107,9 +107,6 @@ invokeProfileCallback(sql * db, Vdbe * p)
* the sql_compile() routine. The integer returned is an SQL_
* success/failure code that describes the result of executing the virtual
* machine.
- *
- * This routine sets the error code and string returned by
- * sql_errcode(), sql_errmsg() and sql_errmsg16().
*/
int
sql_finalize(sql_stmt * pStmt)
--
2.7.4
More information about the Tarantool-patches
mailing list