mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-04-25 09:29:23 -04:00
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:
parent
e1f54c239f
commit
7694bc8bf3
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
#include "retrodb.h"
|
#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);
|
cv.getAsBool(key, value);
|
||||||
oStrStream << value;
|
oStrStream << value;
|
||||||
qValues += oStrStream.str();
|
qValues += oStrStream.str();
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
else if( ContentValue::DOUBLE_TYPE == type)
|
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);
|
cv.getAsDouble(key, value);
|
||||||
oStrStream << value;
|
oStrStream << value;
|
||||||
qValues += oStrStream.str();
|
qValues += oStrStream.str();
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
else if( ContentValue::DATA_TYPE == type)
|
else if( ContentValue::DATA_TYPE == type)
|
||||||
{
|
{
|
||||||
@ -258,14 +256,12 @@ bool RetroDb::sqlInsert(const std::string &table, const std::string& nullColumnH
|
|||||||
b.index = ++index;
|
b.index = ++index;
|
||||||
blobL.push_back(b);
|
blobL.push_back(b);
|
||||||
qValues += "?"; // parameter
|
qValues += "?"; // parameter
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
else if ( ContentValue::STRING_TYPE == type)
|
else if ( ContentValue::STRING_TYPE == type)
|
||||||
{
|
{
|
||||||
std::string value;
|
std::string value;
|
||||||
cv.getAsString(key, value);
|
cv.getAsString(key, value);
|
||||||
qValues += "'" + value +"'";
|
qValues += "'" + value +"'";
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
else if ( ContentValue::INT32_TYPE == type)
|
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);
|
cv.getAsInt32(key, value);
|
||||||
oStrStream << value;
|
oStrStream << value;
|
||||||
qValues += oStrStream.str();
|
qValues += oStrStream.str();
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
else if( ContentValue::INT64_TYPE == type)
|
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);
|
cv.getAsInt64(key, value);
|
||||||
oStrStream << value;
|
oStrStream << value;
|
||||||
qValues += oStrStream.str();
|
qValues += oStrStream.str();
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -420,7 +414,6 @@ bool RetroDb::sqlUpdate(const std::string &tableName, std::string whereClause, c
|
|||||||
cv.getAsBool(key, value);
|
cv.getAsBool(key, value);
|
||||||
oStrStream << value;
|
oStrStream << value;
|
||||||
qValues += key + "='" + oStrStream.str();
|
qValues += key + "='" + oStrStream.str();
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
else if( ContentValue::DOUBLE_TYPE == type)
|
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);
|
cv.getAsDouble(key, value);
|
||||||
oStrStream << value;
|
oStrStream << value;
|
||||||
qValues += key + "='" + oStrStream.str();
|
qValues += key + "='" + oStrStream.str();
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
else if( ContentValue::DATA_TYPE == type)
|
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);
|
cv.getAsData(key, len, value);
|
||||||
oStrStream.write(value, len);
|
oStrStream.write(value, len);
|
||||||
qValues += key + "='" + oStrStream.str() + "' ";
|
qValues += key + "='" + oStrStream.str() + "' ";
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
else if( ContentValue::STRING_TYPE == type)
|
else if( ContentValue::STRING_TYPE == type)
|
||||||
{
|
{
|
||||||
std::string value;
|
std::string value;
|
||||||
cv.getAsString(key, value);
|
cv.getAsString(key, value);
|
||||||
qValues += key + "='" + value + "' ";
|
qValues += key + "='" + value + "' ";
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
else if( ContentValue::INT32_TYPE == type)
|
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);
|
cv.getAsInt32(key, value);
|
||||||
oStrStream << value;
|
oStrStream << value;
|
||||||
qValues += key + "='" + oStrStream.str() + "' ";
|
qValues += key + "='" + oStrStream.str() + "' ";
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
else if( ContentValue::INT64_TYPE == type)
|
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);
|
cv.getAsInt64(key, value);
|
||||||
oStrStream << value;
|
oStrStream << value;
|
||||||
qValues += key + "='" + oStrStream.str() + "' ";
|
qValues += key + "='" + oStrStream.str() + "' ";
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
mit++;
|
mit++;
|
||||||
if(mit != keyTypeMap.end()){ // add comma if more columns left
|
if(mit != keyTypeMap.end()){ // add comma if more columns left
|
||||||
qValues += ",";
|
qValues += ",";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user