/ Check-in [339df63f]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add another test case for the new authorizer functionality.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 339df63f4064f3b9c8d4e8b82e72d00b49d9406bc350b14809a4caf7ddc4b736
User & Date: dan 2017-05-11 19:09:19
Context
2017-05-12
14:05
Make sure the 'sqlite3changegroup_*' functions are included in the SQLITE_APICALL handling. check-in: a123cb93 user: mistachkin tags: trunk
2017-05-11
19:09
Add another test case for the new authorizer functionality. check-in: 339df63f user: dan tags: trunk
18:42
Enhance the json_extract() function to reuse parses of the same JSON when the function appears multiple times in the same query. check-in: 3ba9e7ab user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/auth.test.

  2520   2520     execsql {SELECT t6.a FROM t6, t7}
  2521   2521     set ::authargs
  2522   2522   } [list \
  2523   2523     SQLITE_SELECT {} {} {} {}          \
  2524   2524     SQLITE_READ t6 a main {}           \
  2525   2525     SQLITE_READ t7 {} {} {}            \
  2526   2526     ]
         2527  +
         2528  +# Test also that if SQLITE_DENY is returned from an SQLITE_READ authorizer 
         2529  +# invocation with no column name specified, compilation fails.
         2530  +#
         2531  +set ::authargs [list]
         2532  +proc auth {op a b c d} {
         2533  +  lappend ::authargs $op $a $b $c $d
         2534  +  if {$op == "SQLITE_READ"} { return "SQLITE_DENY" }
         2535  +  return "SQLITE_OK"
         2536  +}
         2537  +set ::authargs [list]
         2538  +do_catchsql_test auth-8.3 {
         2539  +  SELECT count(*) FROM t7
         2540  +} {1 {not authorized}}
         2541  +do_test auth-8.4 {
         2542  +  set ::authargs
         2543  +} [list \
         2544  +  SQLITE_SELECT {} {} {} {}          \
         2545  +  SQLITE_FUNCTION {} count {} {}     \
         2546  +  SQLITE_READ t7 {} {} {}            \
         2547  +]
         2548  +
  2527   2549   
  2528   2550   rename proc {}
  2529   2551   rename proc_real proc
  2530   2552   finish_test