1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-04-20 08:47:46 +03:00

551 Commits

Author SHA1 Message Date
drh
c398c65bee Revise the SQLITE_OPEN_NOFOLLOW so that it actually uses O_NOFOLLOW in the
open() system call.  This backs out the SQLITE_ACCESS_SYMLINK value but adds
the new SQLITE_OK_SYMLINK return code from the xFullPathname method of 
sqlite3_vfs when that routine resolves symbolic links. O_NOFOLLOW is always
included in open() system calls for journal files.

FossilOrigin-Name: 6a64fb6a2da6c98f1e87b55ad5689967e1db4eae2e08345471d95e28cd567e0f
2019-11-22 00:42:01 +00:00
mistachkin
3c161e07af Add support for the SQLITE_ACCESS_SYMLINK flag in the Win32 VFS.
FossilOrigin-Name: 175c15008e9f19b8f6762c2fe4a545735128765081980eed01d5e46ca4acb500
2019-11-18 23:48:03 +00:00
drh
0933aad72c Add support for SQLITE_OPEN_NOFOLLOW.
FossilOrigin-Name: cb79c828496a703f1410f61458ebc1e15a92a63412b36f51945b2b5a32ec6e88
2019-11-18 17:46:38 +00:00
drh
2cd02a5d2a Add assert()s in os_win.c in an effort to silence false-positives from
static analyzers.

FossilOrigin-Name: 22a7c15b262376fb0ce4dd3d044373380d86c5ccd96e2f24576cf04318597c33
2019-07-16 18:27:07 +00:00
drh
eafb9a0ae5 Make the winTruncate() method of the windows VFS be a no-op if there are
outstanding references to the memory-mapped pages.  Otherwise, memory might
be deleted out from under those references when the file is remapped during
the truncate operation.

FossilOrigin-Name: ffce4aac18dacbf2a3112ae2ab56c7db20cb164f179683d90a66ef38f4a98f2b
2018-11-24 17:46:07 +00:00
drh
48ea97e5dd Remove the unused mmapSizeActual field from the Windows sqlite3_file
implementation.

FossilOrigin-Name: 0e7aa62227d1d9c3540b54d7caf44a1ce7ccfa706672fc41dbb2be477ab3a667
2018-11-24 16:07:21 +00:00
mistachkin
1e8487db29 In the Win32 VFS, when truncating a file, unmap it first.
FossilOrigin-Name: 21510a66dce4d0843ccfe20f092a01f5a52563ef244a94f1d5d2563305cab925
2018-07-22 06:25:35 +00:00
mistachkin
07430a8caf Add sqlite3_win32_set_directory8() and sqlite3_win32_set_directory16() functions.
FossilOrigin-Name: 22089ea2bbea93eb1da7f08344789a5455077169443e40025f053d2a117f1c08
2018-05-02 03:01:50 +00:00
mistachkin
95d5ae19d1 Document and expose sqlite3_win32_set_directory() function for use on Win32.
FossilOrigin-Name: cbce7180ee664367ee8fc1f8af703eb7845bb58ade6870cc3b7608dcbe5952b3
2018-04-27 22:42:37 +00:00
mistachkin
bc6b8d7359 Adjust the previous check-in, which modified the Win32 VFS, so that it works with SQLITE_OMIT_WAL.
FossilOrigin-Name: 36c2e67e82626f8d0a187c6c286c133ed659889e3b577469261b9dcd3b3ab75b
2018-02-05 21:02:47 +00:00
mistachkin
435666e26d Allocation the mutex used by the Win32 VFS only once at initialization, instead of every time it is needed.
FossilOrigin-Name: 535ed0ac5e8728ec91fc0a4cb54b820923d161cfd4e0e6aed6df6cdae365bc7d
2018-02-05 20:42:50 +00:00
mistachkin
98e2cb8bd1 Simplifications to winOpenSharedMemory in the Win32 VFS.
FossilOrigin-Name: 3e04999dabb87715de46255b1a9b08d5dfa70d140e0a09a37ea2842d71c77caf
2018-01-17 01:40:57 +00:00
mistachkin
5685257b83 Corrections to error code handling in os_win.c, pursuant to walfault.test.
FossilOrigin-Name: 568192228c9578b8ea34c363e10ff28450045cda76248b2f0f89f84b3a57e680
2018-01-17 01:26:05 +00:00
drh
37874b5f74 Minor enhancement to two assert() statements in the default VFSes.
FossilOrigin-Name: 9cede8a83ca4cd88d504050115e1e89e7b3d3cd3cb2ffb5b8961e311a23ff5e2
2017-12-13 10:11:09 +00:00
mistachkin
0e026f403b Avoid superfluous SHM unlock call in the Win32 VFS.
FossilOrigin-Name: 5a384be6979b783d1f3af2ac6307e7e731c415d052f9405f04c0216f59414633
2017-11-09 23:24:29 +00:00
mistachkin
10813713ba Cleanup superfluous whitespace changes.
FossilOrigin-Name: a2908e2c88f7a30638a7e791fc7ad0325b663097c12cecd1f4726b0d60a9a3ed
2017-11-09 22:25:58 +00:00
mistachkin
7b7f224c62 Revise and vastly simplify the Win32 SHM file locking semantics, allowing all new tests to pass.
FossilOrigin-Name: d0997b0f5bc9a9869684e39a17a01c430d6383c8b31d6c00ea17a5eac15bc6f0
2017-11-09 22:23:50 +00:00
mistachkin
95a05aae67 Add an assert() in the Win32 VFS.
FossilOrigin-Name: 22e58330461736ca22d6f4d7eab897a3597de2e7434a6f4a474f0f0d7f964281
2017-11-09 20:37:37 +00:00
mistachkin
bcb416a9ff Get read-only SHM file tests passing on Win32.
FossilOrigin-Name: abef05353554e72f4d08aff562b87ff8530e8537a79e58d831205ea8c46eed07
2017-11-09 20:02:44 +00:00
mistachkin
9f4aad446b Further corrections to read-only SHM file handling on Win32.
FossilOrigin-Name: 43c311701bdf1202918cd46fa6133a11458e0ef8ddb09e46290a231083f395ce
2017-11-09 18:53:51 +00:00
mistachkin
a515065649 Corrections to Win32 lock detection for SHM files.
FossilOrigin-Name: 3a91be975daee65c3e1199855613066015d5df8ad44ababdef31d1c698b5e746
2017-11-09 18:21:51 +00:00
mistachkin
8a6fa5d41c Corrections to the Win32 porting changes on this branch.
FossilOrigin-Name: 0b26a5a26d700e20eea5ebbd620af0af6f2d61c652cfca5b8563267588cb2be6
2017-11-09 17:29:18 +00:00
mistachkin
4ff8431fd1 Initial work on porting the changes on this branch to Win32.
FossilOrigin-Name: 3738bfd0c0eadb10eea58954af5052cb6ce164059f3aacfe65d7da6a400c63c7
2017-11-09 16:30:55 +00:00
mistachkin
3314062b9d Use the updated Win32 VFS semantics for winOpen from check-in [5d03c738e9] for WinRT, et al, as well.
FossilOrigin-Name: 2c03d8b8f028b6a736aaf2cf8b28a51b3434cf341c95cf3a80469e0a24acdd98
2017-09-22 16:23:23 +00:00
drh
0e97e9a4c2 In the Windows VFS, when trying to open a database file read/write, if it
fails check to see if the file exists and is read-only and immediately fall
back to a read-only open attempt, rather than running the AV retry loop.

