SQLite

Check-in [8627a4cd6d]
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
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 8627a4cd6d64bd076b56c1e8ccc3b1dfc1b4c07d
User & Date: dan 2016-04-04 16:40:44.335
Context
2016-04-04
17:23
Add the ".auth ON|OFF" command to the command-line shell. (check-in: 65c7bcc427 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: 8627a4cd6d 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: 42a2196684 user: drh tags: trunk)
Changes
Unified Diff Show Whitespace Changes Patch
Changes to test/auth.test.
2428
2429
2430
2431
2432
2433
2434






2435





2436











2437
2438























2439
} [list SQLITE_READ   t6 ROWID main {} \
        SQLITE_UPDATE t6 ROWID main {} \
]
do_test auth-6.3 {
  execsql {SELECT rowid, * FROM t6}
} {101 1 2 3 4 5 6 7 8}







rename proc {}





rename proc_real proc




































finish_test







>
>
>
>
>
>
|
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
|

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
} [list SQLITE_READ   t6 ROWID main {} \
        SQLITE_UPDATE t6 ROWID main {} \
]
do_test auth-6.3 {
  execsql {SELECT rowid, * FROM t6}
} {101 1 2 3 4 5 6 7 8}

#-------------------------------------------------------------------------
# Test that view names are included as zArg4.
#
do_execsql_test auth-7.1 {
  CREATE TABLE t7(a, b, c);
  CREATE VIEW v7 AS SELECT * FROM t7;
} {}
set ::authargs [list]
proc auth {args} {
  eval lappend ::authargs [lrange $args 0 4]
  return SQLITE_OK
}

do_test auth-7.2 {
  execsql {SELECT a, c FROM v7}
  set ::authargs
} [list                          \
  SQLITE_SELECT {} {} {} {}      \
  SQLITE_READ t7 a main v7       \
  SQLITE_READ t7 b main v7       \
  SQLITE_READ t7 c main v7       \
  SQLITE_READ v7 a main {}       \
  SQLITE_READ v7 c main {}       \
  SQLITE_SELECT {} {} {} v7      \
]

set ::authargs [list]
do_test auth-7.3 {
  execsql {SELECT a, c FROM t7}
  set ::authargs
} [list                          \
  SQLITE_SELECT {} {} {} {}      \
  SQLITE_READ t7 a main {}       \
  SQLITE_READ t7 c main {}       \
]

set ::authargs [list]
do_test auth-7.4 {
  execsql {SELECT a, c FROM t7 AS v7}
  set ::authargs
} [list                          \
  SQLITE_SELECT {} {} {} {}      \
  SQLITE_READ t7 a main {}       \
  SQLITE_READ t7 c main {}       \
]


rename proc {}
rename proc_real proc
finish_test