[tarantool-patches] Re: [PATCH v9 2/7] sql: fix error code for SQL errors in execute.c

Mergen Imeev imeevma at tarantool.org
Thu Mar 28 20:46:18 MSK 2019


Hi! Thank you for review. My answer, diffs and new patch nelow.
There will be two diffs - one is diff for this patch and one for
the last one in the patch-set.

On Wed, Mar 27, 2019 at 12:48:27AM +0300, Vladislav Shpilevoy wrote:
> Hi! Thanks for the patch!
> 
> > diff --git a/src/box/execute.c b/src/box/execute.c
> > index 7c77df2..5810086 100644
> > --- a/src/box/execute.c
> > +++ b/src/box/execute.c
> > @@ -541,7 +546,12 @@ sql_prepare_and_execute(const char *sql, int len, const struct sql_bind *bind,
> >  		return -1;
> >  	}
> >  	if (sql_prepare_v2(db, sql, len, &stmt, NULL) != SQL_OK) {
> > -		diag_set(ClientError, ER_SQL_EXECUTE, sql_errmsg(db));
> > +		if (db->errCode != SQL_TARANTOOL_ERROR) {
> > +			const char *err = (char *)sql_value_text(db->pErr);
> > +			if (err == NULL)
> > +				err = sqlErrStr(db->errCode);
> > +			diag_set(ClientError, ER_VDBE_EXECUTE, err);
> 
> Prepare has nothing to do with Vdbe except allocation. Error
> says "Error during execution of VDBE", but VDBE is not executed
> here. Also, not sure if 'VDBE' should be showed to a user. He is
> likely not to be aware about what it is.
> 
> In my opinion, ER_VDBE_EXECUTE should be replaced with ER_SQL_EXECUTE,
> and the message should be "Error during execution of SQL bytecode: ...".
> 
Fixed. Changed to errcode that was used before - ER_SQL_EXECUTE.


Diff from previous version of this patch:

diff --git a/src/box/errcode.h b/src/box/errcode.h
index e39a89e..7764aa3 100644
--- a/src/box/errcode.h
+++ b/src/box/errcode.h
@@ -240,7 +240,6 @@ struct errcode_record {
 	/*185 */_(ER_SQL_UNKNOWN_TOKEN,		"Syntax error: unrecognized token: '%.*s'") \
 	/*186 */_(ER_SQL_PARSER_GENERIC,	"%s") \
 	/*187 */_(ER_SQL_ANALYZE_ARGUMENT,	"ANALYZE statement argument %s is not a base table") \
-	/*188 */_(ER_VDBE_EXECUTE,		"Error during execution of VDBE byte-code: %s") \
 
 /*
  * !IMPORTANT! Please follow instructions at start of the file
diff --git a/src/box/execute.c b/src/box/execute.c
index 5810086..d45fb12 100644
--- a/src/box/execute.c
+++ b/src/box/execute.c
@@ -527,7 +527,7 @@ sql_execute(sql *db, struct sql_stmt *stmt, struct port *port,
 			const char *err = (char *)sql_value_text(db->pErr);
 			if (err == NULL)
 				err = sqlErrStr(db->errCode);
-			diag_set(ClientError, ER_VDBE_EXECUTE, err);
+			diag_set(ClientError, ER_SQL_EXECUTE, err);
 		}
 		return -1;
 	}
@@ -550,7 +550,7 @@ sql_prepare_and_execute(const char *sql, int len, const struct sql_bind *bind,
 			const char *err = (char *)sql_value_text(db->pErr);
 			if (err == NULL)
 				err = sqlErrStr(db->errCode);
-			diag_set(ClientError, ER_VDBE_EXECUTE, err);
+			diag_set(ClientError, ER_SQL_EXECUTE, err);
 		}
 		return -1;
 	}
diff --git a/test/box/misc.result b/test/box/misc.result
index 4f1116e..c350bbd 100644
--- a/test/box/misc.result
+++ b/test/box/misc.result
@@ -516,7 +516,6 @@ t;
   185: box.error.SQL_UNKNOWN_TOKEN
   186: box.error.SQL_PARSER_GENERIC
   187: box.error.SQL_ANALYZE_ARGUMENT
-  188: box.error.VDBE_EXECUTE
 ...
 test_run:cmd("setopt delimiter ''");
 ---
diff --git a/test/sql/iproto.result b/test/sql/iproto.result
index 2738ed6..269fbaf 100644
--- a/test/sql/iproto.result
+++ b/test/sql/iproto.result
@@ -651,8 +651,8 @@ future1:wait_result()
 future2:wait_result()
 ---
 - null
-- 'Error during execution of VDBE byte-code: Duplicate key exists in unique index
-  ''pk_unnamed_TEST_1'' in space ''TEST'''
+- 'Failed to execute SQL statement: Duplicate key exists in unique index ''pk_unnamed_TEST_1''
+  in space ''TEST'''
 ...
 future3:wait_result()
 ---


Diff from last version of the patch "Remove box.sql.execute()":

diff --git a/test/sql-tap/alter.test.lua b/test/sql-tap/alter.test.lua
index 2331cd0..97039e2 100755
--- a/test/sql-tap/alter.test.lua
+++ b/test/sql-tap/alter.test.lua
@@ -359,7 +359,7 @@ test:do_catchsql_test(
         INSERT INTO t5 VALUES(2, 1, 3);
     ]], {
         -- <alter-7.2>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </alter-7.2>
     })
 
@@ -369,7 +369,7 @@ test:do_catchsql_test(
         INSERT INTO t5 VALUES(2, 2, 2);
     ]], {
         -- <alter-7.3>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </alter-7.3>
     })
 
@@ -435,7 +435,7 @@ test:do_catchsql_test(
         INSERT INTO t5 VALUES(4, 5, 3);
     ]], {
         -- <alter-7.9>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </alter-7.9>
     })
 
@@ -490,7 +490,7 @@ test:do_catchsql_test(
         INSERT INTO t5 VALUES(6, 5, 10);
     ]], {
         -- <alter-7.14>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </alter-7.14>
     })
 
diff --git a/test/sql-tap/alter2.test.lua b/test/sql-tap/alter2.test.lua
index 612dd74..d714a4b 100755
--- a/test/sql-tap/alter2.test.lua
+++ b/test/sql-tap/alter2.test.lua
@@ -24,7 +24,7 @@ test:do_catchsql_test(
         INSERT INTO t1 VALUES(2, 3, 2);
     ]], {
         -- <alter2-1.2>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </alter2-1.2>
     })
 
@@ -45,7 +45,7 @@ test:do_catchsql_test(
         INSERT INTO t1 VALUES(2, 3, 2);
     ]], {
         -- <alter2-1.4>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </alter2-1.4>
     })
 
@@ -83,7 +83,7 @@ test:do_catchsql_test(
         INSERT INTO t1 VALUES(4, 2, 1);
     ]], {
         -- <alter2-1.6>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </alter2-1.6>
     })
 
@@ -143,7 +143,7 @@ test:do_catchsql_test(
         INSERT INTO parent VALUES(1, 2, 3);
     ]], {
         -- <alter2-2.1>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </alter2-2.1>
     })
 
@@ -154,7 +154,7 @@ test:do_catchsql_test(
         INSERT INTO child VALUES(2, 1, 1);
     ]], {
         -- <alter2-2.2>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </alter2-2.2>
     })
 
@@ -165,7 +165,7 @@ test:do_catchsql_test(
         INSERT INTO parent VALUES(3, 4, 2);
     ]], {
         -- <alter2-2.3>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </alter2-2.3>
     })
 
diff --git a/test/sql-tap/autoinc.test.lua b/test/sql-tap/autoinc.test.lua
index bdc0053..36c243f 100755
--- a/test/sql-tap/autoinc.test.lua
+++ b/test/sql-tap/autoinc.test.lua
@@ -531,7 +531,7 @@ test:do_catchsql_test(
         INSERT INTO t6 VALUES(NULL,1);
     ]], {
         -- <autoinc-6.2>
-        1, "Error during execution of VDBE byte-code: Sequence 'T6' has overflowed"
+        1, "Failed to execute SQL statement: Sequence 'T6' has overflowed"
         -- </autoinc-6.2>
     })
 
@@ -810,7 +810,7 @@ test:do_catchsql_test(
         INSERT INTO t1 SELECT s2, s2 FROM t1;
     ]], {
         -- <autoinc-gh-3670>
-        1, "Error during execution of VDBE byte-code: datatype mismatch"
+        1, "Failed to execute SQL statement: datatype mismatch"
         -- </autoinc-gh-3670>
     })
 
diff --git a/test/sql-tap/check.test.lua b/test/sql-tap/check.test.lua
index c7ef1a1..d5760b0 100755
--- a/test/sql-tap/check.test.lua
+++ b/test/sql-tap/check.test.lua
@@ -55,7 +55,7 @@ test:do_catchsql_test(
         INSERT INTO t1 VALUES(6,7, 2);
     ]], {
         -- <check-1.3>
-        1, "Error during execution of VDBE byte-code: CHECK constraint failed: T1"
+        1, "Failed to execute SQL statement: CHECK constraint failed: T1"
         -- </check-1.3>
     })
 
@@ -75,7 +75,7 @@ test:do_catchsql_test(
         INSERT INTO t1 VALUES(4,3, 2);
     ]], {
         -- <check-1.5>
-        1, "Error during execution of VDBE byte-code: CHECK constraint failed: T1"
+        1, "Failed to execute SQL statement: CHECK constraint failed: T1"
         -- </check-1.5>
     })
 
@@ -147,7 +147,7 @@ test:do_catchsql_test(
         UPDATE t1 SET x=7 WHERE x==2
     ]], {
         -- <check-1.12>
-        1, "Error during execution of VDBE byte-code: CHECK constraint failed: T1"
+        1, "Failed to execute SQL statement: CHECK constraint failed: T1"
         -- </check-1.12>
     })
 
@@ -167,7 +167,7 @@ test:do_catchsql_test(
         UPDATE t1 SET x=5 WHERE x==2
     ]], {
         -- <check-1.14>
-        1, "Error during execution of VDBE byte-code: CHECK constraint failed: T1"
+        1, "Failed to execute SQL statement: CHECK constraint failed: T1"
         -- </check-1.14>
     })
 
@@ -246,7 +246,7 @@ test:do_catchsql_test(
         INSERT INTO t2 VALUES(3, 1.1, NULL, NULL);
     ]], {
         -- <check-2.4>
-        1, "Error during execution of VDBE byte-code: CHECK constraint failed: ONE"
+        1, "Failed to execute SQL statement: CHECK constraint failed: ONE"
         -- </check-2.4>
     })
 
@@ -256,7 +256,7 @@ test:do_catchsql_test(
         INSERT INTO t2 VALUES(4, NULL, 5, NULL);
     ]], {
         -- <check-2.5>
-        1, "Error during execution of VDBE byte-code: CHECK constraint failed: TWO"
+        1, "Failed to execute SQL statement: CHECK constraint failed: TWO"
         -- </check-2.5>
     })
 
@@ -266,7 +266,7 @@ test:do_catchsql_test(
         INSERT INTO t2 VALUES(5, NULL, NULL, 3.14159);
     ]], {
         -- <check-2.6>
-        1, "Error during execution of VDBE byte-code: CHECK constraint failed: THREE"
+        1, "Failed to execute SQL statement: CHECK constraint failed: THREE"
         -- </check-2.6>
     })
 
@@ -413,7 +413,7 @@ test:do_catchsql_test(
         INSERT INTO t3 VALUES(111,222,333);
     ]], {
         -- <check-3.9>
-        1, "Error during execution of VDBE byte-code: CHECK constraint failed: T3"
+        1, "Failed to execute SQL statement: CHECK constraint failed: T3"
         -- </check-3.9>
     })
 
@@ -484,7 +484,7 @@ test:do_catchsql_test(
         UPDATE t4 SET x=0, y=1;
     ]], {
         -- <check-4.6>
-        1, "Error during execution of VDBE byte-code: CHECK constraint failed: T4"
+        1, "Failed to execute SQL statement: CHECK constraint failed: T4"
         -- </check-4.6>
     })
 
@@ -504,7 +504,7 @@ test:do_catchsql_test(
         UPDATE t4 SET x=0, y=2;
     ]], {
         -- <check-4.9>
-        1, "Error during execution of VDBE byte-code: CHECK constraint failed: T4"
+        1, "Failed to execute SQL statement: CHECK constraint failed: T4"
         -- </check-4.9>
     })
 
@@ -581,7 +581,7 @@ test:do_catchsql_test(
         UPDATE OR FAIL t1 SET x=7-x, y=y+1;
     ]], {
         -- <check-6.5>
-        1, "Error during execution of VDBE byte-code: CHECK constraint failed: T1"
+        1, "Failed to execute SQL statement: CHECK constraint failed: T1"
         -- </check-6.5>
     })
 
@@ -603,7 +603,7 @@ test:do_catchsql_test(
         INSERT OR ROLLBACK INTO t1 VALUES(8,40.0, 10);
     ]], {
         -- <check-6.7>
-        1, "Error during execution of VDBE byte-code: CHECK constraint failed: T1"
+        1, "Failed to execute SQL statement: CHECK constraint failed: T1"
         -- </check-6.7>
     })
 
@@ -613,7 +613,7 @@ test:do_catchsql_test(
         COMMIT;
     ]], {
         -- <check-6.8>
-        1, "Error during execution of VDBE byte-code: cannot commit - no transaction is active"
+        1, "Failed to execute SQL statement: cannot commit - no transaction is active"
         -- </check-6.8>
     })
 
@@ -636,7 +636,7 @@ test:do_catchsql_test(
         REPLACE INTO t1 VALUES(6,7, 11);
     ]], {
         -- <check-6.12>
-        1, "Error during execution of VDBE byte-code: CHECK constraint failed: T1"
+        1, "Failed to execute SQL statement: CHECK constraint failed: T1"
         -- </check-6.12>
     })
 
@@ -700,7 +700,7 @@ test:do_catchsql_test(
     7.3,
     " INSERT INTO t6 VALUES(11) ", {
         -- <7.3>
-        1, "Error during execution of VDBE byte-code: CHECK constraint failed: T6"
+        1, "Failed to execute SQL statement: CHECK constraint failed: T6"
         -- </7.3>
     })
 
diff --git a/test/sql-tap/fkey1.test.lua b/test/sql-tap/fkey1.test.lua
index f7c473f..7000ec0 100755
--- a/test/sql-tap/fkey1.test.lua
+++ b/test/sql-tap/fkey1.test.lua
@@ -158,7 +158,7 @@ test:do_catchsql_test(
         INSERT OR REPLACE INTO t11 VALUES (2, 3);
     ]], {
         -- <fkey1-5.2>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey1-5.2>
     })
 
@@ -194,7 +194,7 @@ test:do_catchsql_test(
         INSERT OR REPLACE INTO Foo(Id, ParentId, C1) VALUES (2, 3, 'A-2-3');
     ]], {
         -- <fkey1-5.5>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey1-5.5>
     })
 
diff --git a/test/sql-tap/fkey2.test.lua b/test/sql-tap/fkey2.test.lua
index 525ef2a..09d55be 100755
--- a/test/sql-tap/fkey2.test.lua
+++ b/test/sql-tap/fkey2.test.lua
@@ -26,7 +26,7 @@ test:do_catchsql_test(
         INSERT INTO t2(c,d) VALUES(1, 3);
     ]], {
         -- <fkey2-1.2>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-1.2>
     })
 
@@ -56,7 +56,7 @@ test:do_catchsql_test(
         INSERT INTO t2(c,d) VALUES(2, 4);
     ]], {
         -- <fkey2-1.5>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-1.5>
     })
 
@@ -77,7 +77,7 @@ test:do_catchsql_test(
         UPDATE t2 SET c = 2 WHERE d = 4;
     ]], {
         -- <fkey2-1.7>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-1.7>
     })
 
@@ -98,7 +98,7 @@ test:do_catchsql_test(
         DELETE FROM t1 WHERE a = 1;
     ]], {
         -- <fkey2-1.9>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-1.9>
     })
 
@@ -109,7 +109,7 @@ test:do_catchsql_test(
         UPDATE t1 SET a = 2;
     ]], {
         -- <fkey2-1.10>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-1.10>
     })
 
@@ -131,7 +131,7 @@ test:do_catchsql_test(
         INSERT INTO t4(c,d) values (1,3);
     ]], {
         -- <fkey2-1.12>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-1.12>
     })
 
@@ -161,7 +161,7 @@ test:do_catchsql_test(
         INSERT INTO t8(c,d) values (1,3);
     ]], {
         -- <fkey2-1.15>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-1.15>
     })
 
@@ -191,7 +191,7 @@ test:do_catchsql_test(
         INSERT INTO t8(c,d) values (2,4);
     ]], {
         -- <fkey2-1.18>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-1.18>
     })
 
@@ -201,7 +201,7 @@ test:do_catchsql_test(
         INSERT INTO t8(c,d) values (6,4);
     ]], {
         -- <fkey2-1.19>
-        1,"Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1,"Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-1.19>
     })
 
@@ -241,7 +241,7 @@ test:do_catchsql_test(
         DELETE FROM t7 WHERE b = 1;
     ]], {
         -- <fkey2-1.23>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-1.23>
     })
 
@@ -251,7 +251,7 @@ test:do_catchsql_test(
         UPDATE t7 SET b = 2;
     ]], {
         -- <fkey2-1.24>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-1.24>
     })
 
@@ -271,7 +271,7 @@ test:do_catchsql_test(
         INSERT INTO t8(c,d) VALUES(666, 54644);
     ]], {
         -- <fkey2-1.26>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-1.26>
     })
 
@@ -281,7 +281,7 @@ test:do_catchsql_test(
         UPDATE t7 SET b = 5;
     ]], {
         -- <fkey2-1.27>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-1.27>
     })
 
@@ -333,7 +333,7 @@ test:do_catchsql_test(
         DELETE FROM i;
     ]], {
         -- <fkey2-2.2>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-2.2>
     })
 
@@ -362,7 +362,7 @@ test:do_catchsql_test(
         UPDATE ab SET a = 5;
     ]], {
         -- <fkey2-3.2>
-        1, "Error during execution of VDBE byte-code: CHECK constraint failed: EF"
+        1, "Failed to execute SQL statement: CHECK constraint failed: EF"
         -- </fkey2-3.2>
     })
 
@@ -382,7 +382,7 @@ test:do_catchsql_test(
         UPDATE ab SET a = 5;
     ]], {
         -- <fkey2-3.4>
-        1, "Error during execution of VDBE byte-code: CHECK constraint failed: EF"
+        1, "Failed to execute SQL statement: CHECK constraint failed: EF"
         -- </fkey2-3.4>
     })
 
@@ -403,7 +403,7 @@ test:do_catchsql_test(
         DELETE FROM ab;
     ]], {
         -- <fkey2-3.6>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-3.6>
     })
 
@@ -540,7 +540,7 @@ test:do_catchsql_test(
         INSERT INTO t2(c,b) VALUES(1, 'A');
     ]], {
         -- <fkey2-5.2>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-5.2>
     })
 
@@ -562,7 +562,7 @@ test:do_catchsql_test(
         UPDATE t2 SET c = 3;
     ]], {
         -- <fkey2-5.4>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-5.4>
     })
 
@@ -572,7 +572,7 @@ test:do_catchsql_test(
         DELETE FROM t1 WHERE a = 2;
     ]], {
         -- <fkey2-5.5>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-5.5>
     })
 
@@ -591,7 +591,7 @@ test:do_catchsql_test(
         UPDATE t1 SET a = 3;
     ]], {
         -- <fkey2-5.7>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-5.7>
     })
 
@@ -656,7 +656,7 @@ test:do_catchsql_test(
         DELETE FROM t1;
     ]], {
         -- <fkey2-6.5>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-6.5>
     })
 
@@ -808,7 +808,7 @@ test:do_catchsql_test(
       UPDATE t1 SET b = 'five' WHERE b = 'two';
     ]], {
         -- <fkey2-9.2>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-9.2>
     })
 
@@ -818,7 +818,7 @@ test:do_catchsql_test(
         DELETE FROM t1 WHERE b = 'two';
     ]], {
         -- <fkey2-9.3>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-9.3>
     })
 
@@ -828,7 +828,7 @@ test:do_catchsql_test(
         INSERT INTO t2 VALUES('five');
     ]], {
         -- <fkey2-9.4>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-9.4>
     })
 
@@ -885,7 +885,7 @@ test:do_catchsql_test(
         DELETE FROM t1;
     ]], {
         -- <fkey2-9.8>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-9.8>
     })
 
@@ -942,7 +942,7 @@ test:do_catchsql_test(
         INSERT INTO down(c39, c38) VALUES('yes', 'no');
     ]], {
         -- <fkey2-9.12>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-9.12>
     })
 
@@ -954,7 +954,7 @@ test:do_catchsql_test(
         DELETE FROM up WHERE c34 = 'yes';
     ]], {
         -- <fkey2-9.13>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-9.13>
     })
 
@@ -1007,7 +1007,7 @@ test:do_execsql_test(
 --         INSERT INTO t3 VALUES(1, 2, 3);
 --     ]], {
 --         -- <fkey2-10.2>
---         1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+--         1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
 --         -- </fkey2-10.2>
 --     })
 
@@ -1027,7 +1027,7 @@ test:do_execsql_test(
 --         UPDATE t4 SET b = 5;
 --     ]], {
 --         -- <fkey2-10.4>
---         1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+--         1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
 --         -- </fkey2-10.4>
 --     })
 
@@ -1183,7 +1183,7 @@ test:do_catchsql_test(
         UPDATE self SET b = 15;
     ]], {
         -- <fkey2-11.2>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-11.2>
     })
 
@@ -1193,7 +1193,7 @@ test:do_catchsql_test(
         UPDATE self SET a = 15;
     ]], {
         -- <fkey2-11.3>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-11.3>
     })
 
@@ -1203,7 +1203,7 @@ test:do_catchsql_test(
         UPDATE self SET a = 15, b = 16;
     ]], {
         -- <fkey2-11.4>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-11.4>
     })
 
@@ -1231,7 +1231,7 @@ test:do_catchsql_test(
         INSERT INTO self(a,b) VALUES(20, 21);
     ]], {
         -- <fkey2-11.7>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-11.7>
     })
 
@@ -1253,7 +1253,7 @@ test:do_catchsql_test(
         UPDATE self SET b = 15;
     ]], {
         -- <fkey2-11.9>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-11.9>
     })
 
@@ -1263,7 +1263,7 @@ test:do_catchsql_test(
         UPDATE self SET a = 15;
     ]], {
         -- <fkey2-11.10>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-11.10>
     })
 
@@ -1273,7 +1273,7 @@ test:do_catchsql_test(
         UPDATE self SET a = 15, b = 16;
     ]], {
         -- <fkey2-11.11>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-11.11>
     })
 
@@ -1301,7 +1301,7 @@ test:do_catchsql_test(
         INSERT INTO self(a,b) VALUES(20, 21);
     ]], {
         -- <fkey2-11.14>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-11.14>
     })
 
@@ -1328,7 +1328,7 @@ test:do_catchsql_test(
         DELETE FROM tdd08;
     ]], {
         -- <fkey2-12.2>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-12.2>
     })
 
@@ -1348,7 +1348,7 @@ test:do_catchsql_test(
         INSERT INTO tdd08_b(w,x,y) VALUES(400,500,300);
     ]], {
         -- <fkey2-12.4>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-12.4>
     })
 
@@ -1358,7 +1358,7 @@ test:do_catchsql_test(
         UPDATE tdd08_b SET x=x+1;
     ]], {
         -- <fkey2-12.5>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-12.5>
     })
 
@@ -1368,7 +1368,7 @@ test:do_catchsql_test(
         UPDATE tdd08 SET a=a+1;
     ]], {
         -- <fkey2-12.6>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-12.6>
     })
 
@@ -1394,7 +1394,7 @@ test:do_catchsql_test(
         UPDATE tce71 set b = 201 where a = 100;
     ]], {
         -- <fkey2-13.2>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-13.2>
     })
 
@@ -1404,7 +1404,7 @@ test:do_catchsql_test(
         UPDATE tce71 set a = 101 where a = 100;
     ]], {
         -- <fkey2-13.3>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-13.3>
     })
 
@@ -1429,7 +1429,7 @@ test:do_catchsql_test(
         UPDATE tce73 set b = 201 where a = 100;
     ]], {
         -- <fkey2-14.2>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-14.2>
     })
 
@@ -1439,7 +1439,7 @@ test:do_catchsql_test(
         UPDATE tce71 set a = 101 where a = 100;
     ]], {
         -- <fkey2-14.3>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey2-14.3>
     })
 
diff --git a/test/sql-tap/fkey3.test.lua b/test/sql-tap/fkey3.test.lua
index c66b5e0..900ac32 100755
--- a/test/sql-tap/fkey3.test.lua
+++ b/test/sql-tap/fkey3.test.lua
@@ -122,7 +122,7 @@ test:do_catchsql_test(
         INSERT INTO t3 VALUES(2, 2, 5, 2);
     ]], {
         -- <fkey3-3.2>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey3-3.2>
     })
 
@@ -132,7 +132,7 @@ test:do_catchsql_test(
         INSERT INTO t3 VALUES(2, 3, 5, 2);
     ]], {
         -- <fkey3-3.3>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey3-3.3>
     })
 
@@ -151,7 +151,7 @@ test:do_catchsql_test(
         INSERT INTO t4 VALUES(2, 1);
     ]], {
         -- <fkey3-3.5>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey3-3.5>
     })
 
@@ -175,7 +175,7 @@ test:do_catchsql_test(
         INSERT INTO t6(a,b,c,d) VALUES(4, 'a', 65, 'a');
     ]], {
         -- <fkey3-3.7>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey3-3.7>
     })
 
@@ -197,7 +197,7 @@ test:do_catchsql_test(
         UPDATE t6 SET c = 1, d = 'a' WHERE a = 100;
     ]], {
         -- <fkey3-3.9>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey3-3.9>
     })
 
@@ -219,7 +219,7 @@ test:do_catchsql_test(
         INSERT INTO t7 VALUES('x', 450, 'x', 4);
     ]], {
         -- <fkey3-3.11>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey3-3.11>
     })
 
@@ -229,7 +229,7 @@ test:do_catchsql_test(
         INSERT INTO t7 VALUES('x', 450, 'x', 451);
     ]], {
         -- <fkey3-3.12>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey3-3.12>
     })
 
@@ -253,7 +253,7 @@ test:do_catchsql_test(
         UPDATE t8 SET d = 2;
     ]], {
         -- <fkey3-6.2>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey3-6.2>
     })
 
@@ -282,7 +282,7 @@ test:do_catchsql_test(
         UPDATE TestTable SET parent_id=1000 WHERE id=2;
     ]], {
         -- <fkey3-6.4>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey3-6.4>
     })
 
diff --git a/test/sql-tap/fkey4.test.lua b/test/sql-tap/fkey4.test.lua
index 3a03cd5..ea77278 100755
--- a/test/sql-tap/fkey4.test.lua
+++ b/test/sql-tap/fkey4.test.lua
@@ -30,7 +30,7 @@ test:do_catchsql_test(
         DELETE FROM p1 WHERE a = 2;
     ]], {
         -- <fkey8-1.2>
-        1, "Error during execution of VDBE byte-code: NOT NULL constraint failed: C1.B"
+        1, "Failed to execute SQL statement: NOT NULL constraint failed: C1.B"
         -- </fkey8-1.2>
     })
 
@@ -83,7 +83,7 @@ test:do_catchsql_test(
         DELETE FROM p1 WHERE a = 2;
     ]], {
         -- <fkey8-1.5>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey8-1.5>
     })
 
@@ -159,7 +159,7 @@ test:do_catchsql_test(
         UPDATE OR IGNORE p1 SET a = 4 WHERE a = 2;
     ]], {
         -- <fkey8-1.9>
-        1, "Error during execution of VDBE byte-code: NOT NULL constraint failed: C1.B"
+        1, "Failed to execute SQL statement: NOT NULL constraint failed: C1.B"
         -- </fkey8-1.9>
     })
 
@@ -203,7 +203,7 @@ test:do_catchsql_test(
         INSERT OR REPLACE INTO p1 VALUES(2, 'two');
     ]], {
         -- <fkey8-2.2>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey8-2.2>
     })
 
@@ -278,7 +278,7 @@ test:do_catchsql_test(
         DELETE FROM p3 WHERE a=1;
     ]], {
         -- <fkey8-4.3>
-        1, "Error during execution of VDBE byte-code: FOREIGN KEY constraint failed"
+        1, "Failed to execute SQL statement: FOREIGN KEY constraint failed"
         -- </fkey8-4.3>
     })
 
diff --git a/test/sql-tap/func.test.lua b/test/sql-tap/func.test.lua
index a7fff6e..f6f1eb1 100755
--- a/test/sql-tap/func.test.lua
+++ b/test/sql-tap/func.test.lua
@@ -1598,7 +1598,7 @@ test:do_catchsql_test(
         SELECT sum(x) - ((1<<62)*2.0+1) from t6;
     ]], {
         -- <func-18.12>
-        1, "Error during execution of VDBE byte-code: integer overflow"
+        1, "Failed to execute SQL statement: integer overflow"
         -- </func-18.12>
     })
 
@@ -1653,7 +1653,7 @@ test:do_catchsql_test(
             SELECT 10 AS x);
     ]], {
         -- <func-18.15>
-        1, "Error during execution of VDBE byte-code: integer overflow"
+        1, "Failed to execute SQL statement: integer overflow"
         -- </func-18.15>
     })
 
@@ -1665,7 +1665,7 @@ test:do_catchsql_test(
             SELECT -10 AS x);
     ]], {
         -- <func-18.18>
-        1, "Error during execution of VDBE byte-code: integer overflow"
+        1, "Failed to execute SQL statement: integer overflow"
         -- </func-18.18>
     })
 
@@ -1730,7 +1730,7 @@ test:do_catchsql_test(
         SELECT abs(-9223372036854775807-1);
     ]], {
         -- <func-18.32>
-        1, "Error during execution of VDBE byte-code: integer overflow"
+        1, "Failed to execute SQL statement: integer overflow"
         -- </func-18.32>
     })
 
@@ -1752,7 +1752,7 @@ test:do_catchsql_test(
         SELECT 'abc' MATCH 'xyz';
     ]], {
         -- <func-19.2>
-        1, "Error during execution of VDBE byte-code: unable to use function MATCH in the requested context"
+        1, "Failed to execute SQL statement: unable to use function MATCH in the requested context"
         -- </func-19.2>
     })
 
@@ -1762,7 +1762,7 @@ test:do_catchsql_test(
         SELECT 'abc' NOT MATCH 'xyz';
     ]], {
         -- <func-19.3>
-        1, "Error during execution of VDBE byte-code: unable to use function MATCH in the requested context"
+        1, "Failed to execute SQL statement: unable to use function MATCH in the requested context"
         -- </func-19.3>
     })
 
diff --git a/test/sql-tap/gh-2931-savepoints.test.lua b/test/sql-tap/gh-2931-savepoints.test.lua
index 85dc7a1..acb8bd4 100755
--- a/test/sql-tap/gh-2931-savepoints.test.lua
+++ b/test/sql-tap/gh-2931-savepoints.test.lua
@@ -38,7 +38,7 @@ local testcases = {
 		{0,{1,1}}},
 	{"5",
 		[[rollback to savepoint s1_2;]],
-		{1, "Error during execution of VDBE byte-code: no such savepoint: S1_2"}},
+		{1, "Failed to execute SQL statement: no such savepoint: S1_2"}},
 	{"6",
 		[[insert into t1 values(2);
 		select * from t1 union all select * from t2;]],
@@ -80,13 +80,13 @@ local testcases = {
 		{0,{1,2,10,11,1,2,4,10,11}}},
 	{"14",
 		[[insert into t1 values(4);]],
-		{1,"Error during execution of VDBE byte-code: Duplicate key exists in unique index 'pk_unnamed_T2_1' in space 'T2'"}},
+		{1,"Failed to execute SQL statement: Duplicate key exists in unique index 'pk_unnamed_T2_1' in space 'T2'"}},
 	{"15",
 		[[select * from t1 union all select * from t2;]],
 		{0,{1,2,10,11,1,2,4,10,11}}},
 	{"16",
 		[[insert or rollback into t1 values(4);]],
-		{1,"Error during execution of VDBE byte-code: Duplicate key exists in unique index 'pk_unnamed_T2_1' in space 'T2'"}},
+		{1,"Failed to execute SQL statement: Duplicate key exists in unique index 'pk_unnamed_T2_1' in space 'T2'"}},
 	{"17",  -- should work as transaction is rolled back
 		[[insert or rollback into t1 values(4);
 		select * from t1 union all select * from t2;]],
diff --git a/test/sql-tap/gh-3251-string-pattern-comparison.test.lua b/test/sql-tap/gh-3251-string-pattern-comparison.test.lua
index 0e0a003..dec3cce 100755
--- a/test/sql-tap/gh-3251-string-pattern-comparison.test.lua
+++ b/test/sql-tap/gh-3251-string-pattern-comparison.test.lua
@@ -142,17 +142,17 @@ for i, tested_string in ipairs(invalid_testcases) do
     local test_name = prefix .. "2." .. tostring(i)
     local test_itself = "SELECT 'abc' LIKE 'ab" .. tested_string .. "';"
     test:do_catchsql_test(test_name, test_itself,
-                          {1, "Error during execution of VDBE byte-code: LIKE pattern can only contain UTF-8 characters"})
+                          {1, "Failed to execute SQL statement: LIKE pattern can only contain UTF-8 characters"})
 
     test_name = prefix .. "3." .. tostring(i)
     test_itself = "SELECT 'abc' LIKE 'abc" .. tested_string .. "';"
     test:do_catchsql_test(test_name, test_itself,
-                          {1, "Error during execution of VDBE byte-code: LIKE pattern can only contain UTF-8 characters"})
+                          {1, "Failed to execute SQL statement: LIKE pattern can only contain UTF-8 characters"})
 
     test_name = prefix .. "4." .. tostring(i)
     test_itself = "SELECT 'abc' LIKE 'ab" .. tested_string .. "c';"
     test:do_catchsql_test(test_name, test_itself,
-                          {1, "Error during execution of VDBE byte-code: LIKE pattern can only contain UTF-8 characters"})
+                          {1, "Failed to execute SQL statement: LIKE pattern can only contain UTF-8 characters"})
 
     -- Just skipping if row value predicand contains invalid character.
 
diff --git a/test/sql-tap/gh-3307-xfer-optimization-issue.test.lua b/test/sql-tap/gh-3307-xfer-optimization-issue.test.lua
index 2369be7..859a6ff 100755
--- a/test/sql-tap/gh-3307-xfer-optimization-issue.test.lua
+++ b/test/sql-tap/gh-3307-xfer-optimization-issue.test.lua
@@ -139,7 +139,7 @@ test:do_catchsql_xfer_test(
         INSERT INTO t2 SELECT * FROM t1;
     ]], {
         -- <xfer-optimization-1.9>
-        1, "Error during execution of VDBE byte-code: Duplicate key exists in unique index 'pk_unnamed_T2_1' in space 'T2'"
+        1, "Failed to execute SQL statement: Duplicate key exists in unique index 'pk_unnamed_T2_1' in space 'T2'"
         -- <xfer-optimization-1.9>
     }, {
         exp_xfer_count = 0
@@ -210,7 +210,7 @@ test:do_catchsql_xfer_test(
             INSERT INTO t2 SELECT * FROM t1;
     ]], {
         -- <xfer-optimization-1.13>
-        1, "Error during execution of VDBE byte-code: Duplicate key exists in unique index 'pk_unnamed_T2_1' in space 'T2'"
+        1, "Failed to execute SQL statement: Duplicate key exists in unique index 'pk_unnamed_T2_1' in space 'T2'"
         -- <xfer-optimization-1.13>
     }, {
         exp_xfer_count = 0
@@ -245,7 +245,7 @@ test:do_catchsql_xfer_test(
             INSERT OR ABORT INTO t2 SELECT * FROM t1;
     ]], {
         -- <xfer-optimization-1.20>
-        1, "Error during execution of VDBE byte-code: Duplicate key exists in unique index 'pk_unnamed_T2_1' in space 'T2'"
+        1, "Failed to execute SQL statement: Duplicate key exists in unique index 'pk_unnamed_T2_1' in space 'T2'"
         -- <xfer-optimization-1.20>
     }, {
         exp_xfer_count = 1
@@ -313,7 +313,7 @@ test:do_catchsql_xfer_test(
             INSERT OR ROLLBACK INTO t2 SELECT * FROM t1;
     ]], {
         -- <xfer-optimization-1.24>
-        1, "Error during execution of VDBE byte-code: Duplicate key exists in unique index 'pk_unnamed_T2_1' in space 'T2'"
+        1, "Failed to execute SQL statement: Duplicate key exists in unique index 'pk_unnamed_T2_1' in space 'T2'"
         -- <xfer-optimization-1.24>
     }, {
         exp_xfer_count = 0
@@ -381,7 +381,7 @@ test:do_catchsql_xfer_test(
             INSERT OR FAIL INTO t2 SELECT * FROM t1;
     ]], {
         -- <xfer-optimization-1.28>
-        1, "Error during execution of VDBE byte-code: Duplicate key exists in unique index 'pk_unnamed_T2_1' in space 'T2'"
+        1, "Failed to execute SQL statement: Duplicate key exists in unique index 'pk_unnamed_T2_1' in space 'T2'"
         -- <xfer-optimization-1.28>
     }, {
         exp_xfer_count = 1
diff --git a/test/sql-tap/gh2259-in-stmt-trans.test.lua b/test/sql-tap/gh2259-in-stmt-trans.test.lua
index 1ac0d53..36f5e90 100755
--- a/test/sql-tap/gh2259-in-stmt-trans.test.lua
+++ b/test/sql-tap/gh2259-in-stmt-trans.test.lua
@@ -18,7 +18,7 @@ for _, prefix in pairs({"BEFORE", "AFTER"}) do
 
     test:do_catchsql_test(prefix..'_insert1',
                           'INSERT INTO t1 VALUES(1, 2)',
-                          {1,"Error during execution of VDBE byte-code: Duplicate key exists in unique index 'pk_unnamed_T2_2' in space 'T2'"})
+                          {1,"Failed to execute SQL statement: Duplicate key exists in unique index 'pk_unnamed_T2_2' in space 'T2'"})
 
     test:do_execsql_test(prefix..'_insert1_check1',
                          'SELECT *  FROM t1',
@@ -34,7 +34,7 @@ for _, prefix in pairs({"BEFORE", "AFTER"}) do
 
     test:do_catchsql_test(prefix..'_update1',
                           'UPDATE t1 SET s1=1',
-                          {1,"Error during execution of VDBE byte-code: Duplicate key exists in unique index 'pk_unnamed_T2_2' in space 'T2'"})
+                          {1,"Failed to execute SQL statement: Duplicate key exists in unique index 'pk_unnamed_T2_2' in space 'T2'"})
 
     test:do_execsql_test(prefix..'_update1_check1',
                          'SELECT *  FROM t1',
@@ -52,7 +52,7 @@ for _, prefix in pairs({"BEFORE", "AFTER"}) do
 
     test:do_catchsql_test(prefix..'delete1',
                           'DELETE FROM t1;',
-                          {1, "Error during execution of VDBE byte-code: Duplicate key exists in unique index 'pk_unnamed_T2_2' in space 'T2'"})
+                          {1, "Failed to execute SQL statement: Duplicate key exists in unique index 'pk_unnamed_T2_2' in space 'T2'"})
 
     -- Nothing should be inserted due to abort
     test:do_execsql_test('delete1_check1',
@@ -69,7 +69,7 @@ end
 -- Check multi-insert
 test:do_catchsql_test('insert2',
                       'INSERT INTO t1 VALUES (5, 6), (6, 7)',
-                      {1, "Error during execution of VDBE byte-code: Duplicate key exists in unique index 'pk_unnamed_T2_2' in space 'T2'"})
+                      {1, "Failed to execute SQL statement: Duplicate key exists in unique index 'pk_unnamed_T2_2' in space 'T2'"})
 test:do_execsql_test('insert2_check',
                      'SELECT * FROM t1;',
                      {3, 3})
diff --git a/test/sql-tap/gh2964-abort.test.lua b/test/sql-tap/gh2964-abort.test.lua
index 82aa3e4..fce691a 100755
--- a/test/sql-tap/gh2964-abort.test.lua
+++ b/test/sql-tap/gh2964-abort.test.lua
@@ -12,7 +12,7 @@ test:do_catchsql_test(
     test_prefix.."1.0.2",
     "CREATE TABLE t2 (a int primary key);")
 
-local insert_err = {1, "Error during execution of VDBE byte-code: Duplicate key exists in unique index 'pk_unnamed_T2_1' in space 'T2'"}
+local insert_err = {1, "Failed to execute SQL statement: Duplicate key exists in unique index 'pk_unnamed_T2_1' in space 'T2'"}
 local data = {
 --id|TRIG TYPE|INSERT TYPE|insert error|commit error| result
  {1, "AFTER", "or abort",   insert_err, {0},          {1,1,2}},
diff --git a/test/sql-tap/intpkey.test.lua b/test/sql-tap/intpkey.test.lua
index 3ec3771..b2e8084 100755
--- a/test/sql-tap/intpkey.test.lua
+++ b/test/sql-tap/intpkey.test.lua
@@ -96,7 +96,7 @@ test:do_catchsql_test(
         INSERT INTO t1 VALUES(5,'second','entry');
     ]], {
         -- <intpkey-1.6>
-        1, "Error during execution of VDBE byte-code: Duplicate key exists in unique index 'pk_unnamed_T1_1' in space 'T1'"
+        1, "Failed to execute SQL statement: Duplicate key exists in unique index 'pk_unnamed_T1_1' in space 'T1'"
         -- </intpkey-1.6>
     })
 
diff --git a/test/sql-tap/misc1.test.lua b/test/sql-tap/misc1.test.lua
index 55c0c13..abd2be5 100755
--- a/test/sql-tap/misc1.test.lua
+++ b/test/sql-tap/misc1.test.lua
@@ -383,7 +383,7 @@ test:do_catchsql_test(
         INSERT INTO t5 VALUES(1,2,4);
     ]], {
         -- <misc1-7.4>
-        1, "Error during execution of VDBE byte-code: Duplicate key exists in unique index 'pk_unnamed_T5_1' in space 'T5'"
+        1, "Failed to execute SQL statement: Duplicate key exists in unique index 'pk_unnamed_T5_1' in space 'T5'"
         -- </misc1-7.4>
     })
 
diff --git a/test/sql-tap/table.test.lua b/test/sql-tap/table.test.lua
index 4470bce..5b793c0 100755
--- a/test/sql-tap/table.test.lua
+++ b/test/sql-tap/table.test.lua
@@ -722,7 +722,7 @@ test:do_catchsql_test(
         INSERT INTO t6 VALUES(NULL);
     ]], {
         -- <table-10.1>
-        1, "Error during execution of VDBE byte-code: NOT NULL constraint failed: T6.A"
+        1, "Failed to execute SQL statement: NOT NULL constraint failed: T6.A"
         -- </table-10.1>
     })
 
@@ -1211,7 +1211,7 @@ test:do_catchsql_test(
         INSERT INTO T21 VALUES(1, 2, 2);
     ]], {
         -- <table-21.2>
-        1, "Error during execution of VDBE byte-code: Duplicate key exists in unique index 'pk_unnamed_T21_1' in space 'T21'"
+        1, "Failed to execute SQL statement: Duplicate key exists in unique index 'pk_unnamed_T21_1' in space 'T21'"
         -- </table-21.2>
     })
 
@@ -1221,7 +1221,7 @@ test:do_catchsql_test(
         INSERT INTO T21 VALUES(1, -1, 1);
     ]], {
         -- <table-21.3>
-        1, "Error during execution of VDBE byte-code: CHECK constraint failed: T21"
+        1, "Failed to execute SQL statement: CHECK constraint failed: T21"
         -- </table-21.3>
     })
 
@@ -1231,7 +1231,7 @@ test:do_catchsql_test(
         INSERT INTO T21 VALUES(1, 1, -1);
     ]], {
         -- <table-21.4>
-        1, "Error during execution of VDBE byte-code: CHECK constraint failed: T21"
+        1, "Failed to execute SQL statement: CHECK constraint failed: T21"
         -- </table-21.4>
     })
 
@@ -1283,7 +1283,7 @@ test:do_catchsql_test(
         INSERT INTO T22 VALUES(2, 1, 1);
     ]], {
         -- <table-22.3>
-        1,"Error during execution of VDBE byte-code: Duplicate key exists in unique index 'unique_ONE_2' in space 'T22'"
+        1,"Failed to execute SQL statement: Duplicate key exists in unique index 'unique_ONE_2' in space 'T22'"
         -- </table-22.3>
     })
 
@@ -1308,7 +1308,7 @@ test:do_catchsql_test(
         INSERT INTO T24 VALUES(2, 1, 1);
     ]], {
         -- <table-22.5>
-        1, "Error during execution of VDBE byte-code: Duplicate key exists in unique index 'unique_TWO_2' in space 'T24'"
+        1, "Failed to execute SQL statement: Duplicate key exists in unique index 'unique_TWO_2' in space 'T24'"
         -- </table-22.5>
     })
 
@@ -1362,7 +1362,7 @@ test:do_catchsql_test(
         INSERT INTO T28 VALUES(11);
     ]], {
         -- <table-22.9>
-        1,"Error during execution of VDBE byte-code: Duplicate key exists in unique index 'pk_unnamed_T28_1' in space 'T28'"
+        1,"Failed to execute SQL statement: Duplicate key exists in unique index 'pk_unnamed_T28_1' in space 'T28'"
         -- </table-22.9>
     })
 
@@ -1372,7 +1372,7 @@ test:do_catchsql_test(
         INSERT INTO T28 VALUES(0);
     ]], {
         -- <table-22.10>
-        1, "Error during execution of VDBE byte-code: CHECK constraint failed: CHECK1"
+        1, "Failed to execute SQL statement: CHECK constraint failed: CHECK1"
         -- </table-22.10>
     })
 
@@ -1382,7 +1382,7 @@ test:do_catchsql_test(
         INSERT INTO T28 VALUES(9);
     ]], {
         -- <table-22.11>
-        1, "Error during execution of VDBE byte-code: CHECK constraint failed: CHECK2"
+        1, "Failed to execute SQL statement: CHECK constraint failed: CHECK2"
         -- </table-22.11>
     })
 
diff --git a/test/sql-tap/tkt-4a03edc4c8.test.lua b/test/sql-tap/tkt-4a03edc4c8.test.lua
index 703bf74..0f44d4f 100755
--- a/test/sql-tap/tkt-4a03edc4c8.test.lua
+++ b/test/sql-tap/tkt-4a03edc4c8.test.lua
@@ -38,7 +38,7 @@ test:do_test(
         ]]
     end, {
         -- <tkt-4a03ed-1.1>
-        1, "Error during execution of VDBE byte-code: Duplicate key exists in unique index 'pk_unnamed_T1_1' in space 'T1'"
+        1, "Failed to execute SQL statement: Duplicate key exists in unique index 'pk_unnamed_T1_1' in space 'T1'"
         -- </tkt-4a03ed-1.1>
     })
 
diff --git a/test/sql-tap/trigger1.test.lua b/test/sql-tap/trigger1.test.lua
index bf1857f..a7dafd4 100755
--- a/test/sql-tap/trigger1.test.lua
+++ b/test/sql-tap/trigger1.test.lua
@@ -251,7 +251,7 @@ test:do_catchsql_test(
         end;
     ]], {
         -- <trigger1-1.12>
-        1, "Error during execution of VDBE byte-code: SQL error: cannot create INSTEAD OF trigger on space: T1"
+        1, "Failed to execute SQL statement: SQL error: cannot create INSTEAD OF trigger on space: T1"
         -- </trigger1-1.12>
     })
 
@@ -265,7 +265,7 @@ test:do_catchsql_test(
         end;
     ]], {
         -- <trigger1-1.13>
-        1, "Error during execution of VDBE byte-code: SQL error: cannot create BEFORE trigger on view: V1"
+        1, "Failed to execute SQL statement: SQL error: cannot create BEFORE trigger on view: V1"
         -- </trigger1-1.13>
     })
 
@@ -280,7 +280,7 @@ test:do_catchsql_test(
         end;
     ]], {
         -- <trigger1-1.14>
-        1, "Error during execution of VDBE byte-code: SQL error: cannot create AFTER trigger on view: V1"
+        1, "Failed to execute SQL statement: SQL error: cannot create AFTER trigger on view: V1"
         -- </trigger1-1.14>
     })
 
@@ -495,7 +495,7 @@ test:do_catchsql_test(
         DELETE FROM t2
     ]], {
         -- <trigger1-6.3>
-        1, "Error during execution of VDBE byte-code: deletes are not permitted"
+        1, "Failed to execute SQL statement: deletes are not permitted"
         -- </trigger1-6.3>
     })
 
@@ -857,7 +857,7 @@ test:do_catchsql_test(
             INSERT INTO t16 values(1);
           END;
    ]], {
-        1, [[Error during execution of VDBE byte-code: Space _trigger does not support multi-statement transactions]]
+        1, [[Failed to execute SQL statement: Space _trigger does not support multi-statement transactions]]
 })
 
 test:execsql [[
@@ -870,7 +870,7 @@ test:do_catchsql_test(
         START TRANSACTION;
           DROP TRIGGER t16err3;
    ]], {
-        1, [[Error during execution of VDBE byte-code: Space _trigger does not support multi-statement transactions]]
+        1, [[Failed to execute SQL statement: Space _trigger does not support multi-statement transactions]]
 })
 -- MUST_WORK_TEST
 -- #-------------------------------------------------------------------------
diff --git a/test/sql-tap/triggerC.test.lua b/test/sql-tap/triggerC.test.lua
index 76558f1..c050fb2 100755
--- a/test/sql-tap/triggerC.test.lua
+++ b/test/sql-tap/triggerC.test.lua
@@ -165,7 +165,7 @@ test:do_test(
         return test:catchsql " DELETE FROM t4 "
     end, {
         -- <triggerC-1.9>
-        1, "Error during execution of VDBE byte-code: delete is not supported"
+        1, "Failed to execute SQL statement: delete is not supported"
         -- </triggerC-1.9>
     })
 
@@ -199,7 +199,7 @@ test:do_catchsql_test(
         UPDATE OR REPLACE t5 SET a = 4 WHERE a = 1
     ]], {
         -- <triggerC-1.12>
-        1, "Error during execution of VDBE byte-code: too many levels of trigger recursion"
+        1, "Failed to execute SQL statement: too many levels of trigger recursion"
         -- </triggerC-1.12>
     })
 
@@ -285,7 +285,7 @@ tests =   { {[[ CREATE TRIGGER t2_trig AFTER INSERT ON t2 WHEN (new.a>0) BEGIN
 
             {[[ CREATE TRIGGER t2_trig BEFORE INSERT ON t2 BEGIN
                   INSERT INTO t2 VALUES(new.a - 1);
-                END;]], {1, "Error during execution of VDBE byte-code: too many levels of trigger recursion"}},
+                END;]], {1, "Failed to execute SQL statement: too many levels of trigger recursion"}},
 
             {[[ CREATE TRIGGER t2_trig AFTER INSERT ON t2 WHEN (new.a>0) BEGIN
                   INSERT OR IGNORE INTO t2 VALUES(new.a);
@@ -293,7 +293,7 @@ tests =   { {[[ CREATE TRIGGER t2_trig AFTER INSERT ON t2 WHEN (new.a>0) BEGIN
 
             {[[  CREATE TRIGGER t2_trig BEFORE INSERT ON t2 WHEN (new.a>0) BEGIN
                    INSERT OR IGNORE INTO t2 VALUES(new.a);
-                 END;]], {1, "Error during execution of VDBE byte-code: too many levels of trigger recursion"}}}
+                 END;]], {1, "Failed to execute SQL statement: too many levels of trigger recursion"}}}
 
 for n, v in ipairs(tests) do
     test:do_test(
@@ -382,7 +382,7 @@ test:do_catchsql_test(
         INSERT INTO t3 VALUES(0,0)
     ]], {
         -- <triggerC-3.1.2>
-        1, "Error during execution of VDBE byte-code: too many levels of trigger recursion"
+        1, "Failed to execute SQL statement: too many levels of trigger recursion"
         -- </triggerC-3.1.2>
     })
 
@@ -411,7 +411,7 @@ test:do_catchsql_test(
         INSERT INTO t3b VALUES(1);
     ]], {
         -- <triggerC-3.1.3>
-        1, "Error during execution of VDBE byte-code: too many levels of trigger recursion"
+        1, "Failed to execute SQL statement: too many levels of trigger recursion"
         -- </triggerC-3.1.3>
     })
 
@@ -908,7 +908,7 @@ test:do_catchsql_test(
         UPDATE t12 SET a=a+1, b=b+1;
     ]], {
         -- <triggerC-13.2>
-        1, "Error during execution of VDBE byte-code: too many levels of trigger recursion"
+        1, "Failed to execute SQL statement: too many levels of trigger recursion"
         -- </triggerC-13.2>
     })
 
diff --git a/test/sql-tap/unique.test.lua b/test/sql-tap/unique.test.lua
index 927c419..7ec7651 100755
--- a/test/sql-tap/unique.test.lua
+++ b/test/sql-tap/unique.test.lua
@@ -70,7 +70,7 @@ test:do_catchsql_test(
         INSERT INTO t1(a,b,c) VALUES(1,3,4)
     ]], {
         -- <unique-1.3>
-        1, "Error during execution of VDBE byte-code: Duplicate key exists in unique index 'pk_unnamed_T1_1' in space 'T1'"
+        1, "Failed to execute SQL statement: Duplicate key exists in unique index 'pk_unnamed_T1_1' in space 'T1'"
         -- </unique-1.3>
     })
 
@@ -91,7 +91,7 @@ test:do_catchsql_test(
         INSERT INTO t1(a,b,c) VALUES(3,2,4)
     ]], {
         -- <unique-1.5>
-        1, "Error during execution of VDBE byte-code: Duplicate key exists in unique index 'unique_unnamed_T1_2' in space 'T1'"
+        1, "Failed to execute SQL statement: Duplicate key exists in unique index 'unique_unnamed_T1_2' in space 'T1'"
         -- </unique-1.5>
     })
 
@@ -167,7 +167,7 @@ test:do_catchsql_test(
         INSERT INTO t2 VALUES(3, 1,5);
     ]], {
         -- <unique-2.3>
-        1, "Error during execution of VDBE byte-code: Duplicate key exists in unique index 'I2' in space 'T2'"
+        1, "Failed to execute SQL statement: Duplicate key exists in unique index 'I2' in space 'T2'"
         -- </unique-2.3>
     })
 
@@ -287,7 +287,7 @@ test:do_catchsql_test(
         SELECT a,b,c,d FROM t3 ORDER BY a,b,c,d;
     ]], {
         -- <unique-3.4>
-        1, "Error during execution of VDBE byte-code: Duplicate key exists in unique index 'unique_unnamed_T3_2' in space 'T3'"
+        1, "Failed to execute SQL statement: Duplicate key exists in unique index 'unique_unnamed_T3_2' in space 'T3'"
         -- </unique-3.4>
     })
 
@@ -444,7 +444,7 @@ test:do_catchsql_test(
         INSERT INTO t5 VALUES(2, 1,2,3,4,5,6);
     ]], {
         -- <unique-5.2>
-        1, "Error during execution of VDBE byte-code: Duplicate key exists in unique index 'unique_unnamed_T5_2' in space 'T5'"
+        1, "Failed to execute SQL statement: Duplicate key exists in unique index 'unique_unnamed_T5_2' in space 'T5'"
         -- </unique-5.2>
     })
 
diff --git a/test/sql/collation.result b/test/sql/collation.result
index cc1b1a9..397f653 100644
--- a/test/sql/collation.result
+++ b/test/sql/collation.result
@@ -426,7 +426,7 @@ box.execute("INSERT INTO t1 VALUES (1,'a');")
 -- Should fail.
 box.execute("UPDATE t0 SET s1 = 'A';")
 ---
-- error: 'Error during execution of VDBE byte-code: FOREIGN KEY constraint failed'
+- error: 'Failed to execute SQL statement: FOREIGN KEY constraint failed'
 ...
 box.execute("SELECT * FROM t1;")
 ---
@@ -676,8 +676,8 @@ box.execute("INSERT INTO t3b VALUES ('A');")
 ...
 box.execute("INSERT INTO t3b VALUES ('a');")
 ---
-- error: 'Error during execution of VDBE byte-code: Duplicate key exists in unique
-    index ''pk_unnamed_T3B_1'' in space ''T3B'''
+- error: 'Failed to execute SQL statement: Duplicate key exists in unique index ''pk_unnamed_T3B_1''
+    in space ''T3B'''
 ...
 box.execute("SELECT * FROM t3b;")
 ---
@@ -741,8 +741,8 @@ box.execute("INSERT INTO t3c VALUES ('A');")
 ...
 box.execute("INSERT INTO t3c VALUES ('a');")
 ---
-- error: 'Error during execution of VDBE byte-code: Duplicate key exists in unique
-    index ''pk_unnamed_T3C_1'' in space ''T3C'''
+- error: 'Failed to execute SQL statement: Duplicate key exists in unique index ''pk_unnamed_T3C_1''
+    in space ''T3C'''
 ...
 box.execute("SELECT * FROM t3c;")
 ---
@@ -806,8 +806,8 @@ box.execute("INSERT INTO t3d VALUES ('A');")
 ...
 box.execute("INSERT INTO t3d VALUES ('a');")
 ---
-- error: 'Error during execution of VDBE byte-code: Duplicate key exists in unique
-    index ''pk_unnamed_T3D_1'' in space ''T3D'''
+- error: 'Failed to execute SQL statement: Duplicate key exists in unique index ''pk_unnamed_T3D_1''
+    in space ''T3D'''
 ...
 box.execute("SELECT * FROM t3d;")
 ---
@@ -837,8 +837,8 @@ box.execute("INSERT INTO t3e VALUES ('a');")
 ...
 box.execute("INSERT INTO t3e VALUES ('A');")
 ---
-- error: 'Error during execution of VDBE byte-code: Duplicate key exists in unique
-    index ''pk_unnamed_T3E_1'' in space ''T3E'''
+- error: 'Failed to execute SQL statement: Duplicate key exists in unique index ''pk_unnamed_T3E_1''
+    in space ''T3E'''
 ...
 box.execute("SELECT * FROM t3e;")
 ---
@@ -901,8 +901,8 @@ box.execute("INSERT INTO t3f VALUES ('A');")
 ...
 box.execute("INSERT INTO t3f VALUES ('a');")
 ---
-- error: 'Error during execution of VDBE byte-code: Duplicate key exists in unique
-    index ''pk_unnamed_T3F_1'' in space ''T3F'''
+- error: 'Failed to execute SQL statement: Duplicate key exists in unique index ''pk_unnamed_T3F_1''
+    in space ''T3F'''
 ...
 box.execute("SELECT * FROM t3f;")
 ---
@@ -932,8 +932,8 @@ box.execute("INSERT INTO t3g VALUES ('a');")
 ...
 box.execute("INSERT INTO t3g VALUES ('A');")
 ---
-- error: 'Error during execution of VDBE byte-code: Duplicate key exists in unique
-    index ''pk_unnamed_T3G_1'' in space ''T3G'''
+- error: 'Failed to execute SQL statement: Duplicate key exists in unique index ''pk_unnamed_T3G_1''
+    in space ''T3G'''
 ...
 box.execute("SELECT * FROM t3g;")
 ---
diff --git a/test/sql/errinj.result b/test/sql/errinj.result
index 4b26560..63fa9d9 100644
--- a/test/sql/errinj.result
+++ b/test/sql/errinj.result
@@ -189,7 +189,7 @@ box.error.injection.set("ERRINJ_WAL_IO", true)
 ...
 box.execute("CREATE TRIGGER t1t INSERT ON t1 BEGIN INSERT INTO t2 VALUES (1, 1); END;")
 ---
-- error: 'Error during execution of VDBE byte-code: Failed to write to disk'
+- error: 'Failed to execute SQL statement: Failed to write to disk'
 ...
 box.execute("CREATE INDEX t1a ON t1(a);")
 ---
@@ -257,7 +257,7 @@ box.error.injection.set("ERRINJ_WAL_IO", true)
 ...
 box.execute("DROP TRIGGER t1t;")
 ---
-- error: 'Error during execution of VDBE byte-code: Failed to write to disk'
+- error: 'Failed to execute SQL statement: Failed to write to disk'
 ...
 box.error.injection.set("ERRINJ_WAL_IO", false)
 ---
@@ -334,7 +334,7 @@ errinj.set("ERRINJ_WAL_IO", false)
 ...
 box.execute("INSERT INTO t3 VALUES (1, 2, 2);")
 ---
-- error: 'Error during execution of VDBE byte-code: FOREIGN KEY constraint failed'
+- error: 'Failed to execute SQL statement: FOREIGN KEY constraint failed'
 ...
 errinj.set("ERRINJ_WAL_IO", true)
 ---
@@ -366,7 +366,7 @@ box.execute("ALTER TABLE t3 ADD CONSTRAINT fk1 FOREIGN KEY (b) REFERENCES t3;")
 ...
 box.execute("INSERT INTO t3 VALUES(1, 1, 3);")
 ---
-- error: 'Error during execution of VDBE byte-code: FOREIGN KEY constraint failed'
+- error: 'Failed to execute SQL statement: FOREIGN KEY constraint failed'
 ...
 errinj.set("ERRINJ_WAL_IO", true)
 ---
@@ -374,11 +374,11 @@ errinj.set("ERRINJ_WAL_IO", true)
 ...
 box.execute("ALTER TABLE t3 DROP CONSTRAINT fk1;")
 ---
-- error: 'Error during execution of VDBE byte-code: Failed to write to disk'
+- error: 'Failed to execute SQL statement: Failed to write to disk'
 ...
 box.execute("INSERT INTO t3 VALUES(1, 1, 3);")
 ---
-- error: 'Error during execution of VDBE byte-code: FOREIGN KEY constraint failed'
+- error: 'Failed to execute SQL statement: FOREIGN KEY constraint failed'
 ...
 errinj.set("ERRINJ_WAL_IO", false)
 ---
diff --git a/test/sql/foreign-keys.result b/test/sql/foreign-keys.result
index 293492e..f0ff70d 100644
--- a/test/sql/foreign-keys.result
+++ b/test/sql/foreign-keys.result
@@ -181,8 +181,8 @@ t = box.space._fk_constraint:insert(t)
 --
 box.execute("DROP INDEX i1 on t1;")
 ---
-- error: 'Error during execution of VDBE byte-code: Can''t modify space ''T1'': can
-    not drop a referenced index'
+- error: 'Failed to execute SQL statement: Can''t modify space ''T1'': can not drop
+    a referenced index'
 ...
 -- Referenced index can't be altered as well, if alter leads to
 -- rebuild of index (e.g. index still can be renamed).
diff --git a/test/sql/gh-2981-check-autoinc.result b/test/sql/gh-2981-check-autoinc.result
index 00bfe91..ee5ab4c 100644
--- a/test/sql/gh-2981-check-autoinc.result
+++ b/test/sql/gh-2981-check-autoinc.result
@@ -29,7 +29,7 @@ box.execute("insert into t1 values (18, null);")
 ...
 box.execute("insert into t1(s2) values (null);")
 ---
-- error: 'Error during execution of VDBE byte-code: CHECK constraint failed: T1'
+- error: 'Failed to execute SQL statement: CHECK constraint failed: T1'
 ...
 box.execute("insert into t2 values (18, null);")
 ---
@@ -37,7 +37,7 @@ box.execute("insert into t2 values (18, null);")
 ...
 box.execute("insert into t2(s2) values (null);")
 ---
-- error: 'Error during execution of VDBE byte-code: CHECK constraint failed: T2'
+- error: 'Failed to execute SQL statement: CHECK constraint failed: T2'
 ...
 box.execute("insert into t2 values (24, null);")
 ---
@@ -45,7 +45,7 @@ box.execute("insert into t2 values (24, null);")
 ...
 box.execute("insert into t2(s2) values (null);")
 ---
-- error: 'Error during execution of VDBE byte-code: CHECK constraint failed: T2'
+- error: 'Failed to execute SQL statement: CHECK constraint failed: T2'
 ...
 box.execute("insert into t3 values (9, null)")
 ---
@@ -53,7 +53,7 @@ box.execute("insert into t3 values (9, null)")
 ...
 box.execute("insert into t3(s2) values (null)")
 ---
-- error: 'Error during execution of VDBE byte-code: CHECK constraint failed: T3'
+- error: 'Failed to execute SQL statement: CHECK constraint failed: T3'
 ...
 box.execute("DROP TABLE t1")
 ---
diff --git a/test/sql/insert-unique.result b/test/sql/insert-unique.result
index a18f9ff..75354de 100644
--- a/test/sql/insert-unique.result
+++ b/test/sql/insert-unique.result
@@ -28,14 +28,14 @@ box.execute("INSERT INTO zoobar VALUES (111, 222, 'c3', 444)")
 -- PK must be unique
 box.execute("INSERT INTO zoobar VALUES (112, 222, 'c3', 444)")
 ---
-- error: 'Error during execution of VDBE byte-code: Duplicate key exists in unique
-    index ''pk_unnamed_ZOOBAR_1'' in space ''ZOOBAR'''
+- error: 'Failed to execute SQL statement: Duplicate key exists in unique index ''pk_unnamed_ZOOBAR_1''
+    in space ''ZOOBAR'''
 ...
 -- Unique index must be respected
 box.execute("INSERT INTO zoobar VALUES (111, 223, 'c3', 444)")
 ---
-- error: 'Error during execution of VDBE byte-code: Duplicate key exists in unique
-    index ''ZOOBAR2'' in space ''ZOOBAR'''
+- error: 'Failed to execute SQL statement: Duplicate key exists in unique index ''ZOOBAR2''
+    in space ''ZOOBAR'''
 ...
 -- Cleanup
 box.execute("DROP INDEX zoobar2 ON zoobar")
diff --git a/test/sql/persistency.result b/test/sql/persistency.result
index 9e5994b..8ba42cb 100644
--- a/test/sql/persistency.result
+++ b/test/sql/persistency.result
@@ -31,8 +31,8 @@ box.execute("INSERT INTO foobar VALUES (1000, 'foobar')")
 ...
 box.execute("INSERT INTO foobar VALUES (1, 'duplicate')")
 ---
-- error: 'Error during execution of VDBE byte-code: Duplicate key exists in unique
-    index ''pk_unnamed_FOOBAR_1'' in space ''FOOBAR'''
+- error: 'Failed to execute SQL statement: Duplicate key exists in unique index ''pk_unnamed_FOOBAR_1''
+    in space ''FOOBAR'''
 ...
 -- simple select
 box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar")
@@ -416,8 +416,8 @@ box.execute("SELECT \"name\", \"opts\" FROM \"_trigger\"")
 -- prove barfoo2 still exists
 box.execute("INSERT INTO barfoo VALUES ('xfoo', 1)")
 ---
-- error: 'Error during execution of VDBE byte-code: Duplicate key exists in unique
-    index ''pk_unnamed_BARFOO_1'' in space ''BARFOO'''
+- error: 'Failed to execute SQL statement: Duplicate key exists in unique index ''pk_unnamed_BARFOO_1''
+    in space ''BARFOO'''
 ...
 box.execute("SELECT * FROM barfoo")
 ---
diff --git a/test/sql/row-count.result b/test/sql/row-count.result
index fe48430..657f03a 100644
--- a/test/sql/row-count.result
+++ b/test/sql/row-count.result
@@ -272,8 +272,7 @@ box.execute("SELECT ROW_COUNT();")
 ...
 box.execute("COMMIT;")
 ---
-- error: 'Error during execution of VDBE byte-code: cannot commit - no transaction
-    is active'
+- error: 'Failed to execute SQL statement: cannot commit - no transaction is active'
 ...
 box.execute("SELECT ROW_COUNT();")
 ---
diff --git a/test/sql/savepoints.result b/test/sql/savepoints.result
index d378172..3cebc65 100644
--- a/test/sql/savepoints.result
+++ b/test/sql/savepoints.result
@@ -67,7 +67,7 @@ end;
 ...
 release_sv_fail();
 ---
-- error: 'Error during execution of VDBE byte-code: no such savepoint: T1'
+- error: 'Failed to execute SQL statement: no such savepoint: T1'
 ...
 box.commit();
 ---
diff --git a/test/sql/transition.result b/test/sql/transition.result
index b348730..19212c5 100644
--- a/test/sql/transition.result
+++ b/test/sql/transition.result
@@ -28,8 +28,8 @@ box.execute("INSERT INTO foobar VALUES (1000, 'foobar')")
 ...
 box.execute("INSERT INTO foobar VALUES (1, 'duplicate')")
 ---
-- error: 'Error during execution of VDBE byte-code: Duplicate key exists in unique
-    index ''pk_unnamed_FOOBAR_1'' in space ''FOOBAR'''
+- error: 'Failed to execute SQL statement: Duplicate key exists in unique index ''pk_unnamed_FOOBAR_1''
+    in space ''FOOBAR'''
 ...
 -- simple select
 box.execute("SELECT bar, foo, 42, 'awesome' FROM foobar")
@@ -312,8 +312,8 @@ box.execute("INSERT INTO barfoo VALUES ('foobar', 1000)")
 -- prove barfoo2 was created
 box.execute("INSERT INTO barfoo VALUES ('xfoo', 1)")
 ---
-- error: 'Error during execution of VDBE byte-code: Duplicate key exists in unique
-    index ''pk_unnamed_BARFOO_1'' in space ''BARFOO'''
+- error: 'Failed to execute SQL statement: Duplicate key exists in unique index ''pk_unnamed_BARFOO_1''
+    in space ''BARFOO'''
 ...
 box.execute("SELECT foo, bar FROM barfoo")
 ---
diff --git a/test/sql/transitive-transactions.result b/test/sql/transitive-transactions.result
index 82e0406..72b19d2 100644
--- a/test/sql/transitive-transactions.result
+++ b/test/sql/transitive-transactions.result
@@ -100,7 +100,7 @@ end;
 ...
 fk_defer();
 ---
-- error: 'Error during execution of VDBE byte-code: FOREIGN KEY constraint failed'
+- error: 'Failed to execute SQL statement: FOREIGN KEY constraint failed'
 ...
 box.space.CHILD:select();
 ---
diff --git a/test/sql/triggers.result b/test/sql/triggers.result
index 3f0f388..9ec932f 100644
--- a/test/sql/triggers.result
+++ b/test/sql/triggers.result
@@ -486,7 +486,7 @@ space_id = box.space.T1.id
 ...
 box.execute("CREATE TRIGGER tr1 AFTER INSERT ON t1 WHEN new.a = ? BEGIN SELECT 1; END;")
 ---
-- error: 'Error during execution of VDBE byte-code: bindings are not allowed in DDL'
+- error: 'Failed to execute SQL statement: bindings are not allowed in DDL'
 ...
 tuple = {"TR1", space_id, {sql = [[CREATE TRIGGER tr1 AFTER INSERT ON t1 WHEN new.a = ? BEGIN SELECT 1; END;]]}}
 ---



New patch:

commit 64bd59449df2a45be02670249a69e80cd87ef3b0
Author: Mergen Imeev <imeevma at gmail.com>
Date:   Sat Mar 16 14:15:22 2019 +0300

    sql: fix error code for SQL errors in execute.c
    
    Currently, functions sql_execute() and sql_prepare_and_execute()
    set the ER_SQL_EXECUTE code for all errors that occur during the
    execution of a SQL command. This is considered incorrect because
    some of these errors may have their own error code. After this
    patch, only errors without an error code will have the error code
    ER_SQL_EXECUTE.
    
    Part of #3505

diff --git a/src/box/execute.c b/src/box/execute.c
index 7c77df2..d45fb12 100644
--- a/src/box/execute.c
+++ b/src/box/execute.c
@@ -523,7 +523,12 @@ sql_execute(sql *db, struct sql_stmt *stmt, struct port *port,
 		assert(rc != SQL_ROW && rc != SQL_OK);
 	}
 	if (rc != SQL_DONE) {
-		diag_set(ClientError, ER_SQL_EXECUTE, sql_errmsg(db));
+		if (db->errCode != SQL_TARANTOOL_ERROR) {
+			const char *err = (char *)sql_value_text(db->pErr);
+			if (err == NULL)
+				err = sqlErrStr(db->errCode);
+			diag_set(ClientError, ER_SQL_EXECUTE, err);
+		}
 		return -1;
 	}
 	return 0;
@@ -541,7 +546,12 @@ sql_prepare_and_execute(const char *sql, int len, const struct sql_bind *bind,
 		return -1;
 	}
 	if (sql_prepare_v2(db, sql, len, &stmt, NULL) != SQL_OK) {
-		diag_set(ClientError, ER_SQL_EXECUTE, sql_errmsg(db));
+		if (db->errCode != SQL_TARANTOOL_ERROR) {
+			const char *err = (char *)sql_value_text(db->pErr);
+			if (err == NULL)
+				err = sqlErrStr(db->errCode);
+			diag_set(ClientError, ER_SQL_EXECUTE, err);
+		}
 		return -1;
 	}
 	assert(stmt != NULL);
diff --git a/test/sql/collation.result b/test/sql/collation.result
index 90a9f72..ac8cff2 100644
--- a/test/sql/collation.result
+++ b/test/sql/collation.result
@@ -102,7 +102,7 @@ cn = remote.connect(box.cfg.listen)
 ...
 cn:execute('select 1 limit ? collate not_exist', {1})
 ---
-- error: 'Failed to execute SQL statement: Syntax error near ''COLLATE'''
+- error: Syntax error near 'COLLATE'
 ...
 cn:close()
 ---
diff --git a/test/sql/gh-2362-select-access-rights.result b/test/sql/gh-2362-select-access-rights.result
index 0e5b9bf..8f1ecfa 100644
--- a/test/sql/gh-2362-select-access-rights.result
+++ b/test/sql/gh-2362-select-access-rights.result
@@ -46,8 +46,7 @@ c = nb.connect(box.cfg.listen)
 ...
 c:execute("SELECT * FROM t1;")
 ---
-- error: 'Failed to execute SQL statement: Read access to space ''T1'' is denied for
-    user ''guest'''
+- error: Read access to space 'T1' is denied for user 'guest'
 ...
 box.schema.user.grant('guest','read', 'space', 'T2')
 ---
@@ -57,8 +56,7 @@ c = nb.connect(box.cfg.listen)
 ...
 c:execute('SELECT * FROM t1, t2 WHERE t1.s1 = t2.s1')
 ---
-- error: 'Failed to execute SQL statement: Read access to space ''T1'' is denied for
-    user ''guest'''
+- error: Read access to space 'T1' is denied for user 'guest'
 ...
 box.sql.execute("CREATE VIEW v AS SELECT * FROM t1")
 ---
@@ -71,8 +69,7 @@ v = nb.connect(box.cfg.listen)
 ...
 c:execute('SELECT * FROM v')
 ---
-- error: 'Failed to execute SQL statement: Read access to space ''T1'' is denied for
-    user ''guest'''
+- error: Read access to space 'T1' is denied for user 'guest'
 ...
 box.sql.execute('CREATE TABLE t3 (s1 INT PRIMARY KEY, fk INT, FOREIGN KEY (fk) REFERENCES t1(s2))')
 ---
@@ -85,8 +82,7 @@ v = nb.connect(box.cfg.listen)
 ...
 c:execute('INSERT INTO t3 VALUES (1, 1)')
 ---
-- error: 'Failed to execute SQL statement: Read access to space ''T1'' is denied for
-    user ''guest'''
+- error: Read access to space 'T1' is denied for user 'guest'
 ...
 -- Cleanup
 box.schema.user.revoke('guest','read','space', 'V')
diff --git a/test/sql/iproto.result b/test/sql/iproto.result
index afddf05..33e845c 100644
--- a/test/sql/iproto.result
+++ b/test/sql/iproto.result
@@ -92,11 +92,11 @@ cn:execute('delete from test where a = 12')
 -- SQL errors.
 cn:execute('insert into not_existing_table values ("kek")')
 ---
-- error: 'Failed to execute SQL statement: Space ''NOT_EXISTING_TABLE'' does not exist'
+- error: Space 'NOT_EXISTING_TABLE' does not exist
 ...
 cn:execute('insert qwerty gjsdjq  q  qwd qmq;; q;qwd;')
 ---
-- error: 'Failed to execute SQL statement: Syntax error near ''qwerty'''
+- error: Syntax error near 'qwerty'
 ...
 -- Empty result.
 cn:execute('select id as identifier from test where a = 5;')
@@ -109,7 +109,7 @@ cn:execute('select id as identifier from test where a = 5;')
 -- netbox API errors.
 cn:execute(100)
 ---
-- error: 'Failed to execute SQL statement: Syntax error near ''100'''
+- error: Syntax error near '100'
 ...
 cn:execute('select 1', nil, {dry_run = true})
 ---
@@ -118,11 +118,11 @@ cn:execute('select 1', nil, {dry_run = true})
 -- Empty request.
 cn:execute('')
 ---
-- error: 'Failed to execute SQL statement: Failed to execute an empty SQL statement'
+- error: Failed to execute an empty SQL statement
 ...
 cn:execute('   ;')
 ---
-- error: 'Failed to execute SQL statement: Failed to execute an empty SQL statement'
+- error: Failed to execute an empty SQL statement
 ...
 --
 -- gh-3467: allow only positive integers under limit clause.
@@ -154,18 +154,15 @@ cn:execute('select * from test limit ?', {2})
 ...
 cn:execute('select * from test limit ?', {-2})
 ---
-- error: 'Failed to execute SQL statement: Only positive integers are allowed in the
-    LIMIT clause'
+- error: Only positive integers are allowed in the LIMIT clause
 ...
 cn:execute('select * from test limit ?', {2.7})
 ---
-- error: 'Failed to execute SQL statement: Only positive integers are allowed in the
-    LIMIT clause'
+- error: Only positive integers are allowed in the LIMIT clause
 ...
 cn:execute('select * from test limit ?', {'Hello'})
 ---
-- error: 'Failed to execute SQL statement: Only positive integers are allowed in the
-    LIMIT clause'
+- error: Only positive integers are allowed in the LIMIT clause
 ...
 cn:execute('select * from test limit 1 offset ?', {2})
 ---
@@ -181,18 +178,15 @@ cn:execute('select * from test limit 1 offset ?', {2})
 ...
 cn:execute('select * from test limit 1 offset ?', {-2})
 ---
-- error: 'Failed to execute SQL statement: Only positive integers are allowed in the
-    OFFSET clause'
+- error: Only positive integers are allowed in the OFFSET clause
 ...
 cn:execute('select * from test limit 1 offset ?', {2.7})
 ---
-- error: 'Failed to execute SQL statement: Only positive integers are allowed in the
-    OFFSET clause'
+- error: Only positive integers are allowed in the OFFSET clause
 ...
 cn:execute('select * from test limit 1 offset ?', {'Hello'})
 ---
-- error: 'Failed to execute SQL statement: Only positive integers are allowed in the
-    OFFSET clause'
+- error: Only positive integers are allowed in the OFFSET clause
 ...
 --
 -- Parameters binding.
@@ -363,7 +357,7 @@ sql = 'select '..string.rep('?, ', box.schema.SQL_BIND_PARAMETER_MAX)..'?'
 ...
 cn:execute(sql)
 ---
-- error: 'Failed to execute SQL statement: SQL bind parameter limit reached: 65000'
+- error: 'SQL bind parameter limit reached: 65000'
 ...
 -- Try too many parameter values.
 sql = 'select ?'
@@ -567,12 +561,11 @@ cn:execute('drop table if exists test3')
 --
 cn:execute('select ?1, ?2, ?3', {1, 2, 3})
 ---
-- error: 'Failed to execute SQL statement: Syntax error near ''?1'''
+- error: Syntax error near '?1'
 ...
 cn:execute('select $name, $name2', {1, 2})
 ---
-- error: 'Failed to execute SQL statement: Index of binding slots must start from
-    1'
+- error: Index of binding slots must start from 1
 ...
 parameters = {}
 ---





More information about the Tarantool-patches mailing list