FossilOrigin-Name: 5d03c738e93d36815248991d9ed3d62297ba1bb966e602e7874410076c144f43
2017-09-21 20:43:48 +00:00
drh
b40d9eea50 In the Windows VFS, do not emit an SQLITE_CANTOPEN error log message when
falling back from SQLITE_OPEN_READWRITE to SQLITE_OPEN_READONLY.  Wait until
the open fails completely.

FossilOrigin-Name: fa3f5bcc23d9342f6df8ea15732988d637e9fa5dade85a73b05a9f66136d6964
2017-09-21 20:03:17 +00:00
mistachkin
bf60baa985 Remove use of the rand_s() function (added by [139081bef9f63c3e]) as it appears to cause issues with some third-party DLLs.
FossilOrigin-Name: 3a2793aa65727cbbf8c4678d478cf8fb02350f19ff98201934a984727368d64d
2017-09-12 23:58:47 +00:00
mistachkin
e35395a45a On Windows, avoid casting a value larger than 2^31 to a (SIZE_T) on systems where it is a 32-bit type.
FossilOrigin-Name: f08d63b413601b22726e8b96ff8eb779857321b9df30db0333f71e50ffb5077d
2017-08-07 19:06:54 +00:00
mistachkin
4689956b9e Correct a harmless typo in the previous check-in.
FossilOrigin-Name: 1589db012ef1389bf84399fccf96d143b2ac4c0f
2017-02-20 23:32:04 +00:00
mistachkin
5e6710ab65 Avoid unsigned integer overflows for SQLITE_WIN32_HEAP_INIT_SIZE when the Win32 heap subsystem is used with very large values of SQLITE_DEFAULT_CACHE_SIZE and/or SQLITE_DEFAULT_PAGE_SIZE.
FossilOrigin-Name: 96b6a98e5e4cb0ddbfcd78b05bfbfcd8976e9f32
2017-02-20 19:13:37 +00:00
mistachkin
8705f868e0 Add the SQLITE_FCNTL_WIN32_GET_HANDLE file control.
FossilOrigin-Name: 16039be3739b8d3b34a1e6093eaebb09e07f984b
2016-10-14 21:27:50 +00:00
drh
43f58d6a17 Fix various internal #defines to conform to new C-language naming restrictions,
specifically that private-use macros names must not begin with "_".

