Fossil SCM

Improvements to the /test-warning webpage.

drh 2018-06-24 17:51 trunk
Commit 8d9ad7501e1fc4acafbccc260512f1832cae88c61fc2db759778468c62f4f4f3
2 files changed +2 -2 +7 -2
+2 -2
--- src/db.c
+++ src/db.c
@@ -174,11 +174,11 @@
174174
db.nBegin++;
175175
}
176176
void db_end_transaction(int rollbackFlag){
177177
if( g.db==0 ) return;
178178
if( db.nBegin<=0 ){
179
- fossil_warning("Extra call to db_end_transaction\n");
179
+ fossil_warning("Extra call to db_end_transaction");
180180
return;
181181
}
182182
if( rollbackFlag ){
183183
db.doRollback = 1;
184184
if( g.fSqlTrace ) fossil_trace("-- ROLLBACK by request\n");
@@ -1777,11 +1777,11 @@
17771777
}
17781778
while( db.pAllStmt ){
17791779
db_finalize(db.pAllStmt);
17801780
}
17811781
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.");
17831783
db_end_transaction(1);
17841784
}
17851785
pStmt = 0;
17861786
g.dbIgnoreErrors++; /* Stop "database locked" warnings from PRAGMA optimize */
17871787
sqlite3_exec(g.db, "PRAGMA optimize", 0, 0, 0);
17881788
--- 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 @@
27242724
** case=2 Extra db_begin_transaction()
27252725
** case=3 Extra db_end_transaction()
27262726
*/
27272727
void test_warning_page(void){
27282728
int iCase = atoi(PD("case","1"));
2729
+ int i;
27292730
login_check_credentials();
27302731
if( !g.perm.Admin ){ fossil_redirect_home(); return; }
27312732
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>
27342739
@ <li value='1'> Call fossil_warning()
27352740
if( iCase==1 ){
27362741
fossil_warning("Test warning message from /test-warning");
27372742
}
27382743
@ <li value='2'> Call db_begin_transaction()
27392744
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button