aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/shell.c.in6
-rw-r--r--src/sqlite.h.in8
-rw-r--r--src/test1.c10
-rw-r--r--src/vtab.c2
4 files changed, 16 insertions, 10 deletions
diff --git a/src/shell.c.in b/src/shell.c.in
index 9bfca22e5..0ee136389 100644
--- a/src/shell.c.in
+++ b/src/shell.c.in
@@ -9409,6 +9409,7 @@ static int do_meta_command(char *zLine, ShellState *p){
#ifdef SQLITE_DEBUG
if( c=='u' && strncmp(azArg[0], "unmodule", n)==0 ){
int ii;
+ int lenOpt;
char *zOpt;
if( nArg<2 ){
raw_printf(stderr, "Usage: .unmodule [--allexcept] NAME ...\n");
@@ -9418,9 +9419,10 @@ static int do_meta_command(char *zLine, ShellState *p){
open_db(p, 0);
zOpt = azArg[1];
if( zOpt[0]=='-' && zOpt[1]=='-' && zOpt[2]!=0 ) zOpt++;
- if( strcmp(zOpt, "-allexcept")==0 ){
+ lenOpt = (int)strlen(zOpt);
+ if( lenOpt>=3 && strncmp(zOpt, "-allexcept",lenOpt)==0 ){
assert( azArg[nArg]==0 );
- sqlite3_drop_modules_except(p->db, nArg>2 ? (const char**)(azArg+2) : 0);
+ sqlite3_drop_modules(p->db, nArg>2 ? (const char**)(azArg+2) : 0);
}else{
for(ii=1; ii<nArg; ii++){
sqlite3_create_module(p->db, azArg[ii], 0, 0);
diff --git a/src/sqlite.h.in b/src/sqlite.h.in
index ace4da70b..521ddffdb 100644
--- a/src/sqlite.h.in
+++ b/src/sqlite.h.in
@@ -6639,6 +6639,8 @@ struct sqlite3_index_info {
** ^If the third parameter (the pointer to the sqlite3_module object) is
** NULL then no new module is create and any existing modules with the
** same name are dropped.
+**
+** See also: [sqlite3_drop_modules()]
*/
int sqlite3_create_module(
sqlite3 *db, /* SQLite connection to register module with */
@@ -6658,13 +6660,15 @@ int sqlite3_create_module_v2(
** CAPI3REF: Remove Unnecessary Virtual Table Implementations
** METHOD: sqlite3
**
-** ^The sqlite3_drop_modules_except(D,L) interface removes all virtual
+** ^The sqlite3_drop_modules(D,L) interface removes all virtual
** table modules from database connection D except those named on list L.
** The L parameter must be either NULL or a pointer to an array of pointers
** to strings where the array is terminated by a single NULL pointer.
** ^If the L parameter is NULL, then all virtual table modules are removed.
+**
+** See also: [sqlite3_create_module()]
*/
-int sqlite3_drop_modules_except(
+int sqlite3_drop_modules(
sqlite3 *db, /* Remove modules from this connection */
const char **azKeep /* Except, do not remove the ones named here */
);
diff --git a/src/test1.c b/src/test1.c
index 724333905..e238d31e8 100644
--- a/src/test1.c
+++ b/src/test1.c
@@ -1111,13 +1111,13 @@ static int SQLITE_TCLAPI test_create_function(
}
/*
-** Usage: sqlite3_drop_modules_except DB ?NAME ...?
+** Usage: sqlite3_drop_modules DB ?NAME ...?
**
-** Invoke the sqlite3_drop_modules_except(D,L) interface on database
+** Invoke the sqlite3_drop_modules(D,L) interface on database
** connection DB, in order to drop all modules except those named in
** the argument.
*/
-static int SQLITE_TCLAPI test_drop_except(
+static int SQLITE_TCLAPI test_drop_modules(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -1132,7 +1132,7 @@ static int SQLITE_TCLAPI test_drop_except(
return TCL_ERROR;
}
if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR;
- sqlite3_drop_modules_except(db, argc>2 ? (const char**)(argv+2) : 0);
+ sqlite3_drop_modules(db, argc>2 ? (const char**)(argv+2) : 0);
return TCL_OK;
}
@@ -7886,7 +7886,7 @@ int Sqlitetest1_Init(Tcl_Interp *interp){
{ "sqlite3_close_v2", (Tcl_CmdProc*)sqlite_test_close_v2 },
{ "sqlite3_create_function", (Tcl_CmdProc*)test_create_function },
{ "sqlite3_create_aggregate", (Tcl_CmdProc*)test_create_aggregate },
- { "sqlite3_drop_modules_except", (Tcl_CmdProc*)test_drop_except },
+ { "sqlite3_drop_modules", (Tcl_CmdProc*)test_drop_modules },
{ "sqlite_register_test_function", (Tcl_CmdProc*)test_register_func },
{ "sqlite_abort", (Tcl_CmdProc*)sqlite_abort },
{ "sqlite_bind", (Tcl_CmdProc*)test_bind },
diff --git a/src/vtab.c b/src/vtab.c
index 760993120..dd8a755be 100644
--- a/src/vtab.c
+++ b/src/vtab.c
@@ -137,7 +137,7 @@ int sqlite3_create_module_v2(
** External API to drop all virtual-table modules, except those named
** on the azNames list.
*/
-int sqlite3_drop_modules_except(sqlite3 *db, const char** azNames){
+int sqlite3_drop_modules(sqlite3 *db, const char** azNames){
HashElem *pThis, *pNext;
#ifdef SQLITE_ENABLE_API_ARMOR
if( !sqlite3SafetyCheckOk(db) || zName==0 ) return SQLITE_MISUSE_BKPT;