Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Additional tweaks and improvements to the "showsql" query parameter. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA3-256: |
02491c2684fa125a696b8bec6a816fd4 |
| User & Date: | drh 2024-12-23 13:20:02.344 |
Context
|
2024-12-23
| ||
| 13:36 | Further improvements to formatting of the SQL display using the "showsql" query parameter on /timeline. check-in: a1616c2dbd user: drh tags: trunk | |
| 13:20 | Additional tweaks and improvements to the "showsql" query parameter. check-in: 02491c2684 user: drh tags: trunk | |
| 12:52 | Enhance the "showsql" query parameter on /timeline to show the complete SQL needed to generate the timeline, including all temp tables creation and initialization. check-in: ebd239de02 user: drh tags: trunk | |
Changes
Changes to src/db.c.
| ︙ | ︙ | |||
655 656 657 658 659 660 661 |
if( db.pDmlLog==0 ) return;
if( db.pauseDmlLog ) return;
if( zSql==0 ) return;
nSql = strlen(zSql);
while( nSql>0 && fossil_isspace(zSql[0]) ){ nSql--; zSql++; }
while( nSql>0 && fossil_isspace(zSql[nSql-1]) ) nSql--;
if( nSql<6 ) return;
| | | | 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 |
if( db.pDmlLog==0 ) return;
if( db.pauseDmlLog ) return;
if( zSql==0 ) return;
nSql = strlen(zSql);
while( nSql>0 && fossil_isspace(zSql[0]) ){ nSql--; zSql++; }
while( nSql>0 && fossil_isspace(zSql[nSql-1]) ) nSql--;
if( nSql<6 ) return;
if( fossil_strnicmp(zSql, "SELECT", 6)==0 ) return;
if( fossil_strnicmp(zSql, "PRAGMA", 6)==0 ) return;
blob_append(db.pDmlLog, zSql, nSql);
if( zSql[nSql-1]!=';' ) blob_append_char(db.pDmlLog, ';');
blob_append_char(db.pDmlLog, '\n');
}
/*
** Set the Blob to which DML statement text should be appended. Set it
|
| ︙ | ︙ |
Changes to src/timeline.c.
| ︙ | ︙ | |||
2862 2863 2864 2865 2866 2867 2868 |
rBefore = symbolic_name_to_mtime(zBefore, &zBefore);
rAfter = symbolic_name_to_mtime(zAfter, &zAfter);
rCirca = symbolic_name_to_mtime(zCirca, &zCirca);
blob_append_sql(&sql, "%s", blob_sql_text(&cond));
if( rAfter>0.0 ){
if( rBefore>0.0 ){
blob_append_sql(&sql,
| | | | | | | 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 |
rBefore = symbolic_name_to_mtime(zBefore, &zBefore);
rAfter = symbolic_name_to_mtime(zAfter, &zAfter);
rCirca = symbolic_name_to_mtime(zCirca, &zCirca);
blob_append_sql(&sql, "%s", blob_sql_text(&cond));
if( rAfter>0.0 ){
if( rBefore>0.0 ){
blob_append_sql(&sql,
" AND event.mtime>=%.17g AND event.mtime<=%.17g\n"
" ORDER BY event.mtime ASC", rAfter-ONE_SECOND, rBefore+ONE_SECOND);
nEntry = -1;
}else{
blob_append_sql(&sql,
" AND event.mtime>=%.17g\n ORDER BY event.mtime ASC",
rAfter-ONE_SECOND);
}
zCirca = 0;
url_add_parameter(&url, "c", 0);
}else if( rBefore>0.0 ){
blob_append_sql(&sql,
" AND event.mtime<=%.17g\n ORDER BY event.mtime DESC",
rBefore+ONE_SECOND);
zCirca = 0;
url_add_parameter(&url, "c", 0);
}else if( rCirca>0.0 ){
Blob sql2;
blob_init(&sql2, blob_sql_text(&sql), -1);
blob_append_sql(&sql2,
" AND event.mtime>=%f\n ORDER BY event.mtime ASC", rCirca);
if( nEntry>0 ){
blob_append_sql(&sql2," LIMIT %d", (nEntry+1)/2);
}
db_multi_exec("%s", blob_sql_text(&sql2));
if( nEntry>0 ){
nEntry -= db_int(0,"select count(*) from timeline");
if( nEntry<=0 ) nEntry = 1;
}
blob_reset(&sql2);
blob_append_sql(&sql,
" AND event.mtime<=%f\n ORDER BY event.mtime DESC",
rCirca
);
if( zMark==0 ) zMark = zCirca;
}else{
blob_append_sql(&sql, " ORDER BY event.mtime DESC");
}
if( nEntry>0 ) blob_append_sql(&sql, " LIMIT %d", nEntry);
|
| ︙ | ︙ |