diff --git a/src/box/sql/legacy.c b/src/box/sql/legacy.c index 42fd3d1a4609fdfdaa6afcc5575f599624c19ea7..2947abebbda788ed0909bffd9b137990ba1dda19 100644 --- a/src/box/sql/legacy.c +++ b/src/box/sql/legacy.c @@ -133,9 +133,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 ccc8d35816807f45f95fd0c08d5d74b871cdaaf4..721d8a19bfa8ae9b904d48da049bb6a6aa4ef68d 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; @@ -501,48 +498,6 @@ fileHasMoved(unixFile * pFile) pFile->pInode->fileId.ino); } -/* - * 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 5f08ed116e38271419e552873268f785e1f6c2b7..956112f725c194798c2cbe56a3e963f43f371a7b 100644 --- a/src/box/sql/sqlInt.h +++ b/src/box/sql/sqlInt.h @@ -327,10 +327,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. */ @@ -356,8 +352,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 a2f893430c3e499aea59be26d96cf41dc011aa95..d8309fd703bc360476847b105a62d3b260a367a7 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)) {