OLD | NEW |
1 # 2005 Jan 24 | 1 # 2005 Jan 24 |
2 # | 2 # |
3 # The author disclaims copyright to this source code. In place of | 3 # The author disclaims copyright to this source code. In place of |
4 # a legal notice, here is a blessing: | 4 # a legal notice, here is a blessing: |
5 # | 5 # |
6 # May you do good and not evil. | 6 # May you do good and not evil. |
7 # May you find forgiveness for yourself and forgive others. | 7 # May you find forgiveness for yourself and forgive others. |
8 # May you share freely, never taking more than you give. | 8 # May you share freely, never taking more than you give. |
9 # | 9 # |
10 #*********************************************************************** | 10 #*********************************************************************** |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 CREATE TABLE t4(a, b, c); | 357 CREATE TABLE t4(a, b, c); |
358 } | 358 } |
359 | 359 |
360 # The schema cookie now has the same value as it did when SQL statement | 360 # The schema cookie now has the same value as it did when SQL statement |
361 # $::STMT was prepared. So unless it has been expired, it would be | 361 # $::STMT was prepared. So unless it has been expired, it would be |
362 # possible to run the "CREATE TABLE t4" statement and create a | 362 # possible to run the "CREATE TABLE t4" statement and create a |
363 # duplicate table. | 363 # duplicate table. |
364 list [sqlite3_step $::STMT] [sqlite3_finalize $::STMT] | 364 list [sqlite3_step $::STMT] [sqlite3_finalize $::STMT] |
365 } {SQLITE_ERROR SQLITE_SCHEMA} | 365 } {SQLITE_ERROR SQLITE_SCHEMA} |
366 | 366 |
| 367 ifcapable {auth} { |
| 368 |
| 369 do_test schema-13.1 { |
| 370 set S [sqlite3_prepare_v2 db "SELECT * FROM sqlite_master" -1 dummy] |
| 371 db function hello hello |
| 372 db function hello {} |
| 373 db auth auth |
| 374 proc auth {args} { |
| 375 if {[lindex $args 0] == "SQLITE_READ"} {return SQLITE_DENY} |
| 376 return SQLITE_OK |
| 377 } |
| 378 sqlite3_step $S |
| 379 } {SQLITE_AUTH} |
| 380 |
| 381 do_test schema-13.2 { |
| 382 sqlite3_step $S |
| 383 } {SQLITE_AUTH} |
| 384 |
| 385 do_test schema-13.3 { |
| 386 sqlite3_finalize $S |
| 387 } {SQLITE_AUTH} |
| 388 |
| 389 } |
| 390 |
367 finish_test | 391 finish_test |
OLD | NEW |