Use 'INSERT OR IGNORE'

This commit is contained in:
JoelKatz
2013-01-10 00:33:32 -08:00
parent d0fbcd64ba
commit 20712536b2

View File

@@ -86,7 +86,8 @@ void HashedObjectStore::bulkWrite()
static boost::format fExists("SELECT ObjType FROM CommittedObjects WHERE Hash = '%s';");
static boost::format
fAdd("INSERT INTO CommittedObjects (Hash,ObjType,LedgerIndex,Object) VALUES ('%s','%c','%u',%s);");
fAdd("INSERT OR IGNORE INTO CommittedObjects "
"(Hash,ObjType,LedgerIndex,Object) VALUES ('%s','%c','%u',%s);");
Database* db = theApp->getHashNodeDB()->getDB();
{ // FIXME: We're holding the lock too long!