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 EF7CB2E6A4 for ; Mon, 10 Jun 2019 09:56:28 -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 ZB9b5ox_21rZ for ; Mon, 10 Jun 2019 09:56:28 -0400 (EDT) Received: from smtp17.mail.ru (smtp17.mail.ru [94.100.176.154]) (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 B1B352E612 for ; Mon, 10 Jun 2019 09:56:28 -0400 (EDT) From: imeevma@tarantool.org Subject: [tarantool-patches] [PATCH v1 01/28] sql: remove field zErrMsg from struct Vdbe Date: Mon, 10 Jun 2019 16:56:26 +0300 Message-Id: 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/vdbeInt.h | 1 - src/box/sql/vdbeaux.c | 29 ++++------------------------- 2 files changed, 4 insertions(+), 26 deletions(-) diff --git a/src/box/sql/vdbeInt.h b/src/box/sql/vdbeInt.h index 15eb55c..8b212e3 100644 --- a/src/box/sql/vdbeInt.h +++ b/src/box/sql/vdbeInt.h @@ -384,7 +384,6 @@ struct Vdbe { Mem **apArg; /* Arguments to currently executing user function */ Mem *aColName; /* Column names to return */ Mem *pResultSet; /* Pointer to an array of results */ - char *zErrMsg; /* Error message written here */ VdbeCursor **apCsr; /* One element of this array for each open cursor */ Mem *aVar; /* Values for the OP_Variable opcode. */ /** diff --git a/src/box/sql/vdbeaux.c b/src/box/sql/vdbeaux.c index 3f573d0..ae1f38f 100644 --- a/src/box/sql/vdbeaux.c +++ b/src/box/sql/vdbeaux.c @@ -1957,7 +1957,6 @@ closeCursorsAndFree(Vdbe * p) static void Cleanup(Vdbe * p) { - sql *db = p->db; #ifdef SQL_DEBUG /* Execute assert() statements to ensure that the Vdbe.apCsr[] and @@ -1973,8 +1972,6 @@ Cleanup(Vdbe * p) } #endif - sqlDbFree(db, p->zErrMsg); - p->zErrMsg = 0; p->pResultSet = 0; } @@ -2317,8 +2314,6 @@ sqlVdbeHalt(Vdbe * p) if (p->rc == SQL_OK || (p->rc & 0xff) == SQL_CONSTRAINT) { p->rc = rc; - sqlDbFree(db, p->zErrMsg); - p->zErrMsg = 0; } closeCursorsAndFree(p); sqlRollbackAll(p); @@ -2381,24 +2376,13 @@ sqlVdbeTransferError(Vdbe * p) { sql *db = p->db; int rc = p->rc; - if (p->zErrMsg) { - db->bBenignMalloc++; - sqlBeginBenignMalloc(); - if (db->pErr == 0) - db->pErr = sqlValueNew(db); - sqlValueSetStr(db->pErr, -1, p->zErrMsg, SQL_TRANSIENT); - sqlEndBenignMalloc(); - db->bBenignMalloc--; - db->errCode = rc; - } else { - sqlError(db, rc); - } + sqlError(db, rc); return rc; } /* * Clean up a VDBE after execution but do not delete the VDBE just yet. - * Write any error messages into *pzErrMsg. Return the result code. + * Return the result code. * * After this routine is run, the VDBE should be ready to be executed * again. @@ -2426,8 +2410,6 @@ sqlVdbeReset(Vdbe * p) */ if (p->pc >= 0) { sqlVdbeTransferError(p); - sqlDbFree(db, p->zErrMsg); - p->zErrMsg = 0; if (p->runOnlyOnce) p->expired = 1; } else if (p->rc && p->expired) { @@ -2435,10 +2417,7 @@ sqlVdbeReset(Vdbe * p) * to sql_step(). For consistency (since sql_step() was * called), set the database error in this case as well. */ - sqlErrorWithMsg(db, p->rc, p->zErrMsg ? "%s" : 0, - p->zErrMsg); - sqlDbFree(db, p->zErrMsg); - p->zErrMsg = 0; + sqlErrorWithMsg(db, p->rc, NULL); } /* Reclaim all memory used by the VDBE @@ -2492,7 +2471,7 @@ sqlVdbeReset(Vdbe * p) /* * Clean up and delete a VDBE after execution. Return an integer which is - * the result code. Write any error message text into *pzErrMsg. + * the result code. */ int sqlVdbeFinalize(Vdbe * p) -- 2.7.4