Tarantool development patches archive
 help / color / mirror / Atom feed
* [Tarantool-patches] [PATCH v2 1/1] temporary: locate missing diag
@ 2020-11-25 12:06 imeevma
  0 siblings, 0 replies; only message in thread
From: imeevma @ 2020-11-25 12:06 UTC (permalink / raw)
  To: korablev; +Cc: tarantool-patches

---
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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-11-25 12:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-25 12:06 [Tarantool-patches] [PATCH v2 1/1] temporary: locate missing diag imeevma

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox