Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(562)

Unified Diff: third_party/sqlite/src/test/auth3.test

Issue 2751253002: [sql] Import SQLite 3.17.0. (Closed)
Patch Set: also clang on Linux i386 Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/sqlite/src/test/auth2.test ('k') | third_party/sqlite/src/test/autoinc.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/test/auth3.test
diff --git a/third_party/sqlite/src/test/auth3.test b/third_party/sqlite/src/test/auth3.test
index eef10b398f03f43d4b0b62b55cb94aac846c6dcc..013486e5a03d1cd3c5e49a329d6203cd24001016 100644
--- a/third_party/sqlite/src/test/auth3.test
+++ b/third_party/sqlite/src/test/auth3.test
@@ -12,8 +12,7 @@
# Test that the truncate optimization is disabled if the SQLITE_DELETE
# authorization callback returns SQLITE_IGNORE.
#
-# $Id: auth3.test,v 1.2 2009/05/04 01:58:31 drh Exp $
-#
+# Test that authorizer is disabled during schema parsing.
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -108,4 +107,22 @@ do_test auth3-2.2 {
set sqlite_search_count
} {1}
+# 2016-07-28. A problem report from a private client complaining about
+# an authorizer failure during an ALTER TABLE. The solution (I think) is
+# to disable the authorizer during schema parsing.
+#
+proc auth {code args} {
+ if {$code=="SQLITE_READ" && [regexp {DoNotRead} $args]} {
+ return SQLITE_DENY
+ }
+ return SQLITE_OK
+}
+do_execsql_test auth3-3.0 {
+ CREATE TEMPORARY TABLE TempTable (
+ key TEXT NOT NULL ON CONFLICT FAIL UNIQUE ON CONFLICT REPLACE,
+ value TEXT NOT NULL ON CONFLICT FAIL);
+ ALTER TABLE TempTable RENAME TO DoNotRead;
+ SELECT name FROM temp.sqlite_master;
+} {DoNotRead sqlite_autoindex_DoNotRead_1}
+
finish_test
« no previous file with comments | « third_party/sqlite/src/test/auth2.test ('k') | third_party/sqlite/src/test/autoinc.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698