From: imeevma@tarantool.org To: v.shpilevoy@tarantool.org Cc: tarantool-patches@freelists.org Subject: [tarantool-patches] [PATCH v1 08/28] sql: remove SQL_PERM, SQL_WARNING, SQL_ABORT errcodes Date: Mon, 10 Jun 2019 16:56:37 +0300 [thread overview] Message-ID: <f76097a1fdcc231c960c14f80c7f1ad39e97301a.1560174553.git.imeevma@gmail.com> (raw) In-Reply-To: <cover.1560174553.git.imeevma@gmail.com> Removing these error codes is part of getting rid of the SQL error system. --- src/box/sql/legacy.c | 4 ++-- src/box/sql/os_unix.c | 47 ----------------------------------------------- src/box/sql/sqlInt.h | 6 ------ src/box/sql/where.c | 10 ---------- 4 files changed, 2 insertions(+), 65 deletions(-) diff --git a/src/box/sql/legacy.c b/src/box/sql/legacy.c index f7e069a..3101428 100644 --- a/src/box/sql/legacy.c +++ b/src/box/sql/legacy.c @@ -134,9 +134,9 @@ sql_exec(sql * db, /* The database on which the SQL executes */ if (xCallback(pArg, nCol, azVals, azCols)) { /* EVIDENCE-OF: R-38229-40159 If the callback function to * sql_exec() returns non-zero, then sql_exec() will - * return SQL_ABORT. + * return -1. */ - rc = SQL_ABORT; + rc = -1; sqlVdbeFinalize((Vdbe *) pStmt); pStmt = 0; goto exec_out; diff --git a/src/box/sql/os_unix.c b/src/box/sql/os_unix.c index fd9576e..d9e5656 100644 --- a/src/box/sql/os_unix.c +++ b/src/box/sql/os_unix.c @@ -164,9 +164,6 @@ robust_open(const char *z, int f, mode_t m) if (fd >= SQL_MINIMUM_FILE_DESCRIPTOR) break; close(fd); - sql_log(SQL_WARNING, - "attempt to open \"%s\" as file descriptor %d", z, - fd); fd = -1; if (open("/dev/null", f, m) < 0) break; @@ -502,48 +499,6 @@ fileHasMoved(unixFile * pFile) } /* - * Check a unixFile that is a database. Verify the following: - * - * (1) There is exactly one hard link on the file - * (2) The file is not a symbolic link - * (3) The file has not been renamed or unlinked - * - * Issue sql_log(SQL_WARNING,...) messages if anything is not right. - */ -static void -verifyDbFile(unixFile * pFile) -{ - struct stat buf; - int rc; - - /* These verifications occurs for the main database only */ - if (pFile->ctrlFlags & UNIXFILE_NOLOCK) - return; - - rc = fstat(pFile->h, &buf); - if (rc != 0) { - sql_log(SQL_WARNING, "cannot fstat db file %s", - pFile->zPath); - return; - } - if (buf.st_nlink == 0) { - sql_log(SQL_WARNING, "file unlinked while open: %s", - pFile->zPath); - return; - } - if (buf.st_nlink > 1) { - sql_log(SQL_WARNING, "multiple links to file: %s", - pFile->zPath); - return; - } - if (fileHasMoved(pFile)) { - sql_log(SQL_WARNING, "file renamed while open: %s", - pFile->zPath); - return; - } -} - -/* * Attempt to set a system-lock on the file pFile. The lock is * described by pLock. * @@ -766,7 +721,6 @@ unixClose(sql_file * id) { int rc; unixFile *pFile = (unixFile *) id; - verifyDbFile(pFile); unixUnlock(id, NO_LOCK); /* unixFile.pInode is always valid here. Otherwise, a different close @@ -1528,7 +1482,6 @@ fillInUnixFile(sql_vfs * pVfs, /* Pointer to vfs object */ robust_close(pNew, h, __LINE__); } else { pNew->pMethod = pLockingStyle; - verifyDbFile(pNew); } return rc; } diff --git a/src/box/sql/sqlInt.h b/src/box/sql/sqlInt.h index 93ec9ab..4c97acf 100644 --- a/src/box/sql/sqlInt.h +++ b/src/box/sql/sqlInt.h @@ -358,10 +358,6 @@ struct sql_vfs { enum sql_ret_code { /** Common error code. */ SQL_ERROR = 1, - /** Access permission denied. */ - SQL_PERM, - /** Callback routine requested an abort. */ - SQL_ABORT, /** The database file is locked. */ SQL_BUSY, /** A table in the database is locked. */ @@ -387,8 +383,6 @@ enum sql_ret_code { /** 2nd parameter to sql_bind out of range. */ SQL_RANGE, SQL_TARANTOOL_ERROR, - /** Warnings from sql_log(). */ - SQL_WARNING, /** sql_step() has another row ready. */ SQL_ROW, /** sql_step() has finished executing. */ diff --git a/src/box/sql/where.c b/src/box/sql/where.c index 4d1759e..ab277c5 100644 --- a/src/box/sql/where.c +++ b/src/box/sql/where.c @@ -741,7 +741,6 @@ constructAutomaticIndex(Parse * pParse, /* The parsing context */ char *zNotUsed; /* Extra space on the end of pIdx */ Bitmask idxCols; /* Bitmap of columns used for indexing */ Bitmask extraCols; /* Bitmap of additional columns */ - u8 sentWarning = 0; /* True if a warnning has been issued */ int iContinue = 0; /* Jump here to skip excluded rows */ struct SrcList_item *pTabItem; /* FROM clause term being indexed */ int addrCounter = 0; /* Address where integer counter is initialized */ @@ -768,15 +767,6 @@ constructAutomaticIndex(Parse * pParse, /* The parsing context */ int iCol = pTerm->u.leftColumn; Bitmask cMask = iCol >= BMS ? MASKBIT(BMS - 1) : MASKBIT(iCol); - testcase(iCol == BMS); - testcase(iCol == BMS - 1); - if (!sentWarning) { - sql_log(SQL_WARNING_AUTOINDEX, - "automatic index on %s(%s)", - pTable->def->name, - pTable->aCol[iCol].zName); - sentWarning = 1; - } if ((idxCols & cMask) == 0) { if (whereLoopResize (pParse->db, pLoop, nKeyCol + 1)) { -- 2.7.4
next prev parent reply other threads:[~2019-06-10 13:56 UTC|newest] Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-06-10 13:56 [tarantool-patches] [PATCH v1 00/28] sql: Remove SQL error system imeevma 2019-06-10 13:56 ` [tarantool-patches] [PATCH v1 01/28] sql: remove field zErrMsg from struct Vdbe imeevma 2019-06-10 13:56 ` [tarantool-patches] [PATCH v1 02/28] sql: remove field pErr from struct sql imeevma 2019-06-10 13:56 ` [tarantool-patches] [PATCH v1 03/28] sql: remove field errCode " imeevma 2019-06-10 13:56 ` [tarantool-patches] [PATCH v1 04/28] sql: remove sqlError() and remove sqlErrorWithMsg() imeevma 2019-06-13 22:25 ` [tarantool-patches] " Vladislav Shpilevoy 2019-06-15 9:45 ` Mergen Imeev 2019-06-10 13:56 ` [tarantool-patches] [PATCH v1 05/28] sql: remove unused functions of SQL error system imeevma 2019-06-10 13:56 ` [tarantool-patches] [PATCH v1 06/28] sql: disable lookaside system imeevma 2019-06-13 22:25 ` [tarantool-patches] " Vladislav Shpilevoy 2019-06-15 9:47 ` Mergen Imeev 2019-06-10 13:56 ` [tarantool-patches] [PATCH v1 07/28] sql: remove SQL_OK error/status code imeevma 2019-06-13 22:24 ` [tarantool-patches] " Vladislav Shpilevoy 2019-06-15 9:52 ` Mergen Imeev 2019-06-10 13:56 ` imeevma [this message] 2019-06-10 13:56 ` [tarantool-patches] [PATCH v1 09/28] sql: remove SQL_CANTOPEN errcode imeevma 2019-06-10 13:56 ` [tarantool-patches] [PATCH v1 10/28] sql: remove SQL_NOTFOUND error/status code imeevma 2019-06-10 13:56 ` [tarantool-patches] [PATCH v1 11/28] sql: remove SQL_LOCKED errcode imeevma 2019-06-10 13:56 ` [tarantool-patches] [PATCH v1 12/28] sql: remove SQL_FULL errcode imeevma 2019-06-10 13:56 ` [tarantool-patches] [PATCH v1 13/28] sql: remove SQL_MISUSE errcode imeevma 2019-06-10 13:56 ` [tarantool-patches] [PATCH v1 14/28] sql: remove SQL_RANGE errcode imeevma 2019-06-10 13:56 ` [tarantool-patches] [PATCH v1 15/28] sql: remove SQL_SCHEMA errcode imeevma 2019-06-13 22:24 ` [tarantool-patches] " Vladislav Shpilevoy 2019-06-15 9:55 ` Mergen Imeev 2019-06-10 13:56 ` [tarantool-patches] [PATCH v1 16/28] sql: remove SQL_TOOBIG errcode imeevma 2019-06-13 22:24 ` [tarantool-patches] " Vladislav Shpilevoy 2019-06-15 9:57 ` Mergen Imeev 2019-06-10 13:56 ` [tarantool-patches] [PATCH v1 17/28] sql: remove SQL_BUSY errcode imeevma 2019-06-10 13:56 ` [tarantool-patches] [PATCH v1 18/28] sql: remove SQL_CONSTRAINT errcode imeevma 2019-06-13 22:24 ` [tarantool-patches] " Vladislav Shpilevoy 2019-06-15 10:00 ` Mergen Imeev 2019-06-18 20:40 ` Vladislav Shpilevoy 2019-06-19 8:02 ` Mergen Imeev 2019-06-10 13:56 ` [tarantool-patches] [PATCH v1 19/28] sql: remove SQL_ERROR errcode imeevma 2019-06-10 13:56 ` [tarantool-patches] [PATCH v1 20/28] sql: remove SQL_NOMEM errcode imeevma 2019-06-13 22:24 ` [tarantool-patches] " Vladislav Shpilevoy 2019-06-15 10:01 ` Mergen Imeev 2019-06-10 13:57 ` [tarantool-patches] [PATCH v1 21/28] sql: remove SQL_IOERR errcode imeevma 2019-06-10 13:57 ` [tarantool-patches] [PATCH v1 22/28] sql: remove SQL_TARANTOOL_ERROR errcode imeevma 2019-06-10 13:57 ` [tarantool-patches] [PATCH v1 23/28] sql: remove field errMask from struct sql imeevma 2019-06-10 13:57 ` [tarantool-patches] [PATCH v1 24/28] sql: replace rc by is_aborted in struct VDBE imeevma 2019-06-10 13:57 ` [tarantool-patches] [PATCH v1 25/28] sql: remove sql_log() imeevma 2019-06-13 22:24 ` [tarantool-patches] " Vladislav Shpilevoy 2019-06-15 10:02 ` Mergen Imeev 2019-06-10 13:57 ` [tarantool-patches] [PATCH v1 26/28] sql: cleanup of legacy memory management system imeevma 2019-06-13 22:24 ` [tarantool-patches] " Vladislav Shpilevoy 2019-06-15 10:04 ` Mergen Imeev 2019-06-18 20:40 ` Vladislav Shpilevoy 2019-06-19 8:04 ` Mergen Imeev 2019-06-10 13:57 ` [tarantool-patches] [PATCH v1 27/28] sql: make function return void instead of int imeevma 2019-06-10 13:57 ` [tarantool-patches] [PATCH v1 28/28] sql: remove function sqlApiExit() imeevma 2019-06-11 10:00 ` [tarantool-patches] Re: [PATCH v1 00/28] sql: Remove SQL error system Imeev Mergen 2019-06-13 22:24 ` Vladislav Shpilevoy 2019-06-15 10:08 ` Mergen Imeev 2019-06-19 19:11 ` Vladislav Shpilevoy 2019-06-20 16:08 ` Kirill Yukhin
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=f76097a1fdcc231c960c14f80c7f1ad39e97301a.1560174553.git.imeevma@gmail.com \ --to=imeevma@tarantool.org \ --cc=tarantool-patches@freelists.org \ --cc=v.shpilevoy@tarantool.org \ --subject='Re: [tarantool-patches] [PATCH v1 08/28] sql: remove SQL_PERM, SQL_WARNING, SQL_ABORT errcodes' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox