Hi
Ingo Strüwing wrote:
> 2) This is a valid way to inject an error into the code. It is the right
> way to test the error branch, if there is no better way to do that.
> However, on our last meeting, we agreed that we will always try hard to
> find a way to produce an error without error injection first.
>
> In this case it means to find a way to let obs::check_user_access()
> return TRUE when called from Backup_info::add_db(). I can imagine that
> might not be possible since we have privilege elevation in backup.
> Please ask Chuck, if he knows of a way to let obs::check_user_access()
> fail in BACKUP. If yes, it would be preferable to do that and not
> pollute the code with error injection. If it is not possible, then error
> injection is ok to use in the way you did.
>
I think that currently the only situation where obs::check_user_access()
reports error is when internally get_num_dbs() or get_num_objects() hits
error which can happen only when there is error while executing SELECTS on
I_S tables. I don't see an easy way to trigger errors in such selects.
Rafal