[vtk-developers] Possible bug in vtkMySQLQuery class

David Thompson dcthomp at sandia.gov
Tue Jun 29 15:21:28 EDT 2010


Pat Marion wrote:
> After this is figured out, someone let me know and I'll resolve the  
> bug the prompted the commit-
>   http://www.vtk.org/Bug/view.php?id=10788

I committed a fix yesterday which fixes the problem for me and haven't  
heard from Andy (who said offline he would try it and complain if it  
caused trouble for him). So, I'd say it is ready to be marked as  
resolved.

	David

> On Wed, Jun 23, 2010 at 7:39 PM, David Thompson <dcthomp at sandia.gov>  
> wrote:
>> 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
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>





More information about the vtk-developers mailing list