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
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); "