Skip to content

Commit

Permalink
Fix a compilation issue in the "userauth" extension. Also fix a few test
Browse files Browse the repository at this point in the history
script errors that occur with SQLITE_USER_AUTHENTICATION=1 builds.
  • Loading branch information
danielk-1977 committed Sep 19, 2018
1 parent c6ecdc6 commit 4c98ab8
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ext/userauth/userauth.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ int sqlite3_user_authenticate(
db->auth.nAuthPW = nPW;
rc = sqlite3UserAuthCheckLogin(db, "main", &authLevel);
db->auth.authLevel = authLevel;
sqlite3ExpirePreparedStatements(db);
sqlite3ExpirePreparedStatements(db, 0);
if( rc ){
return rc; /* OOM error, I/O error, etc. */
}
Expand Down
2 changes: 1 addition & 1 deletion test/alterauth.test
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ set testprefix alterauth
set ::auth [list]
proc xAuth {type args} {
if {$type == "SQLITE_ALTER_TABLE"} {
lappend ::auth [concat $type $args]
lappend ::auth [concat $type [lrange $args 0 3]]
}
return SQLITE_OK
}
Expand Down
3 changes: 2 additions & 1 deletion test/auth.test
Original file line number Diff line number Diff line change
Expand Up @@ -2598,7 +2598,8 @@ do_test auth-8.2 {
# invocation with no column name specified, compilation fails.
#
set ::authargs [list]
proc auth {op a b c d} {
proc auth {op args} {
foreach {a b c d} $args break
lappend ::authargs $op $a $b $c $d
if {$op == "SQLITE_READ"} { return "SQLITE_DENY" }
return "SQLITE_OK"
Expand Down
1 change: 1 addition & 0 deletions test/releasetest.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ array set ::Configs [strip_comments {
-DSQLITE_ENABLE_STAT4
-DSQLITE_ENABLE_RBU
-DSQLITE_MAX_ATTACHED=125
-DSQLITE_USER_AUTHENTICATION=1
-DLONGDOUBLE_TYPE=double
--enable-session
}
Expand Down
7 changes: 4 additions & 3 deletions test/view.test
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,8 @@ do_test view-25.1 {
}
proc authLogDelete {code arg1 arg2 arg3 arg4 args} {
if {$code=="SQLITE_DELETE" && [string match sqlite_stat* $arg1]} {
lappend ::log [list $code $arg1 $arg2 $arg3 $arg4 $args]
# lappend ::log [list $code $arg1 $arg2 $arg3 $arg4 $args]
lappend ::log [list $code $arg1 $arg2 $arg3 $arg4]
}
return SQLITE_OK
}
Expand All @@ -692,8 +693,8 @@ do_test view-25.1 {
set log
} {}

set res [list {SQLITE_DELETE sqlite_stat1 {} main {} {}}]
ifcapable stat4 { lappend res {SQLITE_DELETE sqlite_stat4 {} main {} {}} }
set res [list {SQLITE_DELETE sqlite_stat1 {} main {}}]
ifcapable stat4 { lappend res {SQLITE_DELETE sqlite_stat4 {} main {}} }
do_test view-25.2 {
set log ""
db eval {DROP TABLE t25;}
Expand Down

0 comments on commit 4c98ab8

Please sign in to comment.