diff --git a/db/osqlcomm.c b/db/osqlcomm.c index b3e9550178..abc4ae1f13 100644 --- a/db/osqlcomm.c +++ b/db/osqlcomm.c @@ -7547,8 +7547,9 @@ int osql_process_packet(struct ireq *iq, uuid_t uuid, void *trans, char **pmsg, if (rc != 0) { if (rc != RC_INTERNAL_RETRY) { - errstat_cat_strf(&iq->errstat, - " unable to update record rc = %d", rc); + errstat_cat_strf(&iq->errstat," unable to update record"); + logmsg(LOGMSG_ERROR, "%s:%d Failed to update record. Internal error code is %d\n", + __func__, __LINE__, rc); } if (gbl_enable_osql_logging) logmsg(LOGMSG_DEBUG, diff --git a/db/sqlglue.c b/db/sqlglue.c index d4fcde2268..db1899edf8 100644 --- a/db/sqlglue.c +++ b/db/sqlglue.c @@ -5243,7 +5243,7 @@ int sqlite3BtreeCommit(Btree *pBt) if (clnt->early_retry == EARLY_ERR_VERIFY) { clnt->osql.xerr.errval = ERR_BLOCK_FAILED + ERR_VERIFY; errstat_cat_str(&(clnt->osql.xerr), - "unable to update record rc = 4"); + "unable to update record"); } else if (clnt->early_retry == EARLY_ERR_SELECTV) { clnt->osql.xerr.errval = ERR_CONSTR; errstat_cat_str(&(clnt->osql.xerr), diff --git a/db/sqlinterfaces.c b/db/sqlinterfaces.c index d5bf135ea2..7e8b74b361 100644 --- a/db/sqlinterfaces.c +++ b/db/sqlinterfaces.c @@ -2182,7 +2182,7 @@ static int do_commitrollback(struct sqlthdstate *thd, struct sqlclntstate *clnt, if (clnt->early_retry == EARLY_ERR_VERIFY) { clnt->osql.xerr.errval = ERR_BLOCK_FAILED + ERR_VERIFY; errstat_cat_str(&(clnt->osql.xerr), - "unable to update record rc = 4"); + "unable to update record"); } else if (clnt->early_retry == EARLY_ERR_SELECTV) { clnt->osql.xerr.errval = ERR_CONSTR; errstat_cat_str(&(clnt->osql.xerr), diff --git a/db/sqloffload.c b/db/sqloffload.c index b310c2f9f3..acfb95d090 100644 --- a/db/sqloffload.c +++ b/db/sqloffload.c @@ -248,7 +248,7 @@ static int rese_commit(struct sqlclntstate *clnt, struct sql_thread *thd, } else { clnt->osql.xerr.errval = ERR_BLOCK_FAILED + ERR_VERIFY; errstat_cat_str(&(clnt->osql.xerr), - "unable to update record rc = 4"); + "unable to update record"); } rc = SQLITE_ABORT; } else if (clnt->early_retry == EARLY_ERR_SELECTV) { diff --git a/tests/ddl_no_csc2.test/t09_check.expected b/tests/ddl_no_csc2.test/t09_check.expected index 9528074044..839d81ea89 100644 --- a/tests/ddl_no_csc2.test/t09_check.expected +++ b/tests/ddl_no_csc2.test/t09_check.expected @@ -44,7 +44,7 @@ constraints [CREATE TABLE t1(i INT, CHECK (i > (SELECT MAX(i))))] failed with rc 240 malformed database schema (t1) - subqueries prohibited in CHECK constraints (test='4. Test for updates') (rows inserted=1) -[UPDATE t1 SET i = 10 WHERE i = 1] failed with rc 403 CHECK constraint violation CHECK constraint failed for '$CONSTRAINT_3DCCE6D2' unable to update record rc = 320 +[UPDATE t1 SET i = 10 WHERE i = 1] failed with rc 403 CHECK constraint violation CHECK constraint failed for '$CONSTRAINT_3DCCE6D2' unable to update record (i=1) (test='5. Test for some obscure expressions') [INSERT INTO t1 VALUES(1)] failed with rc 403 CHECK constraint violation CHECK constraint failed for '$CONSTRAINT_50FF6780' unable to add record rc = 320 diff --git a/tests/dupewrite.test/t02.req.out b/tests/dupewrite.test/t02.req.out index 23973f5a2f..4d1ae83d82 100644 --- a/tests/dupewrite.test/t02.req.out +++ b/tests/dupewrite.test/t02.req.out @@ -14,7 +14,7 @@ [EXEC PROCEDURE test_dupe_insert_3()] failed with rc -3 [n = q:fetch()...]:7: statement must be read-only [EXEC PROCEDURE test_dupe_update_2()] failed with rc -3 [db:exec(sql):emit()...]:3: statement must be read-only [EXEC PROCEDURE test_dupe_update_3()] failed with rc -3 [n = q:fetch()...]:7: statement must be read-only -[EXEC PROCEDURE test_dupe_update_4()] failed with rc -8 find old record failed unable to update record rc = 4 +[EXEC PROCEDURE test_dupe_update_4()] failed with rc -8 find old record failed unable to update record [EXEC PROCEDURE test_dupe_delete_2()] failed with rc -3 [db:exec(sql):emit()...]:3: statement must be read-only [EXEC PROCEDURE test_dupe_delete_3()] failed with rc -3 [n = q:fetch()...]:7: statement must be read-only [EXEC PROCEDURE test_dupe_delete_4()] failed with rc -8 Table 'dupe4' find old record failed unable to delete genid =XXXXXX rc=4 diff --git a/tests/sc_addfield.test/runit b/tests/sc_addfield.test/runit index 6c32572c1b..20f1c7b93b 100755 --- a/tests/sc_addfield.test/runit +++ b/tests/sc_addfield.test/runit @@ -100,7 +100,7 @@ do_verify t1 function do_alter_and_update (){ #updates fail (deadlock?): -#[update t1 set c=c+10000 where 1] failed with rc 304 unable to update record rc = 199 +#[update t1 set c=c+10000 where 1] failed with rc 304 unable to update record cdb2sql ${CDB2_OPTIONS} $dbnm default "alter table t1 { `cat t1_1.csc2 ` }" assertcnt t1 3000 do_verify t1 diff --git a/tests/serialstep.test/s14_01.req.exp.alt2 b/tests/serialstep.test/s14_01.req.exp.alt2 index 71f4e32a64..c236f61bc8 100644 --- a/tests/serialstep.test/s14_01.req.exp.alt2 +++ b/tests/serialstep.test/s14_01.req.exp.alt2 @@ -5,5 +5,5 @@ done done (rows updated=1) done -[commit] failed with rc 2 find old record failed unable to update record rc = 4 +[commit] failed with rc 2 find old record failed unable to update record done diff --git a/tests/serialstep.test/s2_01.req.exp.alt2 b/tests/serialstep.test/s2_01.req.exp.alt2 index 9edc08b70c..4f79364810 100644 --- a/tests/serialstep.test/s2_01.req.exp.alt2 +++ b/tests/serialstep.test/s2_01.req.exp.alt2 @@ -35,7 +35,7 @@ done (id=99, name='ytu', age=8, address=NULL, state='DB', zip=NULL) done done -[commit] failed with rc 2 find old record failed unable to update record rc = 4 +[commit] failed with rc 2 find old record failed unable to update record done done done diff --git a/tests/tools/linearizable/jepsen/src/comdb2/core.clj b/tests/tools/linearizable/jepsen/src/comdb2/core.clj index ec4e7d2250..d29ae9c969 100644 --- a/tests/tools/linearizable/jepsen/src/comdb2/core.clj +++ b/tests/tools/linearizable/jepsen/src/comdb2/core.clj @@ -186,7 +186,7 @@ "Given an error string, identifies whether the error is safely retriable." [e] (or (re-find #"not serializable" e) - (re-find #"unable to update record rc = 4" e) + (re-find #"unable to update record" e) (re-find #"selectv constraints" e) (re-find #"Maximum number of retries done." e))) diff --git a/tests/upsert.test/t00_upsert.expected b/tests/upsert.test/t00_upsert.expected index 11198e42de..4b67ff16a0 100644 --- a/tests/upsert.test/t00_upsert.expected +++ b/tests/upsert.test/t00_upsert.expected @@ -133,7 +133,7 @@ [INSERT INTO t1 VALUES(11)] failed with rc 299 add key constraint duplicate key '$KEY_877B2989' on table 't1' index 0 (rows inserted=1) (i=11) -[INSERT INTO t1 VALUES(11) ON CONFLICT(i) DO UPDATE SET i = 1] failed with rc 403 CHECK constraint violation CHECK constraint failed for '$CONSTRAINT_A91B9811' unable to update record rc = 320 +[INSERT INTO t1 VALUES(11) ON CONFLICT(i) DO UPDATE SET i = 1] failed with rc 403 CHECK constraint violation CHECK constraint failed for '$CONSTRAINT_A91B9811' unable to update record (i=11) (rows inserted=0) (i=12) diff --git a/tests/verify_error.test/t2_01.req.exp b/tests/verify_error.test/t2_01.req.exp index d54702b86d..037ec1b7b6 100644 --- a/tests/verify_error.test/t2_01.req.exp +++ b/tests/verify_error.test/t2_01.req.exp @@ -30,7 +30,7 @@ done 1 [truncate test2] done 1 [commit] -[commit] failed with rc 2 find old record failed unable to update record rc = 4 +[commit] failed with rc 2 find old record failed unable to update record done 1 [select * from test1] (i=1, j=4) @@ -51,7 +51,7 @@ done (rows updated=1) done 1 [commit] -[commit] failed with rc 2 find old record failed unable to update record rc = 4 +[commit] failed with rc 2 find old record failed unable to update record done 1 [select * from test1] (i=1, j=4) diff --git a/tests/yast.test/check.test b/tests/yast.test/check.test index 0d51918aa6..656cfde7f6 100644 --- a/tests/yast.test/check.test +++ b/tests/yast.test/check.test @@ -85,7 +85,7 @@ do_test check-1.12 { catchsql { UPDATE t1 SET x=7 WHERE x==2 } -} {1 {CHECK constraint violation CHECK constraint failed for '$CONSTRAINT_3BE1A9E5' unable to update record rc = 320}} +} {1 {CHECK constraint violation CHECK constraint failed for '$CONSTRAINT_3BE1A9E5' unable to update record}} do_test check-1.13 { execsql { SELECT * FROM t1; @@ -95,7 +95,7 @@ do_test check-1.14 { catchsql { UPDATE t1 SET x=5 WHERE x==2 } -} {1 {CHECK constraint violation CHECK constraint failed for '$CONSTRAINT_3BE1A9E5' unable to update record rc = 320}} +} {1 {CHECK constraint violation CHECK constraint failed for '$CONSTRAINT_3BE1A9E5' unable to update record}} do_test check-1.15 { execsql { SELECT * FROM t1; @@ -271,7 +271,7 @@ do_test check-4.6 { catchsql { UPDATE t4 SET x=0, y=1; } -} {1 {CHECK constraint violation CHECK constraint failed for '$CONSTRAINT_4026B7C3' unable to update record rc = 320}} +} {1 {CHECK constraint violation CHECK constraint failed for '$CONSTRAINT_4026B7C3' unable to update record}} do_test check-4.7 { execsql { SELECT * FROM t4; @@ -294,7 +294,7 @@ do_test check-4.9 { catchsql { UPDATE t4 SET x=0, y=2; } -} {1 {CHECK constraint violation CHECK constraint failed for '$CONSTRAINT_4026B7C3' unable to update record rc = 320}} +} {1 {CHECK constraint violation CHECK constraint failed for '$CONSTRAINT_4026B7C3' unable to update record}} ifcapable vacuum { do_test check_4.10 { catchsql {