Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

constraint name dropped #5479

Closed
zachmu opened this issue Mar 3, 2023 · 1 comment
Closed

constraint name dropped #5479

zachmu opened this issue Mar 3, 2023 · 1 comment
Labels
bug Something isn't working sql Issue with SQL

Comments

@zachmu
Copy link
Member

zachmu commented Mar 3, 2023

Dolt drops the names of unique constraints and chooses its own name based on the columns.

dolt sql
# Welcome to the DoltSQL shell.
# Statements must be terminated with ';'.
# "exit" or "quit" (or Ctrl-D) to exit.
new> create table t4 (a int primary key, b int not null default 1, c int not null default 2) ;
new> alter table t4 add constraint t4_bc_unique unique (b,c);
new> show create table t4;
+-------+------------------------------------------------------------------+
| Table | Create Table                                                     |
+-------+------------------------------------------------------------------+
| t4    | CREATE TABLE `t4` (                                              |
|       |   `a` int NOT NULL,                                              |
|       |   `b` int NOT NULL DEFAULT (1),                                  |
|       |   `c` int NOT NULL DEFAULT (2),                                  |
|       |   PRIMARY KEY (`a`),                                             |
|       |   UNIQUE KEY `bc` (`b`,`c`)                                      |
|       | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin |
+-------+------------------------------------------------------------------+
1 row in set (0.00 sec)
@timsehn timsehn added bug Something isn't working sql Issue with SQL labels Mar 3, 2023
@jycor
Copy link
Contributor

jycor commented Mar 9, 2023

fix for this is merged, and will make it to dolt main eventually

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working sql Issue with SQL
Projects
None yet
Development

No branches or pull requests

3 participants