import sqlite3


def get_tasklockinfo(db, lockid):
    """Get task lock information"""

    ori_row_factory = db.row_factory
    db.row_factory = sqlite3.Row
    r = db.execute("""SELECT lockid, locked, current_taskid, desc, update_time 
                      FROM tasklock WHERE lockid = ? LIMIT 1""", 
                   (lockid, )).fetchone()
    db.row_factory = ori_row_factory
    return r