You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to add a foreign key constraint on two table's columns fails when the second table is in the form of db_name.table with a Failed to open the referenced table 'table' error. If db_name is removed from the referenced table, then it works as expected.
Reproduction Steps
After creating a keyspace (named db_name), create two tables:
Hello, the statement with VARCHAR(16) works as expected and the table is created.
The second requested output is the following:
mysql> select database() ; show databases ;
+------------+
| database() |
+------------+
| keycloak |
+------------+
1 row in set (0.09 sec)
+--------------------+
| Database |
+--------------------+
| keycloak |
| information_schema |
| mysql |
| sys |
| performance_schema |
+--------------------+
5 rows in set (0.04 sec)
Now, keycloak is just a random name I used to tryout the compatibility of vitess with keycloak, and this problem (and actually another one for which I opened a separate issue) was ecountered during its table migrations.
Overview of the Issue
When trying to add a foreign key constraint on two table's columns fails when the second table is in the form of
db_name.table
with aFailed to open the referenced table 'table'
error. Ifdb_name
is removed from the referenced table, then it works as expected.Reproduction Steps
After creating a keyspace (named
db_name
), create two tables:create table table1 (col1 integer, col2 VARCHAR(16), primary key (col1));
;create table table2 (col1 integer, col2 VARCHAR(16), primary key (col1));
.Try to add the constraint:
alter table table1 add constraint foreign key (col1) references db_name.table2 (col1);
.Observe the error.
Binary Version
Operating System and Environment details
Log Fragments
The text was updated successfully, but these errors were encountered: