]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix a subtle bug in the remember UDF of the kvtest.exe utility program.
authordrh <drh@noemail.net>
Mon, 5 Jun 2017 19:20:35 +0000 (19:20 +0000)
committerdrh <drh@noemail.net>
Mon, 5 Jun 2017 19:20:35 +0000 (19:20 +0000)
FossilOrigin-Name: 9eea3670e77e2f831b7c00ae2d65a5583f9cad626d9ab286f92582ef29ecd4e3

manifest
manifest.uuid
test/kvtest.c

index 3bb2230f319158dbfe5b4b67e0a784d20fef7499..f77aaa12b05e23558b657571cb21b0a439841d83 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\sa\sbug\sin\stest_fs.c\sthat\soccurs\swhen\sthe\sfirst\scomponent\sof\sa\spath\scontains\na\sGLOB\sor\sLIKE\sescape\scharacter.
-D 2017-06-05T16:33:53.195
+C Fix\sa\ssubtle\sbug\sin\sthe\sremember\sUDF\sof\sthe\skvtest.exe\sutility\sprogram.
+D 2017-06-05T19:20:35.377
 F Makefile.in 1cc758ce3374a32425e4d130c2fe7b026b20de5b8843243de75f087c0a2661fb
 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
 F Makefile.msc 8eeb80162074004e906b53d7340a12a14c471a83743aab975947e95ce061efcc
@@ -925,7 +925,7 @@ F test/json102.test eeb54efa221e50b74a2d6fb9259963b48d7414dca3ce2fdfdeed45cb2848
 F test/json103.test c5f6b85e69de05f6b3195f9f9d5ce9cd179099a0
 F test/json104.test 877d5845f6303899b7889ea5dd1bea99076e3100574d5c536082245c5805dcaa
 F test/keyword1.test 37ef6bba5d2ed5b07ecdd6810571de2956599dff
-F test/kvtest.c 4e274696ee1cc588be38ce2d50015b564a79c076084126839a4599bf705fbd15
+F test/kvtest.c d2b8cfc91047ebf6cac4f3a04f19c3a864e4ecfd683bbb65c395df450b8dc79c
 F test/lastinsert.test 42e948fd6442f07d60acbd15d33fb86473e0ef63
 F test/laststmtchanges.test ae613f53819206b3222771828d024154d51db200
 F test/like.test 0603f4fa0dad50987f70032c05800cbfa8985302
@@ -1582,7 +1582,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P f3c25df4562efda2adeb211a4cc893246354917849a0fa4d95da3d7970e9588e
-R aa24b19a4f45442ffc34eeb6356fadd9
-U dan
-Z 26a8d8f95b610c30297dc9723021b8e7
+P 73c70590d7689806901378cd2a7e167ec4339f886031369266e07868acd23b93
+R 0c827ca5686a71389301c8ab16d1380c
+U drh
+Z aa16b10f95a81423ef1d2e52e40fab88
index 5cba0a45b581ed27271a89d34267fafdcf9e5b5a..1e40ffee5ffa7803f2b42376edcc471933e5f88c 100644 (file)
@@ -1 +1 @@
-73c70590d7689806901378cd2a7e167ec4339f886031369266e07868acd23b93
\ No newline at end of file
+9eea3670e77e2f831b7c00ae2d65a5583f9cad626d9ab286f92582ef29ecd4e3
\ No newline at end of file
index 21a35fc07eb7505ed3b03306aa07b807c29f2e26..b80adfea098a50db557efffc2c133c6fec682292 100644 (file)
@@ -543,7 +543,7 @@ static int exportMain(int argc, char **argv){
   zTail = zFN + nFN + 1;
   while( sqlite3_step(pStmt)==SQLITE_ROW ){
     int iKey = sqlite3_column_int(pStmt, 0);
-    int nData = sqlite3_column_bytes(pStmt, 1);
+    sqlite3_int64 nData = sqlite3_column_bytes(pStmt, 1);
     const void *pData = sqlite3_column_blob(pStmt, 1);
     FILE *out;
     if( ePathType==PATH_DIR ){
@@ -587,7 +587,7 @@ static int exportMain(int argc, char **argv){
 ** NULL is returned if any error is encountered. The final value of *pnByte
 ** is undefined in this case.
 */
-static unsigned char *readFile(const char *zName, int *pnByte){
+static unsigned char *readFile(const char *zName, sqlite3_int64 *pnByte){
   FILE *in;               /* FILE from which to read content of zName */
   sqlite3_int64 nIn;      /* Size of zName in bytes */
   size_t nRead;           /* Number of bytes actually read */
@@ -605,7 +605,7 @@ static unsigned char *readFile(const char *zName, int *pnByte){
     sqlite3_free(pBuf);
     return 0;
   }
-  if( pnByte ) *pnByte = (int)nIn;
+  if( pnByte ) *pnByte = nIn;
   return pBuf;
 }
 
@@ -613,7 +613,7 @@ static unsigned char *readFile(const char *zName, int *pnByte){
 ** Overwrite a file with randomness.  Do not change the size of the
 ** file.
 */
-static void updateFile(const char *zName, int *pnByte, int doFsync){
+static void updateFile(const char *zName, sqlite3_int64 *pnByte, int doFsync){
   FILE *out;              /* FILE from which to read content of zName */
   sqlite3_int64 sz;       /* Size of zName in bytes */
   size_t nWritten;        /* Number of bytes actually read */
@@ -624,7 +624,7 @@ static void updateFile(const char *zName, int *pnByte, int doFsync){
   if( sz<0 ){
     fatalError("No such file: \"%s\"", zName);
   }
-  *pnByte = (int)sz;
+  *pnByte = sz;
   if( sz==0 ) return;
   pBuf = sqlite3_malloc64( sz );
   if( pBuf==0 ){
@@ -820,10 +820,10 @@ static int runMain(int argc, char **argv){
   sqlite3_int64 tmStart;      /* Start time */
   sqlite3_int64 tmElapsed;    /* Elapsed time */
   int mmapSize = 0;           /* --mmap N argument */
-  int nData = 0;              /* Bytes of data */
+  sqlite3_int64 nData = 0;    /* Bytes of data */
   sqlite3_int64 nTotal = 0;   /* Total data read */
   unsigned char *pData = 0;   /* Content of the blob */
-  int nAlloc = 0;             /* Space allocated for pData[] */
+  sqlite3_int64 nAlloc = 0;   /* Space allocated for pData[] */
   const char *zJMode = 0;     /* Journal mode */
   
 
@@ -1013,18 +1013,18 @@ static int runMain(int argc, char **argv){
         nData = sqlite3_blob_bytes(pBlob);
         if( nAlloc<nData+1 ){
           nAlloc = nData+100;
-          pData = sqlite3_realloc(pData, nAlloc);
+          pData = sqlite3_realloc64(pData, nAlloc);
         }
         if( pData==0 ) fatalError("cannot allocate %d bytes", nData+1);
         if( isUpdateTest ){
           sqlite3_randomness((int)nData, pData);
-          rc = sqlite3_blob_write(pBlob, pData, nData, 0);
+          rc = sqlite3_blob_write(pBlob, pData, (int)nData, 0);
           if( rc!=SQLITE_OK ){
             fatalError("could not write the blob at %d: %s", iKey,
                       sqlite3_errmsg(db));
           }
         }else{
-          rc = sqlite3_blob_read(pBlob, pData, nData, 0);
+          rc = sqlite3_blob_read(pBlob, pData, (int)nData, 0);
           if( rc!=SQLITE_OK ){
             fatalError("could not read the blob at %d: %s", iKey,
                       sqlite3_errmsg(db));