mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-17 13:19:52 +01:00
Access result columns in order, in case it helps performance.
This commit is contained in:
@@ -1275,8 +1275,8 @@ abstract class JdbcDatabase implements Database<Connection> {
|
|||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
try {
|
try {
|
||||||
String sql = "SELECT messageId, parentId, m.authorId, authorName,"
|
String sql = "SELECT messageId, parentId, m.authorId, authorName,"
|
||||||
+ " authorKey, contentType, subject, timestamp, read,"
|
+ " authorKey, rating, contentType, subject, timestamp,"
|
||||||
+ " starred, rating"
|
+ " read, starred"
|
||||||
+ " FROM messages AS m"
|
+ " FROM messages AS m"
|
||||||
+ " LEFT OUTER JOIN ratings AS r"
|
+ " LEFT OUTER JOIN ratings AS r"
|
||||||
+ " ON m.authorId = r.authorId"
|
+ " ON m.authorId = r.authorId"
|
||||||
@@ -1301,13 +1301,13 @@ abstract class JdbcDatabase implements Database<Connection> {
|
|||||||
String authorName = rs.getString(4);
|
String authorName = rs.getString(4);
|
||||||
byte[] authorKey = rs.getBytes(5);
|
byte[] authorKey = rs.getBytes(5);
|
||||||
author = new Author(authorId, authorName, authorKey);
|
author = new Author(authorId, authorName, authorKey);
|
||||||
rating = Rating.values()[rs.getByte(11)];
|
rating = Rating.values()[rs.getByte(6)];
|
||||||
}
|
}
|
||||||
String contentType = rs.getString(6);
|
String contentType = rs.getString(7);
|
||||||
String subject = rs.getString(7);
|
String subject = rs.getString(8);
|
||||||
long timestamp = rs.getLong(8);
|
long timestamp = rs.getLong(9);
|
||||||
boolean read = rs.getBoolean(9);
|
boolean read = rs.getBoolean(10);
|
||||||
boolean starred = rs.getBoolean(10);
|
boolean starred = rs.getBoolean(11);
|
||||||
headers.add(new GroupMessageHeader(id, parent, contentType,
|
headers.add(new GroupMessageHeader(id, parent, contentType,
|
||||||
subject, timestamp, read, starred, g, author, rating));
|
subject, timestamp, read, starred, g, author, rating));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user