Hello.
Thanks for review.
> Thanks.
>
> After quick review i want to point to a trivial bug in
> NBackup::backup_database()
>
> short null_flag = 0;
> - in_sqlda->sqlvar[0].sqldata = (char*) &level;
> - in_sqlda->sqlvar[0].sqlind = &null_flag;
> + if (level >= 0)
> + {
> + in_sqlda->sqlvar[0].sqldata = (char*) &level;
> + in_sqlda->sqlvar[0].sqlind = &null_flag;
> + }
> + else
> + {
> + short null_ind = -1;
> + in_sqlda->sqlvar[0].sqldata = NULL;
> + in_sqlda->sqlvar[0].sqlind = &null_ind;
> + }
>
> Here you use local variable "null_ind" after is goes out of scope. BTW,
> i see
> no need to new variable "null_ind" as there is already "null_flag" - all you
> need
> is to assign -1 to it in "else" branch. So, this part of patch could be like
> below :
>
> short null_flag = 0;
> - in_sqlda->sqlvar[0].sqldata = (char*) &level;
> in_sqlda->sqlvar[0].sqlind = &null_flag;
> + if (level >= 0)
> + {
> + in_sqlda->sqlvar[0].sqldata = (char*) &level;
> + }
> + else
> + {
> + null_flag = -1;
> + in_sqlda->sqlvar[0].sqldata = NULL;
> + }
>
I'll fix it in our code. New variable is needed because null_flag used
later in the same query and it must be zero there, i.e.
in_sqlda->sqlvar[1].sqldata = temp;
in_sqlda->sqlvar[1].sqlind = &null_flag;
> Also, i wonder - why do you use "first 1" in this query ?
>
> select first 1 rdb$guid, rdb$scn from rdb$backup_history
> where rdb$guid = '%s
Yes, it's not needed here.
>
> And, at last, i guess it requires index on rdb$backup_history.rdb$guid.
>
>
> Regards,
> Vlad
>
Dmitry
------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel