projects
/
fms.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
version 0.2.23
[fms.git]
/
src
/
freenet
/
periodicdbmaintenance.cpp
diff --git
a/src/freenet/periodicdbmaintenance.cpp
b/src/freenet/periodicdbmaintenance.cpp
index
caf14ab
..
f199fd2
100644
(file)
--- a/
src/freenet/periodicdbmaintenance.cpp
+++ b/
src/freenet/periodicdbmaintenance.cpp
@@
-189,6
+189,7
@@
void PeriodicDBMaintenance::Do1DayMaintenance()
while(st.RowReturned())
\r
{
\r
std::string name="";
\r
while(st.RowReturned())
\r
{
\r
std::string name="";
\r
+ std::string namepart="";
\r
std::string publickey="";
\r
int identityid=0;
\r
st.ResultText(0,name);
\r
std::string publickey="";
\r
int identityid=0;
\r
st.ResultText(0,name);
\r
@@
-196,9
+197,19
@@
void PeriodicDBMaintenance::Do1DayMaintenance()
std::vector<std::string> parts;
\r
StringFunctions::Split(name,"@",parts);
\r
\r
std::vector<std::string> parts;
\r
StringFunctions::Split(name,"@",parts);
\r
\r
+ // name can have a @ in it - so reattach all parts except the last which is the key
\r
+ for(long i=0; i<parts.size()-1; i++)
\r
+ {
\r
+ if(i!=0)
\r
+ {
\r
+ namepart+="@";
\r
+ }
\r
+ namepart+=parts[i];
\r
+ }
\r
+
\r
// find identities with this name
\r
SQLite3DB::Statement st2=m_db->Prepare("SELECT IdentityID,PublicKey FROM tblIdentity WHERE Name=?;");
\r
// find identities with this name
\r
SQLite3DB::Statement st2=m_db->Prepare("SELECT IdentityID,PublicKey FROM tblIdentity WHERE Name=?;");
\r
- st2.Bind(0,name);
\r
+ st2.Bind(0,name
part
);
\r
st2.Step();
\r
while(st2.RowReturned())
\r
{
\r
st2.Step();
\r
while(st2.RowReturned())
\r
{
\r
@@
-211,7
+222,7
@@
void PeriodicDBMaintenance::Do1DayMaintenance()
// we have the identity - so update the messages table with the identityid
\r
st2.ResultInt(0,identityid);
\r
\r
// we have the identity - so update the messages table with the identityid
\r
st2.ResultInt(0,identityid);
\r
\r
- SQLite3DB::Statement st3=m_db->Prepare("UPDATE tblMessage SET IdentityID=? WHERE Name=? AND IdentityID IS NULL;");
\r
+ SQLite3DB::Statement st3=m_db->Prepare("UPDATE tblMessage SET IdentityID=? WHERE
From
Name=? AND IdentityID IS NULL;");
\r
st3.Bind(0,identityid);
\r
st3.Bind(1,name);
\r
st3.Step();
\r
st3.Bind(0,identityid);
\r
st3.Bind(1,name);
\r
st3.Step();
\r