/ Check-in [5cdbc097]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:In windows, always open files using FILE_FLAG_RANDOM_ACCESS. Ticket #2699. (CVS 4476)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 5cdbc0972fe94c13dffee1f908a77f903e580449
User & Date: drh 2007-10-08 12:21:11
Context
2007-10-08
12:22
Fix a bug in code for winCE. Ticket #2700. (CVS 4477) check-in: a36fca4c user: drh tags: trunk
12:21
In windows, always open files using FILE_FLAG_RANDOM_ACCESS. Ticket #2699. (CVS 4476) check-in: 5cdbc097 user: drh tags: trunk
2007-10-06
01:40
Fix a memory leak in the sqlite3_realloc() implementation of the non-debugging memory allocator. (CVS 4475) check-in: 7e9b886d user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/os_win.c.

1108
1109
1110
1111
1112
1113
1114

1115
1116
1117
1118
1119





1120
1121
1122
1123
1124
1125
1126
                    | SQLITE_OPEN_SUBJOURNAL) ){
    dwFlagsAndAttributes = FILE_ATTRIBUTE_TEMPORARY
                               | FILE_ATTRIBUTE_HIDDEN
                               | FILE_FLAG_DELETE_ON_CLOSE;
  }else{
    dwFlagsAndAttributes = FILE_ATTRIBUTE_NORMAL;
  }

  if( flags & (SQLITE_OPEN_MAIN_DB | SQLITE_OPEN_TEMP_DB) ){
    dwFlagsAndAttributes |= FILE_FLAG_RANDOM_ACCESS;
  }else{
    dwFlagsAndAttributes |= FILE_FLAG_SEQUENTIAL_SCAN;
  }





  if( isNT() ){
    h = CreateFileW((WCHAR*)zConverted,
       dwDesiredAccess,
       dwShareMode,
       NULL,
       dwCreationDisposition,
       dwFlagsAndAttributes,







>





>
>
>
>
>







1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
                    | SQLITE_OPEN_SUBJOURNAL) ){
    dwFlagsAndAttributes = FILE_ATTRIBUTE_TEMPORARY
                               | FILE_ATTRIBUTE_HIDDEN
                               | FILE_FLAG_DELETE_ON_CLOSE;
  }else{
    dwFlagsAndAttributes = FILE_ATTRIBUTE_NORMAL;
  }
#if 0
  if( flags & (SQLITE_OPEN_MAIN_DB | SQLITE_OPEN_TEMP_DB) ){
    dwFlagsAndAttributes |= FILE_FLAG_RANDOM_ACCESS;
  }else{
    dwFlagsAndAttributes |= FILE_FLAG_SEQUENTIAL_SCAN;
  }
#else
  /* Reports from the internet are that performance is always
  ** better if FILE_FLAG_RANDOM_ACCESS is used.  Ticket #2699. */
  dwFlagsAndAttributes |= FILE_FLAG_RANDOM_ACCESS;
#endif
  if( isNT() ){
    h = CreateFileW((WCHAR*)zConverted,
       dwDesiredAccess,
       dwShareMode,
       NULL,
       dwCreationDisposition,
       dwFlagsAndAttributes,