aboutsummaryrefslogtreecommitdiff
path: root/src/dbstat.c
AgeCommit message (Collapse)AuthorLines
7 daysFix two dbstat bugs: NOCASE name lookups and pgsize/pgoffset fordrh-2/+5
non-default schemas. Bugs [bug:/info/2026-11-04T00:50:04Z|2026-11-04T00:50:04Z] and [bug:/info/2026-11-04T00:50:51Z|2026-11-04T00:50:51Z], respectively. FossilOrigin-Name: 4b3591c790185d5ce6184b45bde5358dec15e4f21f70c7d455bf7335a9b00428
12 daysFix the dbstat virtual table so that it shows the correct number ofdrh-1/+3
unused bytes on a 65536-page-size database with one table that has no content. [bugs:/info/2026-11-04T00:51:37Z|Bug 2026-11-04T00:51:37Z] FossilOrigin-Name: 20a518c18758715da23a4117fb336f63b7992afceffabbed75cb2e4a09af8d39
2026-09-22Fix calculation of the virtual table dbstat.pgoffset field for overflow ↵dan-3/+3
pages. Report [bugs:/info/2026-09-22T01:43:42Z | 2026-09-22T01:43:42Z]. FossilOrigin-Name: 4f4ca57309c82d9e2e090cf3accb83d4ee2868de2a7626d7afc30ff4c8351695
2024-08-22Add the SQLITE_INDEX_SCAN_HEX bit to the sqlite3_index_info.idxFlags bitmask.drh-0/+1
When set, this bit causes the EXPLAIN QUERY PLAN output to show the idxNum value in hex rather than in decimal. This is purely a debugging aid. FossilOrigin-Name: 6c00e88ebdb41d6317bb8758825521614dedc2e6e6289ff415c5f0406eed815b
2023-10-06Ensure that all fields of static sqlite3_module objects are explicitlydrh-1/+2
initialized, in order to hush-up nuisance compiler warnings. FossilOrigin-Name: f3b3d712d6e58b1cb8fdebd2b6b3125080b6b3ac8c7c849a8cc1e5e778d62fe7
2022-12-23Fix lots of harmless, nuisance compiler warnings, mostly unused parameterdrh-0/+4
warnings in extensions. FossilOrigin-Name: c14bbe1606c1450b709970f922b94a641dfc8f9bd09126501d7dc4db99ea4772
2022-12-02Use sqlite3_result_int64() instead of sqlite3_result_int() when returningdrh-5/+5
potentially large values from the DBSTAT virtual table, to avoid integer overflows in the result. [forum:/forumpost/ada2ab044f|Forum post ada2ab044f]. FossilOrigin-Name: 5652154a8c93cf3b1ff6c2e55e94abbe995b0bb625f733461df20e006c2f13f8
2021-09-29Have the dbstat module arrange things internally so that there are 256 ↵dan-2/+12
addressable bytes following each page buffer. This way, small buffer overreads caused by corrupt database pages do not lead to undefined behaviour. FossilOrigin-Name: c4c705abc60624bf9ba4c1c05286b902b965f7ba9fd776c4ef8bc1fb78a4ccde
2021-09-27Have the dbstat virtual table take a copy of each page buffer that it ↵dan-10/+43
traverses instead of just a reference to the page-cache object. This avoids problems if an error causes transaction rollback while a dbstat cursor is open. dbsqlfuzz crash-417224040fee04f0f0e62b70265c518893b08769. FossilOrigin-Name: 6ab25f8bd52d6412a9600143de364f6d8ad8e2c835315fafca6f54d5f38a49dc
2021-09-25Fix a bad interaction between the pager cache and the dbstat module that ↵dan-1/+5
could lead to a malfunction following an OOM. dbsqlfuzz 9ed3e4e3816219d3509d711636c38542bf3f40b1. FossilOrigin-Name: e03554a6a8c33d820922edccf605a2ce92055315bf22e464207ea8c0d81e3dd6
2020-06-19Further refactoring of the schema table name.drh-2/+2
FossilOrigin-Name: 9536fa0ae0c1ae6e2e98d2fa11e5acda7f3c9b8ca5061b6f7f8cae63a11d936b
2020-03-20Allow "main" to be used to refer to the main database even after ↵dan-0/+1
SQLITE_DBCONFIG_MAINDBNAME has been used to assign another alias. FossilOrigin-Name: 75c85ca32f9ae4a28fd8f8ff2f7639599413d22af706e9799a0e76cc560d14eb
2020-03-19Fix an integer overflow problem with the dbstat virtual table that comes updrh-1/+3
when trying to analyze a corrupt database. FossilOrigin-Name: 1d64f4a8af81fe1235fffa54884d8f842a48ff6a33d6172f0cd65bf42fe8b2a1
2020-01-07Create the "trusted_schema" pragma. Add sqlite3_vtab_config() calls to setdrh-0/+1
the risk rank for many virtual tables. FossilOrigin-Name: 4c21373c21c9b17b222ae65297a039a035e6ec6b505c00c33704e3c03f94f834
2020-01-04Fix DBSTAT so that it returns now rows, rather than an error when thedrh-3/+3
WHERE clause is "schema=NULL". FossilOrigin-Name: 5b246b47aeadc25dbec0956e2d6edcd49fbe874a01734fdf15b770507648222d
2020-01-04Omit the omit flat from eq constraints on column "name" of dbstat virtual ↵dan-4/+0
tables. Fix for [74a4c386]. FossilOrigin-Name: cfff5cb2279088aa66f435bd0d627b2c74c9a99ad9addfd44a4df8ba770b795a
2020-01-04Omit the omit flag from eq constraints on column "aggregate" of dbstat ↵dan-1/+2
virtual tables. Fix for [727074e2]. FossilOrigin-Name: 74ef6f2b6d9f50ff1d455e2263ba77707c1e8394b25b3f8a3a2a7b6e7f2c481e
2019-11-19Get the aggregate=TRUE feature working on the DBSTAT virtual table.drh-67/+114
FossilOrigin-Name: 16fef3db063830884de46d53a289f637a7204fe84fcdee7ea81dbb8bca578952
2019-11-19Begin an enhancement effort for the built-in DBSTAT virtual table.drh-56/+131
FossilOrigin-Name: 9b5722f0fe666b99677e5f333dd8413aefb9ace7a461d74f6558f0ac53768719
2019-01-09Improved database corruption detection in the dbstat virtual table.drh-0/+4
FossilOrigin-Name: fc5ecc88f8a0855ba90039177ee284721b2035e4de56a1024e323216f011f0af
2019-01-09Small simplification to the dbstat virtual table.drh-4/+2
FossilOrigin-Name: 9d4c156fa26f80bb8f88b6ad8f24520a15af296de9c110604f6bd42c257455a0
2018-11-16Add SQLITE_CONSTRAINT support to the xBestIndex methods on dbstat,drh-4/+2
sqlite_dbpage, and zipfile. FossilOrigin-Name: 5cd24e552b4fed71cfb2e37929371175682f23f1430df2900a87e6a5823d138e
2018-11-13Fix a potential buffer overread in the dbstat virtual table when processingdrh-0/+1
a corrupt database file. FossilOrigin-Name: a62e6b593b59eae44d299842a4d02b9346a0c72a3e1206882f304ab40f2cd5c5
2018-11-05Initial code to make shadow tables read-only to ordinary SQL. The nowdrh-0/+1
xShadowName method is added to the sqlite3_module object and is used to identify potential shadow tables. The SQLITE_PREPARE_SHADOW argument to sqlite3_prepare_v3() is defined. It is designed to permit writing to shadow tables, but is currently an unused placeholder. FossilOrigin-Name: 31942b3dd3f66eb0d9977bf1cadc2f2d7be7967cce2b55784be0b939dfef1985
2018-10-29Fix minor memory leak in the dbstat extension that can occur following andrh-2/+8
attempt to analyze a corrupt database file. FossilOrigin-Name: cb874fd87384be397008e953242d5773ef5d64e07c3e1ae352a42a25d70597b4
2018-10-29Harden the dbstat extension against corrupt database files.drh-6/+23
FossilOrigin-Name: a0d47f25ae7bdf98f5b853f23776b3bf86bea7c0dda386664c1e3b1c363c518f
2018-03-29Modify the sqlite3OsFileControl() interface to detect unopened sqlite3_filedrh-1/+1
objects and return SQLITE_NOTFOUND. FossilOrigin-Name: 1fc72b707d4f4df049c19b023ae3f70cb45d6a6768bb68efc519cfdcd2d2ecda
2017-07-12Fix harmless compiler warnings about incomplete structure initializers.drh-0/+3
FossilOrigin-Name: 604c11d1a39f09e47b6fcee0f8b1c1054f9dbbc7b2c1cf93312aeaa4b7095018
2016-08-18Rename the Db.zName field to Db.zDbSName to make it more descriptive and todrh-2/+2
distinguish it from all of the other "zName" variables scattered throughout the code. FossilOrigin-Name: 92a22f01343a898455fd61c3b8e7d7c954f5b569
2016-06-13Fix the declaration of the table implemented by DBSTAT so that it usesdrh-3/+3
correct datatypes. FossilOrigin-Name: a1e1cdc51d1c68502f43ac72c28ba87cb1916a0d
2016-02-13Enhance ability to debug out-of-memory errors.mistachkin-10/+10
FossilOrigin-Name: 6a9c4a3ebfb7cc0738ef6634440ccab44a21ff28
2016-01-22Add the sqlite3TokenInit() utility function.drh-5/+3
FossilOrigin-Name: 7323175337b7ba85ac932ca892b28860f6a5b688
2016-01-22Have the dbstat module dequote any argument passed to the CREATE VIRTUAL ↵dan-1/+5
TABLE statement before attempting to match it against the names of attached databases. FossilOrigin-Name: e60461e984b8df09256bb0d733dbfae52568a145
2015-11-04Rename the sqlite3PagerAcquire() function to sqlite3PagerGet(). The formerdrh-3/+3
macro called sqlite3PagerGet() has been removed. FossilOrigin-Name: 708253be34084b89987efe955c34557516171a3a
2015-09-08Enhance the DBSTAT virtual table with a new hidden table "schema" that ifdrh-28/+77
set will cause the table to report on the specified schema rather than on "main". Also: Fix a faulty assert in sqlite3_context_db_handle(). FossilOrigin-Name: 6beb512c7a3c3649b56f0df1ca77855535a87ba7
2015-05-12Attempt to get DBSTAT to compile without warnings across all builddrh-1/+1
configurations. FossilOrigin-Name: c3cbe3b06eb37b9949c5fcb0e257a845953de7a7
2015-05-12Fix a compiler warning when building with tclsqlite3.c and withoutdrh-1/+1
SQLITE_ENABLE_DBSTAT_VTAB. FossilOrigin-Name: aad3ff257a156b572334b64aa57643ff3ea231a4
2015-05-12Try to get recent sqlite3_analyzer and sqldiff tests working for alldrh-0/+2
tested combinations of compile-time options, especially SQLITE_OMIT_VIRTUALTABLE and SQLITE_OMIT_LOAD_EXTENSION. FossilOrigin-Name: 07c7d3925cbcf44c2f606c7f016ec56304e0ca24
2015-05-11Revamp the way the DBSTAT virtual table is registered.drh-1/+1
FossilOrigin-Name: 4e6520159e729b6ea96ccdb14f0ecb00a0ff7cbd
2015-05-07Testing improvements and corner-case bug fixes for the dbstat virtual table.drh-7/+12
FossilOrigin-Name: d51ce539327b4807150b030a10bb105fa34cbc24
2015-05-07Enhance the dbstat virtual table with the ability to analyze ATTACHeddrh-8/+26
databases. FossilOrigin-Name: 25ec09400b753fcb10a2aae57eb43dbf0548b7ca
2015-05-05Spell SQLITE_OMIT_VIRTUALTABLE correctly in a #if in dbstat.c.drh-1/+1
FossilOrigin-Name: d2cb1becc07fad5cbd48c206c676493ba90cada1
2015-05-04Rename the test_stat.c source file to dbstat.c and rework the makefiles todrh-0/+626
make dbstat.c a first-class source module. FossilOrigin-Name: a24480a474993f82ff58edbe12d2093c59b1a2dc