Commit 941b2081 authored by phenigma's avatar phenigma

Refs #2648 - ensure that reverted records have NULL as psc_mod, not the sqlCVS...

Refs #2648 - ensure that reverted records have NULL as psc_mod, not the sqlCVS servers psc_mod or else the local will think the record has changed.
parent 515e27ce
......@@ -663,7 +663,7 @@ void Table::GetChanges( )
}
sql << " FROM `" << m_sName << "` WHERE psc_mod IS NOT NULL AND " << g_GlobalConfig.GetRestrictionClause(m_sName);
//cout << "$$$$ --- " << sql.str() << endl;
PlutoSqlResult result_set;
MYSQL_ROW row=NULL;
if( ( result_set.r=m_pDatabase->mysql_query_result( sql.str( ) ) ) )
......@@ -1230,6 +1230,8 @@ int k=2;
have to do a quick check, and if that's the case, move that other row to a different id.
*/
//OMFG: FIXME: TODO: fix this ^^^
sSQL.str( "" );
sSQL << "SELECT PK_" << m_sName << " FROM `" << m_sName << "` WHERE PK_" << m_sName << "=" << r_CommitRow.m_iNewAutoIncrID;
PlutoSqlResult result_set;
......@@ -2189,7 +2191,9 @@ bool Table::RevertChange(int psc_id,enum TypeOfChange toc)
sSQL << "`" << (*it).first << "`=";
if( (*it).second==NULL_TOKEN )
if( (*it).first=="psc_mod")
sSQL << "NULL";
else if( (*it).second==NULL_TOKEN )
sSQL << "NULL";
else
sSQL << "'" << StringUtils::SQLEscape((*it).second) << "'";
......@@ -2198,6 +2202,8 @@ bool Table::RevertChange(int psc_id,enum TypeOfChange toc)
}
delete pSocket;
//cout << "**** | " << sSQL.str() << endl;
if( m_pDatabase->threaded_mysql_query( sSQL.str( ) )<0 )
{
cerr << "Revert change: " << sSQL.str( ) << endl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment