Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2018-09-20 00:33:41 +0000
committerRyan D. Brooks2018-09-20 00:47:37 +0000
commit9a43e015a90eda23477e3ca9d6688a4fdb9a75e5 (patch)
treeeeae5d76d0d6567fa50e51d97960e00e0f2bcfb9
parentf0da416abc6bd65592943caff6194b393b181635 (diff)
downloadorg.eclipse.osee-9a43e015a90eda23477e3ca9d6688a4fdb9a75e5.tar.gz
org.eclipse.osee-9a43e015a90eda23477e3ca9d6688a4fdb9a75e5.tar.xz
org.eclipse.osee-9a43e015a90eda23477e3ca9d6688a4fdb9a75e5.zip
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
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/LoadDeltasBetweenTxsOnTheSameBranch.java20
1 files 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 ff3496dec2..29df6c9b7e 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,

Back to the top