/ Check-in [89930ea3]
Login

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

Overview
Comment:Adjust #ifdefs in test_autoext.c so that it compiles with SQLITE_OMIT_LOAD_EXTENSION. Fix compiler warnings in two other test modules. No changes to the core.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 89930ea3c3b3bd078f641b2c5203d851083bbf1a
User & Date: drh 2013-08-06 18:35:31
Context
2013-08-06
19:18
Fix a test case related to partial indices so that it works even if STAT3 is disabled. check-in: 153c6450 user: drh tags: trunk
18:35
Adjust #ifdefs in test_autoext.c so that it compiles with SQLITE_OMIT_LOAD_EXTENSION. Fix compiler warnings in two other test modules. No changes to the core. check-in: 89930ea3 user: drh tags: trunk
18:21
Update the configure script to use the latest version number (3.8.0). check-in: 52e8ec5e user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/test_autoext.c.

   204    204   #ifndef SQLITE_OMIT_LOAD_EXTENSION
   205    205     Tcl_CreateObjCommand(interp, "sqlite3_auto_extension_sqr",
   206    206             autoExtSqrObjCmd, 0, 0);
   207    207     Tcl_CreateObjCommand(interp, "sqlite3_auto_extension_cube",
   208    208             autoExtCubeObjCmd, 0, 0);
   209    209     Tcl_CreateObjCommand(interp, "sqlite3_auto_extension_broken",
   210    210             autoExtBrokenObjCmd, 0, 0);
   211         -#endif
   212    211     Tcl_CreateObjCommand(interp, "sqlite3_cancel_auto_extension_sqr",
   213    212             cancelAutoExtSqrObjCmd, 0, 0);
   214    213     Tcl_CreateObjCommand(interp, "sqlite3_cancel_auto_extension_cube",
   215    214             cancelAutoExtCubeObjCmd, 0, 0);
   216    215     Tcl_CreateObjCommand(interp, "sqlite3_cancel_auto_extension_broken",
   217    216             cancelAutoExtBrokenObjCmd, 0, 0);
          217  +#endif
   218    218     Tcl_CreateObjCommand(interp, "sqlite3_reset_auto_extension",
   219    219             resetAutoExtObjCmd, 0, 0);
   220    220     return TCL_OK;
   221    221   }

Changes to src/test_demovfs.c.

   532    532     int nPathOut,                   /* Size of output buffer in bytes */
   533    533     char *zPathOut                  /* Pointer to output buffer */
   534    534   ){
   535    535     char zDir[MAXPATHNAME+1];
   536    536     if( zPath[0]=='/' ){
   537    537       zDir[0] = '\0';
   538    538     }else{
   539         -    getcwd(zDir, sizeof(zDir));
          539  +    if( getcwd(zDir, sizeof(zDir))==0 ) return SQLITE_IOERR;
   540    540     }
   541    541     zDir[MAXPATHNAME] = '\0';
   542    542   
   543    543     sqlite3_snprintf(nPathOut, zPathOut, "%s/%s", zDir, zPath);
   544    544     zPathOut[nPathOut-1] = '\0';
   545    545   
   546    546     return SQLITE_OK;

Changes to src/test_fs.c.

   191    191     assert( i==0 || i==1 );
   192    192     if( i==0 ){
   193    193       sqlite3_result_value(ctx, sqlite3_column_value(pCur->pStmt, 0));
   194    194     }else{
   195    195       const char *zFile = (const char *)sqlite3_column_text(pCur->pStmt, 1);
   196    196       struct stat sbuf;
   197    197       int fd;
          198  +    int n;
   198    199   
   199    200       fd = open(zFile, O_RDONLY);
   200    201       if( fd<0 ) return SQLITE_IOERR;
   201    202       fstat(fd, &sbuf);
   202    203   
   203    204       if( sbuf.st_size>=pCur->nAlloc ){
   204    205         int nNew = sbuf.st_size*2;
................................................................................
   210    211           close(fd);
   211    212           return SQLITE_NOMEM;
   212    213         }
   213    214         pCur->zBuf = zNew;
   214    215         pCur->nAlloc = nNew;
   215    216       }
   216    217   
   217         -    read(fd, pCur->zBuf, sbuf.st_size);
          218  +    n = (int)read(fd, pCur->zBuf, sbuf.st_size);
   218    219       close(fd);
          220  +    if( n!=sbuf.st_size ) return SQLITE_ERROR;
   219    221       pCur->nBuf = sbuf.st_size;
   220    222       pCur->zBuf[pCur->nBuf] = '\0';
   221    223   
   222    224       sqlite3_result_text(ctx, pCur->zBuf, -1, SQLITE_TRANSIENT);
   223    225     }
   224    226     return SQLITE_OK;
   225    227   }