/ Check-in [921c7a0a]
Login

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

Overview
Comment:make os2Truncate() actually do something and fix os2FullPathname() to be more elegant and work more correctly in all cases (Ticket #2904) (CVS 4766)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:921c7a0ac4581255ea5061980ff7991088b9b78a
User & Date: pweilbacher 2008-02-01 00:31:59
Context
2008-02-01
01:19
Modify the printf test script so that it does not depend on the platform printf, so that we do not spurious test failures when moving from one platform to another. (CVS 4767) check-in: 514d7e47 user: drh tags: trunk
00:31
make os2Truncate() actually do something and fix os2FullPathname() to be more elegant and work more correctly in all cases (Ticket #2904) (CVS 4766) check-in: 921c7a0a user: pweilbacher tags: trunk
2008-01-31
19:34
Fix a problem with virtual tables and left joins introduced by check-in (4761). Ticket #2894 and #2913. (CVS 4765) check-in: ebeac2a4 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_os2.c.

   161    161   }
   162    162   
   163    163   /*
   164    164   ** Truncate an open file to a specified size
   165    165   */
   166    166   int os2Truncate( sqlite3_file *id, i64 nByte ){
   167    167     APIRET rc = NO_ERROR;
   168         -  ULONG filePosition = 0L;
   169    168     os2File *pFile = (os2File*)id;
   170    169     OSTRACE3( "TRUNCATE %d %lld\n", pFile->h, nByte );
   171    170     SimulateIOError( return SQLITE_IOERR_TRUNCATE );
   172         -  rc = DosSetFilePtr( pFile->h, nByte, FILE_BEGIN, &filePosition );
   173         -  if( rc != NO_ERROR ){
   174         -    return SQLITE_IOERR;
   175         -  }
   176         -  rc = DosSetFilePtr( pFile->h, 0L, FILE_END, &filePosition );
          171  +  rc = DosSetFileSize( pFile->h, nByte );
   177    172     return rc == NO_ERROR ? SQLITE_OK : SQLITE_IOERR;
   178    173   }
   179    174   
   180    175   #ifdef SQLITE_TEST
   181    176   /*
   182    177   ** Count the number of fullsyncs and normal syncs.  This is used to test
   183    178   ** that syncs and fullsyncs are occuring at the right times.
................................................................................
   786    781   */
   787    782   static int os2FullPathname(
   788    783     sqlite3_vfs *pVfs,          /* Pointer to vfs object */
   789    784     const char *zRelative,      /* Possibly relative input path */
   790    785     int nFull,                  /* Size of output buffer in bytes */
   791    786     char *zFull                 /* Output buffer */
   792    787   ){
   793         -  if( strchr(zRelative, ':') ){
   794         -    sqlite3_snprintf( nFull, zFull, "%s", zRelative );
   795         -  }else{
   796         -    ULONG ulDriveNum = 0;
   797         -    ULONG ulDriveMap = 0;
   798         -    ULONG cbzBufLen = SQLITE_TEMPNAME_SIZE;
   799         -    char *zBuff = (char*)malloc( cbzBufLen );
   800         -    if( zBuff == 0 ){
   801         -      return SQLITE_NOMEM;
   802         -    }
   803         -    DosQueryCurrentDisk( &ulDriveNum, &ulDriveMap );
   804         -    if( DosQueryCurrentDir( ulDriveNum, (PBYTE)zBuff, &cbzBufLen ) == NO_ERROR ){
   805         -      sqlite3_snprintf( nFull, zFull, "%c:\\%s\\%s",
   806         -                               (char)('A' + ulDriveNum - 1), zBuff, zRelative);
   807         -    }
   808         -    free( zBuff );
   809         -  }
   810         -  return SQLITE_OK;
          788  +  APIRET rc = DosQueryPathInfo( zRelative, FIL_QUERYFULLNAME, zFull, nFull );
          789  +  return rc == NO_ERROR ? SQLITE_OK : SQLITE_IOERR;
   811    790   }
   812    791   
   813    792   #ifndef SQLITE_OMIT_LOAD_EXTENSION
   814    793   /*
   815    794   ** Interfaces for opening a shared library, finding entry points
   816    795   ** within the shared library, and closing the shared library.
   817    796   */