Commit Graph

26 Commits

Author SHA1 Message Date
drh
4098aa5d19 Add an assert() to fix a harmless compiler warning in the recovery
extension.

FossilOrigin-Name: 2502339339f3c831966479a400c2b1a531fb4d990b1776b4dc4870cf734c3fcd
2024-08-10 09:56:36 +00:00
dan
3731703dbb Ensure an sqlite_dbdata cursor is properly reset before being used again, even if it has already encountered database corruption.
FossilOrigin-Name: 3210e1ca4d0efedf9710c97abd050ba10d3af98cb1f029c26daa84daf42fbc7e
2024-05-21 17:37:50 +00:00
dan
9a1a4822e8 If there is no data available for a field in a corrupted record, but the type is available, have the recovery extension substitute 0, 0.0, '' or X'' instead of a NULL value.
FossilOrigin-Name: 8eb326c24981647e2df90e4b9d75db52a552bd997bd821f5898c7ff3fb93a57d
2024-05-15 15:06:27 +00:00
dan
01508c814c Fix a case where the recovery extension might write uninitialized data to the recovered database.
FossilOrigin-Name: 8519b4d0393ed17eed06bceffbc891fe8cae0bc1d466a79eba0602ef46b07c56
2024-05-02 17:46:52 +00:00
dan
2ad1e92858 Fix another problem in the recovery extension where a corrupt sqlite_schema table could lead to excessive memory consumption.
FossilOrigin-Name: 1c7e33a8aa0e6122b5ef606e4a7d95e8ecd9440216d4b099fe8f2a40653422be
2024-05-01 16:25:46 +00:00
dan
19ca99eea4 Fix a problem causing the recovery extension to use excessive memory and CPU time in some cases.
FossilOrigin-Name: 8de85170d53e1d2a2abe14508a222377b9493e25f3174b8f0f773427deb8df26
2024-05-01 14:42:20 +00:00
dan
73a50fa42c Avoid some performance problems in the recover extension when recovering strategically corrupted databases.
FossilOrigin-Name: e66a834bbab9d71e02b70588ad4c71eae2e13b50e299b0269d488402bc4a7fc5
2024-04-09 15:09:54 +00:00
drh
ed088f5f8d In the recovery extension, if a payload size is unreasonably large, it is
probably corrupt, so truncate it.

FossilOrigin-Name: 988c3179e978a3a6d42541e9c7a2ab98150383671810926503376ed808f150ff
2023-11-29 13:47:46 +00:00
drh
1935887a68 Ensure that all fields of static sqlite3_module objects are explicitly
initialized, in order to hush-up nuisance compiler warnings.

FossilOrigin-Name: f3b3d712d6e58b1cb8fdebd2b6b3125080b6b3ac8c7c849a8cc1e5e778d62fe7
2023-10-06 12:51:05 +00:00
dan
6e4ff8707e Remove SQLITE_EXTENSION_INIT macros from dbdata.c.
FossilOrigin-Name: 106ec745766ac59131f975d5ab5487c8a24b9c3be1766411c018b42c6ae4672a
2023-06-08 20:49:25 +00:00
dan
3195b88b79 Fix a buffer overread in the recovery extension that might occur on 32-bit platforms.
FossilOrigin-Name: ff4a9a2b59657116da99c748ada19dbc64b7d0fd4c920e1c517d8bda3466f06b
2023-05-23 14:05:02 +00:00
drh
0669d6ebbf Add the SQLITE_VTAB_USES_ALL_SCHEMAS option to sqlite3_vtab_config(). Update
the sqlite_dbpage, sqlite_dbdata, and sqlite_dbptr virtual tables to make
use of that interface.  This was formerly handled by the internal
sqlite3VtabUsesAllSchemas() routine that was called directly from sqlite_dbpage.
But since sqlite_dbdata and sqlite_dbptr are an extension, an external
interface to that functionality had to be provided.
dbsqlfuzz 1a29c245175a63393b6a78c5b8cab5199939d6a8

