Fossil SCM
Begin making use of the new date/time modifiers available in SQLite in the implementation of the byweek variant of the /report page.
Commit
a13a024beacf72e910dd1b6c53d5cfc8ec460e33ffd3862ade0cb75f16e3dfb8
Parent
4fcd911ef7ae308…
3 files changed
+1
-1
+3
-3
+4
-2
M
auto.def
+1
-1
| --- auto.def | ||
| +++ auto.def | ||
| @@ -36,11 +36,11 @@ | ||
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | # Update the minimum required SQLite version number here, and also |
| 39 | 39 | # in src/main.c near the sqlite3_libversion_number() call. Take care |
| 40 | 40 | # that both places agree! |
| 41 | -define MINIMUM_SQLITE_VERSION "3.49.0" | |
| 41 | +define MINIMUM_SQLITE_VERSION "3.54.0" | |
| 42 | 42 | |
| 43 | 43 | # This is useful for people wanting Fossil to use an external SQLite library |
| 44 | 44 | # to compare the one they have against the minimum required |
| 45 | 45 | if {[opt-bool print-minimum-sqlite-version]} { |
| 46 | 46 | puts [get-define MINIMUM_SQLITE_VERSION] |
| 47 | 47 |
| --- auto.def | |
| +++ auto.def | |
| @@ -36,11 +36,11 @@ | |
| 36 | } |
| 37 | |
| 38 | # Update the minimum required SQLite version number here, and also |
| 39 | # in src/main.c near the sqlite3_libversion_number() call. Take care |
| 40 | # that both places agree! |
| 41 | define MINIMUM_SQLITE_VERSION "3.49.0" |
| 42 | |
| 43 | # This is useful for people wanting Fossil to use an external SQLite library |
| 44 | # to compare the one they have against the minimum required |
| 45 | if {[opt-bool print-minimum-sqlite-version]} { |
| 46 | puts [get-define MINIMUM_SQLITE_VERSION] |
| 47 |
| --- auto.def | |
| +++ auto.def | |
| @@ -36,11 +36,11 @@ | |
| 36 | } |
| 37 | |
| 38 | # Update the minimum required SQLite version number here, and also |
| 39 | # in src/main.c near the sqlite3_libversion_number() call. Take care |
| 40 | # that both places agree! |
| 41 | define MINIMUM_SQLITE_VERSION "3.54.0" |
| 42 | |
| 43 | # This is useful for people wanting Fossil to use an external SQLite library |
| 44 | # to compare the one they have against the minimum required |
| 45 | if {[opt-bool print-minimum-sqlite-version]} { |
| 46 | puts [get-define MINIMUM_SQLITE_VERSION] |
| 47 |
+3
-3
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -761,14 +761,14 @@ | ||
| 761 | 761 | fossil_limit_memory(1); |
| 762 | 762 | |
| 763 | 763 | /* When updating the minimum SQLite version, change the number here, |
| 764 | 764 | ** and also MINIMUM_SQLITE_VERSION value set in ../auto.def. Take |
| 765 | 765 | ** care that both places agree! */ |
| 766 | - if( sqlite3_libversion_number()<3049000 | |
| 767 | - || strncmp(sqlite3_sourceid(),"2025-02-06",10)<0 | |
| 766 | + if( sqlite3_libversion_number()<3054000 | |
| 767 | + || strncmp(sqlite3_sourceid(),"2025-07-01",10)<0 | |
| 768 | 768 | ){ |
| 769 | - fossil_panic("Unsuitable SQLite version %s, must be at least 3.49.0", | |
| 769 | + fossil_panic("Unsuitable SQLite version %s, must be at least 3.54.0", | |
| 770 | 770 | sqlite3_libversion()); |
| 771 | 771 | } |
| 772 | 772 | |
| 773 | 773 | sqlite3_config(SQLITE_CONFIG_MULTITHREAD); |
| 774 | 774 | sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0); |
| 775 | 775 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -761,14 +761,14 @@ | |
| 761 | fossil_limit_memory(1); |
| 762 | |
| 763 | /* When updating the minimum SQLite version, change the number here, |
| 764 | ** and also MINIMUM_SQLITE_VERSION value set in ../auto.def. Take |
| 765 | ** care that both places agree! */ |
| 766 | if( sqlite3_libversion_number()<3049000 |
| 767 | || strncmp(sqlite3_sourceid(),"2025-02-06",10)<0 |
| 768 | ){ |
| 769 | fossil_panic("Unsuitable SQLite version %s, must be at least 3.49.0", |
| 770 | sqlite3_libversion()); |
| 771 | } |
| 772 | |
| 773 | sqlite3_config(SQLITE_CONFIG_MULTITHREAD); |
| 774 | sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0); |
| 775 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -761,14 +761,14 @@ | |
| 761 | fossil_limit_memory(1); |
| 762 | |
| 763 | /* When updating the minimum SQLite version, change the number here, |
| 764 | ** and also MINIMUM_SQLITE_VERSION value set in ../auto.def. Take |
| 765 | ** care that both places agree! */ |
| 766 | if( sqlite3_libversion_number()<3054000 |
| 767 | || strncmp(sqlite3_sourceid(),"2025-07-01",10)<0 |
| 768 | ){ |
| 769 | fossil_panic("Unsuitable SQLite version %s, must be at least 3.54.0", |
| 770 | sqlite3_libversion()); |
| 771 | } |
| 772 | |
| 773 | sqlite3_config(SQLITE_CONFIG_MULTITHREAD); |
| 774 | sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0); |
| 775 |
+4
-2
| --- src/statrep.c | ||
| +++ src/statrep.c | ||
| @@ -699,14 +699,16 @@ | ||
| 699 | 699 | style_submenu_checkbox("sa", "Show-All", 0, 0); |
| 700 | 700 | if( zYear==0 || strlen(zYear)!=4 ){ |
| 701 | 701 | zYear = db_text("1970","SELECT substr(date('now'),1,4);"); |
| 702 | 702 | } |
| 703 | 703 | rYearStart = db_double(0.0,"SELECT julianday('%q-01-01')",zYear); |
| 704 | - rYearEnd = db_double(0.0,"SELECT julianday('%q-12-31 23:59:59.999')",zYear); | |
| 704 | + rYearEnd = db_double(0.0,"SELECT julianday('%q-01-01','end of year')",zYear); | |
| 705 | 705 | rWeekOne = db_double(0.0,"SELECT julianday('%q-01-01','weekday 1')",zYear); |
| 706 | 706 | rWeekZero = rWeekOne>rYearStart ? rWeekOne - 7.0 : rWeekOne; |
| 707 | - rAllEnd = db_double(0.0,"SELECT julianday('%q-12-31 23:59:59.999','weekday 0')",zYear); | |
| 707 | + rAllEnd = db_double(0.0, | |
| 708 | + "SELECT julianday('%q-01-01','end of year','weekday 0')", | |
| 709 | + zYear); | |
| 708 | 710 | db_multi_exec("CREATE TEMP TABLE wkdata(wk,n);"); |
| 709 | 711 | db_prepare(&q, |
| 710 | 712 | "WITH RECURSIVE c(wkn) AS (\n" |
| 711 | 713 | " VALUES(if(:WeekZero<:WeekOne,0,1))\n" |
| 712 | 714 | " UNION ALL\n" |
| 713 | 715 |
| --- src/statrep.c | |
| +++ src/statrep.c | |
| @@ -699,14 +699,16 @@ | |
| 699 | style_submenu_checkbox("sa", "Show-All", 0, 0); |
| 700 | if( zYear==0 || strlen(zYear)!=4 ){ |
| 701 | zYear = db_text("1970","SELECT substr(date('now'),1,4);"); |
| 702 | } |
| 703 | rYearStart = db_double(0.0,"SELECT julianday('%q-01-01')",zYear); |
| 704 | rYearEnd = db_double(0.0,"SELECT julianday('%q-12-31 23:59:59.999')",zYear); |
| 705 | rWeekOne = db_double(0.0,"SELECT julianday('%q-01-01','weekday 1')",zYear); |
| 706 | rWeekZero = rWeekOne>rYearStart ? rWeekOne - 7.0 : rWeekOne; |
| 707 | rAllEnd = db_double(0.0,"SELECT julianday('%q-12-31 23:59:59.999','weekday 0')",zYear); |
| 708 | db_multi_exec("CREATE TEMP TABLE wkdata(wk,n);"); |
| 709 | db_prepare(&q, |
| 710 | "WITH RECURSIVE c(wkn) AS (\n" |
| 711 | " VALUES(if(:WeekZero<:WeekOne,0,1))\n" |
| 712 | " UNION ALL\n" |
| 713 |
| --- src/statrep.c | |
| +++ src/statrep.c | |
| @@ -699,14 +699,16 @@ | |
| 699 | style_submenu_checkbox("sa", "Show-All", 0, 0); |
| 700 | if( zYear==0 || strlen(zYear)!=4 ){ |
| 701 | zYear = db_text("1970","SELECT substr(date('now'),1,4);"); |
| 702 | } |
| 703 | rYearStart = db_double(0.0,"SELECT julianday('%q-01-01')",zYear); |
| 704 | rYearEnd = db_double(0.0,"SELECT julianday('%q-01-01','end of year')",zYear); |
| 705 | rWeekOne = db_double(0.0,"SELECT julianday('%q-01-01','weekday 1')",zYear); |
| 706 | rWeekZero = rWeekOne>rYearStart ? rWeekOne - 7.0 : rWeekOne; |
| 707 | rAllEnd = db_double(0.0, |
| 708 | "SELECT julianday('%q-01-01','end of year','weekday 0')", |
| 709 | zYear); |
| 710 | db_multi_exec("CREATE TEMP TABLE wkdata(wk,n);"); |
| 711 | db_prepare(&q, |
| 712 | "WITH RECURSIVE c(wkn) AS (\n" |
| 713 | " VALUES(if(:WeekZero<:WeekOne,0,1))\n" |
| 714 | " UNION ALL\n" |
| 715 |