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 E0CA22B0AF for ; Sun, 5 May 2019 08:17:18 -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 FXXEhJWsIu1H for ; Sun, 5 May 2019 08:17:18 -0400 (EDT) Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (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 A34FC2B0C4 for ; Sun, 5 May 2019 08:17:18 -0400 (EDT) From: imeevma@tarantool.org Subject: [tarantool-patches] [PATCH v1 09/12] sql: remove field pErr from struct sql Date: Sun, 5 May 2019 15:17:16 +0300 Message-Id: <7d1e86f478966ca2eae5177d98f3c8b0d81217d9.1557056617.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: korablev@tarantool.org Cc: tarantool-patches@freelists.org This field became unused and should be removed. --- src/box/sql/sqlInt.h | 1 - src/box/sql/util.c | 14 ++------------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/box/sql/sqlInt.h b/src/box/sql/sqlInt.h index 3981fbf..1af5457 100644 --- a/src/box/sql/sqlInt.h +++ b/src/box/sql/sqlInt.h @@ -1463,7 +1463,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); - } } /* -- 2.7.4