From 433fe94e614f3135bed8b37dcf678f575ec39fb1 Mon Sep 17 00:00:00 2001
From: akwizgran <michael@briarproject.org>
Date: Tue, 9 Apr 2013 17:19:38 +0100
Subject: [PATCH] Fixed an ambiguous column name, removed some logging.

---
 briar-core/src/net/sf/briar/db/JdbcDatabase.java | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/briar-core/src/net/sf/briar/db/JdbcDatabase.java b/briar-core/src/net/sf/briar/db/JdbcDatabase.java
index 62c792be0b..d1ccf16bf9 100644
--- a/briar-core/src/net/sf/briar/db/JdbcDatabase.java
+++ b/briar-core/src/net/sf/briar/db/JdbcDatabase.java
@@ -9,7 +9,6 @@ import static net.sf.briar.api.messaging.MessagingConstants.RETENTION_MODULUS;
 import static net.sf.briar.api.messaging.Rating.UNRATED;
 import static net.sf.briar.db.ExponentialBackoff.calculateExpiry;
 
-import java.io.File;
 import java.io.IOException;
 import java.sql.Connection;
 import java.sql.PreparedStatement;
@@ -382,12 +381,7 @@ abstract class JdbcDatabase implements Database<Connection> {
 
 	protected boolean open(String driverClass) throws DbException, IOException {
 		boolean reopen = config.databaseExists();
-		File dir = config.getDatabaseDirectory();
-		if(LOG.isLoggable(INFO)) {
-			LOG.info("Database directory: " + dir.getPath());
-			if(reopen) for(File f : dir.listFiles()) LOG.info(f.getPath());
-		}
-		if(!reopen) dir.mkdirs();
+		if(!reopen) config.getDatabaseDirectory().mkdirs();
 		// Load the JDBC driver
 		try {
 			Class.forName(driverClass);
@@ -1630,7 +1624,7 @@ abstract class JdbcDatabase implements Database<Connection> {
 					+ " AND cg.contactId = s.contactId"
 					+ " WHERE cg.contactId = ?"
 					+ " AND timestamp >= retention"
-					+ " AND seen = FALSE AND expiry < ?"
+					+ " AND seen = FALSE AND s.expiry < ?"
 					+ " AND sendability > ZERO()"
 					+ " ORDER BY timestamp DESC LIMIT ?";
 			ps = txn.prepareStatement(sql);
-- 
GitLab