1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Try to get recent sqlite3_analyzer and sqldiff tests working for all

tested combinations of compile-time options, especially
SQLITE_OMIT_VIRTUALTABLE and SQLITE_OMIT_LOAD_EXTENSION.

FossilOrigin-Name: 07c7d3925cbcf44c2f606c7f016ec56304e0ca24
This commit is contained in:
drh
2015-05-12 12:24:50 +00:00
parent aa62e48cab
commit 6582ae520f
6 changed files with 23 additions and 10 deletions

View File

@ -1159,12 +1159,14 @@ int main(int argc, char **argv){
showHelp();
return 0;
}else
#ifndef SQLITE_OMIT_LOAD_EXTENSION
if( strcmp(z,"lib")==0 || strcmp(z,"L")==0 ){
if( i==argc-1 ) cmdlineError("missing argument to %s", argv[i]);
azExt = realloc(azExt, sizeof(azExt[0])*(nExt+1));
if( azExt==0 ) cmdlineError("out of memory");
azExt[nExt++] = argv[++i];
}else
#endif
if( strcmp(z,"primarykey")==0 ){
g.bSchemaPK = 1;
}else
@ -1200,6 +1202,7 @@ int main(int argc, char **argv){
if( rc || zErrMsg ){
cmdlineError("\"%s\" does not appear to be a valid SQLite database", zDb1);
}
#ifndef SQLITE_OMIT_LOAD_EXTENSION
sqlite3_enable_load_extension(g.db, 1);
for(i=0; i<nExt; i++){
rc = sqlite3_load_extension(g.db, azExt[i], 0, &zErrMsg);
@ -1207,6 +1210,7 @@ int main(int argc, char **argv){
cmdlineError("error loading %s: %s", azExt[i], zErrMsg);
}
}
#endif
free(azExt);
zSql = sqlite3_mprintf("ATTACH %Q as aux;", zDb2);
rc = sqlite3_exec(g.db, zSql, 0, 0, &zErrMsg);