[Tarantool-patches] [PATCH v1 1/1] temporary: locate missing diag in VDBE

imeevma at tarantool.org imeevma at tarantool.org
Fri Nov 27 14:08:35 MSK 2020


---
 src/box/sql/vdbe.c    | 7 +++++++
 src/box/sql/vdbeInt.h | 1 +
 2 files changed, 8 insertions(+)

diff --git a/src/box/sql/vdbe.c b/src/box/sql/vdbe.c
index 724bc188b..0c24a7bce 100644
--- a/src/box/sql/vdbe.c
+++ b/src/box/sql/vdbe.c
@@ -862,6 +862,7 @@ int sqlVdbeExec(Vdbe *p)
 	}
 #endif
 	for(pOp=&aOp[p->pc]; 1; pOp++) {
+		p->pOp = pOp;
 		/* Errors are detected by individual opcodes, with an immediate
 		 * jumps to abort_due_to_error.
 		 */
@@ -5364,6 +5365,12 @@ abort_due_to_error:
 
 	/* This is the only way out of this procedure. */
 vdbe_return:
+	if (p->is_aborted) {
+		if (diag_is_empty(&fiber()->diag)) {
+			assert(0);
+			abort();
+		}
+	}
 	testcase( nVmStep>0);
 	p->aCounter[SQL_STMTSTATUS_VM_STEP] += (int)nVmStep;
 	assert(rc == 0 || rc == -1 || rc == SQL_ROW || rc == SQL_DONE);
diff --git a/src/box/sql/vdbeInt.h b/src/box/sql/vdbeInt.h
index 2c50b6768..24915bcf5 100644
--- a/src/box/sql/vdbeInt.h
+++ b/src/box/sql/vdbeInt.h
@@ -411,6 +411,7 @@ struct Vdbe {
 	 */
 
 	Op *aOp;		/* Space to hold the virtual machine's program */
+	Op *pOp;
 	Mem *aMem;		/* The memory locations */
 	Mem **apArg;		/* Arguments to currently executing user function */
 	/** SQL metadata for DML/DQL queries. */
-- 
2.25.1



More information about the Tarantool-patches mailing list