diff --git a/src/box/sql/main.c b/src/box/sql/main.c index 1a25ddea460a94f66cd71bcfbfb2c9b2b007d4c9..3e299c0144dbc719e8035720b1ef047f5d4f7304 100644 --- a/src/box/sql/main.c +++ b/src/box/sql/main.c @@ -249,7 +249,7 @@ sqlCreateFunc(sql * db, /* Check if an existing function is being overridden or deleted. If so, - * and there are active VMs, then return SQL_BUSY. If a function + * and there are active VMs, then return an error. If a function * is being overridden/deleted but there are no active VMs, allow the * operation to continue but invalidate all precompiled statements. */ diff --git a/src/box/sql/os_unix.c b/src/box/sql/os_unix.c index 37f7c6bd7ccd17751e57debcc59af19823d56160..3f4831520094ae35684cd3b47b2d929567f342aa 100644 --- a/src/box/sql/os_unix.c +++ b/src/box/sql/os_unix.c @@ -554,9 +554,7 @@ posixUnlock(sql_file * id, int eFileLock, int handleNFSUnlock) /* In theory, the call to unixFileLock() cannot fail because another * process is holding an incompatible lock. If it does, this * indicates that the other process is not following the locking - * protocol. If this happens, return SQL_IOERR_RDLOCK. Returning - * SQL_BUSY would confuse the upper layer (in practice it causes - * an assert to fail). + * protocol. If this happens, return SQL_IOERR_RDLOCK. */ rc = SQL_IOERR_RDLOCK; storeLastErrno(pFile, errno); diff --git a/src/box/sql/sqlInt.h b/src/box/sql/sqlInt.h index 1056411fbae363752e43bce95792d2a8c12c64d8..4af65b0d96c9594e26e98e3e6025677e10658e64 100644 --- a/src/box/sql/sqlInt.h +++ b/src/box/sql/sqlInt.h @@ -327,8 +327,6 @@ struct sql_vfs { enum sql_ret_code { /** Common error code. */ SQL_ERROR = 1, - /** The database file is locked. */ - SQL_BUSY, /** A malloc() failed. */ SQL_NOMEM, /** Some kind of disk I/O error occurred. */ diff --git a/src/box/sql/vdbe.c b/src/box/sql/vdbe.c index bc13eb28e5984acf4ceef25796c64ee1f227f6a7..918e73c39de95cd07c9931dc1e4cd6c9332b4411 100644 --- a/src/box/sql/vdbe.c +++ b/src/box/sql/vdbe.c @@ -752,7 +752,7 @@ int sqlVdbeExec(Vdbe *p) */ goto no_mem; } - assert(p->rc == 0 || (p->rc & 0xff) == SQL_BUSY); + assert(p->rc == 0); p->rc = 0; p->iCurrentTime = 0; assert(p->explain==0); @@ -1064,13 +1064,9 @@ case OP_Halt: { assert(! diag_is_empty(diag_get())); } rc = sqlVdbeHalt(p); - assert(rc == SQL_BUSY || rc == 0 || rc == SQL_ERROR); - if (rc==SQL_BUSY) { - p->rc = SQL_BUSY; - } else { - assert(rc == 0 || (p->rc & 0xff) == SQL_CONSTRAINT); - rc = p->rc ? SQL_TARANTOOL_ERROR : SQL_DONE; - } + assert(rc == 0 || rc == SQL_ERROR); + assert(rc == 0 || (p->rc & 0xff) == SQL_CONSTRAINT); + rc = p->rc ? SQL_TARANTOOL_ERROR : SQL_DONE; goto vdbe_return; } @@ -2879,11 +2875,7 @@ case OP_Savepoint: { if (isTransaction && p1==SAVEPOINT_RELEASE) { if ((rc = sqlVdbeCheckFk(p, 1)) != 0) goto vdbe_return; - if (sqlVdbeHalt(p)==SQL_BUSY) { - p->pc = (int)(pOp - aOp); - p->rc = rc = SQL_BUSY; - goto vdbe_return; - } + sqlVdbeHalt(p); if (p->rc != 0) goto abort_due_to_error; } else { @@ -5256,7 +5248,7 @@ default: { /* This is really OP_Noop and OP_Explain */ assert(rc != 0 || nExtraDelete == 0 || sql_strlike_ci("DELETE%", p->zSql, 0) != 0 ); - assert(rc == 0 || rc == SQL_BUSY || rc == SQL_TARANTOOL_ERROR || + assert(rc == 0 || rc == SQL_TARANTOOL_ERROR || rc == SQL_ROW || rc == SQL_DONE); return rc; diff --git a/src/box/sql/vdbeaux.c b/src/box/sql/vdbeaux.c index eade874504f61ee13ba8a3721f12b1cc47eeed76..2a9e39b9e88da923fdd949e6fb57fd83a064a934 100644 --- a/src/box/sql/vdbeaux.c +++ b/src/box/sql/vdbeaux.c @@ -1390,8 +1390,7 @@ sqlVdbeList(Vdbe * p) assert(p->explain); assert(p->magic == VDBE_MAGIC_RUN); - assert(p->rc == 0 || p->rc == SQL_BUSY - || p->rc == SQL_NOMEM); + assert(p->rc == 0 || p->rc == SQL_NOMEM); /* Even though this opcode does not use dynamic strings for * the result, result columns may become dynamic if the user calls @@ -2086,9 +2085,7 @@ sql_savepoint(MAYBE_UNUSED Vdbe *p, const char *zName) * SQL_MAGIC_RUN to SQL_MAGIC_HALT. It is harmless to * call this on a VM that is in the SQL_MAGIC_HALT state. * - * Return an error code. If the commit could not complete because of - * lock contention, return SQL_BUSY. If SQL_BUSY is returned, it - * means the close did not happen and needs to be repeated. + * Return an error code. */ int sqlVdbeHalt(Vdbe * p) @@ -2192,10 +2189,7 @@ sqlVdbeHalt(Vdbe * p) 0 : SQL_TARANTOOL_ERROR; closeCursorsAndFree(p); } - if (rc == SQL_BUSY && !p->pDelFrame) { - closeCursorsAndFree(p); - return SQL_BUSY; - } else if (rc != 0) { + if (rc != 0) { p->rc = rc; box_txn_rollback(); closeCursorsAndFree(p); @@ -2272,7 +2266,7 @@ sqlVdbeHalt(Vdbe * p) assert(db->nVdbeActive > 0 || box_txn() || p->anonymous_savepoint == NULL); - return p->rc == SQL_BUSY ? SQL_BUSY : 0; + return 0; } /*