Ai
8 Star 20 Fork 10

Gitee 极速下载/sqlite

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/sqlite/sqlite
克隆/下载
alterauth.test 1.51 KB
一键复制 编辑 原始数据 按行查看 历史
# 2018 September 2
#
# The author disclaims copyright to this source code. In place of
# a legal notice, here is a blessing:
#
# May you do good and not evil.
# May you find forgiveness for yourself and forgive others.
# May you share freely, never taking more than you give.
#
#*************************************************************************
#
set testdir [file dirname $argv0]
source $testdir/tester.tcl
# If SQLITE_OMIT_ALTERTABLE is defined, omit this file.
ifcapable !altertable {
finish_test
return
}
set testprefix alterauth
set ::auth [list]
proc xAuth {type args} {
if {$type == "SQLITE_ALTER_TABLE"} {
lappend ::auth [concat $type [lrange $args 0 3]]
}
return SQLITE_OK
}
db auth xAuth
do_execsql_test 1.0 { CREATE TABLE t1(a, b, c); }
do_test 1.1 {
set ::auth [list]
execsql { ALTER TABLE t1 RENAME TO t2 }
set ::auth
} {{SQLITE_ALTER_TABLE main t1 {} {}}}
do_test 1.2 {
set ::auth [list]
execsql { ALTER TABLE t2 RENAME c TO ccc }
set ::auth
} {{SQLITE_ALTER_TABLE main t2 {} {}}}
do_test 1.3 {
set ::auth [list]
execsql { ALTER TABLE t2 ADD COLUMN d }
set ::auth
} {{SQLITE_ALTER_TABLE main t2 {} {}}}
proc xAuth {type args} {
if {$type == "SQLITE_ALTER_TABLE"} {
return SQLITE_DENY
}
return SQLITE_OK
}
do_test 2.1 {
catchsql { ALTER TABLE t2 RENAME TO t3 }
} {1 {not authorized}}
do_test 2.2 {
catchsql { ALTER TABLE t2 RENAME d TO ddd }
} {1 {not authorized}}
do_test 2.3 {
catchsql { ALTER TABLE t2 ADD COLUMN e }
} {1 {not authorized}}
finish_test
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/mirrors/sqlite.git
git@gitee.com:mirrors/sqlite.git
mirrors
sqlite
sqlite
master

搜索帮助