Fossil SCM
Use the schema-table naming convention appropriate for SQLite 3.33.0.
Commit
22645e1f0606b5ef4bd6351a97d5a88b78d01484d50fd61cb46d8d8829f01266
Parent
5cf17694d0ba44f…
7 files changed
+1
-1
+2
-2
+2
-2
+3
-3
+2
-2
+2
-2
+3
-3
+1
-1
| --- src/bundle.c | ||
| +++ src/bundle.c | ||
| @@ -25,11 +25,11 @@ | ||
| 25 | 25 | ** SQL code used to initialize the schema of a bundle. |
| 26 | 26 | ** |
| 27 | 27 | ** The bblob.delta field can be an integer, a text string, or NULL. |
| 28 | 28 | ** If an integer, then the corresponding blobid is the delta basis. |
| 29 | 29 | ** If a text string, then that string is a SHA1 hash for the delta |
| 30 | -** basis, which is presumably in the master repository. If NULL, then | |
| 30 | +** basis, which is presumably in the main repository. If NULL, then | |
| 31 | 31 | ** data contains content without delta compression. |
| 32 | 32 | */ |
| 33 | 33 | static const char zBundleInit[] = |
| 34 | 34 | @ CREATE TABLE IF NOT EXISTS "%w".bconfig( |
| 35 | 35 | @ bcname TEXT, |
| 36 | 36 |
| --- src/bundle.c | |
| +++ src/bundle.c | |
| @@ -25,11 +25,11 @@ | |
| 25 | ** SQL code used to initialize the schema of a bundle. |
| 26 | ** |
| 27 | ** The bblob.delta field can be an integer, a text string, or NULL. |
| 28 | ** If an integer, then the corresponding blobid is the delta basis. |
| 29 | ** If a text string, then that string is a SHA1 hash for the delta |
| 30 | ** basis, which is presumably in the master repository. If NULL, then |
| 31 | ** data contains content without delta compression. |
| 32 | */ |
| 33 | static const char zBundleInit[] = |
| 34 | @ CREATE TABLE IF NOT EXISTS "%w".bconfig( |
| 35 | @ bcname TEXT, |
| 36 |
| --- src/bundle.c | |
| +++ src/bundle.c | |
| @@ -25,11 +25,11 @@ | |
| 25 | ** SQL code used to initialize the schema of a bundle. |
| 26 | ** |
| 27 | ** The bblob.delta field can be an integer, a text string, or NULL. |
| 28 | ** If an integer, then the corresponding blobid is the delta basis. |
| 29 | ** If a text string, then that string is a SHA1 hash for the delta |
| 30 | ** basis, which is presumably in the main repository. If NULL, then |
| 31 | ** data contains content without delta compression. |
| 32 | */ |
| 33 | static const char zBundleInit[] = |
| 34 | @ CREATE TABLE IF NOT EXISTS "%w".bconfig( |
| 35 | @ bcname TEXT, |
| 36 |
M
src/db.c
+2
-2
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -1325,11 +1325,11 @@ | ||
| 1325 | 1325 | ** zDbName is the name of a database file. Attach zDbName using |
| 1326 | 1326 | ** the name zLabel. |
| 1327 | 1327 | */ |
| 1328 | 1328 | void db_attach(const char *zDbName, const char *zLabel){ |
| 1329 | 1329 | Blob key; |
| 1330 | - if( db_table_exists(zLabel,"sqlite_master") ) return; | |
| 1330 | + if( db_table_exists(zLabel,"sqlite_schema") ) return; | |
| 1331 | 1331 | blob_init(&key, 0, 0); |
| 1332 | 1332 | db_maybe_obtain_encryption_key(zDbName, &key); |
| 1333 | 1333 | if( fossil_getenv("FOSSIL_USE_SEE_TEXTKEY")==0 ){ |
| 1334 | 1334 | char *zCmd = sqlite3_mprintf("ATTACH DATABASE %Q AS %Q KEY %Q", |
| 1335 | 1335 | zDbName, zLabel, blob_str(&key)); |
| @@ -3992,11 +3992,11 @@ | ||
| 3992 | 3992 | int dryRun = find_option("dry-run", "n", 0)!=0; |
| 3993 | 3993 | for(i=2; i<g.argc; i++){ |
| 3994 | 3994 | db_open_or_attach(g.argv[i], "main"); |
| 3995 | 3995 | blob_init(&allSql, "BEGIN;\n", -1); |
| 3996 | 3996 | db_prepare(&q, |
| 3997 | - "SELECT name, sql FROM main.sqlite_master " | |
| 3997 | + "SELECT name, sql FROM main.sqlite_schema " | |
| 3998 | 3998 | " WHERE type='table' AND sql NOT LIKE '%%WITHOUT ROWID%%'" |
| 3999 | 3999 | " AND name IN ('global_config','shun','concealed','config'," |
| 4000 | 4000 | " 'plink','tagxref','backlink','vcache');" |
| 4001 | 4001 | ); |
| 4002 | 4002 | while( db_step(&q)==SQLITE_ROW ){ |
| 4003 | 4003 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1325,11 +1325,11 @@ | |
| 1325 | ** zDbName is the name of a database file. Attach zDbName using |
| 1326 | ** the name zLabel. |
| 1327 | */ |
| 1328 | void db_attach(const char *zDbName, const char *zLabel){ |
| 1329 | Blob key; |
| 1330 | if( db_table_exists(zLabel,"sqlite_master") ) return; |
| 1331 | blob_init(&key, 0, 0); |
| 1332 | db_maybe_obtain_encryption_key(zDbName, &key); |
| 1333 | if( fossil_getenv("FOSSIL_USE_SEE_TEXTKEY")==0 ){ |
| 1334 | char *zCmd = sqlite3_mprintf("ATTACH DATABASE %Q AS %Q KEY %Q", |
| 1335 | zDbName, zLabel, blob_str(&key)); |
| @@ -3992,11 +3992,11 @@ | |
| 3992 | int dryRun = find_option("dry-run", "n", 0)!=0; |
| 3993 | for(i=2; i<g.argc; i++){ |
| 3994 | db_open_or_attach(g.argv[i], "main"); |
| 3995 | blob_init(&allSql, "BEGIN;\n", -1); |
| 3996 | db_prepare(&q, |
| 3997 | "SELECT name, sql FROM main.sqlite_master " |
| 3998 | " WHERE type='table' AND sql NOT LIKE '%%WITHOUT ROWID%%'" |
| 3999 | " AND name IN ('global_config','shun','concealed','config'," |
| 4000 | " 'plink','tagxref','backlink','vcache');" |
| 4001 | ); |
| 4002 | while( db_step(&q)==SQLITE_ROW ){ |
| 4003 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1325,11 +1325,11 @@ | |
| 1325 | ** zDbName is the name of a database file. Attach zDbName using |
| 1326 | ** the name zLabel. |
| 1327 | */ |
| 1328 | void db_attach(const char *zDbName, const char *zLabel){ |
| 1329 | Blob key; |
| 1330 | if( db_table_exists(zLabel,"sqlite_schema") ) return; |
| 1331 | blob_init(&key, 0, 0); |
| 1332 | db_maybe_obtain_encryption_key(zDbName, &key); |
| 1333 | if( fossil_getenv("FOSSIL_USE_SEE_TEXTKEY")==0 ){ |
| 1334 | char *zCmd = sqlite3_mprintf("ATTACH DATABASE %Q AS %Q KEY %Q", |
| 1335 | zDbName, zLabel, blob_str(&key)); |
| @@ -3992,11 +3992,11 @@ | |
| 3992 | int dryRun = find_option("dry-run", "n", 0)!=0; |
| 3993 | for(i=2; i<g.argc; i++){ |
| 3994 | db_open_or_attach(g.argv[i], "main"); |
| 3995 | blob_init(&allSql, "BEGIN;\n", -1); |
| 3996 | db_prepare(&q, |
| 3997 | "SELECT name, sql FROM main.sqlite_schema " |
| 3998 | " WHERE type='table' AND sql NOT LIKE '%%WITHOUT ROWID%%'" |
| 3999 | " AND name IN ('global_config','shun','concealed','config'," |
| 4000 | " 'plink','tagxref','backlink','vcache');" |
| 4001 | ); |
| 4002 | while( db_step(&q)==SQLITE_ROW ){ |
| 4003 |
+2
-2
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -673,12 +673,12 @@ | ||
| 673 | 673 | } |
| 674 | 674 | } |
| 675 | 675 | #endif |
| 676 | 676 | |
| 677 | 677 | fossil_limit_memory(1); |
| 678 | - if( sqlite3_libversion_number()<3014000 ){ | |
| 679 | - fossil_panic("Unsuitable SQLite version %s, must be at least 3.14.0", | |
| 678 | + if( sqlite3_libversion_number()<3033000 ){ | |
| 679 | + fossil_panic("Unsuitable SQLite version %s, must be at least 3.33.0", | |
| 680 | 680 | sqlite3_libversion()); |
| 681 | 681 | } |
| 682 | 682 | sqlite3_config(SQLITE_CONFIG_MULTITHREAD); |
| 683 | 683 | sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0); |
| 684 | 684 | memset(&g, 0, sizeof(g)); |
| 685 | 685 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -673,12 +673,12 @@ | |
| 673 | } |
| 674 | } |
| 675 | #endif |
| 676 | |
| 677 | fossil_limit_memory(1); |
| 678 | if( sqlite3_libversion_number()<3014000 ){ |
| 679 | fossil_panic("Unsuitable SQLite version %s, must be at least 3.14.0", |
| 680 | sqlite3_libversion()); |
| 681 | } |
| 682 | sqlite3_config(SQLITE_CONFIG_MULTITHREAD); |
| 683 | sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0); |
| 684 | memset(&g, 0, sizeof(g)); |
| 685 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -673,12 +673,12 @@ | |
| 673 | } |
| 674 | } |
| 675 | #endif |
| 676 | |
| 677 | fossil_limit_memory(1); |
| 678 | if( sqlite3_libversion_number()<3033000 ){ |
| 679 | fossil_panic("Unsuitable SQLite version %s, must be at least 3.33.0", |
| 680 | sqlite3_libversion()); |
| 681 | } |
| 682 | sqlite3_config(SQLITE_CONFIG_MULTITHREAD); |
| 683 | sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0); |
| 684 | memset(&g, 0, sizeof(g)); |
| 685 |
+3
-3
| --- src/rebuild.c | ||
| +++ src/rebuild.c | ||
| @@ -144,11 +144,11 @@ | ||
| 144 | 144 | ** Update the repository schema for Fossil version 2.0. (2017-02-28) |
| 145 | 145 | ** (1) Change the CHECK constraint on BLOB.UUID so that the length |
| 146 | 146 | ** is greater than or equal to 40, not exactly equal to 40. |
| 147 | 147 | */ |
| 148 | 148 | void rebuild_schema_update_2_0(void){ |
| 149 | - char *z = db_text(0, "SELECT sql FROM repository.sqlite_master" | |
| 149 | + char *z = db_text(0, "SELECT sql FROM repository.sqlite_schema" | |
| 150 | 150 | " WHERE name='blob'"); |
| 151 | 151 | if( z ){ |
| 152 | 152 | /* Search for: length(uuid)==40 |
| 153 | 153 | ** 0123456789 12345 */ |
| 154 | 154 | int i; |
| @@ -155,11 +155,11 @@ | ||
| 155 | 155 | for(i=10; z[i]; i++){ |
| 156 | 156 | if( z[i]=='=' && strncmp(&z[i-6],"(uuid)==40",10)==0 ){ |
| 157 | 157 | z[i] = '>'; |
| 158 | 158 | db_multi_exec( |
| 159 | 159 | "PRAGMA writable_schema=ON;" |
| 160 | - "UPDATE repository.sqlite_master SET sql=%Q WHERE name LIKE 'blob';" | |
| 160 | + "UPDATE repository.sqlite_schema SET sql=%Q WHERE name LIKE 'blob';" | |
| 161 | 161 | "PRAGMA writable_schema=OFF;", |
| 162 | 162 | z |
| 163 | 163 | ); |
| 164 | 164 | break; |
| 165 | 165 | } |
| @@ -383,11 +383,11 @@ | ||
| 383 | 383 | } |
| 384 | 384 | alert_triggers_disable(); |
| 385 | 385 | rebuild_update_schema(); |
| 386 | 386 | blob_init(&sql, 0, 0); |
| 387 | 387 | db_prepare(&q, |
| 388 | - "SELECT name FROM sqlite_master /*scan*/" | |
| 388 | + "SELECT name FROM sqlite_schema /*scan*/" | |
| 389 | 389 | " WHERE type='table'" |
| 390 | 390 | " AND name NOT IN ('admin_log', 'blob','delta','rcvfrom','user','alias'," |
| 391 | 391 | "'config','shun','private','reportfmt'," |
| 392 | 392 | "'concealed','accesslog','modreq'," |
| 393 | 393 | "'purgeevent','purgeitem','unversioned'," |
| 394 | 394 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -144,11 +144,11 @@ | |
| 144 | ** Update the repository schema for Fossil version 2.0. (2017-02-28) |
| 145 | ** (1) Change the CHECK constraint on BLOB.UUID so that the length |
| 146 | ** is greater than or equal to 40, not exactly equal to 40. |
| 147 | */ |
| 148 | void rebuild_schema_update_2_0(void){ |
| 149 | char *z = db_text(0, "SELECT sql FROM repository.sqlite_master" |
| 150 | " WHERE name='blob'"); |
| 151 | if( z ){ |
| 152 | /* Search for: length(uuid)==40 |
| 153 | ** 0123456789 12345 */ |
| 154 | int i; |
| @@ -155,11 +155,11 @@ | |
| 155 | for(i=10; z[i]; i++){ |
| 156 | if( z[i]=='=' && strncmp(&z[i-6],"(uuid)==40",10)==0 ){ |
| 157 | z[i] = '>'; |
| 158 | db_multi_exec( |
| 159 | "PRAGMA writable_schema=ON;" |
| 160 | "UPDATE repository.sqlite_master SET sql=%Q WHERE name LIKE 'blob';" |
| 161 | "PRAGMA writable_schema=OFF;", |
| 162 | z |
| 163 | ); |
| 164 | break; |
| 165 | } |
| @@ -383,11 +383,11 @@ | |
| 383 | } |
| 384 | alert_triggers_disable(); |
| 385 | rebuild_update_schema(); |
| 386 | blob_init(&sql, 0, 0); |
| 387 | db_prepare(&q, |
| 388 | "SELECT name FROM sqlite_master /*scan*/" |
| 389 | " WHERE type='table'" |
| 390 | " AND name NOT IN ('admin_log', 'blob','delta','rcvfrom','user','alias'," |
| 391 | "'config','shun','private','reportfmt'," |
| 392 | "'concealed','accesslog','modreq'," |
| 393 | "'purgeevent','purgeitem','unversioned'," |
| 394 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -144,11 +144,11 @@ | |
| 144 | ** Update the repository schema for Fossil version 2.0. (2017-02-28) |
| 145 | ** (1) Change the CHECK constraint on BLOB.UUID so that the length |
| 146 | ** is greater than or equal to 40, not exactly equal to 40. |
| 147 | */ |
| 148 | void rebuild_schema_update_2_0(void){ |
| 149 | char *z = db_text(0, "SELECT sql FROM repository.sqlite_schema" |
| 150 | " WHERE name='blob'"); |
| 151 | if( z ){ |
| 152 | /* Search for: length(uuid)==40 |
| 153 | ** 0123456789 12345 */ |
| 154 | int i; |
| @@ -155,11 +155,11 @@ | |
| 155 | for(i=10; z[i]; i++){ |
| 156 | if( z[i]=='=' && strncmp(&z[i-6],"(uuid)==40",10)==0 ){ |
| 157 | z[i] = '>'; |
| 158 | db_multi_exec( |
| 159 | "PRAGMA writable_schema=ON;" |
| 160 | "UPDATE repository.sqlite_schema SET sql=%Q WHERE name LIKE 'blob';" |
| 161 | "PRAGMA writable_schema=OFF;", |
| 162 | z |
| 163 | ); |
| 164 | break; |
| 165 | } |
| @@ -383,11 +383,11 @@ | |
| 383 | } |
| 384 | alert_triggers_disable(); |
| 385 | rebuild_update_schema(); |
| 386 | blob_init(&sql, 0, 0); |
| 387 | db_prepare(&q, |
| 388 | "SELECT name FROM sqlite_schema /*scan*/" |
| 389 | " WHERE type='table'" |
| 390 | " AND name NOT IN ('admin_log', 'blob','delta','rcvfrom','user','alias'," |
| 391 | "'config','shun','private','reportfmt'," |
| 392 | "'concealed','accesslog','modreq'," |
| 393 | "'purgeevent','purgeitem','unversioned'," |
| 394 |
+2
-2
| --- src/report.c | ||
| +++ src/report.c | ||
| @@ -511,13 +511,13 @@ | ||
| 511 | 511 | ** Output a bunch of text that provides information about report |
| 512 | 512 | ** formats |
| 513 | 513 | */ |
| 514 | 514 | static void report_format_hints(void){ |
| 515 | 515 | char *zSchema; |
| 516 | - zSchema = db_text(0,"SELECT sql FROM sqlite_master WHERE name='ticket'"); | |
| 516 | + zSchema = db_text(0,"SELECT sql FROM sqlite_schema WHERE name='ticket'"); | |
| 517 | 517 | if( zSchema==0 ){ |
| 518 | - zSchema = db_text(0,"SELECT sql FROM repository.sqlite_master" | |
| 518 | + zSchema = db_text(0,"SELECT sql FROM repository.sqlite_schema" | |
| 519 | 519 | " WHERE name='ticket'"); |
| 520 | 520 | } |
| 521 | 521 | @ <hr /><h3>TICKET Schema</h3> |
| 522 | 522 | @ <blockquote><pre> |
| 523 | 523 | @ %h(zSchema) |
| 524 | 524 |
| --- src/report.c | |
| +++ src/report.c | |
| @@ -511,13 +511,13 @@ | |
| 511 | ** Output a bunch of text that provides information about report |
| 512 | ** formats |
| 513 | */ |
| 514 | static void report_format_hints(void){ |
| 515 | char *zSchema; |
| 516 | zSchema = db_text(0,"SELECT sql FROM sqlite_master WHERE name='ticket'"); |
| 517 | if( zSchema==0 ){ |
| 518 | zSchema = db_text(0,"SELECT sql FROM repository.sqlite_master" |
| 519 | " WHERE name='ticket'"); |
| 520 | } |
| 521 | @ <hr /><h3>TICKET Schema</h3> |
| 522 | @ <blockquote><pre> |
| 523 | @ %h(zSchema) |
| 524 |
| --- src/report.c | |
| +++ src/report.c | |
| @@ -511,13 +511,13 @@ | |
| 511 | ** Output a bunch of text that provides information about report |
| 512 | ** formats |
| 513 | */ |
| 514 | static void report_format_hints(void){ |
| 515 | char *zSchema; |
| 516 | zSchema = db_text(0,"SELECT sql FROM sqlite_schema WHERE name='ticket'"); |
| 517 | if( zSchema==0 ){ |
| 518 | zSchema = db_text(0,"SELECT sql FROM repository.sqlite_schema" |
| 519 | " WHERE name='ticket'"); |
| 520 | } |
| 521 | @ <hr /><h3>TICKET Schema</h3> |
| 522 | @ <blockquote><pre> |
| 523 | @ %h(zSchema) |
| 524 |
+2
-2
| --- src/setup.c | ||
| +++ src/setup.c | ||
| @@ -1445,16 +1445,16 @@ | ||
| 1445 | 1445 | @ <input type="submit" name="tablelist" value="List Tables"> |
| 1446 | 1446 | @ <input type="submit" name="configtab" value="CONFIG Table Query"> |
| 1447 | 1447 | @ </form> |
| 1448 | 1448 | if( P("schema") ){ |
| 1449 | 1449 | zQ = sqlite3_mprintf( |
| 1450 | - "SELECT sql FROM repository.sqlite_master" | |
| 1450 | + "SELECT sql FROM repository.sqlite_sqlite" | |
| 1451 | 1451 | " WHERE sql IS NOT NULL ORDER BY name"); |
| 1452 | 1452 | go = 1; |
| 1453 | 1453 | }else if( P("tablelist") ){ |
| 1454 | 1454 | zQ = sqlite3_mprintf( |
| 1455 | - "SELECT name FROM repository.sqlite_master WHERE type='table'" | |
| 1455 | + "SELECT name FROM repository.sqlite_schema WHERE type='table'" | |
| 1456 | 1456 | " ORDER BY name"); |
| 1457 | 1457 | go = 1; |
| 1458 | 1458 | } |
| 1459 | 1459 | if( go ){ |
| 1460 | 1460 | sqlite3_stmt *pStmt; |
| 1461 | 1461 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -1445,16 +1445,16 @@ | |
| 1445 | @ <input type="submit" name="tablelist" value="List Tables"> |
| 1446 | @ <input type="submit" name="configtab" value="CONFIG Table Query"> |
| 1447 | @ </form> |
| 1448 | if( P("schema") ){ |
| 1449 | zQ = sqlite3_mprintf( |
| 1450 | "SELECT sql FROM repository.sqlite_master" |
| 1451 | " WHERE sql IS NOT NULL ORDER BY name"); |
| 1452 | go = 1; |
| 1453 | }else if( P("tablelist") ){ |
| 1454 | zQ = sqlite3_mprintf( |
| 1455 | "SELECT name FROM repository.sqlite_master WHERE type='table'" |
| 1456 | " ORDER BY name"); |
| 1457 | go = 1; |
| 1458 | } |
| 1459 | if( go ){ |
| 1460 | sqlite3_stmt *pStmt; |
| 1461 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -1445,16 +1445,16 @@ | |
| 1445 | @ <input type="submit" name="tablelist" value="List Tables"> |
| 1446 | @ <input type="submit" name="configtab" value="CONFIG Table Query"> |
| 1447 | @ </form> |
| 1448 | if( P("schema") ){ |
| 1449 | zQ = sqlite3_mprintf( |
| 1450 | "SELECT sql FROM repository.sqlite_sqlite" |
| 1451 | " WHERE sql IS NOT NULL ORDER BY name"); |
| 1452 | go = 1; |
| 1453 | }else if( P("tablelist") ){ |
| 1454 | zQ = sqlite3_mprintf( |
| 1455 | "SELECT name FROM repository.sqlite_schema WHERE type='table'" |
| 1456 | " ORDER BY name"); |
| 1457 | go = 1; |
| 1458 | } |
| 1459 | if( go ){ |
| 1460 | sqlite3_stmt *pStmt; |
| 1461 |
+3
-3
| --- src/stat.c | ||
| +++ src/stat.c | ||
| @@ -512,11 +512,11 @@ | ||
| 512 | 512 | style_submenu_element("URLs", "urllist"); |
| 513 | 513 | if( sqlite3_compileoption_used("ENABLE_DBSTAT_VTAB") ){ |
| 514 | 514 | style_submenu_element("Table Sizes", "repo-tabsize"); |
| 515 | 515 | } |
| 516 | 516 | blob_init(&sql, |
| 517 | - "SELECT sql FROM repository.sqlite_master WHERE sql IS NOT NULL", -1); | |
| 517 | + "SELECT sql FROM repository.sqlite_schema WHERE sql IS NOT NULL", -1); | |
| 518 | 518 | if( zArg ){ |
| 519 | 519 | style_submenu_element("All", "repo_schema"); |
| 520 | 520 | blob_appendf(&sql, " AND (tbl_name=%Q OR name=%Q)", zArg, zArg); |
| 521 | 521 | } |
| 522 | 522 | blob_appendf(&sql, " ORDER BY tbl_name, type<>'table', name"); |
| @@ -603,11 +603,11 @@ | ||
| 603 | 603 | style_submenu_element("Schema", "repo_schema"); |
| 604 | 604 | } |
| 605 | 605 | db_multi_exec( |
| 606 | 606 | "CREATE TEMP TABLE trans(name TEXT PRIMARY KEY,tabname TEXT)WITHOUT ROWID;" |
| 607 | 607 | "INSERT INTO trans(name,tabname)" |
| 608 | - " SELECT name, tbl_name FROM repository.sqlite_master;" | |
| 608 | + " SELECT name, tbl_name FROM repository.sqlite_schema;" | |
| 609 | 609 | "CREATE TEMP TABLE piechart(amt REAL, label TEXT);" |
| 610 | 610 | "INSERT INTO piechart(amt,label)" |
| 611 | 611 | " SELECT sum(pageno)," |
| 612 | 612 | " coalesce((SELECT tabname FROM trans WHERE trans.name=dbstat.name),name)" |
| 613 | 613 | " FROM dbstat('repository',TRUE)" |
| @@ -629,11 +629,11 @@ | ||
| 629 | 629 | |
| 630 | 630 | if( g.localOpen ){ |
| 631 | 631 | db_multi_exec( |
| 632 | 632 | "DELETE FROM trans;" |
| 633 | 633 | "INSERT INTO trans(name,tabname)" |
| 634 | - " SELECT name, tbl_name FROM localdb.sqlite_master;" | |
| 634 | + " SELECT name, tbl_name FROM localdb.sqlite_schema;" | |
| 635 | 635 | "DELETE FROM piechart;" |
| 636 | 636 | "INSERT INTO piechart(amt,label)" |
| 637 | 637 | " SELECT sum(pageno), " |
| 638 | 638 | " coalesce((SELECT tabname FROM trans WHERE trans.name=dbstat.name),name)" |
| 639 | 639 | " FROM dbstat('localdb',TRUE)" |
| 640 | 640 |
| --- src/stat.c | |
| +++ src/stat.c | |
| @@ -512,11 +512,11 @@ | |
| 512 | style_submenu_element("URLs", "urllist"); |
| 513 | if( sqlite3_compileoption_used("ENABLE_DBSTAT_VTAB") ){ |
| 514 | style_submenu_element("Table Sizes", "repo-tabsize"); |
| 515 | } |
| 516 | blob_init(&sql, |
| 517 | "SELECT sql FROM repository.sqlite_master WHERE sql IS NOT NULL", -1); |
| 518 | if( zArg ){ |
| 519 | style_submenu_element("All", "repo_schema"); |
| 520 | blob_appendf(&sql, " AND (tbl_name=%Q OR name=%Q)", zArg, zArg); |
| 521 | } |
| 522 | blob_appendf(&sql, " ORDER BY tbl_name, type<>'table', name"); |
| @@ -603,11 +603,11 @@ | |
| 603 | style_submenu_element("Schema", "repo_schema"); |
| 604 | } |
| 605 | db_multi_exec( |
| 606 | "CREATE TEMP TABLE trans(name TEXT PRIMARY KEY,tabname TEXT)WITHOUT ROWID;" |
| 607 | "INSERT INTO trans(name,tabname)" |
| 608 | " SELECT name, tbl_name FROM repository.sqlite_master;" |
| 609 | "CREATE TEMP TABLE piechart(amt REAL, label TEXT);" |
| 610 | "INSERT INTO piechart(amt,label)" |
| 611 | " SELECT sum(pageno)," |
| 612 | " coalesce((SELECT tabname FROM trans WHERE trans.name=dbstat.name),name)" |
| 613 | " FROM dbstat('repository',TRUE)" |
| @@ -629,11 +629,11 @@ | |
| 629 | |
| 630 | if( g.localOpen ){ |
| 631 | db_multi_exec( |
| 632 | "DELETE FROM trans;" |
| 633 | "INSERT INTO trans(name,tabname)" |
| 634 | " SELECT name, tbl_name FROM localdb.sqlite_master;" |
| 635 | "DELETE FROM piechart;" |
| 636 | "INSERT INTO piechart(amt,label)" |
| 637 | " SELECT sum(pageno), " |
| 638 | " coalesce((SELECT tabname FROM trans WHERE trans.name=dbstat.name),name)" |
| 639 | " FROM dbstat('localdb',TRUE)" |
| 640 |
| --- src/stat.c | |
| +++ src/stat.c | |
| @@ -512,11 +512,11 @@ | |
| 512 | style_submenu_element("URLs", "urllist"); |
| 513 | if( sqlite3_compileoption_used("ENABLE_DBSTAT_VTAB") ){ |
| 514 | style_submenu_element("Table Sizes", "repo-tabsize"); |
| 515 | } |
| 516 | blob_init(&sql, |
| 517 | "SELECT sql FROM repository.sqlite_schema WHERE sql IS NOT NULL", -1); |
| 518 | if( zArg ){ |
| 519 | style_submenu_element("All", "repo_schema"); |
| 520 | blob_appendf(&sql, " AND (tbl_name=%Q OR name=%Q)", zArg, zArg); |
| 521 | } |
| 522 | blob_appendf(&sql, " ORDER BY tbl_name, type<>'table', name"); |
| @@ -603,11 +603,11 @@ | |
| 603 | style_submenu_element("Schema", "repo_schema"); |
| 604 | } |
| 605 | db_multi_exec( |
| 606 | "CREATE TEMP TABLE trans(name TEXT PRIMARY KEY,tabname TEXT)WITHOUT ROWID;" |
| 607 | "INSERT INTO trans(name,tabname)" |
| 608 | " SELECT name, tbl_name FROM repository.sqlite_schema;" |
| 609 | "CREATE TEMP TABLE piechart(amt REAL, label TEXT);" |
| 610 | "INSERT INTO piechart(amt,label)" |
| 611 | " SELECT sum(pageno)," |
| 612 | " coalesce((SELECT tabname FROM trans WHERE trans.name=dbstat.name),name)" |
| 613 | " FROM dbstat('repository',TRUE)" |
| @@ -629,11 +629,11 @@ | |
| 629 | |
| 630 | if( g.localOpen ){ |
| 631 | db_multi_exec( |
| 632 | "DELETE FROM trans;" |
| 633 | "INSERT INTO trans(name,tabname)" |
| 634 | " SELECT name, tbl_name FROM localdb.sqlite_schema;" |
| 635 | "DELETE FROM piechart;" |
| 636 | "INSERT INTO piechart(amt,label)" |
| 637 | " SELECT sum(pageno), " |
| 638 | " coalesce((SELECT tabname FROM trans WHERE trans.name=dbstat.name),name)" |
| 639 | " FROM dbstat('localdb',TRUE)" |
| 640 |