There are two major data structures we need to know. One is lock_t, another one is trx_t.

    The main structure of lock_t is as follow:

    As we can see, lock_t->trx will point to the corresponding transaciton. On the other hand, trx_t->rec_pool/table_pool will point back to the lock information.

    Real Lif Examples

    Here is an live example of a lock from debugger LR 3

    We then check the corresponding transaction information.

    We can see this transaciton have 1 rec lock (rec_cached) and 6 table locks (table_cached). The detail informaiton of record locks can be foudn in rec_pool and table locks information can be then found in table_pool. From dict_operation, we can see we are dropping table. We need to lock a bunch of system catalog tables. By using information from table_pool, we can find the corresponding system tables are: SYS_TABLES, SYS_COLUMNS, SYS_INDEXES, SYS_FIELDS, SYS_FIELDS, SYS_TABLESPACES, SYS_DATAFILES. By checking the informaiton from rec_pool, we can find the space id is 0, page number is 11.
    rec_lock = {space = 0, page_no = 11, n_bits = 256}}

    We can actually read even more from it. But that will be covered next time. :-)