Bug 434244
authorShawn Wilsher <sdwilsh@shawnwilsher.com>
Wed, 04 Jun 2008 11:42:15 -0400
changeset 15243 d48909ac2fa1a5296854df982f2b03867621ba5f
parent 15242 a26c86b184f7e162d25d5c8fbfc34dc04485c221
child 15244 5ccc3423220f5808d21b04403827c3dafdb51b2d
push idunknown
push userunknown
push dateunknown
bugs434244
milestone1.9.1a1pre
Bug 434244 Remove mozStorageStatement::Recreate r=shaver
storage/src/mozStorageStatement.cpp
storage/src/mozStorageStatement.h
--- a/storage/src/mozStorageStatement.cpp
+++ b/storage/src/mozStorageStatement.cpp
@@ -455,25 +455,16 @@ mozStorageStatement::Execute()
 NS_IMETHODIMP
 mozStorageStatement::ExecuteStep(PRBool *_retval)
 {
     if (!mDBConnection || !mDBStatement)
         return NS_ERROR_NOT_INITIALIZED;
 
     nsresult rv;
 
-    if (mExecuting == PR_FALSE) {
-        // check if we need to recreate this statement before executing
-        if (sqlite3_expired(mDBStatement)) {
-            PR_LOG(gStorageLog, PR_LOG_DEBUG, ("Statement expired, recreating before step"));
-            rv = Recreate();
-            NS_ENSURE_SUCCESS(rv, rv);
-        }
-    }
-
     int srv = sqlite3_step (mDBStatement);
 
 #ifdef PR_LOGGING
     if (srv != SQLITE_ROW && srv != SQLITE_DONE)
     {
         nsCAutoString errStr;
         mDBConnection->GetLastErrorString(errStr);
         PR_LOG(gStorageLog, PR_LOG_DEBUG, ("mozStorageStatement::ExecuteStep error: %s", errStr.get()));
@@ -521,41 +512,16 @@ mozStorageStatement::GetState(PRInt32 *_
         *_retval = MOZ_STORAGE_STATEMENT_EXECUTING;
     } else {
         *_retval = MOZ_STORAGE_STATEMENT_READY;
     }
 
     return NS_OK;
 }
 
-nsresult
-mozStorageStatement::Recreate()
-{
-    nsresult rv;
-    int srv;
-    sqlite3_stmt *savedStmt = mDBStatement;
-    mDBStatement = nsnull;
-    rv = Initialize(mDBConnection, mStatementString);
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    // copy over the param bindings
-    srv = sqlite3_transfer_bindings(savedStmt, mDBStatement);
-
-    // we're always going to finalize this, so no need to
-    // error check
-    sqlite3_finalize(savedStmt);
-
-    if (srv != SQLITE_OK) {
-        PR_LOG(gStorageLog, PR_LOG_ERROR, ("sqlite3_transfer_bindings returned: %d", srv));
-        return ConvertResultCode(srv);
-    }
-
-    return NS_OK;
-}
-
 /***
  *** mozIStorageValueArray
  ***/
 
 /* readonly attribute unsigned long numEntries; */
 NS_IMETHODIMP
 mozStorageStatement::GetNumEntries(PRUint32 *aLength)
 {
--- a/storage/src/mozStorageStatement.h
+++ b/storage/src/mozStorageStatement.h
@@ -66,13 +66,11 @@ protected:
     nsCString mStatementString;
     nsCOMPtr<mozIStorageConnection> mDBConnection;
     sqlite3_stmt *mDBStatement;
     PRUint32 mParamCount;
     PRUint32 mResultColumnCount;
     nsCStringArray mColumnNames;
     PRBool mExecuting;
 
-    // recreate the statement, and transfer bindings
-    nsresult Recreate();
 };
 
 #endif /* _MOZSTORAGESTATEMENT_H_ */