can we use different function in place of atoi in vacuumdb.c file
Hi all,
While reviewing one patch, I found that if we give any non-integer string
to atoi (say aa), then it is returning zero(0) as output so we are not
giving any error(assuming 0 as valid argument) and continuing our
operations.
Ex:
Let say, we gave "-P aa" (patch is in review[1]/messages/by-id/CA+fd4k6DgwtQSr4=UeY+WbGuF7-oD=m-ypHPy+sYHiXZc+hTUQ@mail.gmail.com -- Thanks and Regards Mahendra Singh Thalor EnterpriseDB: http://www.enterprisedb.com), then it will disable
parallel vacuum because atoi is returning zero as parallel degree but
ideally it should give error or at least it should not disable parallel
vacuum.
I think, in-place of atoi, we should use different function ( defGetInt32,
strtoint) or we can write own function.
Thoughts?
[1]: /messages/by-id/CA+fd4k6DgwtQSr4=UeY+WbGuF7-oD=m-ypHPy+sYHiXZc+hTUQ@mail.gmail.com -- Thanks and Regards Mahendra Singh Thalor EnterpriseDB: http://www.enterprisedb.com
/messages/by-id/CA+fd4k6DgwtQSr4=UeY+WbGuF7-oD=m-ypHPy+sYHiXZc+hTUQ@mail.gmail.com
--
Thanks and Regards
Mahendra Singh Thalor
EnterpriseDB: http://www.enterprisedb.com
Hi,
On Thu, Jan 23, 2020 at 3:56 PM Mahendra Singh Thalor <mahi6run@gmail.com>
wrote:
Hi all,
While reviewing one patch, I found that if we give any non-integer string
to atoi (say aa), then it is returning zero(0) as output so we are not
giving any error(assuming 0 as valid argument) and continuing our
operations.Ex:
Let say, we gave "-P aa" (patch is in review[1]), then it will disable
parallel vacuum because atoi is returning zero as parallel degree but
ideally it should give error or at least it should not disable parallel
vacuum.I think, in-place of atoi, we should use different function ( defGetInt32,
strtoint) or we can write own function.Thoughts?
[1]:
/messages/by-id/CA+fd4k6DgwtQSr4=UeY+WbGuF7-oD=m-ypHPy+sYHiXZc+hTUQ@mail.gmail.com
--
For server side there are also scanint8 function for string parsing and for
Clint side we can use strtoint function that didn't have the above issue
and it accept char pointer which is I think suitable for [1] usage.
regards
Surafel