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 C6DEA2E6AA for ; Mon, 10 Jun 2019 09:56:47 -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 IMK67dZkAemI for ; Mon, 10 Jun 2019 09:56:47 -0400 (EDT) Received: from smtp18.mail.ru (smtp18.mail.ru [94.100.176.155]) (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 66FD12E606 for ; Mon, 10 Jun 2019 09:56:47 -0400 (EDT) From: imeevma@tarantool.org Subject: [tarantool-patches] [PATCH v1 12/28] sql: remove SQL_FULL errcode Date: Mon, 10 Jun 2019 16:56:45 +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 Removing this error code is part of getting rid of the SQL error system. --- src/box/sql/os_unix.c | 2 +- src/box/sql/sqlInt.h | 2 -- src/box/sql/vdbeaux.c | 6 ++---- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/box/sql/os_unix.c b/src/box/sql/os_unix.c index 75263e3..fa28c46 100644 --- a/src/box/sql/os_unix.c +++ b/src/box/sql/os_unix.c @@ -876,7 +876,7 @@ unixWrite(sql_file * id, const void *pBuf, int amt, sql_int64 offset) return SQL_IOERR_WRITE; } else { storeLastErrno(pFile, 0); /* not a system error */ - return SQL_FULL; + return -1; } } diff --git a/src/box/sql/sqlInt.h b/src/box/sql/sqlInt.h index 7af3961..345b0a4 100644 --- a/src/box/sql/sqlInt.h +++ b/src/box/sql/sqlInt.h @@ -364,8 +364,6 @@ enum sql_ret_code { SQL_NOMEM, /** Some kind of disk I/O error occurred. */ SQL_IOERR, - /** Insertion failed because database is full. */ - SQL_FULL, /** The database schema changed. */ SQL_SCHEMA, /** String or BLOB exceeds size limit. */ diff --git a/src/box/sql/vdbeaux.c b/src/box/sql/vdbeaux.c index 7f81fad..efc5103 100644 --- a/src/box/sql/vdbeaux.c +++ b/src/box/sql/vdbeaux.c @@ -2179,7 +2179,6 @@ sqlVdbeHalt(Vdbe * p) * * SQL_NOMEM * SQL_IOERR - * SQL_FULL * * Then the internal cache might have been left in an inconsistent * state. We need to rollback the statement transaction, if there is @@ -2205,8 +2204,7 @@ sqlVdbeHalt(Vdbe * p) /* Check for one of the special errors */ mrc = p->rc & 0xff; - isSpecialError = mrc == SQL_NOMEM || mrc == SQL_IOERR || - mrc == SQL_FULL; + isSpecialError = mrc == SQL_NOMEM || mrc == SQL_IOERR; if (isSpecialError) { /* At least a savepoint transaction must be rolled back * to restore the database to a consistent state. @@ -2218,7 +2216,7 @@ sqlVdbeHalt(Vdbe * p) * pagerStress() in pager.c), the rollback is required to restore * the pager to a consistent state. */ - if ((mrc == SQL_NOMEM || mrc == SQL_FULL) + if ((mrc == SQL_NOMEM) && box_txn()) { eStatementOp = SAVEPOINT_ROLLBACK; } else { -- 2.7.4