Remove db->escape in favor of sqlEscape.

This commit is contained in:
Arthur Britto
2013-01-06 02:08:54 -08:00
parent 04c17ac1f3
commit 8877501e5b
12 changed files with 45 additions and 80 deletions

View File

@@ -121,7 +121,7 @@ bool Wallet::dataDelete(const std::string& strKey)
ScopedLock sl(theApp->getRpcDB()->getDBLock());
return db->executeSQL(str(boost::format("DELETE FROM RPCData WHERE Key=%s;")
% db->escape(strKey)));
% sqlEscape(strKey)));
}
bool Wallet::dataFetch(const std::string& strKey, std::string& strValue)
@@ -133,7 +133,7 @@ bool Wallet::dataFetch(const std::string& strKey, std::string& strValue)
bool bSuccess = false;
if (db->executeSQL(str(boost::format("SELECT Value FROM RPCData WHERE Key=%s;")
% db->escape(strKey))) && db->startIterRows())
% sqlEscape(strKey))) && db->startIterRows())
{
std::vector<unsigned char> vucData = db->getBinary("Value");
strValue.assign(vucData.begin(), vucData.end());
@@ -155,8 +155,8 @@ bool Wallet::dataStore(const std::string& strKey, const std::string& strValue)
bool bSuccess = false;
return (db->executeSQL(str(boost::format("REPLACE INTO RPCData (Key, Value) VALUES (%s,%s);")
% db->escape(strKey)
% db->escape(strValue)
% sqlEscape(strKey)
% sqlEscape(strValue)
)));
return bSuccess;