mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-25 07:29:33 -05:00
Fixed for duplicate messages ending up in db, set msgId and grpId as primary keys in message and group table respectively in db when created
Please delete your TESTNET folders so a keyed db is created few additional fixes - did create id list for meta request in dataservice - possible fix for uninitialised values for rsdb git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6123 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
ee62819389
commit
21dd979ba8
@ -182,7 +182,7 @@ void RsDataService::initialise(){
|
||||
|
||||
// create table for msg data
|
||||
mDb->execSQL("CREATE TABLE " + MSG_TABLE_NAME + "(" +
|
||||
KEY_MSG_ID + " TEXT," +
|
||||
KEY_MSG_ID + " TEXT PRIMARY KEY," +
|
||||
KEY_GRP_ID + " TEXT," +
|
||||
KEY_NXS_FLAGS + " INT," +
|
||||
KEY_ORIG_MSG_ID + " TEXT," +
|
||||
@ -202,7 +202,7 @@ void RsDataService::initialise(){
|
||||
|
||||
// create table for grp data
|
||||
mDb->execSQL("CREATE TABLE " + GRP_TABLE_NAME + "(" +
|
||||
KEY_GRP_ID + " TEXT," +
|
||||
KEY_GRP_ID + " TEXT PRIMARY KEY," +
|
||||
KEY_TIME_STAMP + " INT," +
|
||||
KEY_NXS_FILE + " TEXT," +
|
||||
KEY_NXS_FILE_OFFSET + " INT," +
|
||||
@ -770,7 +770,6 @@ int RsDataService::retrieveNxsMsgs(const GxsMsgReq &reqIds, GxsMsgResult &msg, b
|
||||
}
|
||||
|
||||
msg[grpId] = msgSet;
|
||||
msgSet.clear();
|
||||
|
||||
if(withMeta)
|
||||
{
|
||||
@ -784,6 +783,7 @@ int RsDataService::retrieveNxsMsgs(const GxsMsgReq &reqIds, GxsMsgResult &msg, b
|
||||
|
||||
metaReqIds[grpId] = msgIds;
|
||||
}
|
||||
msgSet.clear();
|
||||
}
|
||||
|
||||
// tres expensive !?
|
||||
|
@ -265,14 +265,14 @@ bool RetroDb::sqlInsert(const std::string &table, const std::string& nullColumnH
|
||||
}
|
||||
else if ( ContentValue::INT32_TYPE == type)
|
||||
{
|
||||
int32_t value;
|
||||
int32_t value = 0;
|
||||
cv.getAsInt32(key, value);
|
||||
oStrStream << value;
|
||||
qValues += oStrStream.str();
|
||||
}
|
||||
else if( ContentValue::INT64_TYPE == type)
|
||||
{
|
||||
int64_t value;
|
||||
int64_t value = 0;
|
||||
cv.getAsInt64(key, value);
|
||||
oStrStream << value;
|
||||
qValues += oStrStream.str();
|
||||
|
Loading…
Reference in New Issue
Block a user