Tarantool development patches archive
 help / color / mirror / Atom feed
From: imeevma@tarantool.org
To: korablev@tarantool.org
Cc: tarantool-patches@freelists.org
Subject: [tarantool-patches] [PATCH v1 04/21] sql: remove SQL_PERM, SQL_WARNING, SQL_ABORT errcodes
Date: Sat, 25 May 2019 13:44:36 +0300	[thread overview]
Message-ID: <a7ff87de0f089dd209d9198d855b0461ef2ae3e7.1558780708.git.imeevma@gmail.com> (raw)
In-Reply-To: <cover.1558780708.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 e3024f2..600c53c 100644
--- a/src/box/sql/legacy.c
+++ b/src/box/sql/legacy.c
@@ -138,9 +138,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 c989664..e3f50b0 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 c716a0e..0b1ccd9 100644
--- a/src/box/sql/where.c
+++ b/src/box/sql/where.c
@@ -742,7 +742,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 */
@@ -769,15 +768,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

  parent reply	other threads:[~2019-05-25 10:44 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-25 10:44 [tarantool-patches] [PATCH v1 00/21] sql: remove SQL error system imeevma
2019-05-25 10:44 ` [tarantool-patches] [PATCH v1 01/21] sql: remove unused functions of " imeevma
2019-05-25 10:44 ` [tarantool-patches] [PATCH v1 02/21] sql: disable lookaside system imeevma
2019-05-25 10:44 ` [tarantool-patches] [PATCH v1 03/21] sql: remove SQL_OK error/status code imeevma
2019-05-25 14:45   ` [tarantool-patches] " n.pettik
2019-05-26  9:39     ` Mergen Imeev
2019-05-25 10:44 ` imeevma [this message]
2019-05-25 10:44 ` [tarantool-patches] [PATCH v1 05/21] sql: remove SQL_CANTOPEN errcode imeevma
2019-05-25 10:44 ` [tarantool-patches] [PATCH v1 06/21] sql: remove SQL_NOTFOUND error/status code imeevma
2019-05-25 14:58   ` [tarantool-patches] " n.pettik
2019-05-25 20:26     ` Konstantin Osipov
2019-05-26 16:07       ` n.pettik
2019-05-26  9:45     ` Mergen Imeev
2019-05-25 10:44 ` [tarantool-patches] [PATCH v1 07/21] sql: remove SQL_LOCKED errcode imeevma
2019-05-25 10:44 ` [tarantool-patches] [PATCH v1 08/21] sql: remove SQL_FULL errcode imeevma
2019-05-25 10:44 ` [tarantool-patches] [PATCH v1 09/21] sql: remove SQL_MISUSE errcode imeevma
2019-05-25 10:44 ` [tarantool-patches] [PATCH v1 10/21] sql: remove SQL_RANGE errcode imeevma
2019-05-25 10:44 ` [tarantool-patches] [PATCH v1 11/21] sql: remove SQL_SCHEMA errcode imeevma
2019-05-25 16:18   ` [tarantool-patches] " n.pettik
2019-05-26  9:46     ` Mergen Imeev
2019-05-25 10:44 ` [tarantool-patches] [PATCH v1 12/21] sql: remove SQL_TOOBIG errcode imeevma
2019-05-25 16:11   ` [tarantool-patches] " n.pettik
2019-05-26 12:12     ` Mergen Imeev
2019-05-25 10:44 ` [tarantool-patches] [PATCH v1 13/21] sql: remove SQL_BUSY errcode imeevma
2019-05-25 10:44 ` [tarantool-patches] [PATCH v1 14/21] sql: remove SQL_CONSTRAINT errcode imeevma
2019-05-25 10:44 ` [tarantool-patches] [PATCH v1 15/21] sql: remove SQL_ERROR errcode imeevma
2019-05-25 10:44 ` [tarantool-patches] [PATCH v1 16/21] sql: remove SQL_NOMEM errcode imeevma
2019-05-25 10:44 ` [tarantool-patches] [PATCH v1 17/21] sql: remove SQL_IOERR errcode imeevma
2019-05-25 10:45 ` [tarantool-patches] [PATCH v1 18/21] sql: remove SQL_TARANTOOL_ERROR errcode imeevma
2019-05-25 10:45 ` [tarantool-patches] [PATCH v1 19/21] sql: remove field errMask from struct sql imeevma
2019-05-25 10:45 ` [tarantool-patches] [PATCH v1 20/21] sql: replace rc by is_aborted in struct Parse imeevma
2019-05-25 15:46   ` [tarantool-patches] " n.pettik
2019-05-26  9:49     ` Mergen Imeev
2019-05-25 10:45 ` [tarantool-patches] [PATCH v1 21/21] sql: remove sql_log() imeevma
2019-05-25 16:36 ` [tarantool-patches] Re: [PATCH v1 00/21] sql: remove SQL error system n.pettik
2019-05-28 11:12   ` Mergen Imeev

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=a7ff87de0f089dd209d9198d855b0461ef2ae3e7.1558780708.git.imeevma@gmail.com \
    --to=imeevma@tarantool.org \
    --cc=korablev@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [tarantool-patches] [PATCH v1 04/21] 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