Lines Matching refs:rc

78   int rc;  in sql_exec_changeset()  local
81 rc = sqlite3session_create(db, "main", &pSession); in sql_exec_changeset()
84 if( rc==SQLITE_OK ) rc = sqlite3session_attach(pSession, NULL); in sql_exec_changeset()
87 if( rc==SQLITE_OK ) rc = sqlite3_exec(db, zSql, 0, 0, 0); in sql_exec_changeset()
90 if( rc==SQLITE_OK ){ in sql_exec_changeset()
91 rc = sqlite3session_changeset(pSession, pnChangeset, ppChangeset); in sql_exec_changeset()
97 return rc; in sql_exec_changeset()
114 int rc; in test_sql_exec_changeset() local
123 rc = sql_exec_changeset(db, zSql, &nChangeset, &pChangeset); in test_sql_exec_changeset()
124 if( rc!=SQLITE_OK ){ in test_sql_exec_changeset()
157 static int test_session_error(Tcl_Interp *interp, int rc, char *zErr){ in test_session_error() argument
159 Tcl_SetObjResult(interp, Tcl_NewStringObj(sqlite3ErrName(rc), -1)); in test_session_error()
170 int rc; in test_table_filter() local
175 rc = Tcl_ListObjAppendElement(p->interp, pEval, Tcl_NewStringObj(zTbl, -1)); in test_table_filter()
176 if( rc==TCL_OK ){ in test_table_filter()
177 rc = Tcl_EvalObjEx(p->interp, pEval, TCL_EVAL_GLOBAL); in test_table_filter()
179 if( rc==TCL_OK ){ in test_table_filter()
180 rc = Tcl_GetBooleanFromObj(p->interp, Tcl_GetObjResult(p->interp), &bRes); in test_table_filter()
182 if( rc!=TCL_OK ){ in test_table_filter()
254 int rc; in test_session_cmd() local
260 rc = Tcl_GetIndexFromObjStruct(interp, in test_session_cmd()
263 if( rc!=TCL_OK ) return rc; in test_session_cmd()
273 rc = sqlite3session_attach(pSession, zArg); in test_session_cmd()
274 if( rc!=SQLITE_OK ){ in test_session_cmd()
275 return test_session_error(interp, rc, 0); in test_session_cmd()
286 rc = sqlite3session_patchset_strm(pSession, testStreamOutput, pCtx); in test_session_cmd()
288 rc = sqlite3session_changeset_strm(pSession, testStreamOutput, pCtx); in test_session_cmd()
292 rc = sqlite3session_patchset(pSession, &o.n, &o.p); in test_session_cmd()
294 rc = sqlite3session_changeset(pSession, &o.n, &o.p); in test_session_cmd()
297 if( rc==SQLITE_OK ){ in test_session_cmd()
301 if( rc!=SQLITE_OK ){ in test_session_cmd()
302 return test_session_error(interp, rc, 0); in test_session_cmd()
345 rc = sqlite3session_diff(pSession, in test_session_cmd()
350 assert( rc!=SQLITE_OK || zErr==0 ); in test_session_cmd()
351 if( rc ){ in test_session_cmd()
352 return test_session_error(interp, rc, zErr); in test_session_cmd()
369 int rc; in test_session_cmd() local
374 rc = sqlite3session_object_config( in test_session_cmd()
377 if( rc!=SQLITE_OK ){ in test_session_cmd()
379 Tcl_SetObjResult(interp, Tcl_NewStringObj(sqlite3ErrName(rc), -1)); in test_session_cmd()
408 int rc; /* sqlite3session_create() return code */ in test_sqlite3session() local
425 rc = sqlite3session_create(db, Tcl_GetString(objv[3]), &p->pSession); in test_sqlite3session()
426 if( rc!=SQLITE_OK ){ in test_sqlite3session()
428 return test_session_error(interp, rc, 0); in test_sqlite3session()
608 int rc; in test_conflict_handler() local
610 rc = sqlite3changeset_conflict(pIter, i, &pVal); in test_conflict_handler()
611 assert( rc==SQLITE_OK ); in test_conflict_handler()
624 int rc = sqlite3changeset_conflict(pIter, 0, &pVal); in test_conflict_handler() local
625 assert( rc==SQLITE_MISUSE ); in test_conflict_handler()
628 int rc = sqlite3changeset_conflict(pIter, -1, &pVal); in test_conflict_handler() local
629 assert( rc==SQLITE_RANGE ); in test_conflict_handler()
630 rc = sqlite3changeset_conflict(pIter, nCol, &pVal); in test_conflict_handler()
631 assert( rc==SQLITE_RANGE ); in test_conflict_handler()
635 int rc = sqlite3changeset_new(pIter, 0, &pVal); in test_conflict_handler() local
636 assert( rc==SQLITE_MISUSE ); in test_conflict_handler()
639 int rc = sqlite3changeset_new(pIter, -1, &pVal); in test_conflict_handler() local
640 assert( rc==SQLITE_RANGE ); in test_conflict_handler()
641 rc = sqlite3changeset_new(pIter, nCol, &pVal); in test_conflict_handler()
642 assert( rc==SQLITE_RANGE ); in test_conflict_handler()
646 int rc = sqlite3changeset_old(pIter, 0, &pVal); in test_conflict_handler() local
647 assert( rc==SQLITE_MISUSE ); in test_conflict_handler()
650 int rc = sqlite3changeset_old(pIter, -1, &pVal); in test_conflict_handler() local
651 assert( rc==SQLITE_RANGE ); in test_conflict_handler()
652 rc = sqlite3changeset_old(pIter, nCol, &pVal); in test_conflict_handler()
653 assert( rc==SQLITE_RANGE ); in test_conflict_handler()
659 int rc = sqlite3changeset_fk_conflicts(pIter, &nDummy); in test_conflict_handler() local
660 assert( rc==SQLITE_MISUSE ); in test_conflict_handler()
770 int rc; /* Return code from changeset_invert() */ in testSqlite3changesetApply() local
827 rc = sqlite3changeset_apply(db, nChangeset, pChangeset, in testSqlite3changesetApply()
831 rc = sqlite3changeset_apply_v2(db, nChangeset, pChangeset, in testSqlite3changesetApply()
840 rc = sqlite3changeset_apply_strm(db, testStreamInput, (void*)&sStr, in testSqlite3changesetApply()
845 rc = sqlite3changeset_apply_v2_strm(db, testStreamInput, (void*)&sStr, in testSqlite3changesetApply()
853 if( rc!=SQLITE_OK ){ in testSqlite3changesetApply()
854 return test_session_error(interp, rc, 0); in testSqlite3changesetApply()
899 int rc; /* Return code from changeset_invert() */ in test_sqlite3changeset_apply_replace_all() local
914 rc = sqlite3changeset_apply(db, nChangeset, pChangeset, 0, replace_handler,0); in test_sqlite3changeset_apply_replace_all()
915 if( rc!=SQLITE_OK ){ in test_sqlite3changeset_apply_replace_all()
916 return test_session_error(interp, rc, 0); in test_sqlite3changeset_apply_replace_all()
932 int rc; /* Return code from changeset_invert() */ in test_sqlite3changeset_invert() local
947 rc = sqlite3changeset_invert_strm( in test_sqlite3changeset_invert()
951 rc = sqlite3changeset_invert(sIn.nData, sIn.aData, &sOut.n, &sOut.p); in test_sqlite3changeset_invert()
953 if( rc!=SQLITE_OK ){ in test_sqlite3changeset_invert()
954 rc = test_session_error(interp, rc, 0); in test_sqlite3changeset_invert()
959 return rc; in test_sqlite3changeset_invert()
971 int rc; /* Return code from changeset_invert() */ in test_sqlite3changeset_concat() local
990 rc = sqlite3changeset_concat_strm( in test_sqlite3changeset_concat()
996 rc = sqlite3changeset_concat( in test_sqlite3changeset_concat()
1001 if( rc!=SQLITE_OK ){ in test_sqlite3changeset_concat()
1002 rc = test_session_error(interp, rc, 0); in test_sqlite3changeset_concat()
1007 return rc; in test_sqlite3changeset_concat()
1022 int rc; in test_sqlite3session_foreach() local
1062 rc = sqlite3changeset_start_v2(&pIter, nChangeset, pChangeset, f); in test_sqlite3session_foreach()
1067 rc = sqlite3changeset_start_v2_strm(&pIter, testStreamInput, pCtx, f); in test_sqlite3session_foreach()
1071 rc = sqlite3changeset_start(&pIter, nChangeset, pChangeset); in test_sqlite3session_foreach()
1075 rc = sqlite3changeset_start_strm(&pIter, testStreamInput, (void*)&sStr); in test_sqlite3session_foreach()
1078 if( rc!=SQLITE_OK ){ in test_sqlite3session_foreach()
1079 return test_session_error(interp, rc, 0); in test_sqlite3session_foreach()
1145 rc = Tcl_EvalObjEx(interp, pScript, 0); in test_sqlite3session_foreach()
1146 if( rc!=TCL_OK && rc!=TCL_CONTINUE ){ in test_sqlite3session_foreach()
1148 return rc==TCL_BREAK ? TCL_OK : rc; in test_sqlite3session_foreach()
1154 rc = sqlite3changeset_finalize(pIter); in test_sqlite3session_foreach()
1155 assert( (rc2==SQLITE_DONE && rc==SQLITE_OK) || rc2==rc ); in test_sqlite3session_foreach()
1157 rc = sqlite3changeset_finalize(pIter); in test_sqlite3session_foreach()
1159 if( rc!=SQLITE_OK ){ in test_sqlite3session_foreach()
1160 return test_session_error(interp, rc, 0); in test_sqlite3session_foreach()
1191 int rc; in test_rebaser_cmd() local
1197 rc = Tcl_GetIndexFromObjStruct(interp, in test_rebaser_cmd()
1200 if( rc!=TCL_OK ) return rc; in test_rebaser_cmd()
1207 assert( rc==SQLITE_OK ); in test_rebaser_cmd()
1212 rc = sqlite3rebaser_configure(p, nRebase, pRebase); in test_rebaser_cmd()
1230 rc = sqlite3rebaser_rebase_strm(p, in test_rebaser_cmd()
1235 rc = sqlite3rebaser_rebase(p, sStr.nData, sStr.aData, &sOut.n, &sOut.p); in test_rebaser_cmd()
1238 if( rc==SQLITE_OK ){ in test_rebaser_cmd()
1246 if( rc!=SQLITE_OK ){ in test_rebaser_cmd()
1247 return test_session_error(interp, rc, 0); in test_rebaser_cmd()
1266 int rc; in test_sqlite3rebaser_create() local
1273 rc = sqlite3rebaser_create(&pNew); in test_sqlite3rebaser_create()
1274 if( rc!=SQLITE_OK ){ in test_sqlite3rebaser_create()
1275 return test_session_error(interp, rc, 0); in test_sqlite3rebaser_create()
1302 int rc; in test_sqlite3session_config() local
1310 rc = Tcl_GetIndexFromObjStruct(interp, in test_sqlite3session_config()
1313 if( rc!=TCL_OK ) return rc; in test_sqlite3session_config()
1316 rc = sqlite3session_config(aSub[iSub].op, (void*)&iVal); in test_sqlite3session_config()
1317 if( rc!=SQLITE_OK ){ in test_sqlite3session_config()
1318 return test_session_error(interp, rc, 0); in test_sqlite3session_config()