Skip to content

Commit 8ba48f4

Browse files
authored
Merge branch 'main' into main
2 parents bfc521a + 6bd9fc8 commit 8ba48f4

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

src/main/java/com/oltpbenchmark/benchmarks/auctionmark/AuctionMarkProfile.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -698,9 +698,9 @@ public ItemId getNextItemId(UserId seller_id) {
698698
Integer cnt = this.seller_item_cnt.get(seller_id);
699699
if (cnt == null || cnt == 0) {
700700
cnt = seller_id.getItemCount();
701-
//this.seller_item_cnt.put(seller_id, cnt);
701+
this.seller_item_cnt.put(seller_id, cnt);
702702
}
703-
this.seller_item_cnt.put(seller_id, cnt);
703+
this.seller_item_cnt.put(seller_id, 1);
704704
return (new ItemId(seller_id, cnt));
705705
}
706706

src/main/java/com/oltpbenchmark/benchmarks/auctionmark/AuctionMarkWorker.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,8 @@ protected boolean executeCloseAuctions(Connection conn, CloseAuctions proc) thro
444444
LOG.debug("Executing {}", proc);
445445
}
446446
Timestamp[] benchmarkTimes = this.getTimestampParameterArray();
447-
Timestamp startTime = profile.getLastCloseAuctionsTime();
448-
Timestamp endTime = profile.updateAndGetLastCloseAuctionsTime();
447+
Timestamp startTime = Timestamp.from(profile.getLastCloseAuctionsTime().toInstant());
448+
Timestamp endTime = Timestamp.from(profile.updateAndGetLastCloseAuctionsTime().toInstant());
449449

450450
List<Object[]> results = proc.run(conn, benchmarkTimes, startTime, endTime);
451451

src/main/java/com/oltpbenchmark/benchmarks/auctionmark/procedures/CloseAuctions.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,15 @@ public List<Object[]> run(Connection conn, Timestamp[] benchmarkTimes,
116116
output_rows.clear();
117117
while (dueItemsTable.next()) {
118118
col = 1;
119-
long itemId = dueItemsTable.getLong(col++);
120-
long sellerId = dueItemsTable.getLong(col++);
119+
String itemId = dueItemsTable.getString(col++);
120+
String sellerId = dueItemsTable.getString(col++);
121121
String i_name = dueItemsTable.getString(col++);
122122
double currentPrice = dueItemsTable.getDouble(col++);
123123
long numBids = dueItemsTable.getLong(col++);
124124
Timestamp endDate = dueItemsTable.getTimestamp(col++);
125125
ItemStatus itemStatus = ItemStatus.get(dueItemsTable.getLong(col++));
126126
Long bidId = null;
127-
Long buyerId = null;
127+
String buyerId = null;
128128

129129
if (debug) {
130130
LOG.debug(String.format("Getting max bid for itemId=%d / sellerId=%d", itemId, sellerId));
@@ -139,15 +139,15 @@ public List<Object[]> run(Connection conn, Timestamp[] benchmarkTimes,
139139
waiting_ctr++;
140140

141141
param = 1;
142-
maxBidStmt.setLong(param++, itemId);
143-
maxBidStmt.setLong(param++, sellerId);
142+
maxBidStmt.setString(param++, itemId);
143+
maxBidStmt.setString(param++, sellerId);
144144
try (ResultSet maxBidResults = maxBidStmt.executeQuery()) {
145145
adv = maxBidResults.next();
146146

147147

148148
col = 1;
149149
bidId = maxBidResults.getLong(col++);
150-
buyerId = maxBidResults.getLong(col++);
150+
buyerId = maxBidResults.getString(col++);
151151
try (PreparedStatement preparedStatement = this.getPreparedStatement(conn, insertUserItem, buyerId, itemId, sellerId, currentTime)) {
152152
preparedStatement.executeUpdate();
153153
}

src/main/resources/benchmarks/auctionmark/dialect-postgres.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<dialect type="POSTGRES">
44
<procedure name="CloseAuctions">
55
<statement name="updateItemStatus">UPDATE item SET i_status = ?, i_updated = ? WHERE i_id = ? AND i_u_id = ?</statement>
6-
<statement name="getDueItems">SELECT i_id, i_u_id, i_name, i_current_price, i_num_bids, i_end_date, i_status FROM item WHERE (i_start_date BETWEEN ? AND ?) AND i_status = 0 ORDER BY i_id ASC LIMIT 100</statement>
6+
<statement name="getDueItems">SELECT i_id, i_u_id, i_name, i_current_price, i_num_bids, i_end_date, i_status FROM item WHERE (i_start_date BETWEEN ? AND ?) AND i_status = ? ORDER BY i_id ASC LIMIT 100</statement>
77
<statement name="getMaxBid">SELECT imb_ib_id, ib_buyer_id FROM item_max_bid, item_bid WHERE imb_i_id = ? AND imb_u_id = ? AND ib_id = imb_ib_id AND ib_i_id = imb_i_id AND ib_u_id = imb_u_id</statement>
88
<statement name="insertUserItem">INSERT INTO useracct_item(ui_u_id, ui_i_id, ui_i_u_id, ui_created) VALUES(?, ?, ?, ?)</statement>
99
</procedure>

0 commit comments

Comments
 (0)