⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 diskfull.test

📁 sqlite嵌入式数据库源码
💻 TEST
字号:
# 2001 October 12## 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.##***********************************************************************# This file implements regression tests for SQLite library.  The# focus of this file is testing for correct handling of disk full# errors.# # $Id: diskfull.test,v 1.3 2005/09/09 10:46:19 drh Exp $set testdir [file dirname $argv0]source $testdir/tester.tcldo_test diskfull-1.1 {  execsql {    CREATE TABLE t1(x);    INSERT INTO t1 VALUES(randstr(1000,1000));    INSERT INTO t1 SELECT * FROM t1;    INSERT INTO t1 SELECT * FROM t1;    INSERT INTO t1 SELECT * FROM t1;    INSERT INTO t1 SELECT * FROM t1;    CREATE INDEX t1i1 ON t1(x);    CREATE TABLE t2 AS SELECT x AS a, x AS b FROM t1;    CREATE INDEX t2i1 ON t2(b);  }} {}set sqlite_diskfull_pending 0integrity_check diskfull-1.2do_test diskfull-1.3 {  set sqlite_diskfull_pending 1  catchsql {    INSERT INTO t1 SELECT * FROM t1;  }} {1 {database or disk is full}}set sqlite_diskfull_pending 0integrity_check diskfull-1.4do_test diskfull-1.5 {  set sqlite_diskfull_pending 1  catchsql {    DELETE FROM t1;  }} {1 {database or disk is full}}set sqlite_diskfull_pending 0integrity_check diskfull-1.6set go 1set i 0while {$go} {  incr i  do_test diskfull-2.$i.1 {    set sqlite_diskfull_pending $i    set sqlite_diskfull 0    set r [catchsql {VACUUM}]    if {!$sqlite_diskfull} {      set r {1 {database or disk is full}}      set go 0    }    if {$r=="1 {disk I/O error}"} {      set r {1 {database or disk is full}}    }    set r  } {1 {database or disk is full}}  set sqlite_diskfull_pending 0  db close  sqlite3 db test.db  integrity_check diskfull-2.$i.2}finish_test

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -