Fossil SCM
Improvements to the /test-warning webpage.
Commit
8d9ad7501e1fc4acafbccc260512f1832cae88c61fc2db759778468c62f4f4f3
Parent
f87fb02780a03b1…
2 files changed
+2
-2
+7
-2
M
src/db.c
+2
-2
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -174,11 +174,11 @@ | ||
| 174 | 174 | db.nBegin++; |
| 175 | 175 | } |
| 176 | 176 | void db_end_transaction(int rollbackFlag){ |
| 177 | 177 | if( g.db==0 ) return; |
| 178 | 178 | if( db.nBegin<=0 ){ |
| 179 | - fossil_warning("Extra call to db_end_transaction\n"); | |
| 179 | + fossil_warning("Extra call to db_end_transaction"); | |
| 180 | 180 | return; |
| 181 | 181 | } |
| 182 | 182 | if( rollbackFlag ){ |
| 183 | 183 | db.doRollback = 1; |
| 184 | 184 | if( g.fSqlTrace ) fossil_trace("-- ROLLBACK by request\n"); |
| @@ -1777,11 +1777,11 @@ | ||
| 1777 | 1777 | } |
| 1778 | 1778 | while( db.pAllStmt ){ |
| 1779 | 1779 | db_finalize(db.pAllStmt); |
| 1780 | 1780 | } |
| 1781 | 1781 | if( db.nBegin ){ |
| 1782 | - fossil_warning("Missed call to db_end_transaction(). Rolling back.\n"); | |
| 1782 | + fossil_warning("Missed call to db_end_transaction(). Rolling back."); | |
| 1783 | 1783 | db_end_transaction(1); |
| 1784 | 1784 | } |
| 1785 | 1785 | pStmt = 0; |
| 1786 | 1786 | g.dbIgnoreErrors++; /* Stop "database locked" warnings from PRAGMA optimize */ |
| 1787 | 1787 | sqlite3_exec(g.db, "PRAGMA optimize", 0, 0, 0); |
| 1788 | 1788 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -174,11 +174,11 @@ | |
| 174 | db.nBegin++; |
| 175 | } |
| 176 | void db_end_transaction(int rollbackFlag){ |
| 177 | if( g.db==0 ) return; |
| 178 | if( db.nBegin<=0 ){ |
| 179 | fossil_warning("Extra call to db_end_transaction\n"); |
| 180 | return; |
| 181 | } |
| 182 | if( rollbackFlag ){ |
| 183 | db.doRollback = 1; |
| 184 | if( g.fSqlTrace ) fossil_trace("-- ROLLBACK by request\n"); |
| @@ -1777,11 +1777,11 @@ | |
| 1777 | } |
| 1778 | while( db.pAllStmt ){ |
| 1779 | db_finalize(db.pAllStmt); |
| 1780 | } |
| 1781 | if( db.nBegin ){ |
| 1782 | fossil_warning("Missed call to db_end_transaction(). Rolling back.\n"); |
| 1783 | db_end_transaction(1); |
| 1784 | } |
| 1785 | pStmt = 0; |
| 1786 | g.dbIgnoreErrors++; /* Stop "database locked" warnings from PRAGMA optimize */ |
| 1787 | sqlite3_exec(g.db, "PRAGMA optimize", 0, 0, 0); |
| 1788 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -174,11 +174,11 @@ | |
| 174 | db.nBegin++; |
| 175 | } |
| 176 | void db_end_transaction(int rollbackFlag){ |
| 177 | if( g.db==0 ) return; |
| 178 | if( db.nBegin<=0 ){ |
| 179 | fossil_warning("Extra call to db_end_transaction"); |
| 180 | return; |
| 181 | } |
| 182 | if( rollbackFlag ){ |
| 183 | db.doRollback = 1; |
| 184 | if( g.fSqlTrace ) fossil_trace("-- ROLLBACK by request\n"); |
| @@ -1777,11 +1777,11 @@ | |
| 1777 | } |
| 1778 | while( db.pAllStmt ){ |
| 1779 | db_finalize(db.pAllStmt); |
| 1780 | } |
| 1781 | if( db.nBegin ){ |
| 1782 | fossil_warning("Missed call to db_end_transaction(). Rolling back."); |
| 1783 | db_end_transaction(1); |
| 1784 | } |
| 1785 | pStmt = 0; |
| 1786 | g.dbIgnoreErrors++; /* Stop "database locked" warnings from PRAGMA optimize */ |
| 1787 | sqlite3_exec(g.db, "PRAGMA optimize", 0, 0, 0); |
| 1788 |
+7
-2
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -2724,15 +2724,20 @@ | ||
| 2724 | 2724 | ** case=2 Extra db_begin_transaction() |
| 2725 | 2725 | ** case=3 Extra db_end_transaction() |
| 2726 | 2726 | */ |
| 2727 | 2727 | void test_warning_page(void){ |
| 2728 | 2728 | int iCase = atoi(PD("case","1")); |
| 2729 | + int i; | |
| 2729 | 2730 | login_check_credentials(); |
| 2730 | 2731 | if( !g.perm.Admin ){ fossil_redirect_home(); return; } |
| 2731 | 2732 | style_header("Warning Test Page"); |
| 2732 | - @ <p>This is the test page for case=%d(iCase)</p> | |
| 2733 | - @ <ol> | |
| 2733 | + @ <p>This is the test page for case=%d(iCase). Cases: | |
| 2734 | + for(i=1; i<=3; i++){ | |
| 2735 | + @ <a href='./test-warning?case=%d(i)'>[%d(i)]</a> | |
| 2736 | + } | |
| 2737 | + @ </p> | |
| 2738 | + @ <p><ol> | |
| 2734 | 2739 | @ <li value='1'> Call fossil_warning() |
| 2735 | 2740 | if( iCase==1 ){ |
| 2736 | 2741 | fossil_warning("Test warning message from /test-warning"); |
| 2737 | 2742 | } |
| 2738 | 2743 | @ <li value='2'> Call db_begin_transaction() |
| 2739 | 2744 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -2724,15 +2724,20 @@ | |
| 2724 | ** case=2 Extra db_begin_transaction() |
| 2725 | ** case=3 Extra db_end_transaction() |
| 2726 | */ |
| 2727 | void test_warning_page(void){ |
| 2728 | int iCase = atoi(PD("case","1")); |
| 2729 | login_check_credentials(); |
| 2730 | if( !g.perm.Admin ){ fossil_redirect_home(); return; } |
| 2731 | style_header("Warning Test Page"); |
| 2732 | @ <p>This is the test page for case=%d(iCase)</p> |
| 2733 | @ <ol> |
| 2734 | @ <li value='1'> Call fossil_warning() |
| 2735 | if( iCase==1 ){ |
| 2736 | fossil_warning("Test warning message from /test-warning"); |
| 2737 | } |
| 2738 | @ <li value='2'> Call db_begin_transaction() |
| 2739 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -2724,15 +2724,20 @@ | |
| 2724 | ** case=2 Extra db_begin_transaction() |
| 2725 | ** case=3 Extra db_end_transaction() |
| 2726 | */ |
| 2727 | void test_warning_page(void){ |
| 2728 | int iCase = atoi(PD("case","1")); |
| 2729 | int i; |
| 2730 | login_check_credentials(); |
| 2731 | if( !g.perm.Admin ){ fossil_redirect_home(); return; } |
| 2732 | style_header("Warning Test Page"); |
| 2733 | @ <p>This is the test page for case=%d(iCase). Cases: |
| 2734 | for(i=1; i<=3; i++){ |
| 2735 | @ <a href='./test-warning?case=%d(i)'>[%d(i)]</a> |
| 2736 | } |
| 2737 | @ </p> |
| 2738 | @ <p><ol> |
| 2739 | @ <li value='1'> Call fossil_warning() |
| 2740 | if( iCase==1 ){ |
| 2741 | fossil_warning("Test warning message from /test-warning"); |
| 2742 | } |
| 2743 | @ <li value='2'> Call db_begin_transaction() |
| 2744 |