/ Changes On Branch cygUtf8
Login

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

Changes In Branch cygUtf8 Excluding Merge-Ins

This is equivalent to a diff from 8f3c767a to 484162b6

2013-11-26
00:28
Better support for UTF-8 paths on Cygwin. (check-in: 9954327c user: mistachkin tags: trunk)
2013-11-25
20:50
Optimizations to the sqlite3BtreeMovetoUnpacked() routine in storage engine making it about 17.8% faster, which in turn makes SQLite over 1.2% faster overall. (check-in: 032e8993 user: drh tags: trunk)
09:36
Initial work on isolating usage of the Windows header file. (check-in: 0d42c6b8 user: mistachkin tags: winHdr)
02:38
Performance improvements in sqlite3BtreeMovetoUnpacked(). (check-in: d0fb7ace user: drh tags: btree-optimization)
2013-11-24
23:18
Better support for UTF-8 paths on Cygwin. (Closed-Leaf check-in: 484162b6 user: mistachkin tags: cygUtf8)
01:14
Add the --scratch parameter to speedtest1. Improved error messages when misconfiguring memory parameters in speedtest1. (check-in: 8f3c767a user: drh tags: trunk)
00:46
The MEMSYS5 algorithm does not have to return the block with the lowest address. Any block of the appropriate size will do. Use the first block found on the freelist for the appropriate size for a performance improvement. (check-in: 12e612e8 user: drh tags: trunk)

