[tarantool-patches] [PATCH v1 08/21] sql: remove SQL_FULL errcode
imeevma at tarantool.org
imeevma at tarantool.org
Sat May 25 13:44:42 MSK 2019
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
More information about the Tarantool-patches
mailing list