Skip to content

Commit

Permalink
correctly generate _id as INTEGER in sectioned_date_view
Browse files Browse the repository at this point in the history
  • Loading branch information
CampelloManuel committed Sep 12, 2024
1 parent ea7de43 commit 33a7e77
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,13 @@ private Columns() {}
* @return a SQL query to create this view
*/
public static String CREATE_SECTIONED_DATE_VIEW(final String listId) {

// TODO on the API 35 emulator (and on the Google Pixel 8a), this function creates a view
// where the "dblist" column is (erroneously) of type BLOB, while on the API 34 emulator
// (and in previous android versions) "dblist" correctly maintains the INTEGER TYPE.
// I think it's because we supply sListId and listId with arrayToCommaString(), so
// we get '1' instead of 1. On older android versions this is ignored, but since API 35
// it becomes a problem.
final String sListId = listId == null ? " NOT NULL " : "'" + listId + "'";

String beginning = "CREATE TEMP VIEW IF NOT EXISTS " + getSECTION_DATE_VIEW_NAME(listId) +
Expand Down Expand Up @@ -505,7 +512,7 @@ Columns.DUE, TODAY_PLUS(daysUntilNextYear), Columns.TITLE, HEADER_KEY_NEXT_YEAR,
" BETWEEN " + OVERDUE + " AND " + TODAY_START + ") ";

// Later. As of now, later = "after the end of the next year"
String later = " UNION ALL " + " SELECT '-1'," + asEmptyCommaStringExcept(Columns.FIELDS_NO_ID,
String later = " UNION ALL " + " SELECT -1," + asEmptyCommaStringExcept(Columns.FIELDS_NO_ID,
Columns.DUE, TODAY_PLUS(toEndOfNextYear), Columns.TITLE, HEADER_KEY_LATER, Columns.DBLIST,
listId) + ",0,0" +
// Only show header if there are tasks under it
Expand Down

0 comments on commit 33a7e77

Please sign in to comment.