Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/MariaDB/mysql-test/suite/galera/t/   (MariaDB Server Version 8.1-8.4©)  Datei vom 1.9.2026 mit Größe 588 B image not shown  

Quelle  galera_fk_multitable.test  Sprache: unbekannt

 
Spracherkennung für: .test vermutete Sprache: SQL {SQL[120] ABAP[72] VDM[36]} [Methode: maximale Elemente, drei Dimensionen]

#
# Test multi-table DELETE in the presence of FKs
#

--source include/galera_cluster.inc
--source include/have_innodb.inc

CREATE TABLE t0 (
    f0 INT PRIMARY KEY
);

CREATE TABLE t1 (
    f1 INT PRIMARY KEY,
    f0 INTEGER,
    FOREIGN KEY (f0)
        REFERENCES t0(f0)
        ON DELETE CASCADE
);

INSERT INTO t0 VALUES (0), (1);
INSERT INTO t1 VALUES (0, 0);
INSERT INTO t1 VALUES (1, 0);

--connection node_2
DELETE t0.*, t1.* FROM t0, t1 WHERE t0.f0 = 0 AND t1.f1 = 0;

--connection node_1
SELECT COUNT(*) = 1 FROM t0;
SELECT COUNT(*) = 0 FROM t1;

DROP TABLE t1;
DROP TABLE t0;

[Dauer der Verarbeitung: 0.14 Sekunden, vorverarbeitet 2026-10-11]