From 9a43e015a90eda23477e3ca9d6688a4fdb9a75e5 Mon Sep 17 00:00:00 2001 From: Ryan D. Brooks Date: Wed, 19 Sep 2018 17:33:41 -0700 Subject: bug: Change report incorrectly computing baseline change data - loadCurrentVersionData's query loaded the current data - for a given item if it happened to be returned in - transaction_id ascending order, but this had been left to chance - since the order was not specified. Since the hashmap was keyed by - item type and item id, the last row returned with that key was used - as the current data. Fixed by ordering the query by transaction_id - ascending. Change-Id: I5b5e32956a70e5305a6debd543868a57aef1dafc --- .../change/LoadDeltasBetweenTxsOnTheSameBranch.java | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/LoadDeltasBetweenTxsOnTheSameBranch.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/LoadDeltasBetweenTxsOnTheSameBranch.java index ff3496dec20..29df6c9b7eb 100644 --- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/LoadDeltasBetweenTxsOnTheSameBranch.java +++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/LoadDeltasBetweenTxsOnTheSameBranch.java @@ -217,16 +217,16 @@ public class LoadDeltasBetweenTxsOnTheSameBranch extends AbstractDatastoreCallab String archiveTable = isArchived ? "osee_txs_archived" : "osee_txs"; String query = String.format( - "select txs.gamma_id, txs.mod_type, txs.app_id, item.art_id as item_id, 2 as table_type from osee_join_export_import idj," + // - " osee_artifact item, %s txs where idj.query_id = ? and idj.id2 = item.art_id and idj.id1 = 2" + // - " and item.gamma_id = txs.gamma_id and txs.branch_id = ? and txs.transaction_id <= ?" + // - " union all select txs.gamma_id, txs.mod_type, txs.app_id, item.attr_id as item_id, 1 as table_type from osee_join_export_import idj," + // - " osee_attribute item, %s txs where idj.query_id = ? and idj.id2 = item.attr_id and idj.id1 = 1" + // - " and item.gamma_id = txs.gamma_id and txs.branch_id = ? and txs.transaction_id <= ?" + // - " union all select txs.gamma_id, txs.mod_type, txs.app_id, item.rel_link_id as item_id, 3 as table_type from osee_join_export_import idj," + // - " osee_relation_link item, %s txs where idj.query_id = ? and idj.id2 = item.rel_link_id and idj.id1 = 3" + // - " and item.gamma_id = txs.gamma_id and txs.branch_id = ? and txs.transaction_id <= ?", archiveTable, - archiveTable, archiveTable); + "select txs.gamma_id, txs.mod_type, txs.app_id, item.art_id as item_id, 2 as table_type, transaction_id from osee_join_export_import idj," + // + " osee_artifact item, %s txs where idj.query_id = ? and idj.id2 = item.art_id and idj.id1 = 2" + // + " and item.gamma_id = txs.gamma_id and txs.branch_id = ? and txs.transaction_id <= ?" + // + " union all select txs.gamma_id, txs.mod_type, txs.app_id, item.attr_id as item_id, 1 as table_type, transaction_id from osee_join_export_import idj," + // + " osee_attribute item, %s txs where idj.query_id = ? and idj.id2 = item.attr_id and idj.id1 = 1" + // + " and item.gamma_id = txs.gamma_id and txs.branch_id = ? and txs.transaction_id <= ?" + // + " union all select txs.gamma_id, txs.mod_type, txs.app_id, item.rel_link_id as item_id, 3 as table_type, transaction_id from osee_join_export_import idj," + // + " osee_relation_link item, %s txs where idj.query_id = ? and idj.id2 = item.rel_link_id and idj.id1 = 3" + // + " and item.gamma_id = txs.gamma_id and txs.branch_id = ? and txs.transaction_id <= ? ORDER BY transaction_id", + archiveTable, archiveTable, archiveTable); getJdbcClient().runQuery(consumer, JdbcConstants.JDBC__MAX_FETCH_SIZE, query, queryId, transactionLimit.getBranch(), transactionLimit, queryId, transactionLimit.getBranch(), transactionLimit, -- cgit v1.2.3