Author: wyoung
Date: Thu Jul 12 05:13:03 2007
New Revision: 1675
URL: http://svn.gna.org/viewcvs/mysqlpp?rev=1675&view=rev
Log:
Removed all query_reset parameters from all Query methods. These
parameters were never obeyed, just overridden within the class. This
removal means no automatic resets happen, but this patch isn't about
doing that, it's about fixing a broken API. We may bring automatic
resets back later.
Modified:
trunk/Wishlist
trunk/lib/query.cpp
trunk/lib/query.h
trunk/lib/querydef.pl
Modified: trunk/Wishlist
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/Wishlist?rev=1675&r1=1674&r2=1675&view=diff
==============================================================================
--- trunk/Wishlist (original)
+++ trunk/Wishlist Thu Jul 12 05:13:03 2007
@@ -59,8 +59,6 @@
made into a base class that all SSQLSes derive from. Some
template functions like Query::insert<T> might become regular
member functions, taking a reference to the SSQLS base class.
-
- o Remove all remaining query_reset function parameters.
o Remove Connection::connect() arguments for turning on compression
and setting the connection timeout. These things are already
Modified: trunk/lib/query.cpp
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/query.cpp?rev=1675&r1=1674&r2=1675&view=diff
==============================================================================
--- trunk/lib/query.cpp (original)
+++ trunk/lib/query.cpp Thu Jul 12 05:13:03 2007
@@ -166,7 +166,7 @@
ResNSel
Query::execute(SQLQueryParms& p)
{
- return execute(str(p, parse_elems_.size() ? DONT_RESET : RESET_QUERY));
+ return execute(str(p));
}
#endif // !defined(DOXYGEN_IGNORE)
@@ -480,7 +480,7 @@
Result
Query::store(SQLQueryParms& p)
{
- return store(str(p, parse_elems_.size() ? DONT_RESET : RESET_QUERY));
+ return store(str(p));
}
#endif // !defined(DOXYGEN_IGNORE)
@@ -552,17 +552,6 @@
}
-std::string
-Query::str(SQLQueryParms& p, query_reset r)
-{
- std::string tmp = str(p);
- if (r == RESET_QUERY) {
- reset();
- }
- return tmp;
-}
-
-
bool
Query::success()
{
@@ -647,7 +636,7 @@
ResUse
Query::use(SQLQueryParms& p)
{
- return use(str(p, parse_elems_.size() ? DONT_RESET : RESET_QUERY));
+ return use(str(p));
}
#endif // !defined(DOXYGEN_IGNORE)
Modified: trunk/lib/query.h
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/query.h?rev=1675&r1=1674&r2=1675&view=diff
==============================================================================
--- trunk/lib/query.h (original)
+++ trunk/lib/query.h Thu Jul 12 05:13:03 2007
@@ -73,9 +73,6 @@
// Make Doxygen ignore this
class MYSQLPP_EXPORT Connection;
#endif
-
-/// \brief Used for indicating whether a query object should auto-reset
-enum query_reset { DONT_RESET, RESET_QUERY };
/// \brief A class for building and executing SQL queries.
///
@@ -209,23 +206,9 @@
/// \brief Get built query as a null-terminated C++ string
///
- /// \param r if equal to \c RESET_QUERY, query object is cleared
- /// after this call
- std::string str(query_reset r) { return str(def, r); }
-
- /// \brief Get built query as a null-terminated C++ string
- ///
/// \param p template query parameters to use, overriding the ones
/// this object holds, if any
std::string str(SQLQueryParms& p);
-
- /// \brief Get built query as a null-terminated C++ string
- ///
- /// \param p template query parameters to use, overriding the ones
- /// this object holds, if any
- /// \param r if equal to \c RESET_QUERY, query object is cleared
- /// after this call
- std::string str(SQLQueryParms& p, query_reset r);
/// \brief Execute a query
///
@@ -587,9 +570,9 @@
///
/// \sa exec(), execute(), store(), and use()
template <class Sequence>
- void storein_sequence(Sequence& con, query_reset r = RESET_QUERY)
- {
- storein_sequence(con, def, r);
+ void storein_sequence(Sequence& con)
+ {
+ storein_sequence(con, def);
}
/// \brief Execute a query, storing the result set in an STL
@@ -600,9 +583,9 @@
/// that detail, that method's comments apply equally well to this
/// one.
template <class Set>
- void storein_set(Set& con, query_reset r = RESET_QUERY)
- {
- storein_set(con, def, r);
+ void storein_set(Set& con)
+ {
+ storein_set(con, def);
}
/// \brief Execute a query, and store the entire result set
@@ -624,9 +607,9 @@
/// See exec(), execute(), store(), and use() for alternative
/// query execution mechanisms.
template <class Container>
- void storein(Container& con, query_reset r = RESET_QUERY)
- {
- storein(con, def, r);
+ void storein(Container& con)
+ {
+ storein(con, def);
}
/// \brief Specialization of storein_sequence() for \c std::vector
@@ -865,10 +848,9 @@
// Doxygen will not generate documentation for this section.
template <class Seq>
-void Query::storein_sequence(Seq& seq, SQLQueryParms& p, query_reset r)
+void Query::storein_sequence(Seq& seq, SQLQueryParms& p)
{
- r = parse_elems_.size() ? DONT_RESET : RESET_QUERY;
- storein_sequence(seq, str(p, r).c_str());
+ storein_sequence(seq, str(p).c_str());
}
@@ -890,10 +872,9 @@
template <class Set>
-void Query::storein_set(Set& sett, SQLQueryParms& p, query_reset r)
+void Query::storein_set(Set& sett, SQLQueryParms& p)
{
- r = parse_elems_.size() ? DONT_RESET : RESET_QUERY;
- storein_set(sett, str(p, r).c_str());
+ storein_set(sett, str(p).c_str());
}
@@ -915,10 +896,9 @@
template <class T>
-void Query::storein(T& con, SQLQueryParms& p, query_reset r)
+void Query::storein(T& con, SQLQueryParms& p)
{
- r = parse_elems_.size() ? DONT_RESET : RESET_QUERY;
- storein(con, str(p, r).c_str());
+ storein(con, str(p).c_str());
}
Modified: trunk/lib/querydef.pl
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/querydef.pl?rev=1675&r1=1674&r2=1675&view=diff
==============================================================================
--- trunk/lib/querydef.pl (original)
+++ trunk/lib/querydef.pl Thu Jul 12 05:13:03 2007
@@ -83,8 +83,7 @@
#define mysql_query_define2(FUNC) \\
template <class T> void FUNC(T& container, const char* str); \\
- template <class T> void FUNC(T& container, SQLQueryParms& p, \\
- query_reset r = RESET_QUERY); \\
+ template <class T> void FUNC(T& container, SQLQueryParms& p); \\
---
for (my $i = 0; $i < $max_parameters; ++$i) {
print OUT "\ttemplate <class T> void FUNC(T& container";
_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits