Files
TheRock/rocm-systems/projects/rocprofiler-sdk/external/sqlite/test/bigmmap.test
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

109 lines
3.1 KiB
Plaintext

# 2017 August 07
#
# 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 script testing the ability of SQLite to use mmap
# to access files larger than 4GiB.
#
if {[file exists skip-big-file]} return
if {$tcl_platform(os)=="Darwin"} return
set testdir [file dirname $argv0]
source $testdir/tester.tcl
set testprefix bigmmap
ifcapable !mmap||!vtab {
finish_test
return
}
set mmap_limit 0
db eval {
SELECT compile_options AS x FROM pragma_compile_options
WHERE x LIKE 'max_mmap_size=%'
} {
regexp {MAX_MMAP_SIZE=([0-9]*)} $x -> mmap_limit
}
if {$mmap_limit < [expr 8 * 1<<30]} {
puts "Skipping bigmmap.test - requires SQLITE_MAX_MMAP_SIZE >= 8G"
finish_test
return
}
#-------------------------------------------------------------------------
# Create the database file roughly 8GiB in size. Most pages are unused,
# except that there is a table and index clustered around each 1GiB
# boundary.
#
do_execsql_test 1.0 {
PRAGMA page_size = 4096;
CREATE TABLE t0(a INTEGER PRIMARY KEY, b, c, UNIQUE(b, c));
WITH s(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM s LIMIT 100 )
INSERT INTO t0 SELECT i, 't0', randomblob(800) FROM s;
}
for {set i 1} {$i < 8} {incr i} {
if {[catch {fake_big_file [expr $i*1024] [get_pwd]/test.db}]} {
puts "Cannot create ${i}MB sparse file"
finish_test
return
}
hexio_write test.db 28 [format %.8x [expr ($i*1024*1024*1024/4096) - 5]]
do_execsql_test 1.$i "
CREATE TABLE t$i (a INTEGER PRIMARY KEY, b, c, UNIQUE(b, c));
WITH s(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM s LIMIT 100 )
INSERT INTO t$i SELECT i, 't$i', randomblob(800) FROM s;
"
}
#-------------------------------------------------------------------------
# Check that data can be retrieved from the db with a variety of
# configured mmap size limits.
#
for {set i 0} {$i < 9} {incr i} {
# Configure a memory mapping $i GB in size.
#
set val [expr $i*1024*1024*1024]
execsql "PRAGMA main.mmap_size = $val"
do_execsql_test 2.$i.0 {
PRAGMA main.mmap_size
} $val
for {set t 0} {$t < 8} {incr t} {
do_execsql_test 2.$i.$t.1 "
SELECT count(*) FROM t$t;
SELECT count(b || c) FROM t$t GROUP BY b;
" {100 100}
do_execsql_test 2.$i.$t.2 "
SELECT * FROM t$t AS o WHERE
NOT EXISTS( SELECT * FROM t$t AS i WHERE a=o.a AND +b=o.b AND +c=o.c )
ORDER BY b, c;
" {}
do_eqp_test 2.$i.$t.3 "
SELECT * FROM t$t AS o WHERE
NOT EXISTS( SELECT * FROM t$t AS i WHERE a=o.a AND +b=o.b AND +c=o.c )
ORDER BY b, c;
" [string map {"\n " "\n"} "
QUERY PLAN
|--SCAN o USING COVERING INDEX sqlite_autoindex_t${t}_1
`--CORRELATED SCALAR SUBQUERY xxxxxx
`--SEARCH i USING INTEGER PRIMARY KEY (rowid=?)
"]
}
}
finish_test