From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 8859B2E6AA for ; Mon, 10 Jun 2019 09:56:30 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id idt7bGZ_yVxM for ; Mon, 10 Jun 2019 09:56:30 -0400 (EDT) Received: from smtp40.i.mail.ru (smtp40.i.mail.ru [94.100.177.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 44D4C2E6A9 for ; Mon, 10 Jun 2019 09:56:30 -0400 (EDT) From: imeevma@tarantool.org Subject: [tarantool-patches] [PATCH v1 02/28] sql: remove field pErr from struct sql Date: Mon, 10 Jun 2019 16:56:28 +0300 Message-Id: <2b9a4b3ba4726818c268e3d8db6c135ecbfcb75b.1560174553.git.imeevma@gmail.com> In-Reply-To: References: Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: v.shpilevoy@tarantool.org Cc: tarantool-patches@freelists.org 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