MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / find_and_lock_queue_table

Function find_and_lock_queue_table

lua/sp.c:3908–3930  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3906}
3907
3908static struct dbtable *find_and_lock_queue_table(Lua L)
3909{
3910 if (tryrdlock_schema_lk() != 0) {
3911 luaL_error(L, sqlite3ErrStr(SQLITE_SCHEMA));
3912 return NULL;
3913 }
3914 SP sp = getsp(L);
3915 Q4SP(qname, sp->spname);
3916 int rc;
3917 struct dbtable *db = getqueuebyname(qname);
3918 if (db) {
3919 rc = bdb_lock_table_read_fromlid(db->handle, bdb_get_lid_from_cursortran(sp->clnt->dbtran.cursor_tran));
3920 }
3921 unlock_schema_lk();
3922 if (!db) {
3923 luaL_error(L, "%s not found for sp:%s", sp->consumer->type, sp->spname);
3924 return NULL;
3925 } else if (rc) {
3926 luaL_error(L, "read-lock failed for %s:%s\n", sp->consumer->type, sp->spname);
3927 return NULL;
3928 }
3929 return db;
3930}
3931
3932static int recover_ddlk_sp(struct sqlclntstate *clnt)
3933{

Callers 2

recover_ddlk_spFunction · 0.85

Calls 5

luaL_errorFunction · 0.85
sqlite3ErrStrFunction · 0.85
getqueuebynameFunction · 0.85

Tested by

no test coverage detected