From: Martin Gallwey Date: December 4 2009 6:49pm Subject: Re: Template query change from v2 to v3 List-Archive: http://lists.mysql.com/plusplus/8805 Message-Id: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="29444707-212170718-1259952595=:32134" --29444707-212170718-1259952595=:32134 Content-Type: TEXT/PLAIN; format=flowed; charset=ISO-8859-15 Content-Transfer-Encoding: 8BIT Hi Warren, One comment on the svn repo - you should change the link on http://tangentsoft.net/mysql++/ from https://gna.org/svn/?group=mysqlpp to http://gna.org/svn/?group=mysqlpp as the https version gives an "invalid security certificate" error (The certificate is not trusted because the issuer certificate is unknown.) - at least for me. In any case, https is probably not entirely needed here. On Fri, 4 Dec 2009, Warren Young wrote: > Martin Gallwey wrote: >> >> I've modified my patch to revert the fix applied in revision 1446 and >> changed the fix so that the zero argument versions of execute/store/use >> (previously unchanged in this patch) were also protected by the >> 'processing_' flag. This protects us from the double substitution described >> in the mail referenced above. > > It's applied, mostly as-is, but with the test code simplified and moved into > its own example, tquery4. Martin, please check this out of svn and see if it > does what you need. Also, check that the new example doesn't remove things > that shouldn't be removed. I confess that I don't really understand what all > you're doing with that cabbage, f'rinstance. Yes, the head of the SVN repository works. The multiple cabbage tests (apart from cabbage being good for you!) were supposed to check: 1) execute called with no parameters on a query with a single template parameter, relying on template_defaults to fill the %0 parameter 2) execute called with no parameters on a query with no template parameters 3) execute called with a single parameter on a query without template parameters which was a complete query 4) execute called with a single parameter on a query with 1 template parameter which was supplied by the single parameter. 5) store called with two parameters (const char * and an int) on a query with two template parameters - to ensure that substitution is correctly processed rather than the version of store which assumes a full query together with it's length are passed in. Basically, they are integration tests for most cases that the patch modified (no tests for any of the versions of 'use' however) - the most interesting ones are (1) and (5) so since you already added test (1) to tquery4.cpp, I'd suggest adding a test of (5) there as well. Something like: query.reset(); query << "select * from stock where item = %0q or " "description like '%%%0%%' or weight > %1"; query.parse(); // Retrieve an item added by resetdb; it won't be there if // tquery* or ssqls3 is run since resetdb. mysqlpp::StoreQueryResult res1 = query.store("Nürnberger Brats", 150); Would do it. Cheers! Martin --29444707-212170718-1259952595=:32134--