Author: wyoung
Date: Fri Jul 13 07:04:12 2007
New Revision: 1694

URL: http://svn.gna.org/viewcvs/mysqlpp?rev=1694&view=rev
Log:
Reversed the sense of Lockable::lock(): returns false now if it fails,
not true.

Modified:
    trunk/Wishlist
    trunk/lib/lockable.h
    trunk/lib/query.cpp

Modified: trunk/Wishlist
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/Wishlist?rev=1694&r1=1693&r2=1694&view=diff
==============================================================================
--- trunk/Wishlist (original)
+++ trunk/Wishlist Fri Jul 13 07:04:12 2007
@@ -105,8 +105,6 @@
     o Apply Waba's patch allowing Null<T> fields in SSQLSes:
       
           http://lists.mysql.com/plusplus/5433
-
-    o Change Lockable::lock() to return true if it succeeds.
 
     o Remove simple const char* version of Query::execute(), store(),
       and use().  The ones taking SQLString will work transparently.

Modified: trunk/lib/lockable.h
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/lockable.h?rev=1694&r1=1693&r2=1694&view=diff
==============================================================================
--- trunk/lib/lockable.h (original)
+++ trunk/lib/lockable.h Fri Jul 13 07:04:12 2007
@@ -54,7 +54,7 @@
 
        /// \brief Lock the object
        ///
-       /// \return true if object was already locked
+       /// \return false if object was already locked
        virtual bool lock() = 0;
 
        /// \brief Unlock the object
@@ -91,14 +91,14 @@
 
        /// \brief Lock the object
        ///
-       /// \return true if object was already locked
+       /// \return false if object was already locked
        bool lock()
        {
                if (locked_) {
-                       return true;
+                       return false;
                }
                locked_ = true;
-               return false;
+               return true;
        }
 
        /// \brief Unlock the object
@@ -137,7 +137,7 @@
 
        /// \brief Lock the object
        ///
-       /// \return true if object was already locked
+       /// \return false if object was already locked
        virtual bool lock() { return pimpl_->lock(); }
 
        /// \brief Unlock the object

Modified: trunk/lib/query.cpp
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/query.cpp?rev=1694&r1=1693&r2=1694&view=diff
==============================================================================
--- trunk/lib/query.cpp (original)
+++ trunk/lib/query.cpp Fri Jul 13 07:04:12 2007
@@ -127,7 +127,7 @@
 ResNSel
 Query::execute(const char* str, size_t len)
 {
-       if (lock()) {
+       if (!lock()) {
                copacetic_ = false;
                if (throw_exceptions()) {
                        throw LockFailed();
@@ -415,7 +415,7 @@
 Result
 Query::store(const char* str, size_t len)
 {
-       if (lock()) {
+       if (!lock()) {
                copacetic_ = false;
                if (throw_exceptions()) {
                        throw LockFailed();
@@ -458,7 +458,7 @@
 Query::store_next()
 {
 #if MYSQL_VERSION_ID > 41000           // only in MySQL v4.1 +
-       if (lock()) {
+       if (!lock()) {
                if (throw_exceptions()) {
                        throw LockFailed();
                }
@@ -556,7 +556,7 @@
 ResUse
 Query::use(const char* str, size_t len)
 {
-       if (lock()) {
+       if (!lock()) {
                copacetic_ = false;
                if (throw_exceptions()) {
                        throw LockFailed();


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

Reply via email to