Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/sqlite/blob/master/test/c/changeblob1.c # sqlite [Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `sqlite / test / c / changeblob1.c` 35 lines ยท 814 bytes Raw Blame History 1 2 #include 3 #include 4 #include 5 #include "sqlite3.h" 6 7 int main(void){ 8 #ifdef SQLITE_ENABLE_SESSION 9 sqlite3 *db; 10 sqlite3_changegroup *pGrp; 11 char *zErr = 0; 12 char *buf = malloc(64); 13 int rc = SQLITE_OK; 14 15 sqlite3_open(":memory:", &db); 16 sqlite3_exec(db, "CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT);", 0, 0, 0); 17 18 sqlite3changegroup_new(&pGrp); 19 sqlite3changegroup_schema(pGrp, db, "main"); 20 sqlite3changegroup_change_begin(pGrp, SQLITE_INSERT, "t1", 0, &zErr); 21 sqlite3changegroup_change_int64(pGrp, 1, 0, 42); 22 23 memset(buf, 'X', 64); 24 25 /* This should return an OOM error: */ 26 rc = sqlite3changegroup_change_blob(pGrp, 1, 1, buf, `2147483647`); 27 28 free(buf); 29 sqlite3changegroup_delete(pGrp); 30 sqlite3_close(db); 31 return (rc==7) ? 0 : -1; 32 #else 33 return 0; 34 #endif 35 }