mirror of
https://github.com/moparisthebest/k-9
synced 2024-12-25 17:18:50 -05:00
Fix crash due to ambiguous column name in SORT clause
This commit is contained in:
parent
aff9bec92b
commit
1c75590e7a
@ -73,10 +73,21 @@ public class EmailProvider extends ContentProvider {
|
|||||||
THREAD_AGGREGATION_FUNCS.put(MessageColumns.ANSWERED, "MIN");
|
THREAD_AGGREGATION_FUNCS.put(MessageColumns.ANSWERED, "MIN");
|
||||||
THREAD_AGGREGATION_FUNCS.put(MessageColumns.FORWARDED, "MIN");
|
THREAD_AGGREGATION_FUNCS.put(MessageColumns.FORWARDED, "MIN");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final String[] FIXUP_MESSAGES_COLUMNS = {
|
private static final String[] FIXUP_MESSAGES_COLUMNS = {
|
||||||
MessageColumns.ID
|
MessageColumns.ID
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private static final String[] FIXUP_AGGREGATED_MESSAGES_COLUMNS = {
|
||||||
|
MessageColumns.DATE,
|
||||||
|
MessageColumns.INTERNAL_DATE,
|
||||||
|
MessageColumns.ATTACHMENT_COUNT,
|
||||||
|
MessageColumns.READ,
|
||||||
|
MessageColumns.FLAGGED,
|
||||||
|
MessageColumns.ANSWERED,
|
||||||
|
MessageColumns.FORWARDED
|
||||||
|
};
|
||||||
|
|
||||||
private static final String FOLDERS_TABLE = "folders";
|
private static final String FOLDERS_TABLE = "folders";
|
||||||
|
|
||||||
private static final String[] FOLDERS_COLUMNS = {
|
private static final String[] FOLDERS_COLUMNS = {
|
||||||
@ -408,7 +419,8 @@ public class EmailProvider extends ContentProvider {
|
|||||||
query.append("WHERE m." + MessageColumns.DATE + " = a." + MessageColumns.DATE);
|
query.append("WHERE m." + MessageColumns.DATE + " = a." + MessageColumns.DATE);
|
||||||
if (!StringUtils.isNullOrEmpty(sortOrder)) {
|
if (!StringUtils.isNullOrEmpty(sortOrder)) {
|
||||||
query.append(" ORDER BY ");
|
query.append(" ORDER BY ");
|
||||||
query.append(sortOrder);
|
query.append(SqlQueryBuilder.addPrefixToSelection(
|
||||||
|
FIXUP_AGGREGATED_MESSAGES_COLUMNS, "a.", sortOrder));
|
||||||
}
|
}
|
||||||
|
|
||||||
return db.rawQuery(query.toString(), selectionArgs);
|
return db.rawQuery(query.toString(), selectionArgs);
|
||||||
|
Loading…
Reference in New Issue
Block a user