SQLite
Check-in [6b4979e8]
Not logged in
Overview
Comment:In test_quota.c, provide a work-around for the missing _chsize_s() function in mingw.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:6b4979e86c05f2da2c5fff67ea7feec5fa56756a
User & Date: drh 2012-11-06 18:41:41
Context
2012-11-06
20:39
Adjust the SQLITE_DBSTATUS_STMT_USED calculation to take the modified usage of sqlite3VdbeClearObject() into account. check-in: 82eb7ead user: mistachkin tags: trunk
18:41
In test_quota.c, provide a work-around for the missing _chsize_s() function in mingw. check-in: 6b4979e8 user: drh tags: trunk
2012-11-05
13:51
Add the INSTR() SQL function. check-in: a4c181cb user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/test_quota.c.

1175
1176
1177
1178
1179
1180
1181





1182

1183
1184
1185
1186
1187
1188
1189
    pGroup->iSize += szNew - pFile->iSize;
    quotaLeave();
  }
#if SQLITE_OS_UNIX
  rc = ftruncate(fileno(p->f), szNew);
#endif
#if SQLITE_OS_WIN





  rc = _chsize_s(_fileno(p->f), szNew);

#endif
  if( pFile && rc==0 ){
    quotaGroup *pGroup = pFile->pGroup;
    quotaEnter();
    pGroup->iSize += szNew - pFile->iSize;
    pFile->iSize = szNew;
    quotaLeave();







>
>
>
>
>
|
>







1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
    pGroup->iSize += szNew - pFile->iSize;
    quotaLeave();
  }
#if SQLITE_OS_UNIX
  rc = ftruncate(fileno(p->f), szNew);
#endif
#if SQLITE_OS_WIN
#  if defined(__MINGW32__) && defined(SQLITE_TEST)
     /* _chsize_s() is missing from MingW (as of 2012-11-06).  Use
     ** _chsize() as a work-around for testing purposes. */
     rc = _chsize(_fileno(p->f), (long)szNew);
#  else
     rc = _chsize_s(_fileno(p->f), szNew);
#  endif
#endif
  if( pFile && rc==0 ){
    quotaGroup *pGroup = pFile->pGroup;
    quotaEnter();
    pGroup->iSize += szNew - pFile->iSize;
    pFile->iSize = szNew;
    quotaLeave();