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 DA5F12FD6F for ; Sat, 25 May 2019 06:45:05 -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 1bN1zWo5yADP for ; Sat, 25 May 2019 06:45:05 -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 9C1C621CFA for ; Sat, 25 May 2019 06:45:05 -0400 (EDT) From: imeevma@tarantool.org Subject: [tarantool-patches] [PATCH v1 19/21] sql: remove field errMask from struct sql Date: Sat, 25 May 2019 13:45:03 +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: korablev@tarantool.org Cc: tarantool-patches@freelists.org This field has become unused and should be removed. --- src/box/sql/legacy.c | 1 - src/box/sql/main.c | 1 - src/box/sql/malloc.c | 2 +- src/box/sql/prepare.c | 2 -- src/box/sql/sqlInt.h | 1 - src/box/sql/vdbeapi.c | 3 +-- src/box/sql/vdbeaux.c | 9 ++------- 7 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/box/sql/legacy.c b/src/box/sql/legacy.c index e9c9961..0769d3a 100644 --- a/src/box/sql/legacy.c +++ b/src/box/sql/legacy.c @@ -167,6 +167,5 @@ sql_exec(sql * db, /* The database on which the SQL executes */ sqlDbFree(db, azCols); assert(rc == 0); - assert((rc & db->errMask) == rc); return rc; } diff --git a/src/box/sql/main.c b/src/box/sql/main.c index 76d464f..145964f 100644 --- a/src/box/sql/main.c +++ b/src/box/sql/main.c @@ -535,7 +535,6 @@ sql_init_db(sql **out_db) *out_db = NULL; return -1; } - db->errMask = 0xff; db->magic = SQL_MAGIC_BUSY; db->pVfs = sql_vfs_find(0); diff --git a/src/box/sql/malloc.c b/src/box/sql/malloc.c index 3c25458..a4911c2 100644 --- a/src/box/sql/malloc.c +++ b/src/box/sql/malloc.c @@ -809,5 +809,5 @@ sqlApiExit(sql * db, int rc) if (db->mallocFailed) { return apiOomError(db); } - return rc & db->errMask; + return rc; } diff --git a/src/box/sql/prepare.c b/src/box/sql/prepare.c index 61f6493..e1da179 100644 --- a/src/box/sql/prepare.c +++ b/src/box/sql/prepare.c @@ -176,8 +176,6 @@ sqlPrepare(sql * db, /* Database handle. */ end_prepare: sql_parser_destroy(&sParse); - rc = sqlApiExit(db, rc); - assert((rc & db->errMask) == rc); return rc; } diff --git a/src/box/sql/sqlInt.h b/src/box/sql/sqlInt.h index 50a577b..0db13ed 100644 --- a/src/box/sql/sqlInt.h +++ b/src/box/sql/sqlInt.h @@ -1332,7 +1332,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 errMask; /* & result codes with this before returning */ u16 dbOptFlags; /* Flags to enable/disable optimizations */ u8 enc; /* Text encoding */ u8 temp_store; /* 1: file 2: memory 0: default */ diff --git a/src/box/sql/vdbeapi.c b/src/box/sql/vdbeapi.c index f1897e2..1842e26 100644 --- a/src/box/sql/vdbeapi.c +++ b/src/box/sql/vdbeapi.c @@ -116,7 +116,6 @@ sql_reset(sql_stmt * pStmt) checkProfileCallback(db, v); rc = sqlVdbeReset(v); sqlVdbeRewind(v); - assert((rc & (db->errMask)) == rc); rc = sqlApiExit(db, rc); } return rc; @@ -475,7 +474,7 @@ sqlStep(Vdbe * p) */ rc = p->rc; } - return (rc & db->errMask); + return rc; } /* diff --git a/src/box/sql/vdbeaux.c b/src/box/sql/vdbeaux.c index d4ba3a3..28b423d 100644 --- a/src/box/sql/vdbeaux.c +++ b/src/box/sql/vdbeaux.c @@ -2315,9 +2315,6 @@ sqlVdbeResetStepResult(Vdbe * p) int sqlVdbeReset(Vdbe * p) { - sql *db; - db = p->db; - /* If the VM did not run to completion or if it encountered an * error, then it might not have been halted properly. So halt * it now. @@ -2389,7 +2386,7 @@ sqlVdbeReset(Vdbe * p) #endif p->iCurrentTime = 0; p->magic = VDBE_MAGIC_RESET; - return p->rc & db->errMask; + return p->rc; } /* @@ -2400,10 +2397,8 @@ int sqlVdbeFinalize(Vdbe * p) { int rc = 0; - if (p->magic == VDBE_MAGIC_RUN || p->magic == VDBE_MAGIC_HALT) { + if (p->magic == VDBE_MAGIC_RUN || p->magic == VDBE_MAGIC_HALT) rc = sqlVdbeReset(p); - assert((rc & p->db->errMask) == rc); - } sqlVdbeDelete(p); return rc; } -- 2.7.4