Fossil SCM
Add "De-ANALYZE" buttons on the schema display pages.
Commit
1c64373d05145244813f2dc609e9c7a4e7cda90fb02eab6f5d37add2dbf222a5
Parent
6da255034b30b4b…
1 file changed
+14
-2
+14
-2
| --- src/stat.c | ||
| +++ src/stat.c | ||
| @@ -723,10 +723,15 @@ | ||
| 723 | 723 | ){ |
| 724 | 724 | if( P("analyze")!=0 ){ |
| 725 | 725 | db_multi_exec("ANALYZE \"%w\"", zArg); |
| 726 | 726 | }else if( P("analyze200")!=0 ){ |
| 727 | 727 | db_multi_exec("PRAGMA analysis_limit=200; ANALYZE \"%w\"", zArg); |
| 728 | + }else if( P("deanalyze")!=0 ){ | |
| 729 | + db_unprotect(PROTECT_ALL); | |
| 730 | + db_multi_exec("DELETE FROM repository.sqlite_stat1" | |
| 731 | + " WHERE tbl LIKE %Q", zArg); | |
| 732 | + db_protect_pop(); | |
| 728 | 733 | } |
| 729 | 734 | } |
| 730 | 735 | |
| 731 | 736 | style_set_current_feature("stat"); |
| 732 | 737 | style_header("Repository Schema"); |
| @@ -773,11 +778,12 @@ | ||
| 773 | 778 | } |
| 774 | 779 | } |
| 775 | 780 | @ <hr><form method="POST"> |
| 776 | 781 | @ <input type="submit" name="analyze" value="Run ANALYZE"><br /> |
| 777 | 782 | @ <input type="submit" name="analyze200"\ |
| 778 | - @ value="Run ANALYZE with limit=200"> | |
| 783 | + @ value="Run ANALYZE with limit=200"><br /> | |
| 784 | + @ <input type="submit" name="deanalyze" value="De-ANALYZE"> | |
| 779 | 785 | @ </form> |
| 780 | 786 | |
| 781 | 787 | style_finish_page(); |
| 782 | 788 | } |
| 783 | 789 | |
| @@ -794,10 +800,14 @@ | ||
| 794 | 800 | |
| 795 | 801 | if( P("analyze")!=0 && cgi_csrf_safe(1) ){ |
| 796 | 802 | db_multi_exec("ANALYZE"); |
| 797 | 803 | }else if( P("analyze200")!=0 && cgi_csrf_safe(1) ){ |
| 798 | 804 | db_multi_exec("PRAGMA analysis_limit=200; ANALYZE;"); |
| 805 | + }else if( P("deanalyze")!=0 && cgi_csrf_safe(1) ){ | |
| 806 | + db_unprotect(PROTECT_ALL); | |
| 807 | + db_multi_exec("DELETE FROM repository.sqlite_stat1;"); | |
| 808 | + db_protect_pop(); | |
| 799 | 809 | } |
| 800 | 810 | style_set_current_feature("stat"); |
| 801 | 811 | style_header("Repository STAT1 Table"); |
| 802 | 812 | style_adunit_config(ADUNIT_RIGHT_OK); |
| 803 | 813 | style_submenu_element("Stat", "stat"); |
| @@ -837,11 +847,13 @@ | ||
| 837 | 847 | if( bTabular ){ |
| 838 | 848 | @ <input type="hidden" name="tabular" value="1"> |
| 839 | 849 | } |
| 840 | 850 | @ <input type="submit" name="analyze" value="Run ANALYZE"><br /> |
| 841 | 851 | @ <input type="submit" name="analyze200"\ |
| 842 | - @ value="Run ANALYZE with limit=200"> | |
| 852 | + @ value="Run ANALYZE with limit=200"><br> | |
| 853 | + @ <input type="submit" name="deanalyze"\ | |
| 854 | + @ value="De-ANALYZE"> | |
| 843 | 855 | @ </form> |
| 844 | 856 | style_finish_page(); |
| 845 | 857 | } |
| 846 | 858 | |
| 847 | 859 | /* |
| 848 | 860 |
| --- src/stat.c | |
| +++ src/stat.c | |
| @@ -723,10 +723,15 @@ | |
| 723 | ){ |
| 724 | if( P("analyze")!=0 ){ |
| 725 | db_multi_exec("ANALYZE \"%w\"", zArg); |
| 726 | }else if( P("analyze200")!=0 ){ |
| 727 | db_multi_exec("PRAGMA analysis_limit=200; ANALYZE \"%w\"", zArg); |
| 728 | } |
| 729 | } |
| 730 | |
| 731 | style_set_current_feature("stat"); |
| 732 | style_header("Repository Schema"); |
| @@ -773,11 +778,12 @@ | |
| 773 | } |
| 774 | } |
| 775 | @ <hr><form method="POST"> |
| 776 | @ <input type="submit" name="analyze" value="Run ANALYZE"><br /> |
| 777 | @ <input type="submit" name="analyze200"\ |
| 778 | @ value="Run ANALYZE with limit=200"> |
| 779 | @ </form> |
| 780 | |
| 781 | style_finish_page(); |
| 782 | } |
| 783 | |
| @@ -794,10 +800,14 @@ | |
| 794 | |
| 795 | if( P("analyze")!=0 && cgi_csrf_safe(1) ){ |
| 796 | db_multi_exec("ANALYZE"); |
| 797 | }else if( P("analyze200")!=0 && cgi_csrf_safe(1) ){ |
| 798 | db_multi_exec("PRAGMA analysis_limit=200; ANALYZE;"); |
| 799 | } |
| 800 | style_set_current_feature("stat"); |
| 801 | style_header("Repository STAT1 Table"); |
| 802 | style_adunit_config(ADUNIT_RIGHT_OK); |
| 803 | style_submenu_element("Stat", "stat"); |
| @@ -837,11 +847,13 @@ | |
| 837 | if( bTabular ){ |
| 838 | @ <input type="hidden" name="tabular" value="1"> |
| 839 | } |
| 840 | @ <input type="submit" name="analyze" value="Run ANALYZE"><br /> |
| 841 | @ <input type="submit" name="analyze200"\ |
| 842 | @ value="Run ANALYZE with limit=200"> |
| 843 | @ </form> |
| 844 | style_finish_page(); |
| 845 | } |
| 846 | |
| 847 | /* |
| 848 |
| --- src/stat.c | |
| +++ src/stat.c | |
| @@ -723,10 +723,15 @@ | |
| 723 | ){ |
| 724 | if( P("analyze")!=0 ){ |
| 725 | db_multi_exec("ANALYZE \"%w\"", zArg); |
| 726 | }else if( P("analyze200")!=0 ){ |
| 727 | db_multi_exec("PRAGMA analysis_limit=200; ANALYZE \"%w\"", zArg); |
| 728 | }else if( P("deanalyze")!=0 ){ |
| 729 | db_unprotect(PROTECT_ALL); |
| 730 | db_multi_exec("DELETE FROM repository.sqlite_stat1" |
| 731 | " WHERE tbl LIKE %Q", zArg); |
| 732 | db_protect_pop(); |
| 733 | } |
| 734 | } |
| 735 | |
| 736 | style_set_current_feature("stat"); |
| 737 | style_header("Repository Schema"); |
| @@ -773,11 +778,12 @@ | |
| 778 | } |
| 779 | } |
| 780 | @ <hr><form method="POST"> |
| 781 | @ <input type="submit" name="analyze" value="Run ANALYZE"><br /> |
| 782 | @ <input type="submit" name="analyze200"\ |
| 783 | @ value="Run ANALYZE with limit=200"><br /> |
| 784 | @ <input type="submit" name="deanalyze" value="De-ANALYZE"> |
| 785 | @ </form> |
| 786 | |
| 787 | style_finish_page(); |
| 788 | } |
| 789 | |
| @@ -794,10 +800,14 @@ | |
| 800 | |
| 801 | if( P("analyze")!=0 && cgi_csrf_safe(1) ){ |
| 802 | db_multi_exec("ANALYZE"); |
| 803 | }else if( P("analyze200")!=0 && cgi_csrf_safe(1) ){ |
| 804 | db_multi_exec("PRAGMA analysis_limit=200; ANALYZE;"); |
| 805 | }else if( P("deanalyze")!=0 && cgi_csrf_safe(1) ){ |
| 806 | db_unprotect(PROTECT_ALL); |
| 807 | db_multi_exec("DELETE FROM repository.sqlite_stat1;"); |
| 808 | db_protect_pop(); |
| 809 | } |
| 810 | style_set_current_feature("stat"); |
| 811 | style_header("Repository STAT1 Table"); |
| 812 | style_adunit_config(ADUNIT_RIGHT_OK); |
| 813 | style_submenu_element("Stat", "stat"); |
| @@ -837,11 +847,13 @@ | |
| 847 | if( bTabular ){ |
| 848 | @ <input type="hidden" name="tabular" value="1"> |
| 849 | } |
| 850 | @ <input type="submit" name="analyze" value="Run ANALYZE"><br /> |
| 851 | @ <input type="submit" name="analyze200"\ |
| 852 | @ value="Run ANALYZE with limit=200"><br> |
| 853 | @ <input type="submit" name="deanalyze"\ |
| 854 | @ value="De-ANALYZE"> |
| 855 | @ </form> |
| 856 | style_finish_page(); |
| 857 | } |
| 858 | |
| 859 | /* |
| 860 |