Files
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

165 lines
5.8 KiB
Plaintext

# 2017-07-30
#
# 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 tests to show that certain CREATE TABLE statements
# generate identical database files. For example, changes in identifier
# names, white-space, and formatting of the CREATE TABLE statement should
# produce identical table content.
#
set testdir [file dirname $argv0]
source $testdir/tester.tcl
set ::testprefix schema6
do_not_use_codec
# Command: check_same_database_content TESTNAME SQL1 SQL2 SQL3 ...
#
# This command creates fresh databases using SQL1 and subsequent arguments
# and checks to make sure the content of all database files is byte-for-byte
# identical. Page 1 of the database files is allowed to be different, since
# page 1 contains the sqlite_master table which is expected to vary.
#
proc check_same_database_content {basename args} {
set i 0
set hash {}
foreach sql $args {
catch {db close}
forcedelete test.db
sqlite3 db test.db
db eval $sql
set pgsz [db one {PRAGMA page_size}]
db close
set sz [file size test.db]
set thishash [md5file test.db $pgsz [expr {$sz-$pgsz}]]
if {$i==0} {
set hash $thishash
} else {
do_test $basename-$i "set x $thishash" $hash
}
incr i
}
}
# Command: check_different_database_content TESTNAME SQL1 SQL2 SQL3 ...
#
# This command creates fresh databases using SQL1 and subsequent arguments
# and checks to make sure the content of all database files is different
# in ways other than on page 1.
#
proc check_different_database_content {basename args} {
set i 0
set hashes {}
foreach sql $args {
forcedelete test.db
sqlite3 db test.db
db eval $sql
set pgsz [db one {PRAGMA page_size}]
db close
set sz [file size test.db]
set thishash [md5file test.db $pgsz [expr {$sz-$pgsz}]]
set j [lsearch $hashes $thishash]
if {$j>=0} {
do_test $basename-$i "set x {$i is the same as $j}" "All are different"
} else {
do_test $basename-$i "set x {All are different}" "All are different"
}
lappend hashes $thishash
incr i
}
}
check_same_database_content 100 {
CREATE TABLE t1(a INTEGER PRIMARY KEY, b UNIQUE);
INSERT INTO t1(a,b) VALUES(123,'Four score and seven years ago...');
} {
CREATE TABLE t1(xyz INTEGER, abc, PRIMARY KEY(xyz), UNIQUE(abc));
INSERT INTO t1(xyz,abc) VALUES(123,'Four score and seven years ago...');
} {
CREATE TABLE t1(xyz INTEGER, abc, UNIQUE(abc), PRIMARY KEY(xyz));
INSERT INTO t1(xyz,abc) VALUES(123,'Four score and seven years ago...');
} {
CREATE TABLE t1(a INTEGER PRIMARY KEY ASC, b UNIQUE);
INSERT INTO t1(a,b) VALUES(123,'Four score and seven years ago...');
} {
CREATE TABLE t1(a INTEGER PRIMARY KEY, b);
CREATE UNIQUE INDEX t1b ON t1(b);
INSERT INTO t1(a,b) VALUES(123,'Four score and seven years ago...');
} {
CREATE TABLE t1(a INTEGER PRIMARY KEY, b);
INSERT INTO t1(a,b) VALUES(123,'Four score and seven years ago...');
CREATE UNIQUE INDEX t1b ON t1(b);
}
check_same_database_content 110 {
CREATE TABLE t1(a INTEGER PRIMARY KEY UNIQUE, b UNIQUE);
INSERT INTO t1(a,b) VALUES(123,'Four score and seven years ago...');
} {
CREATE TABLE t1(a INTEGER UNIQUE PRIMARY KEY, b UNIQUE);
INSERT INTO t1(a,b) VALUES(123,'Four score and seven years ago...');
} {
CREATE TABLE t1(a INTEGER UNIQUE PRIMARY KEY, b UNIQUE, UNIQUE(a));
INSERT INTO t1(a,b) VALUES(123,'Four score and seven years ago...');
} {
CREATE TABLE t1(a INTEGER UNIQUE PRIMARY KEY, b);
CREATE UNIQUE INDEX t1b ON t1(b);
INSERT INTO t1(a,b) VALUES(123,'Four score and seven years ago...');
} {
CREATE TABLE t1(a INTEGER UNIQUE PRIMARY KEY, b);
INSERT INTO t1(a,b) VALUES(123,'Four score and seven years ago...');
CREATE UNIQUE INDEX t1b ON t1(b);
}
check_same_database_content 120 {
CREATE TABLE t1(a INTEGER PRIMARY KEY, b UNIQUE) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(123,'Four score and seven years ago...');
} {
CREATE TABLE t1(xyz INTEGER, abc, PRIMARY KEY(xyz), UNIQUE(abc))WITHOUT ROWID;
INSERT INTO t1(xyz,abc) VALUES(123,'Four score and seven years ago...');
} {
CREATE TABLE t1(xyz INTEGER, abc, UNIQUE(abc), PRIMARY KEY(xyz))WITHOUT ROWID;
INSERT INTO t1(xyz,abc) VALUES(123,'Four score and seven years ago...');
} {
CREATE TABLE t1(a INTEGER PRIMARY KEY ASC, b UNIQUE) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(123,'Four score and seven years ago...');
} {
CREATE TABLE t1(a INTEGER PRIMARY KEY UNIQUE, b UNIQUE) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(123,'Four score and seven years ago...');
} {
CREATE TABLE t1(a INTEGER UNIQUE PRIMARY KEY, b UNIQUE) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(123,'Four score and seven years ago...');
} {
CREATE TABLE t1(a INTEGER UNIQUE PRIMARY KEY, b UNIQUE, UNIQUE(a))
WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(123,'Four score and seven years ago...');
} {
CREATE TABLE t1(a INTEGER PRIMARY KEY, b) WITHOUT ROWID;
CREATE UNIQUE INDEX t1b ON t1(b);
INSERT INTO t1(a,b) VALUES(123,'Four score and seven years ago...');
} {
CREATE TABLE t1(a INTEGER PRIMARY KEY, b) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(123,'Four score and seven years ago...');
CREATE UNIQUE INDEX t1b ON t1(b);
}
check_different_database_content 130 {
CREATE TABLE t1(a INTEGER PRIMARY KEY, b UNIQUE);
INSERT INTO t1(a,b) VALUES(123,'Four score and seven years ago...');
} {
CREATE TABLE t1(a INTEGER PRIMARY KEY UNIQUE, b UNIQUE);
INSERT INTO t1(a,b) VALUES(123,'Four score and seven years ago...');
} {
CREATE TABLE t1(a INTEGER PRIMARY KEY, b UNIQUE) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(123,'Four score and seven years ago...');
}
finish_test