[Tarantool-patches] [PATCH v2 1/1] temporary: locate missing diag

imeevma at tarantool.org imeevma at tarantool.org
Wed Nov 25 15:06:29 MSK 2020


---
https://github.com/tarantool/tarantool/issues/5537
https://github.com/tarantool/tarantool/tree/imeevma/gh-5537-find-missing-diag

 src/box/execute.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/box/execute.c b/src/box/execute.c
index 66eac9814..058d78d55 100644
--- a/src/box/execute.c
+++ b/src/box/execute.c
@@ -685,8 +685,11 @@ sql_execute(struct sql_stmt *stmt, struct port *port, struct region *region)
 		rc = sql_step(stmt);
 		assert(rc != SQL_ROW && rc != 0);
 	}
-	if (rc != SQL_DONE)
+	if (rc != SQL_DONE) {
+		if (diag_last_error(&fiber()->diag) == NULL)
+			abort();
 		return -1;
+	}
 	return 0;
 }
 
@@ -737,8 +740,11 @@ sql_prepare_and_execute(const char *sql, int len, const struct sql_bind *bind,
 			struct region *region)
 {
 	struct sql_stmt *stmt;
-	if (sql_stmt_compile(sql, len, NULL, &stmt, NULL) != 0)
+	if (sql_stmt_compile(sql, len, NULL, &stmt, NULL) != 0) {
+		if (diag_last_error(&fiber()->diag) == NULL)
+			abort();
 		return -1;
+	}
 	assert(stmt != NULL);
 	enum sql_serialization_format format = sql_column_count(stmt) > 0 ?
 					   DQL_EXECUTE : DML_EXECUTE;
-- 
2.25.1



More information about the Tarantool-patches mailing list