Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  galera_fk_truncate.test  Sprache: unbekannt

 
Spracherkennung für: .test vermutete Sprache: SQL {SQL[140] ABAP[70] ADA[42]} [Methode: maximale Elemente, drei Dimensionen]

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

#
# Make sure earlier test has no effect to this one
#
--connection node_1
set global auto_increment_offset=1;
set global auto_increment_increment=2;
--connection node_2
set global auto_increment_offset=2;
set global auto_increment_increment=2;

--connection node_1
CREATE TABLE author (
  id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
  name VARCHAR(100) NOT NULL
) ENGINE = InnoDB;

CREATE TABLE book (
  id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
  title VARCHAR(200) NOT NULL,
  author_id SMALLINT UNSIGNED NOT NULL,
  CONSTRAINT `fk_book_author`
    FOREIGN KEY (author_id) REFERENCES author (id)
    ON DELETE CASCADE
    ON UPDATE RESTRICT
) ENGINE = InnoDB;

INSERT INTO author (name) VALUES ('Abdul Alhazred');
INSERT INTO book (title, author_id) VALUES ('Necronomicon', LAST_INSERT_ID());

TRUNCATE TABLE book;
SELECT * FROM author;
SELECT * FROM book;

--connection node_2
SELECT * FROM author;
SELECT * FROM book;
INSERT INTO author (name) VALUES ('Abdul Alhazred');
INSERT INTO book (title, author_id) VALUES ('Necronomicon', LAST_INSERT_ID());
TRUNCATE TABLE book;
SELECT * FROM author;
SELECT * FROM book;

--connection node_1
TRUNCATE TABLE book;
SELECT * FROM author;
SELECT * FROM book;

DROP TABLE book, author;
set global auto_increment_increment=2;
--connection node_2
set global auto_increment_offset=2;



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

                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1126864
#Domains=1897691