MySQL Lists are EOL. Please join:

List:MySQL++« Previous MessageNext Message »
From:Dale Stewart Date:January 28 2009 3:38pm
Subject:RE: Question about BadQuery
View as plain text  
You could derive a class from Query, i.e. MyQuery, add a static member
such as last_query (and possibly an accessor for it), override the
members you want to record it, and have them save the query and call the
base class.  That would eliminate the need to modify the library.  Don't
know if that reduces the impact significantly enough or not, but thought
I'd mention it.

-----Original Message-----
From: Jim Wallace [mailto:jwallace@stripped] 
Sent: Wednesday, January 28, 2009 7:16 AM
To: plusplus@stripped
Subject: RE: Question about BadQuery

I do that exact same thing elsewhere and was thinking the about doing it
in for the query to avoid getting my MySQL++ code out-of-sync.  However,
it does require the extra str() and quite a bit of code changes to do
that.  I'm going to look at when BadQuery is thrown and if it's easy to
put in the completed query I'll do that.


-----Original Message-----
From: Warren Young [mailto:mysqlpp@stripped] 
Sent: Tuesday, January 27, 2009 11:45 PM
To: Jim Wallace
Subject: Re: Question about BadQuery

Jim Wallace wrote:
> if I have multiple statements in a try/catch I could figure out
> which one caused the exception.

A way you could get by without it:

string last_query;
try {
	Query q("stuff");
	last_query = q.str();
	StoreQueryResult res =;
	// do something with res

	q = "other stuff";
	last_query = q.str();
	res =;
	// do more stuff

catch (const BadQuery& e) {
	cerr << "Query failed: \"" << last_query << "\"" << endl;

MySQL++ Mailing List
For list archives:
To unsubscribe:

RELEASE: v3.0.5Warren Young7 Aug
  • query.str() in template query -- help!Jim Wallace28 Jan
    • RE: query.str() in template query -- <blush>Jim Wallace28 Jan
      • Re: query.str() in template query -- <blush>Warren Young28 Jan
        • storein with parametersJim Wallace28 Jan
          • Re: storein with parametersWarren Young28 Jan
            • RE: storein with parametersJim Wallace28 Jan
              • Re: storein with parametersWarren Young28 Jan
            • Question about BadQueryJim Wallace28 Jan
              • Re: Question about BadQueryWarren Young28 Jan
RE: RELEASE: v3.0.5Bernard8 Aug
  • Re: RELEASE: v3.0.5Warren Young8 Aug
    • Re: RELEASE: v3.0.5Alex9 Aug
RE: Question about BadQueryJim Wallace28 Jan
RE: Question about BadQueryDale Stewart28 Jan
RE: Question about BadQueryDale Stewart28 Jan
  • Re: Question about BadQueryWarren Young28 Jan