FossilOrigin-Name: bcd51abee0b0f82bb5dbb881025a92d55baf9df6adeaf3a305e2e0da96a81d58
2023-04-03 15:01:37 +00:00
dan
66086eb6a6 Fix a potential buffer overread in the recovery extension.
FossilOrigin-Name: 0b3b5bf9597615589a1d045aaa697c13550553ee4fe4b9008a8e51415b6fe96a
2023-03-17 14:18:39 +00:00
dan
eb5d71ed58 Fix a broken assert() in the recovery extension.
FossilOrigin-Name: 4c4e66f293d7768cceb875a936ca0f4cd910473e20b9910698cc1e1ce221a7d4
2023-03-15 13:53:47 +00:00
dan
b211a4b391 Improve the error message generated by the recovery extension if it is used with a non-SQLITE_ENABLE_DBPAGE_VTAB build.
FossilOrigin-Name: c1f2a1d55c180fb51a4e203befbbe529bdd23137b26190c50b8f85820450e7fa
2023-02-28 11:02:02 +00:00
drh
3547e4997f Fix lots of harmless, nuisance compiler warnings, mostly unused parameter
warnings in extensions.

FossilOrigin-Name: c14bbe1606c1450b709970f922b94a641dfc8f9bd09126501d7dc4db99ea4772
2022-12-23 14:49:24 +00:00
drh
ea038d3d23 Additional defense against corrupt database files in dbdata.c.
FossilOrigin-Name: 2e70d1e5c9b2c9e068be3ccf8a6062edf7bdde2e46d60ba8ce54eda851af6008
2022-11-09 11:02:39 +00:00
drh
92c0881d9d Increase the precision of the nData parameter to the dbdataValue() routine
inside the sqlite_dbdata virtual table, to avoid the possibility of integer
overflow.

FossilOrigin-Name: 295447b44fc7658891352a9b3f792379b52a76ee5dcfd498b7028f5f87b40e9e
2022-11-09 10:17:25 +00:00
dan
ffc9b1b046 Fix Tcl tests so that they again build and run with SQLITE_OMIT_VIRTUALTABLE defined.
FossilOrigin-Name: 06a9dbea40c8a0cdfae6b127a1ce1cba0547acdf1115c087e9b790a78c264b52
2022-11-04 15:17:14 +00:00
drh
053bb22f35 Fix harmless compiler warnings in testing code.
FossilOrigin-Name: 2f53612388507f9b1ecbec3c15281825beab54b8062d97d0ab6f009c5fed347b
2022-10-28 18:52:05 +00:00
drh
c97bb14fab Fix a minor problem with sqlite_dbdata.
FossilOrigin-Name: 58c2e49279c8f77f006b0c2ce351776bc711633f9c1a39c7a37969838d49ec0b
2022-10-27 23:17:49 +00:00
dan
676d1cda92 Fix another crash in the recover extension triggered by a corrupt database.
FossilOrigin-Name: d125377378916fb3147612a536fde15ee955176eea9ea6eaa4a2ee5f1e8e1cbe
2022-10-27 20:27:45 +00:00
dan
895f12dfe7 Fix an assert() failure in the recover extension triggered by a zero value as the first page-number in an overflow page chain.
FossilOrigin-Name: 44c0874c33e76ce708022e5c38c74f75565a8cea9f4c5b067cc0a54079aeee20
2022-10-27 18:35:09 +00:00
dan
340b1d1a71 Do not use sqlite3_result_text16() in the recover extension if SQLITE_OMIT_UTF16 is defined.
FossilOrigin-Name: 3d20d77a3511bb223474da8491e1da8aec098c41c1b81ab78ff80fbd37d5b568
2022-10-27 11:25:08 +00:00
dan
5ad03a486e Merge further changes from trunk, including fix to dbdata.c.
FossilOrigin-Name: bcf6b48d52c1ce656899f50bd508c0920cae8cf2ef3c0758a7633981f0f0f484
2022-10-26 18:22:22 +00:00
dan
361fb98b5d Move file /ext/misc/dbdata.c to the /ext/recover/ directory.
FossilOrigin-Name: f6d5ac807efcf6140016a8b8f0c74566c0bfc98ad92bd8fca03c5cc80ebf3dec
2022-10-19 18:03:39 +00:00