From bcd3818929dd93d09af4743b314faa1be98c6d76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Sejkora?= Date: Mon, 15 Feb 2021 16:45:10 +0100 Subject: [PATCH] Fix combine bound axis not being part of primary key This did not impact results, as it only resulted in looser bounds and some bounds not being stored. --- src/db.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/db.rs b/src/db.rs index 59ac746..a276154 100644 --- a/src/db.rs +++ b/src/db.rs @@ -226,7 +226,7 @@ impl SqliteLayoutDB { pub fn add_merge_lower_bounds(&mut self, lower_bounds: Vec) -> Result<()> { let transaction = self.connection.transaction()?; for lower_bound in &lower_bounds { - transaction.execute("INSERT INTO merge_lower_bounds (left_layout_id, right_layout_id, axis, price) VALUES (?1, ?2, ?3, ?4) ON CONFLICT(left_layout_id, right_layout_id) DO UPDATE SET price = ?4", + transaction.execute("INSERT INTO merge_lower_bounds (left_layout_id, right_layout_id, axis, price) VALUES (?1, ?2, ?3, ?4) ON CONFLICT(left_layout_id, right_layout_id, axis) DO UPDATE SET price = ?4", params![lower_bound.left_layout_id as u32, lower_bound.right_layout_id as u32, if lower_bound.y_axis {1u32} else {0u32},