Fossil SCM
Improvements to the /admin_sql page.
Commit
6325f81d0605d7acf3002923c499d612b26f44f68b04d72e05899387f8cb44fb
Parent
e5c054376069939…
1 file changed
+3
-4
+3
-4
| --- src/setup.c | ||
| +++ src/setup.c | ||
| @@ -1731,13 +1731,11 @@ | ||
| 1731 | 1731 | zQ = sqlite3_mprintf( |
| 1732 | 1732 | "SELECT sql FROM repository.sqlite_schema" |
| 1733 | 1733 | " WHERE sql IS NOT NULL ORDER BY name"); |
| 1734 | 1734 | go = 1; |
| 1735 | 1735 | }else if( P("tablelist") ){ |
| 1736 | - zQ = sqlite3_mprintf( | |
| 1737 | - "SELECT name FROM repository.sqlite_schema WHERE type='table'" | |
| 1738 | - " ORDER BY name"); | |
| 1736 | + zQ = sqlite3_mprintf("SELECT*FROM pragma_table_list ORDER BY schema, name"); | |
| 1739 | 1737 | go = 1; |
| 1740 | 1738 | } |
| 1741 | 1739 | if( go ){ |
| 1742 | 1740 | sqlite3_stmt *pStmt; |
| 1743 | 1741 | int rc; |
| @@ -1746,10 +1744,11 @@ | ||
| 1746 | 1744 | int nRow = 0; |
| 1747 | 1745 | int i; |
| 1748 | 1746 | @ <hr /> |
| 1749 | 1747 | login_verify_csrf_secret(); |
| 1750 | 1748 | sqlite3_set_authorizer(g.db, raw_sql_query_authorizer, 0); |
| 1749 | + search_sql_setup(g.db); | |
| 1751 | 1750 | rc = sqlite3_prepare_v2(g.db, zQ, -1, &pStmt, &zTail); |
| 1752 | 1751 | if( rc!=SQLITE_OK ){ |
| 1753 | 1752 | @ <div class="generalError">%h(sqlite3_errmsg(g.db))</div> |
| 1754 | 1753 | sqlite3_finalize(pStmt); |
| 1755 | 1754 | }else if( pStmt==0 ){ |
| @@ -1759,11 +1758,11 @@ | ||
| 1759 | 1758 | rc = sqlite3_finalize(pStmt); |
| 1760 | 1759 | if( rc ){ |
| 1761 | 1760 | @ <div class="generalError">%h(sqlite3_errmsg(g.db))</div> |
| 1762 | 1761 | } |
| 1763 | 1762 | }else{ |
| 1764 | - @ <table border=1> | |
| 1763 | + @ <table border="1" cellpadding="4" cellspacing="0"> | |
| 1765 | 1764 | while( sqlite3_step(pStmt)==SQLITE_ROW ){ |
| 1766 | 1765 | if( nRow==0 ){ |
| 1767 | 1766 | @ <tr> |
| 1768 | 1767 | for(i=0; i<nCol; i++){ |
| 1769 | 1768 | @ <th>%h(sqlite3_column_name(pStmt, i))</th> |
| 1770 | 1769 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -1731,13 +1731,11 @@ | |
| 1731 | zQ = sqlite3_mprintf( |
| 1732 | "SELECT sql FROM repository.sqlite_schema" |
| 1733 | " WHERE sql IS NOT NULL ORDER BY name"); |
| 1734 | go = 1; |
| 1735 | }else if( P("tablelist") ){ |
| 1736 | zQ = sqlite3_mprintf( |
| 1737 | "SELECT name FROM repository.sqlite_schema WHERE type='table'" |
| 1738 | " ORDER BY name"); |
| 1739 | go = 1; |
| 1740 | } |
| 1741 | if( go ){ |
| 1742 | sqlite3_stmt *pStmt; |
| 1743 | int rc; |
| @@ -1746,10 +1744,11 @@ | |
| 1746 | int nRow = 0; |
| 1747 | int i; |
| 1748 | @ <hr /> |
| 1749 | login_verify_csrf_secret(); |
| 1750 | sqlite3_set_authorizer(g.db, raw_sql_query_authorizer, 0); |
| 1751 | rc = sqlite3_prepare_v2(g.db, zQ, -1, &pStmt, &zTail); |
| 1752 | if( rc!=SQLITE_OK ){ |
| 1753 | @ <div class="generalError">%h(sqlite3_errmsg(g.db))</div> |
| 1754 | sqlite3_finalize(pStmt); |
| 1755 | }else if( pStmt==0 ){ |
| @@ -1759,11 +1758,11 @@ | |
| 1759 | rc = sqlite3_finalize(pStmt); |
| 1760 | if( rc ){ |
| 1761 | @ <div class="generalError">%h(sqlite3_errmsg(g.db))</div> |
| 1762 | } |
| 1763 | }else{ |
| 1764 | @ <table border=1> |
| 1765 | while( sqlite3_step(pStmt)==SQLITE_ROW ){ |
| 1766 | if( nRow==0 ){ |
| 1767 | @ <tr> |
| 1768 | for(i=0; i<nCol; i++){ |
| 1769 | @ <th>%h(sqlite3_column_name(pStmt, i))</th> |
| 1770 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -1731,13 +1731,11 @@ | |
| 1731 | zQ = sqlite3_mprintf( |
| 1732 | "SELECT sql FROM repository.sqlite_schema" |
| 1733 | " WHERE sql IS NOT NULL ORDER BY name"); |
| 1734 | go = 1; |
| 1735 | }else if( P("tablelist") ){ |
| 1736 | zQ = sqlite3_mprintf("SELECT*FROM pragma_table_list ORDER BY schema, name"); |
| 1737 | go = 1; |
| 1738 | } |
| 1739 | if( go ){ |
| 1740 | sqlite3_stmt *pStmt; |
| 1741 | int rc; |
| @@ -1746,10 +1744,11 @@ | |
| 1744 | int nRow = 0; |
| 1745 | int i; |
| 1746 | @ <hr /> |
| 1747 | login_verify_csrf_secret(); |
| 1748 | sqlite3_set_authorizer(g.db, raw_sql_query_authorizer, 0); |
| 1749 | search_sql_setup(g.db); |
| 1750 | rc = sqlite3_prepare_v2(g.db, zQ, -1, &pStmt, &zTail); |
| 1751 | if( rc!=SQLITE_OK ){ |
| 1752 | @ <div class="generalError">%h(sqlite3_errmsg(g.db))</div> |
| 1753 | sqlite3_finalize(pStmt); |
| 1754 | }else if( pStmt==0 ){ |
| @@ -1759,11 +1758,11 @@ | |
| 1758 | rc = sqlite3_finalize(pStmt); |
| 1759 | if( rc ){ |
| 1760 | @ <div class="generalError">%h(sqlite3_errmsg(g.db))</div> |
| 1761 | } |
| 1762 | }else{ |
| 1763 | @ <table border="1" cellpadding="4" cellspacing="0"> |
| 1764 | while( sqlite3_step(pStmt)==SQLITE_ROW ){ |
| 1765 | if( nRow==0 ){ |
| 1766 | @ <tr> |
| 1767 | for(i=0; i<nCol; i++){ |
| 1768 | @ <th>%h(sqlite3_column_name(pStmt, i))</th> |
| 1769 |