[vtk-developers] Possible bug in vtkMySQLQuery class
David Thompson
dcthomp at sandia.gov
Wed Jun 23 19:39:50 EDT 2010
Matthew Wong wrote:
> In the vtkMySQLQuery.cxx file, in the Execute() function, after the
> following line:
> int result = mysql_query(db, this->Query);
> there is a check to see if the result == 0. If the result == 0,
> then there is a comment in the code that says "The query probably
> succeeded". If the result is not 0, there is a comment in the code
> that says " // result != 0; the query succeeded"
>
> However, according to
> http://dev.mysql.com/doc/refman/5.0/en/mysql-query.html the return
> value is:
> "Zero if the statement was successful. Nonzero if an error
> occurred. "
> I was wondering what motivation for the "the query succeeded"
> comment was, and it looks incorrect according to the dev.mysql.com
> documentation.
Matthew didn't mention it, but the reason we found this was because we
ran into a case where in fact result != 0 and the query had failed. Is
there some reason that the change you made on June 4:
http://vtk.org/gitweb?p=VTK.git;a=commitdiff;h=6992568a4cb9243a305f1efd383b4fab4c45ae88
affected both branches of the conditional instead of just the branch
with result == 0?
Thanks,
David
More information about the vtk-developers
mailing list