/ Check-in [05fee1a2]
Login

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

Overview
Comment:Improve the error message that comes back when sqlite3_load_extension() fails because the named file exists but is not a valid shared library.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 05fee1a21ea398f1e4d6f1cf361657eff25ed6cd8f85ab398262dcfd30da57e9
User & Date: drh 2017-12-23 13:55:43
References
2018-05-07
02:50
Backout change [05fee1a21ea398f1e4d6f1cf3] because it does not take into account the LD_LIBRARY_PATH environment variable used by dl_open(). check-in: b348d119 user: drh tags: trunk
Context
2017-12-23
14:39
Simplification to the error handling logic in the extension loader. check-in: 07c77314 user: drh tags: trunk
13:55
Improve the error message that comes back when sqlite3_load_extension() fails because the named file exists but is not a valid shared library. check-in: 05fee1a2 user: drh tags: trunk
12:33
Move the generation of output column names earlier in the case of a CREATE TABLE AS. This is a fix for ticket [3b4450072511e62] and a continuation of check-in [ade7ddf1998190b2b63] that fixes cases of ticket [de3403bf5ae5f72ed6] that were missed previously. check-in: 6b2ff26c user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/loadext.c.

   492    492   
   493    493     zEntry = zProc ? zProc : "sqlite3_extension_init";
   494    494   
   495    495     handle = sqlite3OsDlOpen(pVfs, zFile);
   496    496   #if SQLITE_OS_UNIX || SQLITE_OS_WIN
   497    497     for(ii=0; ii<ArraySize(azEndings) && handle==0; ii++){
   498    498       char *zAltFile = sqlite3_mprintf("%s.%s", zFile, azEndings[ii]);
          499  +    int bOk = 0;
   499    500       if( zAltFile==0 ) return SQLITE_NOMEM_BKPT;
   500         -    handle = sqlite3OsDlOpen(pVfs, zAltFile);
          501  +    if( sqlite3OsAccess(pVfs,zAltFile,SQLITE_ACCESS_EXISTS,&bOk)==SQLITE_OK
          502  +     && bOk
          503  +    ){
          504  +      handle = sqlite3OsDlOpen(pVfs, zAltFile);
          505  +    }
   501    506       sqlite3_free(zAltFile);
   502    507     }
   503    508   #endif
   504    509     if( handle==0 ){
   505    510       if( pzErrMsg ){
   506    511         *pzErrMsg = zErrmsg = sqlite3_malloc64(nMsg);
   507    512         if( zErrmsg ){