Changes to src/os_win.c.

  4064   4064   /****************************************************************************
  4065   4065   **************************** sqlite3_vfs methods ****************************
  4066   4066   **
  4067   4067   ** This division contains the implementation of methods on the
  4068   4068   ** sqlite3_vfs object.
  4069   4069   */
  4070   4070   
  4071         -#if 0
         4071  +#if defined(__CYGWIN__)
  4072   4072   /*
  4073   4073   ** Convert a filename from whatever the underlying operating system
  4074   4074   ** supports for filenames into UTF-8.  Space to hold the result is
  4075   4075   ** obtained from malloc and must be freed by the calling function.
  4076   4076   */
  4077   4077   static char *winConvertToUtf8Filename(const void *zFilename){
  4078   4078     char *zConverted = 0;
................................................................................
  4240   4240                                "winGetTempname2", zDir);
  4241   4241           }
  4242   4242           if( winIsDir(zConverted) ){
  4243   4243             /* At this point, we know the candidate directory exists and should
  4244   4244             ** be used.  However, we may need to convert the string containing
  4245   4245             ** its name into UTF-8 (i.e. if it is UTF-16 right now).
  4246   4246             */
  4247         -          if( osIsNT() ){
  4248         -            char *zUtf8 = winUnicodeToUtf8(zConverted);
  4249         -            if( !zUtf8 ){
  4250         -              sqlite3_free(zConverted);
  4251         -              sqlite3_free(zBuf);
  4252         -              OSTRACE(("TEMP-FILENAME rc=SQLITE_IOERR_NOMEM\n"));
  4253         -              return SQLITE_IOERR_NOMEM;
  4254         -            }
  4255         -            sqlite3_snprintf(nMax, zBuf, "%s", zUtf8);
  4256         -            sqlite3_free(zUtf8);
         4247  +          char *zUtf8 = winConvertToUtf8Filename(zConverted);
         4248  +          if( !zUtf8 ){
  4257   4249               sqlite3_free(zConverted);
  4258         -            break;
  4259         -          }else{
  4260         -            sqlite3_snprintf(nMax, zBuf, "%s", zConverted);
  4261         -            sqlite3_free(zConverted);
  4262         -            break;
         4250  +            sqlite3_free(zBuf);
         4251  +            OSTRACE(("TEMP-FILENAME rc=SQLITE_IOERR_NOMEM\n"));
         4252  +            return SQLITE_IOERR_NOMEM;
  4263   4253             }
         4254  +          sqlite3_snprintf(nMax, zBuf, "%s", zUtf8);
         4255  +          sqlite3_free(zUtf8);
         4256  +          sqlite3_free(zConverted);
         4257  +          break;
  4264   4258           }
  4265   4259           sqlite3_free(zConverted);
  4266   4260         }
  4267   4261       }
  4268   4262     }
  4269   4263   #elif !SQLITE_OS_WINRT && !defined(__CYGWIN__)
  4270   4264     else if( osIsNT() ){
................................................................................
  4941   4935       **       for converting the relative path name to an absolute
  4942   4936       **       one by prepending the data directory and a slash.
  4943   4937       */
  4944   4938       char *zOut = sqlite3MallocZero( pVfs->mxPathname+1 );
  4945   4939       if( !zOut ){
  4946   4940         return SQLITE_IOERR_NOMEM;
  4947   4941       }
  4948         -    if( cygwin_conv_path(CCP_POSIX_TO_WIN_A|CCP_RELATIVE, zRelative, zOut,
  4949         -                         pVfs->mxPathname+1)<0 ){
         4942  +    if( cygwin_conv_path(
         4943  +            (osIsNT() ? CCP_POSIX_TO_WIN_W : CCP_POSIX_TO_WIN_A) |
         4944  +            CCP_RELATIVE, zRelative, zOut, pVfs->mxPathname+1)<0 ){
  4950   4945         sqlite3_free(zOut);
  4951   4946         return winLogError(SQLITE_CANTOPEN_CONVPATH, (DWORD)errno,
  4952   4947                            "winFullPathname1", zRelative);
         4948  +    }else{
         4949  +      char *zUtf8 = winConvertToUtf8Filename(zOut);
         4950  +      if( !zUtf8 ){
         4951  +        sqlite3_free(zOut);
         4952  +        return SQLITE_IOERR_NOMEM;
         4953  +      }
         4954  +      sqlite3_snprintf(MIN(nFull, pVfs->mxPathname), zFull, "%s%c%s",
         4955  +                       sqlite3_data_directory, winGetDirSep(), zUtf8);
         4956  +      sqlite3_free(zUtf8);
         4957  +      sqlite3_free(zOut);
  4953   4958       }
  4954         -    sqlite3_snprintf(MIN(nFull, pVfs->mxPathname), zFull, "%s%c%s",
  4955         -                     sqlite3_data_directory, winGetDirSep(), zOut);
  4956         -    sqlite3_free(zOut);
  4957   4959     }else{
  4958         -    if( cygwin_conv_path(CCP_POSIX_TO_WIN_A, zRelative, zFull, nFull)<0 ){
         4960  +    char *zOut = sqlite3MallocZero( pVfs->mxPathname+1 );
         4961  +    if( !zOut ){
         4962  +      return SQLITE_IOERR_NOMEM;
         4963  +    }
         4964  +    if( cygwin_conv_path(
         4965  +            (osIsNT() ? CCP_POSIX_TO_WIN_W : CCP_POSIX_TO_WIN_A),
         4966  +            zRelative, zOut, pVfs->mxPathname+1)<0 ){
         4967  +      sqlite3_free(zOut);
  4959   4968         return winLogError(SQLITE_CANTOPEN_CONVPATH, (DWORD)errno,
  4960   4969                            "winFullPathname2", zRelative);
         4970  +    }else{
         4971  +      char *zUtf8 = winConvertToUtf8Filename(zOut);
         4972  +      if( !zUtf8 ){
         4973  +        sqlite3_free(zOut);
         4974  +        return SQLITE_IOERR_NOMEM;
         4975  +      }
         4976  +      sqlite3_snprintf(MIN(nFull, pVfs->mxPathname), zFull, "%s", zUtf8);
         4977  +      sqlite3_free(zUtf8);
         4978  +      sqlite3_free(zOut);
  4961   4979       }
  4962   4980     }
  4963   4981     return SQLITE_OK;
  4964   4982   #endif
  4965   4983   
  4966   4984   #if (SQLITE_OS_WINCE || SQLITE_OS_WINRT) && !defined(__CYGWIN__)
  4967   4985     SimulateIOError( return SQLITE_ERROR );