| 3906 | } |
| 3907 | |
| 3908 | static 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 | |
| 3932 | static int recover_ddlk_sp(struct sqlclntstate *clnt) |
| 3933 | { |
no test coverage detected