Commit Graph

109 Commits

Author SHA1 Message Date
drh
4ac285a1c2 Add support for extended result codes - additional result information
carried in the higher bits of the integer return codes.  This must be
enabled using the sqlite3_extended_result_code() API.  Only a few extra
result codes are currently defined. (CVS 3422)

FossilOrigin-Name: ba579ddc4361fc6e8ea66f9385770d70dfe94751
2006-09-15 07:28:50 +00:00
drh
5968593b51 Enhanced I/O error simulation. (CVS 3418)
FossilOrigin-Name: 86931854fc5a63571719639d9a23b1d6614a6153
2006-09-14 13:47:11 +00:00
drh
cdc35e9343 Remove a superfluous call to access() in the unix driver. Error spotted
by Coverity. (CVS 3175)

FossilOrigin-Name: 4f195aa1ebef5129e6f912e78b3d5f97b393a06c
2006-04-19 01:24:53 +00:00
drh
b912b2889c Use the pread()/pwrite() interface on Posix if compiled with -DUSE_PREAD=1.
Note that on Linux this is slower and does not work for large files. (CVS 3147)

FossilOrigin-Name: 5a24f61981df4d8b696f03372eba2d37228906d9
2006-03-23 22:42:20 +00:00
danielk1977
750b03e543 Changes so that test_async.c works with memory management turned on. (CVS 3093)
FossilOrigin-Name: f4150c29df2774b4422d4296d913cdbcee62c859
2006-02-14 10:48:39 +00:00
drh
4eb9a9792a Disable the /./ and /../ collapser logic in sqlite3OsFullPathname under Unix. (CVS 3092)
FossilOrigin-Name: 111a426b3e2fae77c9e6c3cd903fd80652b23720
2006-02-13 18:42:21 +00:00
drh
89ea93121d Add in-process file locking to test_async.c. The unix implementation of
sqlite3OsFullPathname() now attempts to remove /./ and /../ elements from
the path. (CVS 3090)

FossilOrigin-Name: 42379c623073eb541d053c2dff9f49087fb290f8
2006-02-13 17:03:47 +00:00
drh
e9565a6d94 Fix typo in os_unix.c. (CVS 3082)
FossilOrigin-Name: c0e987bcfa899c073d54fbd5a3606c704b8bc3d9
2006-02-11 02:03:52 +00:00
drh
ac530b1ab4 Add support and documentation for the fullfsync pragma. Also include
some other unrelated documentation updates. (CVS 3080)

FossilOrigin-Name: f2069d0bf3161591535e68b7389792e9cb7fe043
2006-02-11 01:25:50 +00:00
drh
6a3d670205 More comments on the unix locking code. Ticket #1672. (CVS 3075)
FossilOrigin-Name: 4b6f5688843ebe39f6bd3e863666a44d486fbe0f
2006-02-10 13:11:32 +00:00
drh
5c11123df8 Fix deadlock problem in the unix mutex. Ticket #1672. (CVS 3071)
FossilOrigin-Name: a6c30be214bb575f9ecfa299b7a597d21e3d3aca
2006-02-10 04:33:12 +00:00
drh
86631a5ad1 Ignore errors when when calling fsync() on a directory. Ticket #1657. (CVS 3068)
FossilOrigin-Name: d54d3b82c468b7e6dd39aac6aac56b26b3918c37
2006-02-09 23:05:51 +00:00
drh
5062d3a048 Add the SQLITE_THREADS_OVERRIDE_LOCKS compile-time option that disables
the run-time test to see if threads can override each others locks on unix. (CVS 3050)

FossilOrigin-Name: e83a19e8cb6d721b02502925b362f2e86b2de742
2006-01-31 23:03:35 +00:00
danielk1977
4d5238f0c0 Fix a couple of (harmless) intel compiler warnings. (CVS 3034)
FossilOrigin-Name: 2e23231f0c10b2bba9e08ea47859e2c0ffa84c76
2006-01-27 06:32:00 +00:00
drh
2f1a4d106d Fix uninitialized variable in os_unix.c. (CVS 3006)
FossilOrigin-Name: 892e644d20b9d132cf29242a9bca0116ebe6968f
2006-01-23 16:24:54 +00:00
drh
02afc86171 More compiler warnings fixed - or in some cases comments are added to explain
that the compiler is wrong. (CVS 2984)

FossilOrigin-Name: 507653a98cbd096f836a977408e373640c7cdb8f
2006-01-20 18:10:57 +00:00
danielk1977
76e8d1a292 Include the ThreadData structure in internal malloc() testing. Also fixes for revealed bugs. (CVS 2974)
FossilOrigin-Name: c7b9d50d0a975912776aaa2b870308652f77e1e6
2006-01-18 18:22:43 +00:00
drh
757b04ed36 Modify the sqlite3OsInMutex os-layer interface to take a single parameter
to distinguish between mutexes held by the current thread and mutexes held
by any thread.  Part of the fix for ticket #1630. (CVS 2973)

