aboutsummaryrefslogtreecommitdiff
path: root/src/dbstat.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2019-01-09 11:06:03 +0000
committerdrh <drh@noemail.net>2019-01-09 11:06:03 +0000
commit3e08ba4521c29df5c8b64692548ecdbe33ebf888 (patch)
tree30815d0c9493ed8855a621365decc91e7068375a /src/dbstat.c
parent885eeb676b5bf2b6cda8d3449f4eb268fac11ca5 (diff)
downloadsqlite-3e08ba4521c29df5c8b64692548ecdbe33ebf888.tar.gz
sqlite-3e08ba4521c29df5c8b64692548ecdbe33ebf888.zip
Small simplification to the dbstat virtual table.
FossilOrigin-Name: 9d4c156fa26f80bb8f88b6ad8f24520a15af296de9c110604f6bd42c257455a0
Diffstat (limited to 'src/dbstat.c')
-rw-r--r--src/dbstat.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/dbstat.c b/src/dbstat.c
index a6e521bee..c9a8bb3e2 100644
--- a/src/dbstat.c
+++ b/src/dbstat.c
@@ -602,7 +602,6 @@ static int statFilter(
StatTable *pTab = (StatTable*)(pCursor->pVtab);
char *zSql;
int rc = SQLITE_OK;
- char *zMaster;
if( idxNum==1 ){
const char *zDbase = (const char*)sqlite3_value_text(argv[0]);
@@ -618,13 +617,12 @@ static int statFilter(
statResetCsr(pCsr);
sqlite3_finalize(pCsr->pStmt);
pCsr->pStmt = 0;
- zMaster = pCsr->iDb==1 ? "sqlite_temp_master" : "sqlite_master";
zSql = sqlite3_mprintf(
"SELECT 'sqlite_master' AS name, 1 AS rootpage, 'table' AS type"
" UNION ALL "
"SELECT name, rootpage, type"
- " FROM \"%w\".%s WHERE rootpage!=0"
- " ORDER BY name", pTab->db->aDb[pCsr->iDb].zDbSName, zMaster);
+ " FROM \"%w\".sqlite_master WHERE rootpage!=0"
+ " ORDER BY name", pTab->db->aDb[pCsr->iDb].zDbSName);
if( zSql==0 ){
return SQLITE_NOMEM_BKPT;
}else{