SQLite

Check-in [339df63f40]
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
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 339df63f4064f3b9c8d4e8b82e72d00b49d9406bc350b14809a4caf7ddc4b736
User & Date: dan 2017-05-11 19:09:19.861
Context
2017-05-12
14:05
Make sure the 'sqlite3changegroup_*' functions are included in the SQLITE_APICALL handling. (check-in: a123cb9330 user: mistachkin tags: trunk)
2017-05-11
19:09
Add another test case for the new authorizer functionality. (check-in: 339df63f40 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: 3ba9e7ab79 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/auth.test.
2520
2521
2522
2523
2524
2525
2526






















2527
2528
2529
2530
  execsql {SELECT t6.a FROM t6, t7}
  set ::authargs
} [list \
  SQLITE_SELECT {} {} {} {}          \
  SQLITE_READ t6 a main {}           \
  SQLITE_READ t7 {} {} {}            \
  ]























rename proc {}
rename proc_real proc
finish_test







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




2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
  execsql {SELECT t6.a FROM t6, t7}
  set ::authargs
} [list \
  SQLITE_SELECT {} {} {} {}          \
  SQLITE_READ t6 a main {}           \
  SQLITE_READ t7 {} {} {}            \
  ]

# Test also that if SQLITE_DENY is returned from an SQLITE_READ authorizer 
# invocation with no column name specified, compilation fails.
#
set ::authargs [list]
proc auth {op a b c d} {
  lappend ::authargs $op $a $b $c $d
  if {$op == "SQLITE_READ"} { return "SQLITE_DENY" }
  return "SQLITE_OK"
}
set ::authargs [list]
do_catchsql_test auth-8.3 {
  SELECT count(*) FROM t7
} {1 {not authorized}}
do_test auth-8.4 {
  set ::authargs
} [list \
  SQLITE_SELECT {} {} {} {}          \
  SQLITE_FUNCTION {} count {} {}     \
  SQLITE_READ t7 {} {} {}            \
]


rename proc {}
rename proc_real proc
finish_test