FossilOrigin-Name: 5471aca0158851d3fb0a2517306917536deb38bb
2016-07-09 16:14:45 +00:00
mistachkin
1e75483cf0 Initial work on a Win32 VFS with NOP locking.
FossilOrigin-Name: 549abe3f89b55b05a05f267865a5dd84b8cd335d
2016-07-08 21:14:37 +00:00
mistachkin
4a58d5fdf5 In winFullPathname, translate '/X:' to 'X:' before doing anything else.
FossilOrigin-Name: e404ad705d0e2d96025d05cc88348ffcd0703533
2016-06-06 20:36:26 +00:00
drh
8a5fd26116 Translate filenames of the form "/c:/*" into just "c:/*" on WinRT and Cygwin.
(SQLite has long done this for Win32/WinNT.)

FossilOrigin-Name: f8470ffc49918099820cc0008b9089e5fe8a7dff
2016-06-06 20:27:15 +00:00
mistachkin
1b361ff381 Add the experimental SQLITE_FCNTL_WIN32_GET_HANDLE file control.
FossilOrigin-Name: b6ddabe1818c36007c476a31e2e35755630a5f14
2016-05-03 19:36:54 +00:00
drh
97a7e5e68c The pcache and the built-in VFSes should not use mutexes when
SQLITE_CONFIG_SINGLETHREAD is set.

FossilOrigin-Name: 12418b100196abbfbfb85e0ab4bb6b1cbf335df7
2016-04-26 18:58:54 +00:00
drh
333f80562b Fix a locking race condition in Windows 10 that can occur when two or more
processes attempt to recover the same hot journal at the same time.

FossilOrigin-Name: 38a4e9d92887898b779493c71e4500f777a4e2e7
2016-04-20 18:31:27 +00:00
mistachkin
8366ddf242 Add and adjust comments.
FossilOrigin-Name: 541c6da23850673f5d2a2e31c3967b796ee2effc
2016-04-12 16:11:52 +00:00
mistachkin
0cedb963a3 Further refinements.
FossilOrigin-Name: b35bb928b25492f6dd71ccf9c250cb9f0cce09ff
2016-04-11 22:45:45 +00:00
mistachkin
0e188e1d1e Fix some compilation issues.
FossilOrigin-Name: 016481b39f8b23b4f0f851053068d8eaee6122e1
2016-04-11 22:10:26 +00:00
mistachkin
c0d10c8d4f Merge updates from trunk.
FossilOrigin-Name: 00990020d07d7c87b922cdbfa5373298a86bb4b3
2016-04-05 17:59:56 +00:00
mistachkin
1293120345 More refactoring and cleanup work on the Win32 string conversion and utility routines.
FossilOrigin-Name: 02ccb444a3d0b9a52ffd04cae9d9b6f654128c35
2016-04-04 02:05:46 +00:00
mistachkin
5daed673b8 Revise and enhance the Win32 string conversion routines.
FossilOrigin-Name: 345860c92195544aad44ea9b0d14c9ebbd50adf2
2016-04-03 22:44:16 +00:00
mistachkin
82452480ea In the Win32 VFS, avoid trying to use rand_s() on Windows CE.
FossilOrigin-Name: 183350fa7cc6a5ab8bd0a86cab231a6e4c915890
2016-03-25 17:19:57 +00:00
mistachkin
eb2329bed3 Prevent negative values of SQLITE_DEFAULT_CACHE_SIZE from making SQLITE_WIN32_HEAP_INIT_SIZE negative.
FossilOrigin-Name: e0737f5236ed3e85bd03203c880ee41b34619137
2016-03-24 20:36:47 +00:00
mistachkin
527b0435fa Fix harmless compiler warning for MSVC.
FossilOrigin-Name: 142cd359d37f1d8d53de32e329523d9a93c7d6e5
2016-03-22 15:26:03 +00:00
drh
762e32bcfa Change the xGetLastError() method on the windows VFS so that it continues to
format an error message (if requested) but returns the system error code,
rather than an SQLite status code.

FossilOrigin-Name: 1602f6b53698bd3a1a4be218c2e3145dd895f1f1
2016-03-17 19:28:19 +00:00
mistachkin
b7b91068ee In the Win32 VFS, use SQLITE_FCNTL_LAST_ERRNO instead of (the older) SQLITE_LAST_ERRNO.
FossilOrigin-Name: 9463762c437488970a87093ef13131c39b2adadc
2016-03-15 19:10:39 +00:00
mistachkin
b71aef3461 Readability improvements for winRandomness.
FossilOrigin-Name: 1640f814c7a5210f08c81e52e5a3fb89ac26f4d4
2016-02-15 22:37:18 +00:00