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
93 lines
2.4 KiB
Plaintext
93 lines
2.4 KiB
Plaintext
# 2007 January 17
|
|
#
|
|
# The author disclaims copyright to this source code.
|
|
#
|
|
#*************************************************************************
|
|
# This file implements regression tests for SQLite fts3 library. The
|
|
# focus here is testing handling of UPDATE when using UTF-16-encoded
|
|
# databases.
|
|
#
|
|
# $Id: fts3ai.test,v 1.1 2007/08/20 17:38:42 shess Exp $
|
|
#
|
|
|
|
set testdir [file dirname $argv0]
|
|
source $testdir/tester.tcl
|
|
|
|
# If SQLITE_ENABLE_FTS3 is defined, omit this file.
|
|
ifcapable !fts3 {
|
|
finish_test
|
|
return
|
|
}
|
|
|
|
ifcapable !utf16 {
|
|
finish_test
|
|
return
|
|
}
|
|
|
|
# Return the UTF-16 representation of the supplied UTF-8 string $str.
|
|
# If $nt is true, append two 0x00 bytes as a nul terminator.
|
|
# NOTE(shess) Copied from capi3.test.
|
|
proc utf16 {str {nt 1}} {
|
|
set r [encoding convertto unicode $str]
|
|
if {$nt} {
|
|
append r "\x00\x00"
|
|
}
|
|
return $r
|
|
}
|
|
|
|
db eval {
|
|
PRAGMA encoding = "UTF-16le";
|
|
CREATE VIRTUAL TABLE t1 USING fts3(content);
|
|
}
|
|
|
|
do_test fts3ai-1.0 {
|
|
execsql {PRAGMA encoding}
|
|
} {UTF-16le}
|
|
|
|
do_test fts3ai-1.1 {
|
|
execsql {INSERT INTO t1 (rowid, content) VALUES(1, 'one')}
|
|
execsql {SELECT content FROM t1 WHERE rowid = 1}
|
|
} {one}
|
|
|
|
do_test fts3ai-1.2 {
|
|
set sql "INSERT INTO t1 (rowid, content) VALUES(2, 'two')"
|
|
set STMT [sqlite3_prepare $DB $sql -1 TAIL]
|
|
sqlite3_step $STMT
|
|
sqlite3_finalize $STMT
|
|
execsql {SELECT content FROM t1 WHERE rowid = 2}
|
|
} {two}
|
|
|
|
do_test fts3ai-1.3 {
|
|
set sql "INSERT INTO t1 (rowid, content) VALUES(3, 'three')"
|
|
set STMT [sqlite3_prepare $DB $sql -1 TAIL]
|
|
sqlite3_step $STMT
|
|
sqlite3_finalize $STMT
|
|
set sql "UPDATE t1 SET content = 'trois' WHERE rowid = 3"
|
|
set STMT [sqlite3_prepare $DB $sql -1 TAIL]
|
|
sqlite3_step $STMT
|
|
sqlite3_finalize $STMT
|
|
execsql {SELECT content FROM t1 WHERE rowid = 3}
|
|
} {trois}
|
|
|
|
do_test fts3ai-1.4 {
|
|
set sql16 [utf16 {INSERT INTO t1 (rowid, content) VALUES(4, 'four')}]
|
|
set STMT [sqlite3_prepare16 $DB $sql16 -1 TAIL]
|
|
sqlite3_step $STMT
|
|
sqlite3_finalize $STMT
|
|
execsql {SELECT content FROM t1 WHERE rowid = 4}
|
|
} {four}
|
|
|
|
do_test fts3ai-1.5 {
|
|
set sql16 [utf16 {INSERT INTO t1 (rowid, content) VALUES(5, 'five')}]
|
|
set STMT [sqlite3_prepare16 $DB $sql16 -1 TAIL]
|
|
sqlite3_step $STMT
|
|
sqlite3_finalize $STMT
|
|
set sql "UPDATE t1 SET content = 'cinq' WHERE rowid = 5"
|
|
set STMT [sqlite3_prepare $DB $sql -1 TAIL]
|
|
sqlite3_step $STMT
|
|
sqlite3_finalize $STMT
|
|
execsql {SELECT content FROM t1 WHERE rowid = 5}
|
|
} {cinq}
|
|
|
|
finish_test
|