/ Check-in [27a8379b]
Login

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

Overview
Comment:Fix auth.test to work when SQLITE_OMIT_ALTERTABLE is defined. (CVS 2130)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 27a8379b54d6a1169b89e540ba44f4f94d006fb7
User & Date: danielk1977 2004-11-22 03:34:21
Context
2004-11-22
05:26
Have tests pass when SQLITE_OMIT_MEMORYDB is defined. (CVS 2131) check-in: 9df837c0 user: danielk1977 tags: trunk
03:34
Fix auth.test to work when SQLITE_OMIT_ALTERTABLE is defined. (CVS 2130) check-in: 27a8379b user: danielk1977 tags: trunk
2004-11-21
01:02
AUTOINCREMENT documentation added. Improvements to lang.html. (CVS 2129) check-in: ac72a1d5 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to test/auth.test.

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
....
1663
1664
1665
1666
1667
1668
1669
1670


1671
1672
1673
1674
1675
1676
1677
1678
....
1778
1779
1780
1781
1782
1783
1784


1785
1786
1787
1788
1789
1790
1791
#    May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements regression tests for SQLite library.  The
# focus of this script is testing the ATTACH and DETACH commands
# and related functionality.
#
# $Id: auth.test,v 1.20 2004/11/12 15:53:37 danielk1977 Exp $
#

set testdir [file dirname $argv0]
source $testdir/tester.tcl

# disable this test if the SQLITE_OMIT_AUTHORIZATION macro is
# defined during compilation.
................................................................................
do_test auth-1.262 {
  lindex [execsql {PRAGMA database_list}] 7
} {test1}
db authorizer {}
execsql {DETACH DATABASE test1}
db authorizer ::auth

# Authorization for ALTER TABLE


#
do_test auth-1.263 {
  proc auth {code arg1 arg2 arg3 arg4} {
    if {$code=="SQLITE_ALTER_TABLE"} {
      set ::authargs [list $arg1 $arg2 $arg3 $arg4]
      return SQLITE_OK
    }
    return SQLITE_OK
................................................................................
  execsql {SELECT name FROM sqlite_master WHERE type='table'}
} {t2x}
do_test auth-1.280 {
  set authargs
} {main t2x {} {}}
db authorizer {}
catchsql {ALTER TABLE t2x RENAME TO t2}




do_test auth-2.1 {
  proc auth {code arg1 arg2 arg3 arg4} {
    if {$code=="SQLITE_READ" && $arg1=="t3" && $arg2=="x"} {
      return SQLITE_DENY
    }







|







 







|
>
>
|







 







>
>







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
....
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
....
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
#    May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements regression tests for SQLite library.  The
# focus of this script is testing the ATTACH and DETACH commands
# and related functionality.
#
# $Id: auth.test,v 1.21 2004/11/22 03:34:21 danielk1977 Exp $
#

set testdir [file dirname $argv0]
source $testdir/tester.tcl

# disable this test if the SQLITE_OMIT_AUTHORIZATION macro is
# defined during compilation.
................................................................................
do_test auth-1.262 {
  lindex [execsql {PRAGMA database_list}] 7
} {test1}
db authorizer {}
execsql {DETACH DATABASE test1}
db authorizer ::auth

# Authorization for ALTER TABLE. These tests are omitted if the library
# was built without ALTER TABLE support.
ifcapable altertable {

do_test auth-1.263 {
  proc auth {code arg1 arg2 arg3 arg4} {
    if {$code=="SQLITE_ALTER_TABLE"} {
      set ::authargs [list $arg1 $arg2 $arg3 $arg4]
      return SQLITE_OK
    }
    return SQLITE_OK
................................................................................
  execsql {SELECT name FROM sqlite_master WHERE type='table'}
} {t2x}
do_test auth-1.280 {
  set authargs
} {main t2x {} {}}
db authorizer {}
catchsql {ALTER TABLE t2x RENAME TO t2}

} ;# ifcapable altertable


do_test auth-2.1 {
  proc auth {code arg1 arg2 arg3 arg4} {
    if {$code=="SQLITE_READ" && $arg1=="t3" && $arg2=="x"} {
      return SQLITE_DENY
    }