Eine aufbereitete Darstellung der Quelle

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

Benutzer

Quelle  foreign_key.test  Sprache: unbekannt

 
Spracherkennung für: .test vermutete Sprache: SQL {SQL[294] VDM[112] ADA[98]} [Methode: maximale Elemente, drei Dimensionen]

--source include/have_rocksdb.inc

--disable_warnings
DROP TABLE IF EXISTS t1, t2;
--enable_warnings

CREATE TABLE t1 (b INT PRIMARY KEY);

# Try simple foreign key - should fail
--error ER_NOT_SUPPORTED_YET
CREATE TABLE t2 (a INT NOT NULL, b INT NOT NULL, FOREIGN KEY (b) REFERENCES t1(b));

# Try simple valid syntax with 'foreign' as part - should succeed
CREATE TABLE t2 (a INT NOT NULL, bforeign INT NOT NULL);
DROP TABLE t2;

# Try simple valid syntax with 'foreign' and 'key' as part (with no space) - should succeed
CREATE TABLE t2 (a INT NOT NULL, foreignkey INT NOT NULL);
DROP TABLE t2;

# Try with valid id containing 'foreign' and then a foreign key - should fail
--error ER_NOT_SUPPORTED_YET
CREATE TABLE t2 (a INT NOT NULL, bforeign INT not null, FOREIGN KEY (bforeign) REFERENCES t1(b));

CREATE TABLE t2 (a INT NOT NULL, b INT NOT NULL);
# Alter with foreign key - should fail
--error ER_NOT_SUPPORTED_YET
ALTER TABLE t2 ADD FOREIGN KEY (b) REFERENCES t1(b);
DROP TABLE t2;

# Alter with valid syntax that contains 'foreign' - should succeed
CREATE TABLE t2 (a INT NOT NULL);
ALTER TABLE t2 ADD bforeign INT NOT NULL;
DROP TABLE t2;

# Alter with valid syntax that contains 'foreign' and 'key' (no space) - should succeed
CREATE TABLE t2 (a INT NOT NULL);
ALTER TABLE t2 ADD foreignkey INT NOT NULL;
DROP TABLE t2;

# Alter with valid syntax that contains 'foreign' and then foreign key - should fail
CREATE TABLE t2 (a INT NOT NULL);
--error ER_NOT_SUPPORTED_YET
ALTER TABLE t2 ADD bforeign INT NOT NULL, ADD FOREIGN KEY (bforeign) REFERENCES t1(b);
DROP TABLE t2;

DROP TABLE t1;

[Dauer der Verarbeitung: 0.16 Sekunden, vorverarbeitet 2026-10-08]

                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1126864
#Domains=1897691