Author: eelco Date: 2010-06-08 13:38:28 +0000 (Tue, 08 Jun 2010) New Revision: 22186
You can view the changes in this commit at: https://svn.nixos.org/viewvc/nix?rev=22186&view=rev Modified: nix/branches/sqlite/src/libstore/local-store.cc Log: * Replacing ValidPath rows doesn't work because it causes a constraint violation of the Refs table. So don't do that. Changes: Modified: nix/branches/sqlite/src/libstore/local-store.cc =================================================================== --- nix/branches/sqlite/src/libstore/local-store.cc 2010-06-08 13:01:44 UTC (rev 22185) +++ nix/branches/sqlite/src/libstore/local-store.cc 2010-06-08 13:38:28 UTC (rev 22186) @@ -311,7 +311,7 @@ /* Prepare SQL statements. */ stmtRegisterValidPath.create(db, - "insert or replace into ValidPaths (path, hash, registrationTime, deriver) values (?, ?, ?, ?);"); + "insert into ValidPaths (path, hash, registrationTime, deriver) values (?, ?, ?, ?);"); stmtAddReference.create(db, "insert or replace into Refs (referrer, reference) values (?, ?);"); stmtQueryPathInfo.create(db, @@ -837,7 +837,10 @@ { SQLiteTxn txn(db); - foreach (ValidPathInfos::const_iterator, i, infos) addValidPath(*i); + foreach (ValidPathInfos::const_iterator, i, infos) + /* !!! Maybe the registration info should be updated if the + path is already valid. */ + if (!isValidPath(i->path)) addValidPath(*i); foreach (ValidPathInfos::const_iterator, i, infos) { unsigned long long referrer = queryValidPathId(i->path); _______________________________________________ nix-commits mailing list [email protected] http://mail.cs.uu.nl/mailman/listinfo/nix-commits
