/ Check-in [752d8e21]
Login

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

Overview
Comment:Fix an alignment problem in test_async.c. (CVS 4840)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 752d8e21bb250d7df58a3abc945fcd7a3b38ad15
User & Date: drh 2008-03-07 21:04:02
Context
2008-03-07
21:37
Make sure all necessary mutexes are held prior to initializing the schema in sqlite3_table_column_metadata(). (CVS 4841) check-in: 4996ff93 user: drh tags: trunk
21:04
Fix an alignment problem in test_async.c. (CVS 4840) check-in: 752d8e21 user: drh tags: trunk
20:14
Another fix to the OsUnlock I/O error logic. (CVS 4839) check-in: 22bd537e user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/test_async.c.

1007
1008
1009
1010
1011
1012
1013

1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028

1029



1030
1031
1032
1033
1034
1035
1036
  sqlite3_vfs *pVfs = (sqlite3_vfs *)pAsyncVfs->pAppData;
  AsyncFile *p = (AsyncFile *)pFile;
  int nName = strlen(zName)+1;
  int rc = SQLITE_OK;
  int nByte;
  AsyncFileData *pData;
  AsyncLock *pLock = 0;

  int isExclusive = (flags&SQLITE_OPEN_EXCLUSIVE);

  nByte = (
    sizeof(AsyncFileData) +        /* AsyncFileData structure */
    2 * pVfs->szOsFile +           /* AsyncFileData.pBaseRead and pBaseWrite */
    nName                          /* AsyncFileData.zName */
  ); 
  pData = sqlite3_malloc(nByte);
  if( !pData ){
    return SQLITE_NOMEM;
  }
  memset(pData, 0, nByte);
  pData->zName = (char *)&pData[1];
  pData->nName = nName;
  pData->pBaseRead = (sqlite3_file *)&pData->zName[nName];

  pData->pBaseWrite = (sqlite3_file *)&pData->zName[nName+pVfs->szOsFile];



  pData->close.pFileData = pData;
  pData->close.op = ASYNC_CLOSE;
  memcpy(pData->zName, zName, nName);

  if( !isExclusive ){
    rc = sqlite3OsOpen(pVfs, zName, pData->pBaseRead, flags, pOutFlags);
    if( rc==SQLITE_OK && ((*pOutFlags)&SQLITE_OPEN_READWRITE) ){







>







|
|


|
|
|
|
>
|
>
>
>







1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
  sqlite3_vfs *pVfs = (sqlite3_vfs *)pAsyncVfs->pAppData;
  AsyncFile *p = (AsyncFile *)pFile;
  int nName = strlen(zName)+1;
  int rc = SQLITE_OK;
  int nByte;
  AsyncFileData *pData;
  AsyncLock *pLock = 0;
  char *z;
  int isExclusive = (flags&SQLITE_OPEN_EXCLUSIVE);

  nByte = (
    sizeof(AsyncFileData) +        /* AsyncFileData structure */
    2 * pVfs->szOsFile +           /* AsyncFileData.pBaseRead and pBaseWrite */
    nName                          /* AsyncFileData.zName */
  ); 
  z = sqlite3_malloc(nByte);
  if( !z ){
    return SQLITE_NOMEM;
  }
  memset(z, 0, nByte);
  pData = (AsyncFileData*)z;
  z += sizeof(pData[0]);
  pData->pBaseRead = (sqlite3_file*)z;
  z += pVfs->szOsFile;
  pData->pBaseWrite = (sqlite3_file*)z;
  z += pVfs->szOsFile;
  pData->zName = z;
  pData->nName = nName;
  pData->close.pFileData = pData;
  pData->close.op = ASYNC_CLOSE;
  memcpy(pData->zName, zName, nName);

  if( !isExclusive ){
    rc = sqlite3OsOpen(pVfs, zName, pData->pBaseRead, flags, pOutFlags);
    if( rc==SQLITE_OK && ((*pOutFlags)&SQLITE_OPEN_READWRITE) ){