Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37712953
en ru br
ALT Linux repos
S:1.15.3-alt1
5.0: 1.4.28-alt1
4.1: 1.4.17-alt2.M41.1
4.0: 1.2.5-alt1

Group :: Networking/News
RPM: liferea

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: liferea-1.4.17-fix-db-schema-migration.patch
Download


--- src/db.c	2008-07-22 11:46:37 +0400
+++ src/db.c.fixed	2008-08-14 20:48:10 +0400
@@ -315,9 +315,11 @@ open:
 			if (db_get_schema_version () == 5) {
 				/* 1.4.9 -> 1.4.10 adding parent_item_id to itemset relation */
 				debug0 (DEBUG_DB, "migrating from schema version 5 to 6 (this drops all comments)");
+                /* Do it outside the transaction so that the triggers'
+                   absence does not lead to the transaction rollback. */
+                db_exec ("DROP TRIGGER item_removal;");
+                db_exec ("DROP TRIGGER item_insert;");
 				db_exec ("BEGIN; "
-				         "DROP TRIGGER item_removal; "
-					 "DROP TRIGGER item_insert; "
 				         "DELETE FROM itemsets WHERE comment = 1; "
 					 "DELETE FROM items WHERE comment = 1; "
 				         "CREATE TEMPORARY TABLE itemsets_backup(item_id,node_id,read,comment); "
@@ -339,10 +341,12 @@ open:
 			
 			if (db_get_schema_version () == 6) {
 				/* 1.4.15 -> 1.4.16 adding parent_node_id to itemset relation */
-				debug0 (DEBUG_DB, "migrating from schema version 5 to 6 (this drops all comments)");
+				debug0 (DEBUG_DB, "migrating from schema version 6 to 7 (this drops all comments)");
+                /* Do it outside the transaction so that the triggers'
+                   absence does not lead to the transaction rollback. */
+                db_exec ("DROP TRIGGER item_removal;");
+                db_exec ("DROP TRIGGER item_insert;");
 				db_exec ("BEGIN; "
-				         "DROP TRIGGER item_removal; "
-					 "DROP TRIGGER item_insert; "
 				         "DELETE FROM itemsets WHERE comment = 1; "
 					 "DELETE FROM items WHERE comment = 1; "
 				         "CREATE TEMPORARY TABLE itemsets_backup(item_id,node_id,read,comment); "
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin