/ Check-in [8627a4cd]
Login

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

Overview
Comment:Test that the view name is passed to the authorization callback when a SELECT statement is run on a view.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 8627a4cd6d64bd076b56c1e8ccc3b1dfc1b4c07d
User & Date: dan 2016-04-04 16:40:44
Context
2016-04-04
17:23
Add the ".auth ON|OFF" command to the command-line shell. check-in: 65c7bcc4 user: drh tags: trunk
16:40
Test that the view name is passed to the authorization callback when a SELECT statement is run on a view. check-in: 8627a4cd user: dan tags: trunk
14:57
Enhance sqlite3session_apply() and sqlite3session_apply_strm() so that conflicts are retried before the xConflict() callback is invoked, as long as the "apply" operation is making forward progress. check-in: 42a21966 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/auth.test.

  2428   2428   } [list SQLITE_READ   t6 ROWID main {} \
  2429   2429           SQLITE_UPDATE t6 ROWID main {} \
  2430   2430   ]
  2431   2431   do_test auth-6.3 {
  2432   2432     execsql {SELECT rowid, * FROM t6}
  2433   2433   } {101 1 2 3 4 5 6 7 8}
  2434   2434   
  2435         -rename proc {}
  2436         -rename proc_real proc
         2435  +#-------------------------------------------------------------------------
         2436  +# Test that view names are included as zArg4.
         2437  +#
         2438  +do_execsql_test auth-7.1 {
         2439  +  CREATE TABLE t7(a, b, c);
         2440  +  CREATE VIEW v7 AS SELECT * FROM t7;
         2441  +} {}
         2442  +set ::authargs [list]
         2443  +proc auth {args} {
         2444  +  eval lappend ::authargs [lrange $args 0 4]
         2445  +  return SQLITE_OK
         2446  +}
         2447  +
         2448  +do_test auth-7.2 {
         2449  +  execsql {SELECT a, c FROM v7}
         2450  +  set ::authargs
         2451  +} [list                          \
         2452  +  SQLITE_SELECT {} {} {} {}      \
         2453  +  SQLITE_READ t7 a main v7       \
         2454  +  SQLITE_READ t7 b main v7       \
         2455  +  SQLITE_READ t7 c main v7       \
         2456  +  SQLITE_READ v7 a main {}       \
         2457  +  SQLITE_READ v7 c main {}       \
         2458  +  SQLITE_SELECT {} {} {} v7      \
         2459  +]
         2460  +
         2461  +set ::authargs [list]
         2462  +do_test auth-7.3 {
         2463  +  execsql {SELECT a, c FROM t7}
         2464  +  set ::authargs
         2465  +} [list                          \
         2466  +  SQLITE_SELECT {} {} {} {}      \
         2467  +  SQLITE_READ t7 a main {}       \
         2468  +  SQLITE_READ t7 c main {}       \
         2469  +]
         2470  +
         2471  +set ::authargs [list]
         2472  +do_test auth-7.4 {
         2473  +  execsql {SELECT a, c FROM t7 AS v7}
         2474  +  set ::authargs
         2475  +} [list                          \
         2476  +  SQLITE_SELECT {} {} {} {}      \
         2477  +  SQLITE_READ t7 a main {}       \
         2478  +  SQLITE_READ t7 c main {}       \
         2479  +]
  2437   2480   
  2438   2481   
         2482  +rename proc {}
         2483  +rename proc_real proc
  2439   2484   finish_test