fixed bug introduced into retrodb.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs-b1@5465 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
chrisparker126 2012-08-24 11:49:31 +00:00
parent e1f54c239f
commit 7694bc8bf3

View File

@ -30,7 +30,7 @@
#include "retrodb.h"
//#define RETRODB_DEBUG
#define RETRODB_DEBUG
@ -237,7 +237,6 @@ bool RetroDb::sqlInsert(const std::string &table, const std::string& nullColumnH
cv.getAsBool(key, value);
oStrStream << value;
qValues += oStrStream.str();
break;
}
else if( ContentValue::DOUBLE_TYPE == type)
{
@ -245,7 +244,6 @@ bool RetroDb::sqlInsert(const std::string &table, const std::string& nullColumnH
cv.getAsDouble(key, value);
oStrStream << value;
qValues += oStrStream.str();
break;
}
else if( ContentValue::DATA_TYPE == type)
{
@ -258,14 +256,12 @@ bool RetroDb::sqlInsert(const std::string &table, const std::string& nullColumnH
b.index = ++index;
blobL.push_back(b);
qValues += "?"; // parameter
break;
}
else if ( ContentValue::STRING_TYPE == type)
{
std::string value;
cv.getAsString(key, value);
qValues += "'" + value +"'";
break;
}
else if ( ContentValue::INT32_TYPE == type)
{
@ -273,7 +269,6 @@ bool RetroDb::sqlInsert(const std::string &table, const std::string& nullColumnH
cv.getAsInt32(key, value);
oStrStream << value;
qValues += oStrStream.str();
break;
}
else if( ContentValue::INT64_TYPE == type)
{
@ -281,7 +276,6 @@ bool RetroDb::sqlInsert(const std::string &table, const std::string& nullColumnH
cv.getAsInt64(key, value);
oStrStream << value;
qValues += oStrStream.str();
break;
}
@ -420,7 +414,6 @@ bool RetroDb::sqlUpdate(const std::string &tableName, std::string whereClause, c
cv.getAsBool(key, value);
oStrStream << value;
qValues += key + "='" + oStrStream.str();
break;
}
else if( ContentValue::DOUBLE_TYPE == type)
{
@ -428,7 +421,6 @@ bool RetroDb::sqlUpdate(const std::string &tableName, std::string whereClause, c
cv.getAsDouble(key, value);
oStrStream << value;
qValues += key + "='" + oStrStream.str();
break;
}
else if( ContentValue::DATA_TYPE == type)
{
@ -437,14 +429,12 @@ bool RetroDb::sqlUpdate(const std::string &tableName, std::string whereClause, c
cv.getAsData(key, len, value);
oStrStream.write(value, len);
qValues += key + "='" + oStrStream.str() + "' ";
break;
}
else if( ContentValue::STRING_TYPE == type)
{
std::string value;
cv.getAsString(key, value);
qValues += key + "='" + value + "' ";
break;
}
else if( ContentValue::INT32_TYPE == type)
{
@ -452,7 +442,6 @@ bool RetroDb::sqlUpdate(const std::string &tableName, std::string whereClause, c
cv.getAsInt32(key, value);
oStrStream << value;
qValues += key + "='" + oStrStream.str() + "' ";
break;
}
else if( ContentValue::INT64_TYPE == type)
{
@ -460,10 +449,8 @@ bool RetroDb::sqlUpdate(const std::string &tableName, std::string whereClause, c
cv.getAsInt64(key, value);
oStrStream << value;
qValues += key + "='" + oStrStream.str() + "' ";
break;
}
mit++;
if(mit != keyTypeMap.end()){ // add comma if more columns left
qValues += ",";