In subversion/libsvn_wc/wc_db.c the function follow_moved_to() has an int working_op_depth.
It gets initialized by running a db query and if there is a row result it's set with: working_op_depth = svn_sqlite__column_text(stmt, 1, result_pool); Later on it's used in a couple of places including some loop control. However, there seems to be no error handling if there is no resulting row. I'd fix it myself but I'm not familiar enough with the code to know what sort of error should be thrown here.