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

120 lines
3.5 KiB
Plaintext

# 2005 August 18
#
# 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.
#
# This file implements tests to increase coverage of trigger.c.
#
# $Id: trigger7.test,v 1.3 2008/08/11 18:44:58 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
ifcapable {!trigger} {
finish_test
return
}
# Error messages resulting from qualified trigger names.
#
do_test trigger7-1.1 {
execsql {
CREATE TABLE t1(x, y);
}
catchsql {
CREATE TEMP TRIGGER main.r1 AFTER INSERT ON t1 BEGIN
SELECT 'no nothing';
END
}
} {1 {temporary trigger may not have qualified name}}
do_test trigger7-1.2 {
catchsql {
CREATE TRIGGER not_a_db.r1 AFTER INSERT ON t1 BEGIN
SELECT 'no nothing';
END
}
} {1 {unknown database not_a_db}}
# When the UPDATE OF syntax is used, no code is generated for triggers
# that do not match the update columns.
#
ifcapable explain {
do_test trigger7-2.1 {
execsql {
CREATE TRIGGER r1 AFTER UPDATE OF x ON t1 BEGIN
SELECT '___update_t1.x___';
END;
CREATE TRIGGER r2 AFTER UPDATE OF y ON t1 BEGIN
SELECT '___update_t1.y___';
END;
}
set txt [db eval {EXPLAIN UPDATE t1 SET x=5}]
string match *___update_t1.x___* $txt
} 1
do_test trigger7-2.2 {
set txt [db eval {EXPLAIN UPDATE t1 SET x=5}]
string match *___update_t1.y___* $txt
} 0
do_test trigger7-2.3 {
set txt [db eval {EXPLAIN UPDATE t1 SET y=5}]
string match *___update_t1.x___* $txt
} 0
do_test trigger7-2.4 {
set txt [db eval {EXPLAIN UPDATE t1 SET y=5}]
string match *___update_t1.y___* $txt
} 1
do_test trigger7-2.5 {
set txt [db eval {EXPLAIN UPDATE t1 SET rowid=5}]
string match *___update_t1.x___* $txt
} 0
do_test trigger7-2.6 {
set txt [db eval {EXPLAIN UPDATE t1 SET rowid=5}]
string match *___update_t1.x___* $txt
} 0
}
# Test the ability to create many triggers on the same table, then
# selectively drop those triggers.
#
do_test trigger7-3.1 {
execsql {
CREATE TABLE t2(x,y,z);
CREATE TRIGGER t2r1 AFTER INSERT ON t2 BEGIN SELECT 1; END;
CREATE TRIGGER t2r2 BEFORE INSERT ON t2 BEGIN SELECT 1; END;
CREATE TRIGGER t2r3 AFTER UPDATE ON t2 BEGIN SELECT 1; END;
CREATE TRIGGER t2r4 BEFORE UPDATE ON t2 BEGIN SELECT 1; END;
CREATE TRIGGER t2r5 AFTER DELETE ON t2 BEGIN SELECT 1; END;
CREATE TRIGGER t2r6 BEFORE DELETE ON t2 BEGIN SELECT 1; END;
CREATE TRIGGER t2r7 AFTER INSERT ON t2 BEGIN SELECT 1; END;
CREATE TRIGGER t2r8 BEFORE INSERT ON t2 BEGIN SELECT 1; END;
CREATE TRIGGER t2r9 AFTER UPDATE ON t2 BEGIN SELECT 1; END;
CREATE TRIGGER t2r10 BEFORE UPDATE ON t2 BEGIN SELECT 1; END;
CREATE TRIGGER t2r11 AFTER DELETE ON t2 BEGIN SELECT 1; END;
CREATE TRIGGER t2r12 BEFORE DELETE ON t2 BEGIN SELECT 1; END;
DROP TRIGGER t2r6;
}
} {}
# This test corrupts the database file so it must be the last test
# in the series.
#
do_test trigger7-99.1 {
sqlite3_db_config db DEFENSIVE 0
execsql {
PRAGMA writable_schema=on;
UPDATE sqlite_master SET sql='nonsense';
}
db close
catch { sqlite3 db test.db }
catchsql { DROP TRIGGER t2r5 }
} {/1 {malformed database schema .*}/}
finish_test