/ Check-in [e4fa8be7]
Login

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

Overview
Comment:Add one more authentication test to fkey2.test to cover an untested branch.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e4fa8be770eb79806d489be46f68f969de17378b
User & Date: dan 2009-10-02 15:29:10
Context
2009-10-03
07:04
Handle an SQLITE_IGNORE returned when requesting authorization to read parent key columns by pretending the parent key columns contain NULL values. check-in: 3c24df38 user: dan tags: trunk
2009-10-02
15:29
Add one more authentication test to fkey2.test to cover an untested branch. check-in: e4fa8be7 user: dan tags: trunk
14:23
When inserting a row into a child table, invoke the authorization callback to request permission to read the parent key columns. check-in: 9842f2d5 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/fkey2.test.

  1406   1406       set authargs
  1407   1407     } {SQLITE_UPDATE nought b main {} SQLITE_READ cross e main {} SQLITE_READ cross e main {} SQLITE_READ nought b main {} SQLITE_READ nought b main {} SQLITE_READ nought b main {} SQLITE_UPDATE cross e main {} SQLITE_READ nought b main {} SQLITE_READ cross e main {} SQLITE_READ nought b main {} SQLITE_READ nought b main {}}
  1408   1408   
  1409   1409     do_test fkey2-18.6 {
  1410   1410       execsql {SELECT * FROM cross}
  1411   1411     } {0 5 0}
  1412   1412   
         1413  +  do_test fkey2-18.7 {
         1414  +    execsql {
         1415  +      CREATE TABLE one(a INTEGER PRIMARY KEY, b);
         1416  +      CREATE TABLE two(b, c REFERENCES one);
         1417  +      INSERT INTO one VALUES(101, 102);
         1418  +    }
         1419  +    set authargs [list]
         1420  +    execsql { INSERT INTO two VALUES(100, 101); }
         1421  +    set authargs
         1422  +  } {SQLITE_INSERT two {} main {} SQLITE_READ one a main {}}
         1423  +
  1413   1424     rename auth {}
  1414   1425     proc auth {args} {
  1415   1426       if {[lindex $args 1] == "long"} {return SQLITE_IGNORE}
  1416   1427       return SQLITE_OK
  1417   1428     }
  1418         -  do_test fkey2-18.7 {
         1429  +  do_test fkey2-18.8 {
  1419   1430       catchsql { INSERT INTO short VALUES(1, 3, 2) }
  1420   1431     } {1 {access to long.b is prohibited}}
  1421   1432   
  1422   1433     db auth {}
  1423   1434     unset authargs
  1424   1435   }
  1425   1436