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 D3D8321CFA for ; Sat, 25 May 2019 06:44:44 -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 Zy5aMK1x8oRb for ; Sat, 25 May 2019 06:44:44 -0400 (EDT) Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (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 94D892F902 for ; Sat, 25 May 2019 06:44:44 -0400 (EDT) From: imeevma@tarantool.org Subject: [tarantool-patches] [PATCH v1 08/21] sql: remove SQL_FULL errcode Date: Sat, 25 May 2019 13:44:42 +0300 Message-Id: <910b38d4737b49a196ad81d8a629a664dbf1639d.1558780708.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 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 1838245..3c312b0 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