[db] Fix an undefined variable