Improve the error message that comes back when sqlite3_load_extension()
fails because the named file exists but is not a valid shared library. FossilOrigin-Name: 05fee1a21ea398f1e4d6f1cf361657eff25ed6cd8f85ab398262dcfd30da57e9
This commit is contained in:
+6
-1
@@ -496,8 +496,13 @@ static int sqlite3LoadExtension(
|
||||
#if SQLITE_OS_UNIX || SQLITE_OS_WIN
|
||||
for(ii=0; ii<ArraySize(azEndings) && handle==0; ii++){
|
||||
char *zAltFile = sqlite3_mprintf("%s.%s", zFile, azEndings[ii]);
|
||||
int bOk = 0;
|
||||
if( zAltFile==0 ) return SQLITE_NOMEM_BKPT;
|
||||
handle = sqlite3OsDlOpen(pVfs, zAltFile);
|
||||
if( sqlite3OsAccess(pVfs,zAltFile,SQLITE_ACCESS_EXISTS,&bOk)==SQLITE_OK
|
||||
&& bOk
|
||||
){
|
||||
handle = sqlite3OsDlOpen(pVfs, zAltFile);
|
||||
}
|
||||
sqlite3_free(zAltFile);
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user