Author: mysqlpp
Date: Tue Aug 24 12:12:57 2010
New Revision: 2675

URL: http://svn.gna.org/viewcvs/mysqlpp?rev=2675&view=rev
Log:
Reverted part of r2590 change, which was supposed to restore support for
template queries with repeated parameters (e.g. "%0q ... %0q") but which
broke storein() with tquery parameters.  New version still passes all
the tests and restores functionality in a test program someone sent in.

Modified:
    trunk/lib/query.cpp

Modified: trunk/lib/query.cpp
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/query.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- trunk/lib/query.cpp (original)
+++ trunk/lib/query.cpp Tue Aug 24 12:12:57 2010
@@ -177,7 +177,7 @@
 SimpleResult
 Query::execute(const SQLTypeAdapter& s)
 {
-       if (!parse_elems_.empty() && !template_defaults.processing_) {
+       if ((parse_elems_.size() == 2) && !template_defaults.processing_) {
                // We're a template query and this isn't a recursive call, so
                // take s to be a lone parameter for the query.  We will come
                // back in here with a completed query, but the processing_
@@ -195,7 +195,7 @@
 SimpleResult
 Query::execute(const char* str, size_t len)
 {
-       if (!parse_elems_.empty() && !template_defaults.processing_) {
+       if ((parse_elems_.size() == 2) && !template_defaults.processing_) {
                // We're a template query and this isn't a recursive call, so
                // take s to be a lone parameter for the query.  We will come
                // back in here with a completed query, but the processing_
@@ -495,7 +495,7 @@
 StoreQueryResult
 Query::store(const SQLTypeAdapter& s)
 {
-       if (!parse_elems_.empty() && !template_defaults.processing_) {
+       if ((parse_elems_.size() == 2) && !template_defaults.processing_) {
                // We're a template query and this isn't a recursive call, so
                // take s to be a lone parameter for the query.  We will come
                // back in here with a completed query, but the processing_
@@ -513,7 +513,7 @@
 StoreQueryResult
 Query::store(const char* str, size_t len)
 {
-       if (!parse_elems_.empty() && !template_defaults.processing_) {
+       if ((parse_elems_.size() == 2) && !template_defaults.processing_) {
                // We're a template query and this isn't a recursive call, so
                // take s to be a lone parameter for the query.  We will come
                // back in here with a completed query, but the processing_
@@ -633,7 +633,7 @@
 UseQueryResult
 Query::use(const SQLTypeAdapter& s)
 {
-       if (!parse_elems_.empty()  && !template_defaults.processing_) {
+       if ((parse_elems_.size() == 2) && !template_defaults.processing_) {
                // We're a template query and this isn't a recursive call, so
                // take s to be a lone parameter for the query.  We will come
                // back in here with a completed query, but the processing_
@@ -651,7 +651,7 @@
 UseQueryResult
 Query::use(const char* str, size_t len)
 {
-       if (!parse_elems_.empty() && !template_defaults.processing_) {
+       if ((parse_elems_.size() == 2) && !template_defaults.processing_) {
                // We're a template query and this isn't a recursive call, so
                // take s to be a lone parameter for the query.  We will come
                // back in here with a completed query, but the processing_


_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits

Reply via email to