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 17F022E6A9 for ; Mon, 10 Jun 2019 09:56:32 -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 3xSJKZ3xbQSJ for ; Mon, 10 Jun 2019 09:56:32 -0400 (EDT) Received: from smtp52.i.mail.ru (smtp52.i.mail.ru [94.100.177.112]) (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 C90112E6A4 for ; Mon, 10 Jun 2019 09:56:31 -0400 (EDT) From: imeevma@tarantool.org Subject: [tarantool-patches] [PATCH v1 03/28] sql: remove field errCode from struct sql Date: Mon, 10 Jun 2019 16:56:29 +0300 Message-Id: <126010ccfcfe374765b188c410206f90b26f9cec.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/main.c | 18 ------------------ src/box/sql/prepare.c | 2 -- src/box/sql/sqlInt.h | 1 - src/box/sql/util.c | 2 -- src/box/sql/vdbeapi.c | 1 - 5 files changed, 24 deletions(-) diff --git a/src/box/sql/main.c b/src/box/sql/main.c index a3c6aa1..155cbcc 100644 --- a/src/box/sql/main.c +++ b/src/box/sql/main.c @@ -568,22 +568,6 @@ sqlTempInMemory(const sql * db) } /* - * Return the most recent error code generated by an sql routine. If NULL is - * passed to this function, we assume a malloc() failed during sql_open(). - */ -int -sql_errcode(sql * db) -{ - if (db && !sqlSafetyCheckSickOrOk(db)) { - return SQL_MISUSE; - } - if (!db || db->mallocFailed) { - return SQL_NOMEM; - } - return db->errCode & db->errMask; -} - -/* * This array defines hard upper bounds on limit values. The * initializer must be kept in sync with the SQL_LIMIT_* * #defines in sql.h. @@ -734,7 +718,6 @@ sql_init_db(sql **out_db) */ sqlError(db, SQL_OK); sqlRegisterPerConnectionBuiltinFunctions(db); - rc = sql_errcode(db); if (rc) sqlError(db, rc); @@ -744,7 +727,6 @@ sql_init_db(sql **out_db) sqlGlobalConfig.nLookaside); opendb_out: - rc = sql_errcode(db); assert(db != 0 || rc == SQL_NOMEM); if (rc == SQL_NOMEM) { sql_close(db); diff --git a/src/box/sql/prepare.c b/src/box/sql/prepare.c index ad4c71c..e2f8c0b 100644 --- a/src/box/sql/prepare.c +++ b/src/box/sql/prepare.c @@ -166,8 +166,6 @@ sqlPrepare(sql * db, /* Database handle. */ *ppStmt = (sql_stmt *) sParse.pVdbe; } - db->errCode = rc; - /* Delete any TriggerPrg structures allocated while parsing this statement. */ while (sParse.pTriggerPrg) { TriggerPrg *pT = sParse.pTriggerPrg; diff --git a/src/box/sql/sqlInt.h b/src/box/sql/sqlInt.h index fe5e64c..bda3df1 100644 --- a/src/box/sql/sqlInt.h +++ b/src/box/sql/sqlInt.h @@ -1436,7 +1436,6 @@ struct sql { struct Vdbe *pVdbe; /* List of active virtual machines */ struct coll *pDfltColl; /* The default collating sequence (BINARY) */ i64 szMmap; /* Default mmap_size setting */ - int errCode; /* Most recent error code (sql_*) */ int errMask; /* & result codes with this before returning */ int iSysErrno; /* Errno value from last system error */ u16 dbOptFlags; /* Flags to enable/disable optimizations */ diff --git a/src/box/sql/util.c b/src/box/sql/util.c index 62c29ce..819f7fa 100644 --- a/src/box/sql/util.c +++ b/src/box/sql/util.c @@ -150,7 +150,6 @@ void sqlError(sql * db, int err_code) { assert(db != 0); - db->errCode = err_code; if (err_code) sqlErrorFinish(db, err_code); } @@ -195,7 +194,6 @@ void sqlErrorWithMsg(sql * db, int err_code, const char *zFormat, ...) { assert(db != 0); - db->errCode = err_code; sqlSystemError(db, err_code); if (zFormat == 0) sqlError(db, err_code); diff --git a/src/box/sql/vdbeapi.c b/src/box/sql/vdbeapi.c index 81ee36b..db1726a 100644 --- a/src/box/sql/vdbeapi.c +++ b/src/box/sql/vdbeapi.c @@ -515,7 +515,6 @@ sqlStep(Vdbe * p) checkProfileCallback(db, p); #endif - db->errCode = rc; if (SQL_NOMEM == sqlApiExit(p->db, p->rc)) { p->rc = SQL_NOMEM; } -- 2.7.4