| 474 | |
| 475 | typedef struct { const char *denied_table; bool restore; unsigned denials; } gd_auth_t; |
| 476 | static int gd_authorizer(void *opaque,int op,const char *a,const char *b,const char *db,const char *trigger) { |
| 477 | gd_auth_t *c=opaque;(void)db;(void)trigger; |
| 478 | if(op==SQLITE_READ && a && c->denied_table && |
| 479 | (strcmp(a,c->denied_table)==0 || (strcmp(c->denied_table,"@schema")==0 && |
| 480 | (strcmp(a,"sqlite_master")==0 || strcmp(a,"sqlite_schema")==0)))) { |
| 481 | c->denials++;return SQLITE_DENY; |
| 482 | } |
| 483 | if(c->restore && op==SQLITE_PRAGMA && a && b && strcmp(a,"query_only")==0)return SQLITE_DENY; |
| 484 | return SQLITE_OK; |
| 485 | } |
| 486 | TEST(store_graph_digest_sql_errors_cleanup_no_mutation_and_close_discard) { |
| 487 | for(int phase=0;phase<2;phase++) { |
| 488 | cbm_store_t *s=gd_fixture(false,false);sqlite3 *db=s?cbm_store_get_db(s):NULL; |
nothing calls this directly
no outgoing calls
no test coverage detected