Eine aufbereitete Darstellung der Quelle

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

Benutzer

Quelle  innodb_virtual_fk.result   Sprache: Lisp

 

set default_storage_engine=innodb;
create table t1 (id int primary key, id2 int as (id) virtual, key id2 (id2));
create table t2 (id int key, constraint fk_id foreign key (id) references t1 (id) on delete cascade);
insert into t1 (id) values (1), (2);
insert into t2 (id) values (1), (2);
delete from t1;
select * from t1;
id id2
select * from t2;
id
drop table t2;
drop table t1;
#
# End of 10.2 tests
#
#
# MDEV-18114 Foreign Key Constraint actions don't affect Virtual Column
#
create table t1 (id int primary key);
create or replace table t2 (id int, id2 int as (id) virtual, key(id2), foreign key (id) references t1 (id) on update restrict);
create or replace table t2 (id int, id2 int as (id) virtual, key(id2), foreign key (id) references t1 (id) on update no action);
create or replace table t2 (id int, id2 int as (id) virtual, key(id2), foreign key (id) references t1 (id) on delete cascade);
create or replace table t2 (id int, id2 int as (id) virtual, key(id2), foreign key (id) references t1 (id) on update cascade);
create or replace table t2 (id int, id2 int as (id) virtual, key(id2), foreign key (id) references t1 (id) on delete set null);
create or replace table t2 (id int, id2 int as (id) virtual, key(id2), foreign key (id) references t1 (id) on update set null);
create or replace table t2 (id int, id2 int as (id) stored, foreign key (id) references t1 (id) on update restrict);
create or replace table t2 (id int, id2 int as (id) stored, foreign key (id) references t1 (id) on update no action);
create or replace table t2 (id int, id2 int as (id) stored, foreign key (id) references t1 (id) on delete cascade);
create or replace table t2 (id int, id2 int as (id) stored, foreign key (id) references t1 (id) on update cascade);
ERROR HY000: Function or expression 'id' cannot be used in the GENERATED ALWAYS AS clause of `id2`
create or replace table t2 (id int, id2 int as (id) stored, foreign key (id) references t1 (id) on delete set null);
ERROR HY000: Function or expression 'id' cannot be used in the GENERATED ALWAYS AS clause of `id2`
create or replace table t2 (id int, id2 int as (id) stored, foreign key (id) references t1 (id) on update set null);
ERROR HY000: Function or expression 'id' cannot be used in the GENERATED ALWAYS AS clause of `id2`
create or replace table t2 (id int, id2 int as (id) virtual, id3 int as (id2) stored, foreign key (id) references t1 (id) on update restrict);
create or replace table t2 (id int, id2 int as (id) virtual, id3 int as (id2) stored, foreign key (id) references t1 (id) on update no action);
create or replace table t2 (id int, id2 int as (id) virtual, id3 int as (id2) stored, foreign key (id) references t1 (id) on delete cascade);
create or replace table t2 (id int, id2 int as (id) virtual, id3 int as (id2) stored, foreign key (id) references t1 (id) on update cascade);
ERROR HY000: Function or expression 'id2' cannot be used in the GENERATED ALWAYS AS clause of `id3`
create or replace table t2 (id int, id2 int as (id) virtual, id3 int as (id2) stored, foreign key (id) references t1 (id) on delete set null);
ERROR HY000: Function or expression 'id2' cannot be used in the GENERATED ALWAYS AS clause of `id3`
create or replace table t2 (id int, id2 int as (id) virtual, id3 int as (id2) stored, foreign key (id) references t1 (id) on update set null);
ERROR HY000: Function or expression 'id2' cannot be used in the GENERATED ALWAYS AS clause of `id3`
create or replace table t2 (id int, id2 int default (id), foreign key (id) references t1 (id) on update restrict);
create or replace table t2 (id int, id2 int default (id), foreign key (id) references t1 (id) on update no action);
create or replace table t2 (id int, id2 int default (id), foreign key (id) references t1 (id) on delete cascade);
create or replace table t2 (id int, id2 int default (id), foreign key (id) references t1 (id) on update cascade);
create or replace table t2 (id int, id2 int default (id), foreign key (id) references t1 (id) on delete set null);
create or replace table t2 (id int, id2 int default (id), foreign key (id) references t1 (id) on update set null);
create or replace table t2 (id int, id2 int check (id), foreign key (id) references t1 (id) on update restrict);
create or replace table t2 (id int, id2 int check (id), foreign key (id) references t1 (id) on update no action);
create or replace table t2 (id int, id2 int check (id), foreign key (id) references t1 (id) on delete cascade);
create or replace table t2 (id int, id2 int check (id), foreign key (id) references t1 (id) on update cascade);
ERROR HY000: Function or expression 'id' cannot be used in the CHECK clause of `id2`
create or replace table t2 (id int, id2 int check (id), foreign key (id) references t1 (id) on delete set null);
ERROR HY000: Function or expression 'id' cannot be used in the CHECK clause of `id2`
create or replace table t2 (id int, id2 int check (id), foreign key (id) references t1 (id) on update set null);
ERROR HY000: Function or expression 'id' cannot be used in the CHECK clause of `id2`
create or replace table t2 (id int, id2 int, check (id), foreign key (id) references t1 (id) on update restrict);
create or replace table t2 (id int, id2 int, check (id), foreign key (id) references t1 (id) on update no action);
create or replace table t2 (id int, id2 int, check (id), foreign key (id) references t1 (id) on delete cascade);
create or replace table t2 (id int, id2 int, check (id), foreign key (id) references t1 (id) on update cascade);
ERROR HY000: Function or expression 'id' cannot be used in the CHECK clause of `CONSTRAINT_1`
create or replace table t2 (id int, id2 int, check (id), foreign key (id) references t1 (id) on delete set null);
ERROR HY000: Function or expression 'id' cannot be used in the CHECK clause of `CONSTRAINT_1`
create or replace table t2 (id int, id2 int, check (id), foreign key (id) references t1 (id) on update set null);
ERROR HY000: Function or expression 'id' cannot be used in the CHECK clause of `CONSTRAINT_1`
create or replace table t2 (id int, id2 int as (id) virtual, check (id2), foreign key (id) references t1 (id) on update restrict);
create or replace table t2 (id int, id2 int as (id) virtual, check (id2), foreign key (id) references t1 (id) on update no action);
create or replace table t2 (id int, id2 int as (id) virtual, check (id2), foreign key (id) references t1 (id) on delete cascade);
create or replace table t2 (id int, id2 int as (id) virtual, check (id2), foreign key (id) references t1 (id) on update cascade);
ERROR HY000: Function or expression 'id2' cannot be used in the CHECK clause of `CONSTRAINT_1`
create or replace table t2 (id int, id2 int as (id) virtual, check (id2), foreign key (id) references t1 (id) on delete set null);
ERROR HY000: Function or expression 'id2' cannot be used in the CHECK clause of `CONSTRAINT_1`
create or replace table t2 (id int, id2 int as (id) virtual, check (id2), foreign key (id) references t1 (id) on update set null);
ERROR HY000: Function or expression 'id2' cannot be used in the CHECK clause of `CONSTRAINT_1`
drop table if exists t2, t1;
Warnings:
Note 1051 Unknown table 'test.t2'
#
# MDEV-31853 Assertion failure in Column_definition::check_vcol_for_key upon adding FK
#
create table t (a int, b int, c int generated always as (a), key(b), key(c));
alter table t add foreign key (a) references t (b) on update set null, algorithm=nocopy;
ERROR 0A000: ALGORITHM=NOCOPY is not supported. Reason: Adding foreign keys needs foreign_key_checks=OFF. Try ALGORITHM=COPY
alter table t add foreign key (a) references t (b);
show create table t;
Table Create Table
t CREATE TABLE `t` (
  `a` int(11) DEFAULT NULL,
  `b` int(11) DEFAULT NULL,
  `c` int(11) GENERATED ALWAYS AS (`a`) VIRTUAL,
  KEY `b` (`b`),
  KEY `c` (`c`),
  KEY `a` (`a`),
  CONSTRAINT `1` FOREIGN KEY (`a`) REFERENCES `t` (`b`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
drop table t;
#
# End of 10.5 tests
#

Messung V0.5 in Prozent
C=80 H=95 G=87

¤ Dauer der Verarbeitung: 0.9 Sekunden  (vorverarbeitet am  2026-10-11) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1127926
#Domains=2039723