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
88 lines
2.6 KiB
Plaintext
88 lines
2.6 KiB
Plaintext
# 2007 February 6
|
|
#
|
|
# The author disclaims copyright to this source code.
|
|
#
|
|
#*************************************************************************
|
|
# This file implements regression tests for SQLite library. This
|
|
# tests creating fts3 tables in an attached database.
|
|
#
|
|
|
|
set testdir [file dirname $argv0]
|
|
source $testdir/tester.tcl
|
|
|
|
# If SQLITE_ENABLE_FTS3 is defined, omit this file.
|
|
ifcapable !fts3 {
|
|
finish_test
|
|
return
|
|
}
|
|
|
|
# Clean up anything left over from a previous pass.
|
|
forcedelete test2.db
|
|
forcedelete test2.db-journal
|
|
sqlite3 db2 test2.db
|
|
|
|
db eval {
|
|
CREATE VIRTUAL TABLE t3 USING fts3(content);
|
|
INSERT INTO t3 (rowid, content) VALUES(1, 'hello world');
|
|
}
|
|
|
|
db2 eval {
|
|
CREATE VIRTUAL TABLE t1 USING fts3(content);
|
|
INSERT INTO t1 (rowid, content) VALUES(1, 'hello world');
|
|
INSERT INTO t1 (rowid, content) VALUES(2, 'hello there');
|
|
INSERT INTO t1 (rowid, content) VALUES(3, 'cruel world');
|
|
}
|
|
|
|
# This has always worked because the t1_* tables used by fts3 will be
|
|
# the defaults.
|
|
do_test fts3aj-1.1 {
|
|
execsql {
|
|
ATTACH DATABASE 'test2.db' AS two;
|
|
SELECT rowid FROM t1 WHERE t1 MATCH 'hello';
|
|
DETACH DATABASE two;
|
|
}
|
|
} {1 2}
|
|
# Make certain we're detached if there was an error.
|
|
catch {db eval {DETACH DATABASE two}}
|
|
|
|
# In older code, this appears to work fine, but the t2_* tables used
|
|
# by fts3 will be created in database 'main' instead of database
|
|
# 'two'. It appears to work fine because the tables end up being the
|
|
# defaults, but obviously is badly broken if you hope to use things
|
|
# other than in the exact same ATTACH setup.
|
|
do_test fts3aj-1.2 {
|
|
execsql {
|
|
ATTACH DATABASE 'test2.db' AS two;
|
|
CREATE VIRTUAL TABLE two.t2 USING fts3(content);
|
|
INSERT INTO t2 (rowid, content) VALUES(1, 'hello world');
|
|
INSERT INTO t2 (rowid, content) VALUES(2, 'hello there');
|
|
INSERT INTO t2 (rowid, content) VALUES(3, 'cruel world');
|
|
SELECT rowid FROM t2 WHERE t2 MATCH 'hello';
|
|
DETACH DATABASE two;
|
|
}
|
|
} {1 2}
|
|
catch {db eval {DETACH DATABASE two}}
|
|
|
|
# In older code, this broke because the fts3 code attempted to create
|
|
# t3_* tables in database 'main', but they already existed. Normally
|
|
# this wouldn't happen without t3 itself existing, in which case the
|
|
# fts3 code would never be called in the first place.
|
|
do_test fts3aj-1.3 {
|
|
execsql {
|
|
ATTACH DATABASE 'test2.db' AS two;
|
|
|
|
CREATE VIRTUAL TABLE two.t3 USING fts3(content);
|
|
INSERT INTO two.t3 (rowid, content) VALUES(2, 'hello there');
|
|
INSERT INTO two.t3 (rowid, content) VALUES(3, 'cruel world');
|
|
SELECT rowid FROM two.t3 WHERE t3 MATCH 'hello';
|
|
|
|
DETACH DATABASE two;
|
|
} db2
|
|
} {2}
|
|
catch {db eval {DETACH DATABASE two}}
|
|
|
|
catch {db2 close}
|
|
forcedelete test2.db
|
|
|
|
finish_test
|