List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:June 8 2009 7:47pm
Subject:Re: Detecting errors executing SQL queries
View as plain text  
On Jun 8, 2009, at 6:18 AM, Martin Dubuc wrote:

> I don't really understand the change you describe to the simple1.cpp
> example.

> http://en.wikipedia.org/wiki/Patch_(Unix)#Usage_examples

> In your modified example, if
> the query was bad and exceptions were disabled, then, the code would  
> never
> get to the "else" section, meaning that it is not possible to detect  
> errors
> in handling the query.

On following the instructions in the Wikipedia article to apply the  
patch, you will see that it causes simple1 to detect the broken query  
correctly.  (Notice that the patch also changed the query string.)  A  
single-character change to the patch to un-break the query ("stocxk" - 
 > "stock") will then cause simple1 to take the other branch in the if/ 
else.

Therefore, this feature of MySQL++ is not broken.

If you still don't believe me after trying it, modify another one of  
the examples to demonstrate the problem, then post the patch.  It's  
far more credible than posting code snippets that don't compile.
Thread
Detecting errors executing SQL queriesMartin Dubuc5 Jun
  • Re: Detecting errors executing SQL queriesWarren Young6 Jun
    • Re: Detecting errors executing SQL queriesMartin Dubuc8 Jun
      • Re: Detecting errors executing SQL queriesWarren Young8 Jun
        • Re: Detecting errors executing SQL queriesMartin Dubuc9 Jun
          • Re: Detecting errors executing SQL queriesWarren Young10 Jun
            • Re: Detecting errors executing SQL queriesWarren Young18 May