Closed bddicken closed 3 months ago
In FK when the column getting updated in on duplicate key upddate
is a foreign key column. It will be rejected. We have added some partial support like table having only 1 unique column
so it not fully supported yet.
Insert .. As
support is a general support that needs to be added. That is unrelated to FK.
I guess the documentation isn't very clear about this. From what it says on that page, someone might be led to believe that the ON DUPLICATE KEY UPDATE
is not supported at ALL if FK constraints are enabled for a keyspace. Rather, sounds like what you are saying is that it will only fail if the column is an FK constraint column. Maybe not a huge deal, but may be useful to clarify that wording on the site.
We will update the doc once we have a good story for OSS Vitess i.e. when we have shard-scoped or cross-shard support
This page states:
From what I can tell,
INSERT INTO ... ON DUPLICATE KEY UPDATE
works ok with Vitess. I tested via PS. Is there a difference between whats supported on PS vs vanilla Vitess?However, using
INSERT... AS ...
is not supported, but this is even for DBs without fk constraints.