FossilOrigin-Name: e1ad9df1cf46287f2a7789275e98d28e05880e17
2006-01-18 17:25:45 +00:00
danielk1977
9e12800dec Use a global variable protected by a mutex instead of thread-specific-data to record malloc() failures. (CVS 2972)
FossilOrigin-Name: ac090f2ab3b5a792c2fdf897e10060f263e0d408
2006-01-18 16:51:35 +00:00
danielk1977
54f0198e47 Change sqlite3MallocClearFailed() calls to sqlite3ApiExit(), a better API. (CVS 2970)
FossilOrigin-Name: e0b022e5b2bfd272b4e25cd7a7b472206a118bbe
2006-01-18 15:25:17 +00:00
drh
a3fad6f5f3 Convert the unix driver to use a recusive mutex. Similar changes to the
windows driver are pending. (CVS 2968)

FossilOrigin-Name: 8830bbbac8e0c9243956aac42dc9f86a0bd1fa07
2006-01-18 14:06:37 +00:00
danielk1977
cbb8496c5e Arrange for ThreadData to be automatically deallocated even if SQLITE_MEMDEBUG is defined. Fix for #1623. (CVS 2965)
FossilOrigin-Name: 9e2e40845d30cc150abe23ee318a721b4fe9613c
2006-01-17 16:10:13 +00:00
drh
f1a221e695 Clean up comments in os_unix.c. (CVS 2950)
FossilOrigin-Name: 2170e803ad48cffa6dddf8b591e0c085a7e66c86
2006-01-15 17:27:17 +00:00
drh
3832230e25 Closing a file from the wrong thread is harmless on most systems.
(See ticket #1611)
But on systems like RedHat9 with broken fcntl() locks, it leaks file
descriptors.  That is better than the alternative of prematurely breaking
locks and causing database corruption.  Nevertheless, it would be good
if we could figure out a way to report errors when closing a file from
the wrong thread. (CVS 2946)

FossilOrigin-Name: ad8f12cad1fcd9c54478abe20050f9a953035506
2006-01-15 02:43:16 +00:00
drh
64b1bea3ba Add tests and fix bugs in the new cross-thread lock resolution code.
When an unlock fails, do not leak file descriptors (ticket #1611).
But we really ought to report SQLITE_MISUSE or some other error instead
of just returning SQLITE_OK. (CVS 2945)

FossilOrigin-Name: f68e05cb2be65fad43fac823b2a9c53b6d2e797d
2006-01-15 02:30:57 +00:00
drh
029b44bdd3 Documentation updates. Fix to date.c. But most importantly: database
connections are now allowed to change threads as long as they are not
holding a lock. (CVS 2944)

FossilOrigin-Name: 03c422ecb508dd84dfafc8b7a0b790a43f5dadda
2006-01-15 00:13:15 +00:00
drh
70ff98ab74 Improve performance by about 10% by avoiding excess calls to get
the thread-specific data. (CVS 2921)

FossilOrigin-Name: a8c74febec11eb689ca9f6b454f8c8bbadfc49d7
2006-01-12 01:25:18 +00:00
drh
b4bc7057e5 Testing of the automatic TSD deallocation logic. The sqlite3_thread_cleanup()
API is documented.  This should close ticket #1601. (CVS 2920)

FossilOrigin-Name: fb518b0ce4ddd4aaca5cccf61e651f173e735119
2006-01-11 23:40:33 +00:00
drh
6f7adc8a80 Automatically deallocate thread-specific data when it is no longer
being used.  Ticket #1601.  Also implemented the suggestion of
ticket #1603. Memory management is now off by default at compile-time.
The sqlite3_enable_memory_management() API has been removed. (CVS 2919)

FossilOrigin-Name: 5d9c6aa964305c3f36741ff0058da5b5f3ce0d24
2006-01-11 21:41:20 +00:00
drh
29c636bc12 Added database server example code (untested). Fixed serveral bugs including
the autovacuum compile problem described by ticket #1593. (CVS 2897)

FossilOrigin-Name: ec332d8822d1ac9673581a26ab2a2fce5f2554a3
2006-01-09 23:40:25 +00:00
danielk1977
e501b89ada Rename DbSchema to "Schema" and SqliteTsd to "ThreadData". (CVS 2893)
FossilOrigin-Name: 82b81f69c78cb3f54634d9aea4f6a838474dc5e5
2006-01-09 06:29:47 +00:00
drh
8c0ca7d27c Drop the mutex if the TSD key allocation fails. Ticket #1585. (CVS 2880)
FossilOrigin-Name: 77ac231c0e21c09c0b612a4e72bcc863f2c95fd3
2006-01-07 04:06:54 +00:00
drh
198bf39128 Changes so that SQLITE_OMIT_PARSER and SQLITE_OMIT_DISKIO work. (CVS 2878)
FossilOrigin-Name: 9d71b7deaffdd7eb9ddad1f03df3e4c51c2cbd98
2006-01-06 21:52:49 +00:00
drh
0739723d76 Fix an alignment problem in the sqlite3OsRandomSeed(). Ticket #1584. (CVS 2872)
FossilOrigin-Name: 373b56f0048fd6a1946a97acfcca40fd12f7d572
2006-01-06 14:46:46 +00:00
drh
66560adab3 Change the OS interface layer to use traditional direct function call
implementations instead of the more complicated virtual function table.
Omit the asynchronous I/O demo. (CVS 2870)

FossilOrigin-Name: 2529c2e11fa1d345ec61f647e4f6fae20a7133d6
2006-01-06 14:32:19 +00:00
drh
3fbb0b1a3b Windows implementation of the thread-specific data interface. (CVS 2864)
FossilOrigin-Name: 3aa8befedf4534cd100a7309997a4ad2ba08af20
2006-01-06 00:36:00 +00:00
danielk1977
441b09ae55 Disable automatic invocation of sqlite3_release_memory() when a malloc() fails
in those cases where the global mutex is held. (CVS 2860)

FossilOrigin-Name: 6fdbb8b771e490f0d791326689245302c4fe18f5
2006-01-05 13:48:29 +00:00
drh
88f474a938 Add the xInMutex method to the os-layer switch for testing whether or not
mutexes are used correctly. (CVS 2851)

FossilOrigin-Name: a582b159595ff8d31c81e9b3044711d6590d3f0e
2006-01-02 20:00:12 +00:00
danielk1977
c529f52046 Move malloc(), free(), realloc() and allocationSize() into the Os vtbl. (CVS 2819)
FossilOrigin-Name: 81a41f66370ea7f6810dfb323ba5cea60f240edd
2005-12-15 10:50:53 +00:00
danielk1977
13a68c3f61 Add the sqlite3_os_routine_set()/get() functions. (CVS 2818)
FossilOrigin-Name: c1ed79f594fb85009c2e9e5e281cbe66a9d2fa17
2005-12-15 10:11:30 +00:00
drh
2646da7e52 Clean up annoying (and pointless) compiler warnings about differing signedness. (CVS 2810)
FossilOrigin-Name: 83a59151559d9496d4f546e03e65087ea974717d
2005-12-09 20:02:05 +00:00
danielk1977
2e588c7525 Many small changes to ensure memory is not leaked after malloc() fails. (CVS 2808)
FossilOrigin-Name: 601c335463aaabc2e9918e4b9298cff6161be5c4
2005-12-09 14:25:08 +00:00
danielk1977
261919cc16 Some elements of the new malloc() failure handling. Not all cases work properly yet. Also, library is not threadsafe if malloc() fails right now. (CVS 2800)
FossilOrigin-Name: e1606658f1b4530e3001db4779b5669c8d13c853
2005-12-06 12:52:59 +00:00
drh
054889ec6d Restructure the OS interface yet again. This time make the OsFile object
a virtual base class which is subclassed for unix, windows, and the crash
test simulator.  Add the new file "os.c" for common os layer code.  Move
all OS-specific routines into the sqlite3Os structure. (CVS 2795)

FossilOrigin-Name: bd8740d1aecba69e1b5d64d43db07e8ad8841f07
2005-11-30 03:20:31 +00:00
drh
392b3ddf2e The crash test works now, at least on unix. Untested on windows. But it never
worked on windows before so if it still does not there is no big loss.  I am
still troubled by the current design of the OS overloading mechanism.  Expect
to see more changes. (CVS 2794)

FossilOrigin-Name: fa1d7ecfcc648fbe9fc6d92e080cf937bdc9c439
2005-11-29 19:56:32 +00:00
drh
9cbe635219 Make the OsFile structure opaque with its internal structure known only to
the appropriate os_*.c implementation.  Omit the os_unix.h and os_win.h
include files.  The crash tests are broken by this patch. (CVS 2791)

FossilOrigin-Name: 058f31753871b16b40fe4048e3adcee411e0f87d
2005-11-29 03:13:21 +00:00
drh
18839217da Add an OS method for making copies of file descriptors. This fixes the
crash tests. (CVS 2786)

FossilOrigin-Name: 57a674fc71512f11393b8eb595961ec9465ba4e1
2005-11-26 03:43:23 +00:00
drh
9c06c95309 Modify the OS layer so that I/O routines are called through a virtual function
table.  The os_test.c module has been replaced by test6.c.  The crash tests
are busted now and need to be fixed. (CVS 2785)

FossilOrigin-Name: 1f69aec285dd8e26bd739d5e44bb50fe03a9682a
2005-11-26 00:25:00 +00:00
danielk1977
d7c03f7485 Add the compilation option SQLITE_DISABLE_DIRSYNC (CVS 2782)
FossilOrigin-Name: f1298bb103aad46c737741d89d33c4c2904aec68
2005-11-25 10:38:22 +00:00
danielk1977
26c5d79f60 If SQLITE_DISABLE_LFS is defined, omit the bigfile tests. (CVS 2781)
FossilOrigin-Name: f882a516da18f45dbb668078d0d8240d930e1180
2005-11-25 09:01:23 +00:00