0
0
mirror of https://github.com/tursodatabase/libsql.git synced 2025-06-04 01:51:48 +00:00
Files
.cargo
.config
.github
bindings
bottomless
bottomless-cli
docker-compose
docs
libsql
libsql-ffi
libsql-hrana
libsql-replication
libsql-server
libsql-shell
libsql-sqlite3
art
autoconf
benchmark
contrib
crates
doc
ext
async
consio
crr
expert
fts3
fts5
icu
jni
libsql-wasi
lsm1
misc
rbu
rbu.c
rbu1.test
rbu10.test
rbu11.test
rbu12.test
rbu13.test
rbu14.test
rbu3.test
rbu5.test
rbu6.test
rbu7.test
rbu8.test
rbu9.test
rbuA.test
rbuB.test
rbuC.test
rbu_common.tcl
rbubusy.test
rbucollate.test
rbucrash.test
rbucrash2.test
rbudiff.test
rbudor.test
rbuexlock.test
rbuexpr.test
rbufault.test
rbufault2.test
rbufault3.test
rbufault4.test
rbufts.test
rbumisc.test
rbumulti.test
rbupartial.test
rbupass.test
rbuprogress.test
rburename.test
rburesume.test
rbusave.test
rbusplit.test
rbutemplimit.test
rbuvacuum.test
rbuvacuum2.test
rbuvacuum3.test
rbuvacuum4.test
sqlite3rbu.c
sqlite3rbu.h
test_rbu.c
recover
repair
rtree
session
udf
userauth
vwal
wasi
wasm
README.md
mptest
src
test
tool
vsixtest
.gitignore
Dockerfile-wasm-udf
LIBSQL_VERSION
LICENSE.md
Makefile.in
Makefile.linux-gcc
Makefile.msc
README-SQLite.md
VERSION
aclocal.m4
config.guess
config.sub
configure
configure.ac
install-sh
libsql.pc.in
ltmain.sh
magic.txt
main.mk
manifest
manifest.uuid
spec.template
sqlite.pc.in
sqlite3.1
sqlite3.pc.in
sqlite_cfg.h.in
libsql-storage
libsql-storage-server
libsql-sys
libsql-wal
tools
vendored
xtask
.dockerignore
.env
.gitignore
.gitmodules
CODE_OF_CONDUCT.md
CONTRIBUTING.md
Cargo.lock
Cargo.toml
Dockerfile
Dockerfile.dev
Dockerfile.musl
LICENSE.md
README-libsql.md
README.md
docker-entrypoint.sh
docker-wrapper.sh
fly.toml
rust-toolchain.toml
2023-10-16 13:58:16 +02:00

63 lines
1.6 KiB
Plaintext

# 2015 February 16
#
# 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.
#
#***********************************************************************
#
# Test an RBU update that features lots of different rbu_control strings
# for UPDATE statements. This tests RBU's internal UPDATE statement cache.
#
source [file join [file dirname [info script]] rbu_common.tcl]
if_no_rbu_support { finish_test ; return }
source $testdir/lock_common.tcl
set ::testprefix rbu13
do_execsql_test 1.0 {
CREATE TABLE t1(a PRIMARY KEY, b, c, d, e, f, g, h);
WITH ii(i) AS (SELECT 0 UNION ALL SELECT i+1 FROM ii WHERE i<127)
INSERT INTO t1 SELECT i, 0, 0, 0, 0, 0, 0, 0 FROM ii;
}
forcedelete rbu.db
do_execsql_test 1.1 {
ATTACH 'rbu.db' AS rbu;
CREATE TABLE rbu.data_t1(a, b, c, d, e, f, g, h, rbu_control);
}
do_test 1.2 {
for {set i 0} {$i<128} {incr i} {
set control "."
for {set bit 6} {$bit>=0} {incr bit -1} {
if { $i & (1<<$bit) } {
append control "x"
} else {
append control "."
}
}
execsql { INSERT INTO data_t1 VALUES($i, 1, 1, 1, 1, 1, 1, 1, $control) }
}
} {}
do_test 1.3 {
sqlite3rbu rbu test.db rbu.db
while 1 {
set rc [rbu step]
if {$rc!="SQLITE_OK"} break
}
rbu close
} {SQLITE_DONE}
do_execsql_test 1.4 {
SELECT count(*) FROM t1 WHERE
a == ( (b<<6) + (c<<5) + (d<<4) + (e<<3) + (f<<2) + (g<<1) + (h<<0) )
} {128}
finish_test